37 globalHVSummary = ibooker.
book2D(
"HVGlbSummary",
"HV Status Summary", 1, 1, 13, 5, -2, 3);
39 globalHVSummary->setAxisTitle(
"Wheel", 2);
43 totalDCSFraction = ibooker.
bookFloat(
"DTDCSSummary");
44 for (
int wh = -2; wh <= 2; wh++) {
45 stringstream wheel_str;
50 totalDCSFractionWh.push_back(FractionWh);
54 globalHVSummary->
Reset();
57 totalDCSFraction->Reset();
59 for (
int wh = -2; wh <= 2; wh++) {
60 totalDCSFractionWh[wh + 2]->Reset();
68 bool null_pointer_histo(
false);
70 std::vector<float> wh_activeFrac;
72 for (
int wh = -2; wh <= 2; wh++) {
73 stringstream wheel_str;
76 string hActiveUnitsPath =
"DT/EventInfo/DCSContents/hActiveUnits" + wheel_str.str();
81 float activeFrac =
static_cast<float>(hActiveUnits->
getBinContent(2)) /
87 wh_activeFrac.push_back(activeFrac);
90 totalDCSFraction->Fill(activeFrac);
91 totalDCSFractionWh[wh + 2]->Fill(activeFrac);
94 LogTrace(
"DTDQM|DTMonitorClient|DTDCSByLumiSummary")
95 <<
"[DTDCSByLumiSummary]: got null pointer retrieving histo at :" << hActiveUnitsPath <<
" for lumi # "
96 << lumiNumber <<
"client operation not performed." << endl;
98 null_pointer_histo =
true;
103 if (!null_pointer_histo)
104 dcsFracPerLumi[lumiNumber] = wh_activeFrac;
107 totalDCSFraction->Reset();
109 for (
int wh = -2; wh <= 2; wh++) {
110 totalDCSFractionWh[wh + 2]->Reset();
116 map<int, std::vector<float> >::const_iterator fracPerLumiIt = dcsFracPerLumi.begin();
117 map<int, std::vector<float> >::const_iterator fracPerLumiEnd = dcsFracPerLumi.end();
119 if (fracPerLumiIt != fracPerLumiEnd) {
120 int fLumi = dcsFracPerLumi.begin()->first;
121 int lLumi = dcsFracPerLumi.rbegin()->first;
125 int nLumis = lLumi - fLumi + 1.;
128 for (
int wh = -2; wh <= 2; wh++) {
129 stringstream wheel_str;
135 "hDCSFracTrendWh" + wheel_str.str(),
136 "Fraction of DT-HV ON Wh" + wheel_str.str(),
143 hDCSFracTrend.push_back(trend);
147 float goodLSperWh[5] = {0, 0, 0, 0, 0};
148 float badLSperWh[5] = {0, 0, 0, 0, 0};
151 for (; fracPerLumiIt != fracPerLumiEnd; ++fracPerLumiIt) {
152 for (
int wh = -2; wh <= 2; wh++) {
153 std::vector<float> activeFracPerWh;
154 activeFracPerWh = fracPerLumiIt->second;
156 hDCSFracTrend[wh + 2]->
setTimeSlotValue(activeFracPerWh[wh + 2], fracPerLumiIt->first);
158 if (activeFracPerWh[wh + 2] > 0) {
160 if (activeFracPerWh[wh + 2] > 0.9)
161 goodLSperWh[wh + 2]++;
163 badLSperWh[wh + 2]++;
166 if (activeFracPerWh[wh + 2] < 0)
167 badLSperWh[wh + 2] = -1;
173 for (
int wh = -2; wh <= 2; wh++) {
174 if (goodLSperWh[wh + 2] != 0 || badLSperWh[wh + 2] == -1) {
175 float r = badLSperWh[wh + 2] / fabs(goodLSperWh[wh + 2] + badLSperWh[wh + 2]);
177 globalHVSummary->Fill(1, wh, 0);
179 globalHVSummary->Fill(1, wh, 1);
181 globalHVSummary->Fill(1, wh, -1);
184 globalHVSummary->Fill(1, wh, 0);
LuminosityBlockID id() const
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
virtual void setCurrentFolder(std::string const &fullpath)
void dqmEndJob(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter) override
void beginRun(const edm::Run &r, const edm::EventSetup &c) override
~DTDCSByLumiSummary() override
Destructor.
void setTimeSlotValue(float value, int timeSlot)
virtual void Reset()
Remove all data from the ME, keept the empty histogram with all its settings.
virtual MonitorElement * get(std::string const &fullpath) const
DTDCSByLumiSummary(const edm::ParameterSet &pset)
Constructor.
UseScope< MonitorElementData::Scope::LUMI > UseLumiScope
virtual double getBinContent(int binx) const
get content of bin (1-D)
void dqmEndLuminosityBlock(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) override
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
LuminosityBlockNumber_t luminosityBlock() const
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)