1414#include < iostream>
1515#include < memory>
1616#include < fstream>
17+ #include " Framework/Logger.h"
1718using namespace std ;
1819
1920#include < TObject.h>
@@ -99,11 +100,11 @@ void HistogramManager::AddHistClass(const char* histClass)
99100 // Add a new histogram list
100101 //
101102 if (fMainList ->FindObject (histClass)) {
102- cout << " Warning in HistogramManager::AddHistClass(): Cannot add histogram class " << histClass
103- << " because it already exists." << endl ;
103+ LOG (warn) << " HistogramManager::AddHistClass(): Cannot add histogram class " << histClass
104+ << " because it already exists." ;
104105 return ;
105106 }
106- TList * hList = new TList;
107+ auto * hList = new TList;
107108 hList->SetOwner (kTRUE );
108109 hList->SetName (histClass);
109110 fMainList ->Add (hList);
@@ -127,15 +128,15 @@ void HistogramManager::AddHistogram(const char* histClass, const char* hname, co
127128 // TODO: replace the cout warning messages with LOG (same for all the other functions)
128129
129130 // get the list to which the histogram should be added
130- TList * hList = reinterpret_cast <TList*>(fMainList ->FindObject (histClass));
131+ auto * hList = reinterpret_cast <TList*>(fMainList ->FindObject (histClass));
131132 if (!hList) {
132- cout << " Warning in HistogramManager::AddHistogram(): Histogram list " << histClass << " not found!" << endl ;
133- cout << " Histogram not created" << endl ;
133+ LOG (warn) << " HistogramManager::AddHistogram(): Histogram list " << histClass << " not found!" ;
134+ LOG (warn) << " Histogram not created" ;
134135 return ;
135136 }
136137 // check whether this histogram name was used before
137138 if (hList->FindObject (hname)) {
138- cout << " Warning in HistogramManager::AddHistogram(): Histogram " << hname << " already exists" << endl ;
139+ LOG (warn) << " HistogramManager::AddHistogram(): Histogram " << hname << " already exists" ;
139140 return ;
140141 }
141142
@@ -325,15 +326,15 @@ void HistogramManager::AddHistogram(const char* histClass, const char* hname, co
325326 //
326327
327328 // get the list to which the histogram should be added
328- TList * hList = reinterpret_cast <TList*>(fMainList ->FindObject (histClass));
329+ auto * hList = reinterpret_cast <TList*>(fMainList ->FindObject (histClass));
329330 if (!hList) {
330- cout << " Warning in HistogramManager::AddHistogram(): Histogram list " << histClass << " not found!" << endl ;
331- cout << " Histogram not created" << endl ;
331+ LOG (warn) << " HistogramManager::AddHistogram(): Histogram list " << histClass << " not found!" ;
332+ LOG (warn) << " Histogram not created" ;
332333 return ;
333334 }
334335 // check whether this histogram name was used before
335336 if (hList->FindObject (hname)) {
336- cout << " Warning in HistogramManager::AddHistogram(): Histogram " << hname << " already exists" << endl ;
337+ LOG (warn) << " HistogramManager::AddHistogram(): Histogram " << hname << " already exists" ;
337338 return ;
338339 }
339340
@@ -517,15 +518,15 @@ void HistogramManager::AddHistogram(const char* histClass, const char* hname, co
517518 //
518519
519520 // get the list to which the histogram should be added
520- TList * hList = reinterpret_cast <TList*>(fMainList ->FindObject (histClass));
521+ auto * hList = reinterpret_cast <TList*>(fMainList ->FindObject (histClass));
521522 if (!hList) {
522- cout << " Warning in HistogramManager::AddHistogram(): Histogram list " << histClass << " not found!" << endl ;
523- cout << " Histogram not created" << endl ;
523+ LOG (warn) << " HistogramManager::AddHistogram(): Histogram list " << histClass << " not found!" ;
524+ LOG (warn) << " Histogram not created" ;
524525 return ;
525526 }
526527 // check whether this histogram name was used before
527528 if (hList->FindObject (hname)) {
528- cout << " Warning in HistogramManager::AddHistogram(): Histogram " << hname << " already exists" << endl ;
529+ LOG (warn) << " HistogramManager::AddHistogram(): Histogram " << hname << " already exists" ;
529530 return ;
530531 }
531532
@@ -596,15 +597,15 @@ void HistogramManager::AddHistogram(const char* histClass, const char* hname, co
596597 //
597598
598599 // get the list to which the histogram should be added
599- TList * hList = reinterpret_cast <TList*>(fMainList ->FindObject (histClass));
600+ auto * hList = reinterpret_cast <TList*>(fMainList ->FindObject (histClass));
600601 if (!hList) {
601- cout << " Warning in HistogramManager::AddHistogram(): Histogram list " << histClass << " not found!" << endl ;
602- cout << " Histogram not created" << endl ;
602+ LOG (warn) << " HistogramManager::AddHistogram(): Histogram list " << histClass << " not found!" ;
603+ LOG (warn) << " Histogram not created" ;
603604 return ;
604605 }
605606 // check whether this histogram name was used before
606607 if (hList->FindObject (hname)) {
607- cout << " Warning in HistogramManager::AddHistogram(): Histogram " << hname << " already exists" << endl ;
608+ LOG (warn) << " HistogramManager::AddHistogram(): Histogram " << hname << " already exists" ;
608609 return ;
609610 }
610611
@@ -631,8 +632,8 @@ void HistogramManager::AddHistogram(const char* histClass, const char* hname, co
631632 fVariablesMap [histClass] = varList;
632633
633634 // get the min and max for each axis
634- double * xmin = new double [nDimensions];
635- double * xmax = new double [nDimensions];
635+ auto * xmin = new double [nDimensions];
636+ auto * xmax = new double [nDimensions];
636637 int * nBins = new int [nDimensions];
637638 for (int idim = 0 ; idim < nDimensions; ++idim) {
638639 nBins[idim] = binLimits[idim].GetSize () - 1 ;
@@ -686,11 +687,11 @@ void HistogramManager::FillHistClass(const char* className, Float_t* values)
686687 //
687688
688689 // get the needed histogram list
689- TList * hList = reinterpret_cast <TList*>(fMainList ->FindObject (className));
690+ auto * hList = reinterpret_cast <TList*>(fMainList ->FindObject (className));
690691 if (!hList) {
691692 // TODO: add some meaningfull error message
692- /* cout << "Warning in HistogramManager::FillHistClass(): Histogram list " << className << " not found!" << endl ;
693- cout << " Histogram list not filled" << endl; */
693+ /* LOG(warn) << "HistogramManager::FillHistClass(): Histogram list " << className << " not found!";
694+ LOG(warn) << " Histogram list not filled" << endl; */
694695 return ;
695696 }
696697
@@ -830,7 +831,7 @@ void HistogramManager::Print(Option_t*) const
830831 cout << " ###################################################################" << endl;
831832 cout << " HistogramManager:: " << fMainList ->GetName () << endl;
832833 for (int i = 0 ; i < fMainList ->GetEntries (); ++i) {
833- TList * list = reinterpret_cast <TList*>(fMainList ->At (i));
834+ auto * list = reinterpret_cast <TList*>(fMainList ->At (i));
834835 cout << " ************** List " << list->GetName () << endl;
835836 for (int j = 0 ; j < list->GetEntries (); ++j) {
836837 TObject* obj = list->At (j);
0 commit comments