5 #include "DQM/SiStripMonitorHardware/interface/HistogramBase.hh" 9 void HistogramBase::fillHistogram(HistogramConfig & histogram,
13 if (histogram.monitorEle) histogram.monitorEle->Fill(value,weight);
21 if (histogram) histogram->
Fill(value,weight);
25 void HistogramBase::fillTkHistoMap(
TkHistoMap* aMap,
29 if (aMap) aMap->
fill(detid,value);
33 void HistogramBase::getConfigForHistogram(HistogramConfig & aConfig,
36 std::ostringstream* pDebugStream
40 aConfig.monitorEle = 0;
41 aConfig.enabled =
false;
43 aConfig.min = aConfig.max = 0.;
47 bool isTimeHisto = configName.find(
"vsTime") != configName.npos;
49 if (psetContainingConfigPSet.
exists(psetName)) {
52 if (aConfig.enabled) {
57 if (pDebugStream) (*pDebugStream) <<
"[HistogramBase]\tHistogram: " << configName <<
"\tEnabled" 58 <<
"\tNBins: " << aConfig.nBins <<
"\tMin: " << aConfig.min <<
"\tMax: " << aConfig.max << std::endl;
60 if (pDebugStream) (*pDebugStream) <<
"[HistogramBase]\tHistogram: " << configName <<
"\tEnabled" << std::endl;
63 aConfig.enabled =
false;
65 aConfig.min = aConfig.max = 0.;
66 if (pDebugStream) (*pDebugStream) <<
"[HistogramBase]\tHistogram: " << configName <<
"\tDisabled" << std::endl;
70 aConfig.enabled =
false;
72 aConfig.min = aConfig.max = 0.;
73 if (pDebugStream) (*pDebugStream) <<
"[HistogramBase]\tHistogram: " << configName <<
"\tDisabled" << std::endl;
77 if (psetContainingConfigPSet.
exists(
"TimeHistogramConfig") && isTimeHisto)
87 void HistogramBase::bookHistogram(
DQMStore::IBooker & ibooker , HistogramConfig & aConfig,
90 const unsigned int nBins,
97 if (aConfig.enabled) {
98 aConfig.monitorEle = ibooker.
book1D(name,title,nBins,min,max);
101 aConfig.monitorEle = 0;
106 void HistogramBase::bookHistogram(
DQMStore::IBooker & ibooker , HistogramConfig & aConfig,
110 const unsigned int nBins,
117 if (aConfig.enabled) {
118 aHist = ibooker.
book1D(name,title,nBins,min,max);
126 void HistogramBase::bookHistogram(
DQMStore::IBooker & ibooker , HistogramConfig & aConfig,
132 return bookHistogram(ibooker , aConfig,name,title,aConfig.nBins,aConfig.min,aConfig.max,xAxisTitle);
136 void HistogramBase::book2DHistogram(
DQMStore::IBooker & ibooker , HistogramConfig & aConfig,
139 const unsigned int nBins,
142 const unsigned int nBinsY,
149 if (aConfig.enabled) {
150 aConfig.monitorEle = ibooker.
book2D(name,title,nBins,min,max,nBinsY,minY,maxY);
152 aConfig.monitorEle->setAxisTitle(yAxisTitle,2);
154 aConfig.monitorEle=
NULL;
159 void HistogramBase::book2DHistogram(
DQMStore::IBooker & ibooker , HistogramConfig & aConfig,
163 const unsigned int nBins,
166 const unsigned int nBinsY,
173 if (aConfig.enabled) {
174 aHist = ibooker.
book2D(name,title,nBins,min,max,nBinsY,minY,maxY);
183 void HistogramBase::bookProfile(
DQMStore::IBooker & ibooker , HistogramConfig & aConfig,
186 const unsigned int nBins,
196 if (aConfig.enabled) {
207 aConfig.monitorEle->setAxisTitle(yAxisTitle,2);
209 aConfig.monitorEle =
NULL;
213 void HistogramBase::bookProfile(
DQMStore::IBooker & ibooker , HistogramConfig & aConfig,
223 bookProfile(ibooker , aConfig,
235 if (aConfig.monitorEle) aConfig.monitorEle->getTProfile()->SetCanExtend(TH1::kAllAxes);
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * bookProfile(Args &&...args)
bool exists(std::string const ¶meterName) const
checks if a parameter exists
void fill(uint32_t &detid, float value)
MonitorElement * book1D(Args &&...args)
MonitorElement * book2D(Args &&...args)
Constants and enumerated types for FED/FEC systems.
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)