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);
24 void HistogramBase::fillHistogram2D(HistogramConfig & histogram,
30 if (histogram.monitorEle) histogram.monitorEle->Fill(trendVar,value,weight);
33 void HistogramBase::fillTkHistoMap(
TkHistoMap* aMap,
37 if (aMap) aMap->
fill(detid,value);
41 void HistogramBase::getConfigForHistogram(HistogramConfig & aConfig,
44 std::ostringstream* pDebugStream
48 aConfig.monitorEle =
nullptr;
49 aConfig.enabled =
false;
51 aConfig.min = aConfig.max = 0.;
55 bool isTimeHisto = configName.find(
"vsTime") != configName.npos;
57 if (psetContainingConfigPSet.
exists(psetName)) {
59 if(configName.find(
"fedErrorsVsIdVsLumi") != std::string::npos){
63 if (aConfig.enabled) {
68 if (pDebugStream) (*pDebugStream) <<
"[HistogramBase]\tHistogram: " << configName <<
"\tEnabled" 69 <<
"\tNBins: " << aConfig.nBins <<
"\tMin: " << aConfig.min <<
"\tMax: " << aConfig.max << std::endl;
71 if (pDebugStream) (*pDebugStream) <<
"[HistogramBase]\tHistogram: " << configName <<
"\tEnabled" << std::endl;
74 aConfig.enabled =
false;
76 aConfig.min = aConfig.max = 0.;
77 if (pDebugStream) (*pDebugStream) <<
"[HistogramBase]\tHistogram: " << configName <<
"\tDisabled" << std::endl;
81 aConfig.enabled =
false;
83 aConfig.min = aConfig.max = 0.;
84 if (pDebugStream) (*pDebugStream) <<
"[HistogramBase]\tHistogram: " << configName <<
"\tDisabled" << std::endl;
88 if (psetContainingConfigPSet.
exists(
"TimeHistogramConfig") && isTimeHisto)
98 void HistogramBase::bookHistogram(
DQMStore::IBooker & ibooker , HistogramConfig & aConfig,
101 const unsigned int nBins,
108 if (aConfig.enabled) {
109 aConfig.monitorEle = ibooker.
book1D(name,title,nBins,min,max);
112 aConfig.monitorEle =
nullptr;
117 void HistogramBase::bookHistogram(
DQMStore::IBooker & ibooker , HistogramConfig & aConfig,
121 const unsigned int nBins,
128 if (aConfig.enabled) {
129 aHist = ibooker.
book1D(name,title,nBins,min,max);
137 void HistogramBase::bookHistogram(
DQMStore::IBooker & ibooker , HistogramConfig & aConfig,
143 return bookHistogram(ibooker , aConfig,name,title,aConfig.nBins,aConfig.min,aConfig.max,xAxisTitle);
147 void HistogramBase::book2DHistogram(
DQMStore::IBooker & ibooker , HistogramConfig & aConfig,
150 const unsigned int nBins,
153 const unsigned int nBinsY,
160 if (aConfig.enabled) {
161 aConfig.monitorEle = ibooker.
book2D(name,title,nBins,min,max,nBinsY,minY,maxY);
163 aConfig.monitorEle->setAxisTitle(yAxisTitle,2);
165 aConfig.monitorEle=
nullptr;
170 void HistogramBase::book2DHistogram(
DQMStore::IBooker & ibooker , HistogramConfig & aConfig,
174 const unsigned int nBins,
177 const unsigned int nBinsY,
184 if (aConfig.enabled) {
185 aHist = ibooker.
book2D(name,title,nBins,min,max,nBinsY,minY,maxY);
194 void HistogramBase::bookProfile(
DQMStore::IBooker & ibooker , HistogramConfig & aConfig,
197 const unsigned int nBins,
207 if (aConfig.enabled) {
218 aConfig.monitorEle->setAxisTitle(yAxisTitle,2);
220 aConfig.monitorEle =
nullptr;
224 void HistogramBase::bookProfile(
DQMStore::IBooker & ibooker , HistogramConfig & aConfig,
234 bookProfile(ibooker , aConfig,
246 if (aConfig.monitorEle) aConfig.monitorEle->getTProfile()->SetCanExtend(TH1::kAllAxes);
252 void HistogramBase::bookProfile2D(
DQMStore::IBooker & ibooker , HistogramConfig & aConfig,
255 const unsigned int nBinsx,
258 const unsigned int nBinsy,
266 if (aConfig.enabled) {
280 aConfig.monitorEle->setAxisTitle(yAxisTitle,2);
282 aConfig.monitorEle =
nullptr;
287 void HistogramBase::bookProfile2D(
DQMStore::IBooker & ibooker , HistogramConfig & aConfig,
290 const unsigned int nBinsy,
298 bookProfile2D(ibooker , aConfig,
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * bookProfile(Args &&...args)
bool exists(std::string const ¶meterName) const
checks if a parameter exists
MonitorElement * bookProfile2D(Args &&...args)
MonitorElement * book1D(Args &&...args)
MonitorElement * book2D(Args &&...args)
Constants and enumerated types for FED/FEC systems.
void fill(DetId detid, float value)
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)