diff --git a/PWGDQ/Core/HistogramManager.cxx b/PWGDQ/Core/HistogramManager.cxx index 76a777b4857..456f5d59a74 100644 --- a/PWGDQ/Core/HistogramManager.cxx +++ b/PWGDQ/Core/HistogramManager.cxx @@ -14,6 +14,7 @@ #include #include #include +#include "Framework/Logger.h" using namespace std; #include @@ -99,11 +100,11 @@ void HistogramManager::AddHistClass(const char* histClass) // Add a new histogram list // if (fMainList->FindObject(histClass)) { - cout << "Warning in HistogramManager::AddHistClass(): Cannot add histogram class " << histClass - << " because it already exists." << endl; + LOG(warn) << "HistogramManager::AddHistClass(): Cannot add histogram class " << histClass + << " because it already exists."; return; } - TList* hList = new TList; + auto* hList = new TList; hList->SetOwner(kTRUE); hList->SetName(histClass); fMainList->Add(hList); @@ -127,15 +128,15 @@ void HistogramManager::AddHistogram(const char* histClass, const char* hname, co // TODO: replace the cout warning messages with LOG (same for all the other functions) // get the list to which the histogram should be added - TList* hList = reinterpret_cast(fMainList->FindObject(histClass)); + auto* hList = reinterpret_cast(fMainList->FindObject(histClass)); if (!hList) { - cout << "Warning in HistogramManager::AddHistogram(): Histogram list " << histClass << " not found!" << endl; - cout << " Histogram not created" << endl; + LOG(warn) << "HistogramManager::AddHistogram(): Histogram list " << histClass << " not found!"; + LOG(warn) << " Histogram not created"; return; } // check whether this histogram name was used before if (hList->FindObject(hname)) { - cout << "Warning in HistogramManager::AddHistogram(): Histogram " << hname << " already exists" << endl; + LOG(warn) << "HistogramManager::AddHistogram(): Histogram " << hname << " already exists"; return; } @@ -325,15 +326,15 @@ void HistogramManager::AddHistogram(const char* histClass, const char* hname, co // // get the list to which the histogram should be added - TList* hList = reinterpret_cast(fMainList->FindObject(histClass)); + auto* hList = reinterpret_cast(fMainList->FindObject(histClass)); if (!hList) { - cout << "Warning in HistogramManager::AddHistogram(): Histogram list " << histClass << " not found!" << endl; - cout << " Histogram not created" << endl; + LOG(warn) << "HistogramManager::AddHistogram(): Histogram list " << histClass << " not found!"; + LOG(warn) << " Histogram not created"; return; } // check whether this histogram name was used before if (hList->FindObject(hname)) { - cout << "Warning in HistogramManager::AddHistogram(): Histogram " << hname << " already exists" << endl; + LOG(warn) << "HistogramManager::AddHistogram(): Histogram " << hname << " already exists"; return; } @@ -517,15 +518,15 @@ void HistogramManager::AddHistogram(const char* histClass, const char* hname, co // // get the list to which the histogram should be added - TList* hList = reinterpret_cast(fMainList->FindObject(histClass)); + auto* hList = reinterpret_cast(fMainList->FindObject(histClass)); if (!hList) { - cout << "Warning in HistogramManager::AddHistogram(): Histogram list " << histClass << " not found!" << endl; - cout << " Histogram not created" << endl; + LOG(warn) << "HistogramManager::AddHistogram(): Histogram list " << histClass << " not found!"; + LOG(warn) << " Histogram not created"; return; } // check whether this histogram name was used before if (hList->FindObject(hname)) { - cout << "Warning in HistogramManager::AddHistogram(): Histogram " << hname << " already exists" << endl; + LOG(warn) << "HistogramManager::AddHistogram(): Histogram " << hname << " already exists"; return; } @@ -596,15 +597,15 @@ void HistogramManager::AddHistogram(const char* histClass, const char* hname, co // // get the list to which the histogram should be added - TList* hList = reinterpret_cast(fMainList->FindObject(histClass)); + auto* hList = reinterpret_cast(fMainList->FindObject(histClass)); if (!hList) { - cout << "Warning in HistogramManager::AddHistogram(): Histogram list " << histClass << " not found!" << endl; - cout << " Histogram not created" << endl; + LOG(warn) << "HistogramManager::AddHistogram(): Histogram list " << histClass << " not found!"; + LOG(warn) << " Histogram not created"; return; } // check whether this histogram name was used before if (hList->FindObject(hname)) { - cout << "Warning in HistogramManager::AddHistogram(): Histogram " << hname << " already exists" << endl; + LOG(warn) << "HistogramManager::AddHistogram(): Histogram " << hname << " already exists"; return; } @@ -631,8 +632,8 @@ void HistogramManager::AddHistogram(const char* histClass, const char* hname, co fVariablesMap[histClass] = varList; // get the min and max for each axis - double* xmin = new double[nDimensions]; - double* xmax = new double[nDimensions]; + auto* xmin = new double[nDimensions]; + auto* xmax = new double[nDimensions]; int* nBins = new int[nDimensions]; for (int idim = 0; idim < nDimensions; ++idim) { nBins[idim] = binLimits[idim].GetSize() - 1; @@ -686,11 +687,11 @@ void HistogramManager::FillHistClass(const char* className, Float_t* values) // // get the needed histogram list - TList* hList = reinterpret_cast(fMainList->FindObject(className)); + auto* hList = reinterpret_cast(fMainList->FindObject(className)); if (!hList) { // TODO: add some meaningfull error message - /*cout << "Warning in HistogramManager::FillHistClass(): Histogram list " << className << " not found!" << endl; - cout << " Histogram list not filled" << endl; */ + /*LOG(warn) << "HistogramManager::FillHistClass(): Histogram list " << className << " not found!"; + LOG(warn) << " Histogram list not filled" << endl; */ return; } @@ -830,7 +831,7 @@ void HistogramManager::Print(Option_t*) const cout << "###################################################################" << endl; cout << "HistogramManager:: " << fMainList->GetName() << endl; for (int i = 0; i < fMainList->GetEntries(); ++i) { - TList* list = reinterpret_cast(fMainList->At(i)); + auto* list = reinterpret_cast(fMainList->At(i)); cout << "************** List " << list->GetName() << endl; for (int j = 0; j < list->GetEntries(); ++j) { TObject* obj = list->At(j); diff --git a/PWGEM/PhotonMeson/Core/HistogramsLibrary.cxx b/PWGEM/PhotonMeson/Core/HistogramsLibrary.cxx index 0017be59ac6..4dc423047cc 100644 --- a/PWGEM/PhotonMeson/Core/HistogramsLibrary.cxx +++ b/PWGEM/PhotonMeson/Core/HistogramsLibrary.cxx @@ -11,7 +11,7 @@ // // Contact: daiki.sekihata@cern.ch // - +#include "Framework/Logger.h" #include #include #include @@ -248,11 +248,11 @@ void o2::aod::emphotonhistograms::DefineHistograms(THashList* list, const char* void o2::aod::emphotonhistograms::AddHistClass(THashList* list, const char* histClass) { if (list->FindObject(histClass)) { - std::cout << "Warning in HistogramsLibrary::AddHistClass(): Cannot add histogram class " << histClass << " because it already exists." << std::endl; + LOG(warn) << "HistogramsLibrary::AddHistClass(): Cannot add histogram class " << histClass << " because it already exists."; return; } - THashList* sublist = new THashList(); + auto* sublist = new THashList(); sublist->SetOwner(true); sublist->SetName(histClass); list->Add(sublist); diff --git a/PWGUD/Tasks/DGCandAnalyzer.cxx b/PWGUD/Tasks/DGCandAnalyzer.cxx index bc723d248dd..becfc313cff 100644 --- a/PWGUD/Tasks/DGCandAnalyzer.cxx +++ b/PWGUD/Tasks/DGCandAnalyzer.cxx @@ -24,6 +24,7 @@ #include "PWGUD/Core/DGPIDSelector.h" #include "PWGUD/Core/UDGoodRunSelector.h" #include "PWGUD/Core/UDFSParser.h" +#include using namespace o2; using namespace o2::framework;