5 #include "DQM/SiStripMonitorHardware/interface/HistogramBase.hh" 7 void HistogramBase::fillHistogram(HistogramConfig& histogram,
double value,
double weight) {
8 if (histogram.monitorEle)
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) {
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;
42 if (configName.find(
"fedErrorsVsIdVsLumi") != std::string::npos) {
43 aConfig.globalswitchon =
pset.getUntrackedParameter<
bool>(
"globalswitchon");
45 aConfig.enabled = (
pset.exists(
"Enabled") ?
pset.getUntrackedParameter<
bool>(
"Enabled") :
true);
46 if (aConfig.enabled) {
47 aConfig.nBins = (
pset.exists(
"NBins") ?
pset.getUntrackedParameter<
unsigned int>(
"NBins") : 600);
48 aConfig.min = (
pset.exists(
"Min") ?
pset.getUntrackedParameter<
double>(
"Min") : 0);
49 aConfig.max = (
pset.exists(
"Max") ?
pset.getUntrackedParameter<
double>(
"Max") : 3600);
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) {
78 aConfig.nBins = (
pset.exists(
"NBins") ?
pset.getUntrackedParameter<
unsigned int>(
"NBins") : 600);
79 aConfig.min = (
pset.exists(
"Min") ?
pset.getUntrackedParameter<
double>(
"Min") : 0);
80 aConfig.max = (
pset.exists(
"Max") ?
pset.getUntrackedParameter<
double>(
"Max") : 3600);
85 HistogramConfig& aConfig,
88 const unsigned int nBins,
92 if (aConfig.enabled) {
96 aConfig.monitorEle =
nullptr;
101 HistogramConfig& aConfig,
105 const unsigned int nBins,
109 if (aConfig.enabled) {
118 HistogramConfig& aConfig,
122 return bookHistogram(ibooker, aConfig,
name,
title, aConfig.nBins, aConfig.min, aConfig.max,
xAxisTitle);
126 HistogramConfig& aConfig,
129 const unsigned int nBins,
132 const unsigned int nBinsY,
137 if (aConfig.enabled) {
140 aConfig.monitorEle->setAxisTitle(
yAxisTitle, 2);
142 aConfig.monitorEle =
nullptr;
147 HistogramConfig& aConfig,
151 const unsigned int nBins,
154 const unsigned int nBinsY,
159 if (aConfig.enabled) {
169 HistogramConfig& aConfig,
172 const unsigned int nBins,
179 if (aConfig.enabled) {
183 aConfig.monitorEle->setAxisTitle(
yAxisTitle, 2);
185 aConfig.monitorEle =
nullptr;
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);
209 HistogramConfig& aConfig,
212 const unsigned int nBinsx,
215 const unsigned int nBinsy,
220 if (aConfig.enabled) {
224 aConfig.monitorEle->setAxisTitle(
yAxisTitle, 2);
226 aConfig.monitorEle =
nullptr;
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);
MonitorElement * bookProfile2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, double lowZ, double highZ, char const *option="s", FUNC onbooking=NOOP())
bool exists(std::string const ¶meterName) const
checks if a parameter exists
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int, double lowY, double highY, char const *option="s", FUNC onbooking=NOOP())
Constants and enumerated types for FED/FEC systems.
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
void fill(DetId detid, float value)
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)