50 totalDCSFraction = ibooker.
bookFloat(
"DTDCSSummary");
53 globalHVSummary = ibooker.
book2D(
"HVGlbSummary",
"HV Status Summary",1,1,13,5,-2,3);
55 globalHVSummary->setAxisTitle(
"Wheel",2);
57 for(
int wh=-2;wh<=2;wh++){
59 stringstream wheel_str; wheel_str << wh;
64 totalDCSFractionWh.push_back(FractionWh);
67 globalHVSummary->Reset();
70 totalDCSFraction->Reset();
72 for(
int wh=-2;wh<=2;wh++){
73 totalDCSFractionWh[wh+2]->Reset();
82 bool null_pointer_histo(0);
84 std::vector<float> wh_activeFrac;
86 for(
int wh=-2;wh<=2;wh++){
88 stringstream wheel_str; wheel_str << wh;
90 string hActiveUnitsPath =
"DT/EventInfo/DCSContents/hActiveUnits"+wheel_str.str();
95 float activeFrac =
static_cast<float>(hActiveUnits->
getBinContent(2)) /
98 if(activeFrac < 0.) activeFrac=-1;
100 wh_activeFrac.push_back(activeFrac);
103 totalDCSFraction->Fill(activeFrac);
104 totalDCSFractionWh[wh+2]->Fill(activeFrac);
107 LogTrace(
"DTDQM|DTMonitorClient|DTDCSByLumiSummary")
108 <<
"[DTDCSByLumiSummary]: got null pointer retrieving histo at :"
109 << hActiveUnitsPath <<
" for lumi # " << lumiNumber
110 <<
"client operation not performed." << endl;
112 null_pointer_histo=
true;
117 if(!null_pointer_histo) dcsFracPerLumi[lumiNumber] = wh_activeFrac;
121 totalDCSFraction->Reset();
123 for(
int wh=-2;wh<=2;wh++){
124 totalDCSFractionWh[wh+2]->Reset();
132 map<int,std::vector<float> >::const_iterator fracPerLumiIt = dcsFracPerLumi.begin();
133 map<int,std::vector<float> >::const_iterator fracPerLumiEnd = dcsFracPerLumi.end();
135 if (fracPerLumiIt != fracPerLumiEnd ) {
136 int fLumi = dcsFracPerLumi.begin()->first;
137 int lLumi = dcsFracPerLumi.rbegin()->first;
141 int nLumis = lLumi-fLumi + 1.;
144 for(
int wh=-2; wh<=2; wh++) {
146 stringstream wheel_str; wheel_str << wh;
150 trend =
new DTTimeEvolutionHisto(ibooker,
"hDCSFracTrendWh" + wheel_str.str(),
"Fraction of DT-HV ON Wh" + wheel_str.str(),
151 nLumis, fLumi, 1,
false, 2);
153 hDCSFracTrend.push_back(trend);
158 float goodLSperWh[5] = {0,0,0,0,0};
159 float badLSperWh[5] = {0,0,0,0,0};
162 for(;fracPerLumiIt!=fracPerLumiEnd;++fracPerLumiIt) {
164 for(
int wh=-2; wh<=2; wh++) {
166 std::vector<float> activeFracPerWh;
167 activeFracPerWh = fracPerLumiIt->second;
169 hDCSFracTrend[wh+2]->
setTimeSlotValue(activeFracPerWh[wh+2],fracPerLumiIt->first);
171 if( activeFracPerWh[wh+2] > 0 ) {
173 if( activeFracPerWh[wh+2] > 0.9 ) goodLSperWh[wh+2]++;
178 if( activeFracPerWh[wh+2] < 0 ) badLSperWh[wh+2]=-1;
186 for(
int wh=-2; wh<=2; wh++) {
188 if( goodLSperWh[wh+2] != 0 || badLSperWh[wh+2] == -1 ) {
190 float r = badLSperWh[wh+2]/fabs(goodLSperWh[wh+2] + badLSperWh[wh+2]);
191 if( r > 0.5 ) globalHVSummary->Fill(1,wh,0);
192 else globalHVSummary->Fill(1,wh,1);
193 if( r == -1 ) globalHVSummary->Fill(1,wh,-1);
197 globalHVSummary->Fill(1,wh,0);
LuminosityBlockID id() const
void dqmEndLuminosityBlock(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, edm::LuminosityBlock const &lumi, edm::EventSetup const &setup)
MonitorElement * get(const std::string &path)
void setTimeSlotValue(float value, int timeSlot)
void dqmEndJob(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
DTDCSByLumiSummary(const edm::ParameterSet &pset)
Constructor.
void setCurrentFolder(const std::string &fullpath)
MonitorElement * book2D(Args &&...args)
LuminosityBlockNumber_t luminosityBlock() const
virtual ~DTDCSByLumiSummary()
Destructor.
double getBinContent(int binx) const
get content of bin (1-D)
void beginRun(const edm::Run &r, const edm::EventSetup &c)
MonitorElement * bookFloat(Args &&...args)
void setLumiFlag(void)
this ME is meant to be stored for each luminosity section
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)