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(HistogramConfig & aConfig,
90 const unsigned int nBins,
97 if (aConfig.enabled) {
98 aConfig.monitorEle = dqm_->book1D(name,title,nBins,min,max);
99 aConfig.monitorEle->setAxisTitle(xAxisTitle,1);
101 aConfig.monitorEle = 0;
106 void HistogramBase::bookHistogram(HistogramConfig & aConfig,
110 const unsigned int nBins,
117 if (aConfig.enabled) {
118 aHist = dqm_->book1D(name,title,nBins,min,max);
126 void HistogramBase::bookHistogram(HistogramConfig & aConfig,
132 return bookHistogram(aConfig,name,title,aConfig.nBins,aConfig.min,aConfig.max,xAxisTitle);
136 void HistogramBase::book2DHistogram(HistogramConfig & aConfig,
139 const unsigned int nBins,
142 const unsigned int nBinsY,
149 if (aConfig.enabled) {
150 aConfig.monitorEle = dqm_->book2D(name,title,nBins,min,max,nBinsY,minY,maxY);
151 aConfig.monitorEle->setAxisTitle(xAxisTitle,1);
152 aConfig.monitorEle->setAxisTitle(yAxisTitle,2);
154 aConfig.monitorEle=
NULL;
159 void HistogramBase::book2DHistogram(HistogramConfig & aConfig,
163 const unsigned int nBins,
166 const unsigned int nBinsY,
173 if (aConfig.enabled) {
174 aHist = dqm_->book2D(name,title,nBins,min,max,nBinsY,minY,maxY);
183 void HistogramBase::bookProfile(HistogramConfig & aConfig,
186 const unsigned int nBins,
196 if (aConfig.enabled) {
197 aConfig.monitorEle = dqm_->bookProfile(name,
206 aConfig.monitorEle->setAxisTitle(xAxisTitle,1);
207 aConfig.monitorEle->setAxisTitle(yAxisTitle,2);
209 aConfig.monitorEle =
NULL;
213 void HistogramBase::bookProfile(HistogramConfig & aConfig,
235 if (aConfig.monitorEle) aConfig.monitorEle->getTProfile()->SetBit(TH1::kCanRebin);
T getUntrackedParameter(std::string const &, T const &) const
bool exists(std::string const ¶meterName) const
checks if a parameter exists
const T & max(const T &a, const T &b)
void fill(uint32_t &detid, float value)
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)