5 #include "DQM/SiStripMonitorHardware/interface/HistogramBase.hh" 7 void HistogramBase::fillHistogram(HistogramConfig& histogram,
double value,
double weight) {
8 if (histogram.monitorEle)
9 histogram.monitorEle->Fill(value, weight);
12 void HistogramBase::fillHistogram(
MonitorElement* histogram,
double value,
double weight) {
14 histogram->
Fill(value, weight);
17 void HistogramBase::fillHistogram2D(HistogramConfig& histogram,
double trendVar,
double value,
double weight) {
18 if (histogram.monitorEle)
19 histogram.monitorEle->Fill(trendVar, value, weight);
22 void HistogramBase::fillTkHistoMap(
TkHistoMap* aMap, uint32_t& detid,
float value) {
24 aMap->
fill(detid, value);
27 void HistogramBase::getConfigForHistogram(HistogramConfig& aConfig,
30 std::ostringstream* pDebugStream) {
31 aConfig.monitorEle =
nullptr;
32 aConfig.enabled =
false;
34 aConfig.min = aConfig.max = 0.;
38 bool isTimeHisto = configName.find(
"vsTime") != configName.npos;
40 if (psetContainingConfigPSet.
exists(psetName)) {
42 if (configName.find(
"fedErrorsVsIdVsLumi") != std::string::npos) {
46 if (aConfig.enabled) {
52 (*pDebugStream) <<
"[HistogramBase]\tHistogram: " << configName <<
"\tEnabled" 53 <<
"\tNBins: " << aConfig.nBins <<
"\tMin: " << aConfig.min <<
"\tMax: " << aConfig.max
57 (*pDebugStream) <<
"[HistogramBase]\tHistogram: " << configName <<
"\tEnabled" << std::endl;
60 aConfig.enabled =
false;
62 aConfig.min = aConfig.max = 0.;
64 (*pDebugStream) <<
"[HistogramBase]\tHistogram: " << configName <<
"\tDisabled" << std::endl;
67 aConfig.enabled =
false;
69 aConfig.min = aConfig.max = 0.;
71 (*pDebugStream) <<
"[HistogramBase]\tHistogram: " << configName <<
"\tDisabled" << std::endl;
75 if (psetContainingConfigPSet.
exists(
"TimeHistogramConfig") && isTimeHisto) {
84 void HistogramBase::bookHistogram(DQMStore::IBooker& ibooker,
85 HistogramConfig& aConfig,
88 const unsigned int nBins,
92 if (aConfig.enabled) {
93 aConfig.monitorEle = ibooker.book1D(name, title, nBins, min, max);
94 aConfig.monitorEle->setAxisTitle(xAxisTitle, 1);
96 aConfig.monitorEle =
nullptr;
100 void HistogramBase::bookHistogram(DQMStore::IBooker& ibooker,
101 HistogramConfig& aConfig,
105 const unsigned int nBins,
109 if (aConfig.enabled) {
110 aHist = ibooker.book1D(name, title, nBins, min, max);
117 void HistogramBase::bookHistogram(DQMStore::IBooker& ibooker,
118 HistogramConfig& aConfig,
122 return bookHistogram(ibooker, aConfig, name, title, aConfig.nBins, aConfig.min, aConfig.max, xAxisTitle);
125 void HistogramBase::book2DHistogram(DQMStore::IBooker& ibooker,
126 HistogramConfig& aConfig,
129 const unsigned int nBins,
132 const unsigned int nBinsY,
137 if (aConfig.enabled) {
138 aConfig.monitorEle = ibooker.book2D(name, title, nBins, min, max, nBinsY, minY, maxY);
139 aConfig.monitorEle->setAxisTitle(xAxisTitle, 1);
140 aConfig.monitorEle->setAxisTitle(yAxisTitle, 2);
142 aConfig.monitorEle =
nullptr;
146 void HistogramBase::book2DHistogram(DQMStore::IBooker& ibooker,
147 HistogramConfig& aConfig,
151 const unsigned int nBins,
154 const unsigned int nBinsY,
159 if (aConfig.enabled) {
160 aHist = ibooker.book2D(name, title, nBins, min, max, nBinsY, minY, maxY);
168 void HistogramBase::bookProfile(DQMStore::IBooker& ibooker,
169 HistogramConfig& aConfig,
172 const unsigned int nBins,
179 if (aConfig.enabled) {
180 aConfig.monitorEle = ibooker.bookProfile(name, title, nBins, min, max, minY, maxY);
183 aConfig.monitorEle->setAxisTitle(yAxisTitle, 2);
185 aConfig.monitorEle =
nullptr;
189 void HistogramBase::bookProfile(DQMStore::IBooker& ibooker,
190 HistogramConfig& aConfig,
198 ibooker, aConfig, name, title, aConfig.nBins, aConfig.min, aConfig.max, minY, maxY, xAxisTitle, yAxisTitle);
201 if (aConfig.monitorEle)
202 aConfig.monitorEle->getTProfile()->SetCanExtend(TH1::kAllAxes);
208 void HistogramBase::bookProfile2D(DQMStore::IBooker& ibooker,
209 HistogramConfig& aConfig,
212 const unsigned int nBinsx,
215 const unsigned int nBinsy,
220 if (aConfig.enabled) {
221 aConfig.monitorEle = ibooker.bookProfile2D(name, title, nBinsx, xmin, xmax, nBinsy, ymin, ymax, 0, 0);
223 aConfig.monitorEle->setAxisTitle(xAxisTitle, 1);
224 aConfig.monitorEle->setAxisTitle(yAxisTitle, 2);
226 aConfig.monitorEle =
nullptr;
230 void HistogramBase::bookProfile2D(DQMStore::IBooker& ibooker,
231 HistogramConfig& aConfig,
234 const unsigned int nBinsy,
240 ibooker, aConfig, name, title, aConfig.nBins, aConfig.min, aConfig.max, nBinsy, ymin, ymax, xAxisTitle, yAxisTitle);
244 aConfig.monitorEle->getTProfile2D()->SetCanExtend(TH1::kAllAxes);
T getUntrackedParameter(std::string const &, T const &) const
bool exists(std::string const ¶meterName) const
checks if a parameter exists
Constants and enumerated types for FED/FEC systems.
void fill(DetId detid, float value)
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)