1 #ifndef DPGAnalysis_SiStripTools_RunHistogramManager_H 2 #define DPGAnalysis_SiStripTools_RunHistogramManager_H 13 #include "TProfile2D.h" 34 const unsigned int nbinx = -1,
35 const double xmin = -1.,
36 const double xmax = -1.,
37 const unsigned int nbiny = -1,
38 const double ymin = -1.,
39 const double ymax = -1.)
55 LogDebug(
"Destructor") <<
"Destroy " << _name;
59 if (_runpointers.find(irun) != _runpointers.end()) {
60 *_pointer = _runpointers[irun];
61 LogDebug(
"TH1Fbooked") <<
"Histogram " << _name.c_str() <<
" already exists " << _runpointers[irun];
65 sprintf(title,
"%s %s %d", _title.c_str(), fillrun, irun);
67 _runpointers[irun] = subrun.
make<
T>(_name.c_str(),
title, _nbinx, _xmin, _xmax);
69 *_pointer = _runpointers[irun];
70 LogDebug(
"TH1Fbooked") <<
"Histogram " << _name.c_str() <<
" booked " << _runpointers[irun];
95 const unsigned int nbinx = -1,
96 const double xmin = -1.,
97 const double xmax = -1.,
98 const unsigned int nbiny = -1,
99 const double ymin = -1.,
100 const double ymax = -1.)
116 LogDebug(
"TH2FDestructor") <<
"Destroy " << _name;
120 if (_runpointers.find(irun) != _runpointers.end()) {
121 *_pointer = _runpointers[irun];
122 LogDebug(
"TH2Fbooked") <<
"Histogram " << _name.c_str() <<
" already exists " << _runpointers[irun];
126 sprintf(title,
"%s %s %d", _title.c_str(), fillrun, irun);
128 _runpointers[irun] = subrun.
make<TH2F>(_name.c_str(),
title, _nbinx, _xmin, _xmax, _nbiny, _ymin, _ymax);
130 *_pointer = _runpointers[irun];
131 LogDebug(
"TH2Fbooked") <<
"Histogram " << _name.c_str() <<
" booked " << _runpointers[irun];
156 const unsigned int nbinx = -1,
157 const double xmin = -1.,
158 const double xmax = -1.,
159 const unsigned int nbiny = -1,
160 const double ymin = -1.,
161 const double ymax = -1.)
177 LogDebug(
"TProfile2DDestructor") <<
"Destroy " << _name;
181 if (_runpointers.find(irun) != _runpointers.end()) {
182 *_pointer = _runpointers[irun];
183 LogDebug(
"TProfile2Dbooked") <<
"Histogram " << _name.c_str() <<
" already exists " << _runpointers[irun];
187 sprintf(title,
"%s %s %d", _title.c_str(), fillrun, irun);
189 _runpointers[irun] = subrun.
make<TProfile2D>(_name.c_str(),
title, _nbinx, _xmin, _xmax, _nbiny, _ymin, _ymax);
191 *_pointer = _runpointers[irun];
192 LogDebug(
"TProfile2Dbooked") <<
"Histogram " << _name.c_str() <<
" booked " << _runpointers[irun];
216 TH1F** makeTH1F(
const char*
name,
const char*
title,
const unsigned int nbinx,
const double xmin,
const double xmax);
217 TProfile** makeTProfile(
218 const char* name,
const char* title,
const unsigned int nbinx,
const double xmin,
const double xmax);
219 TH2F** makeTH2F(
const char* name,
221 const unsigned int nbinx,
224 const unsigned int nbiny,
227 TProfile2D** makeTProfile2D(
const char* name,
229 const unsigned int nbinx,
232 const unsigned int nbiny,
238 void beginRun(
const unsigned int irun);
247 #endif // DPGAnalysis_SiStripTools_RunHistogramManager_H
edm::EDGetTokenT< edm::ConditionsInRunBlock > _conditionsInRunToken
HistoParams(TProfile2D **pointer, const std::string type, const std::string name, const std::string title, const unsigned int nbinx=-1, const double xmin=-1., const double xmax=-1., const unsigned int nbiny=-1, const double ymin=-1., const double ymax=-1.)
HistoParams(T **pointer, const std::string type, const std::string name, const std::string title, const unsigned int nbinx=-1, const double xmin=-1., const double xmax=-1., const unsigned int nbiny=-1, const double ymin=-1., const double ymax=-1.)
std::map< unsigned int, T * > _runpointers
void beginRun(const unsigned int irun, TFileDirectory &subrun, const char *fillrun) override
void beginRun(const unsigned int irun, TFileDirectory &subrun, const char *fillrun) override
T * make(const Args &...args) const
make new ROOT object
std::vector< BaseHistoParams * > _histograms
HistoParams(TH2F **pointer, const std::string type, const std::string name, const std::string title, const unsigned int nbinx=-1, const double xmin=-1., const double xmax=-1., const unsigned int nbiny=-1, const double ymin=-1., const double ymax=-1.)
std::map< unsigned int, TH2F * > _runpointers
virtual ~BaseHistoParams()
std::map< unsigned int, TProfile2D * > _runpointers
virtual void beginRun(const unsigned int irun, TFileDirectory &subrun, const char *fillrun)=0
void beginRun(const unsigned int irun, TFileDirectory &subrun, const char *fillrun) override