Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 26 additions & 25 deletions PWGDQ/Core/HistogramManager.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <iostream>
#include <memory>
#include <fstream>
#include "Framework/Logger.h"
using namespace std;

#include <TObject.h>
Expand Down Expand Up @@ -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);
Expand All @@ -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<TList*>(fMainList->FindObject(histClass));
auto* hList = reinterpret_cast<TList*>(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;
}

Expand Down Expand Up @@ -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<TList*>(fMainList->FindObject(histClass));
auto* hList = reinterpret_cast<TList*>(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;
}

Expand Down Expand Up @@ -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<TList*>(fMainList->FindObject(histClass));
auto* hList = reinterpret_cast<TList*>(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;
}

Expand Down Expand Up @@ -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<TList*>(fMainList->FindObject(histClass));
auto* hList = reinterpret_cast<TList*>(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;
}

Expand All @@ -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;
Expand Down Expand Up @@ -686,11 +687,11 @@ void HistogramManager::FillHistClass(const char* className, Float_t* values)
//

// get the needed histogram list
TList* hList = reinterpret_cast<TList*>(fMainList->FindObject(className));
auto* hList = reinterpret_cast<TList*>(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;
}

Expand Down Expand Up @@ -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<TList*>(fMainList->At(i));
auto* list = reinterpret_cast<TList*>(fMainList->At(i));
cout << "************** List " << list->GetName() << endl;
for (int j = 0; j < list->GetEntries(); ++j) {
TObject* obj = list->At(j);
Expand Down
6 changes: 3 additions & 3 deletions PWGEM/PhotonMeson/Core/HistogramsLibrary.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
//
// Contact: daiki.sekihata@cern.ch
//

#include "Framework/Logger.h"
#include <iostream>
#include <memory>
#include <fstream>
Expand Down Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions PWGUD/Tasks/DGCandAnalyzer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "PWGUD/Core/DGPIDSelector.h"
#include "PWGUD/Core/UDGoodRunSelector.h"
#include "PWGUD/Core/UDFSParser.h"
#include <set>

using namespace o2;
using namespace o2::framework;
Expand Down