1 #ifndef DPGAnalysis_SiStripTools_RunHistogramManager_H 2 #define DPGAnalysis_SiStripTools_RunHistogramManager_H 13 #include "TProfile2D.h" 35 const unsigned int nbinx=-1,
const double xmin = -1.,
const double xmax = -1.,
36 const unsigned int nbiny=-1,
const double ymin = -1.,
const double ymax = -1.):
39 _type(type), _name(name), _title(title), _nbinx(nbinx), _xmin(
xmin), _xmax(
xmax),
40 _nbiny(nbiny), _ymin(
ymin), _ymax(
ymax), _runpointers() { }
45 LogDebug(
"Destructor") <<
"Destroy " << _name;
51 if(_runpointers.find(irun)!=_runpointers.end()) {
52 *_pointer = _runpointers[irun];
53 LogDebug(
"TH1Fbooked") <<
"Histogram " << _name.c_str() <<
" already exists " << _runpointers[irun];
59 sprintf(title,
"%s %s %d",_title.c_str(),fillrun,irun);
61 _runpointers[irun] = subrun.
make<
T>(_name.c_str(),
67 *_pointer = _runpointers[irun];
68 LogDebug(
"TH1Fbooked") <<
"Histogram " << _name.c_str() <<
" booked " << _runpointers[irun];
94 const unsigned int nbinx=-1,
const double xmin = -1.,
const double xmax = -1.,
95 const unsigned int nbiny=-1,
const double ymin = -1.,
const double ymax = -1.):
98 _type(type), _name(name), _title(title), _nbinx(nbinx), _xmin(
xmin), _xmax(
xmax),
99 _nbiny(nbiny), _ymin(
ymin), _ymax(
ymax), _runpointers() { }
105 LogDebug(
"TH2FDestructor") <<
"Destroy " << _name;
111 if(_runpointers.find(irun)!=_runpointers.end()) {
112 *_pointer = _runpointers[irun];
113 LogDebug(
"TH2Fbooked") <<
"Histogram " << _name.c_str() <<
" already exists " << _runpointers[irun];
119 sprintf(title,
"%s %s %d",_title.c_str(),fillrun,irun);
121 _runpointers[irun] = subrun.
make<TH2F>(_name.c_str(),
130 *_pointer = _runpointers[irun];
131 LogDebug(
"TH2Fbooked") <<
"Histogram " << _name.c_str() <<
" booked " << _runpointers[irun];
158 const unsigned int nbinx=-1,
const double xmin = -1.,
const double xmax = -1.,
159 const unsigned int nbiny=-1,
const double ymin = -1.,
const double ymax = -1.):
162 _type(type), _name(name), _title(title), _nbinx(nbinx), _xmin(
xmin), _xmax(
xmax),
163 _nbiny(nbiny), _ymin(
ymin), _ymax(
ymax), _runpointers() { }
169 LogDebug(
"TProfile2DDestructor") <<
"Destroy " << _name;
175 if(_runpointers.find(irun)!=_runpointers.end()) {
176 *_pointer = _runpointers[irun];
177 LogDebug(
"TProfile2Dbooked") <<
"Histogram " << _name.c_str() <<
" already exists " << _runpointers[irun];
183 sprintf(title,
"%s %s %d",_title.c_str(),fillrun,irun);
185 _runpointers[irun] = subrun.
make<TProfile2D>(_name.c_str(),
194 *_pointer = _runpointers[irun];
195 LogDebug(
"TProfile2Dbooked") <<
"Histogram " << _name.c_str() <<
" booked " << _runpointers[irun];
225 TH1F** makeTH1F(
const char*
name,
const char*
title,
const unsigned int nbinx,
const double xmin,
const double xmax);
226 TProfile** makeTProfile(
const char* name,
const char* title,
const unsigned int nbinx,
const double xmin,
const double xmax);
227 TH2F** makeTH2F(
const char* name,
const char* title,
const unsigned int nbinx,
const double xmin,
const double xmax,
const unsigned int nbiny,
const double ymin,
const double ymax);
228 TProfile2D** makeTProfile2D(
const char* name,
const char* title,
const unsigned int nbinx,
const double xmin,
const double xmax,
const unsigned int nbiny,
const double ymin,
const double ymax);
232 void beginRun(
const unsigned int irun);
246 #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