38 percentual =
parameters.getUntrackedParameter<
int>(
"BadSLpercentual", 10);
58 for (map<int, MonitorElement*>::const_iterator
histo = wheelHistos.begin();
histo != wheelHistos.end();
histo++) {
59 (*histo).second->Reset();
62 for (map<int, MonitorElement*>::const_iterator
histo = wheelUnassHistos.begin();
histo != wheelUnassHistos.end();
64 (*histo).second->Reset();
67 edm::LogVerbatim(
"efficiency") <<
"[DTEfficiencyTest]: End of LS transition, performing the DQM client operation";
76 edm::LogVerbatim(
"efficiency") <<
"[DTEfficiencyTest]: " << nLumiSegs <<
" updates";
78 vector<const DTChamber*>::const_iterator ch_it = muonGeom->chambers().begin();
79 vector<const DTChamber*>::const_iterator ch_end = muonGeom->chambers().end();
81 edm::LogVerbatim(
"efficiency") <<
"[DTEfficiencyTest]: Efficiency tests results";
83 map<DTLayerId, vector<double> > LayerBadCells;
84 LayerBadCells.clear();
85 map<DTLayerId, vector<double> > LayerUnassBadCells;
86 LayerUnassBadCells.clear();
87 map<DTSuperLayerId, vector<double> > SuperLayerBadCells;
88 SuperLayerBadCells.clear();
89 map<DTSuperLayerId, vector<double> > SuperLayerUnassBadCells;
90 SuperLayerUnassBadCells.clear();
91 map<pair<int, int>,
int> cmsHistos;
93 map<pair<int, int>,
bool> filled;
94 for (
int i = -2;
i < 3;
i++) {
95 for (
int j = 1;
j < 15;
j++) {
96 filled[make_pair(
i,
j)] =
false;
99 map<pair<int, int>,
int> cmsUnassHistos;
100 cmsUnassHistos.clear();
101 map<pair<int, int>,
bool> UnassFilled;
102 for (
int i = -2;
i < 3;
i++) {
103 for (
int j = 1;
j < 15;
j++) {
104 UnassFilled[make_pair(
i,
j)] =
false;
109 for (; ch_it != ch_end; ++ch_it) {
111 vector<const DTSuperLayer*>::const_iterator sl_it = (*ch_it)->superLayers().begin();
112 vector<const DTSuperLayer*>::const_iterator sl_end = (*ch_it)->superLayers().end();
115 for (; sl_it != sl_end; ++sl_it) {
117 vector<const DTLayer*>::const_iterator l_it = (*sl_it)->layers().begin();
118 vector<const DTLayer*>::const_iterator l_end = (*sl_it)->layers().end();
121 for (; l_it != l_end; ++l_it) {
130 stringstream superLayer;
136 superLayer.str() +
"_L" +
layer.str();
140 MonitorElement* unassOccupancy_histo = igetter.
get(getMEName(
"hEffUnassOccupancy", lID));
141 MonitorElement* recSegmOccupancy_histo = igetter.
get(getMEName(
"hRecSegmOccupancy", lID));
144 if (occupancy_histo && unassOccupancy_histo && recSegmOccupancy_histo) {
145 TH1F* occupancy_histo_root = occupancy_histo->
getTH1F();
146 TH1F* unassOccupancy_histo_root = unassOccupancy_histo->
getTH1F();
147 TH1F* recSegmOccupancy_histo_root = recSegmOccupancy_histo->
getTH1F();
149 const int firstWire = muonGeom->layer(lID)->specificTopology().firstChannel();
150 const int lastWire = muonGeom->layer(lID)->specificTopology().lastChannel();
153 for (
int bin = firstWire;
bin <= lastWire;
bin++) {
154 if ((recSegmOccupancy_histo_root->GetBinContent(
bin)) != 0) {
155 if (EfficiencyHistos.find(lID) == EfficiencyHistos.end())
156 bookHistos(ibooker, lID, firstWire, lastWire);
158 occupancy_histo_root->GetBinContent(
bin) / recSegmOccupancy_histo_root->GetBinContent(
bin);
160 EfficiencyHistos.find(lID)->second->setBinContent(
bin,
efficiency);
161 EfficiencyHistos.find(lID)->second->setBinError(
bin, errorEff);
163 if (UnassEfficiencyHistos.find(lID) == EfficiencyHistos.end())
164 bookHistos(ibooker, lID, firstWire, lastWire);
165 float unassEfficiency =
166 unassOccupancy_histo_root->GetBinContent(
bin) / recSegmOccupancy_histo_root->GetBinContent(
bin);
167 float errorUnassEff =
168 sqrt(unassEfficiency * (1 - unassEfficiency) / recSegmOccupancy_histo_root->GetBinContent(
bin));
169 UnassEfficiencyHistos.find(lID)->second->setBinContent(
bin, unassEfficiency);
170 UnassEfficiencyHistos.find(lID)->second->setBinError(
bin, errorUnassEff);
180 string EfficiencyCriterionName =
parameters.getUntrackedParameter<
string>(
"EfficiencyTestName",
"EfficiencyInRange");
181 for (map<DTLayerId, MonitorElement*>::const_iterator hEff = EfficiencyHistos.begin(); hEff != EfficiencyHistos.end();
183 const QReport* theEfficiencyQReport = (*hEff).second->getQReport(EfficiencyCriterionName);
185 if (theEfficiencyQReport) {
186 vector<dqm::me_util::Channel> badChannels = theEfficiencyQReport->
getBadChannels();
187 for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin(); channel != badChannels.end();
189 edm::LogError(
"efficiency") <<
"LayerID : " << getMEName(
"hEffOccupancy", (*hEff).first)
190 <<
" Bad efficiency channels: " << (*channel).getBin()
191 <<
" Contents : " << (*channel).getContents();
194 LayerBadCells[(*hEff).first].push_back(
counter);
195 LayerBadCells[(*hEff).first].push_back(muonGeom->layer((*hEff).first)->specificTopology().channels());
203 string UnassEfficiencyCriterionName =
204 parameters.getUntrackedParameter<
string>(
"UnassEfficiencyTestName",
"UnassEfficiencyInRange");
205 for (map<DTLayerId, MonitorElement*>::const_iterator hUnassEff = UnassEfficiencyHistos.begin();
206 hUnassEff != UnassEfficiencyHistos.end();
208 const QReport* theUnassEfficiencyQReport = (*hUnassEff).second->getQReport(UnassEfficiencyCriterionName);
210 if (theUnassEfficiencyQReport) {
211 vector<dqm::me_util::Channel> badChannels = theUnassEfficiencyQReport->
getBadChannels();
212 for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin(); channel != badChannels.end();
214 edm::LogError(
"efficiency") <<
"Bad unassEfficiency channels: " << (*channel).getBin() <<
" "
215 << (*channel).getContents();
218 LayerUnassBadCells[(*hUnassEff).first].push_back(
counter);
219 LayerUnassBadCells[(*hUnassEff).first].push_back(
220 double(muonGeom->layer((*hUnassEff).first)->specificTopology().channels()));
226 vector<const DTChamber*>::const_iterator ch2_it = muonGeom->chambers().begin();
227 vector<const DTChamber*>::const_iterator ch2_end = muonGeom->chambers().end();
228 for (; ch2_it != ch2_end; ++ch2_it) {
229 vector<const DTSuperLayer*>::const_iterator sl2_it = (*ch2_it)->superLayers().begin();
230 vector<const DTSuperLayer*>::const_iterator sl2_end = (*ch2_it)->superLayers().end();
232 for (; sl2_it != sl2_end; ++sl2_it) {
234 double superLayerBadC = 0;
235 double superLayerTotC = 0;
236 double superLayerUnassBadC = 0;
237 double superLayerUnassTotC = 0;
239 vector<const DTLayer*>::const_iterator l2_it = (*sl2_it)->layers().begin();
240 vector<const DTLayer*>::const_iterator l2_end = (*sl2_it)->layers().end();
242 for (; l2_it != l2_end; ++l2_it) {
244 if (LayerBadCells.find(layerId) != LayerBadCells.end() &&
245 LayerUnassBadCells.find(layerId) != LayerUnassBadCells.end()) {
247 superLayerBadC += LayerBadCells[layerId][0];
248 superLayerTotC += LayerBadCells[layerId][1];
249 superLayerUnassBadC += LayerUnassBadCells[layerId][0];
250 superLayerUnassTotC += LayerUnassBadCells[layerId][1];
254 SuperLayerBadCells[sl].push_back(superLayerBadC);
255 SuperLayerBadCells[sl].push_back(superLayerTotC);
256 SuperLayerUnassBadCells[sl].push_back(superLayerUnassBadC);
257 SuperLayerUnassBadCells[sl].push_back(superLayerUnassTotC);
262 for (
map<
DTSuperLayerId, vector<double> >::const_iterator SLBCells = SuperLayerBadCells.begin();
263 SLBCells != SuperLayerBadCells.end();
265 if ((*SLBCells).second[0] / (*SLBCells).second[1] >
double(percentual / 100)) {
266 if (wheelHistos.find((*SLBCells).first.wheel()) == wheelHistos.end())
267 bookHistos(ibooker, (*SLBCells).first.wheel());
268 if (!((*SLBCells).first.station() == 4 && (*SLBCells).first.superlayer() == 3))
269 wheelHistos[(*SLBCells).first.wheel()]->Fill(
270 (*SLBCells).first.sector() - 1,
271 ((*SLBCells).first.superlayer() - 1) + 3 * ((*SLBCells).first.station() - 1));
273 wheelHistos[(*SLBCells).first.wheel()]->Fill((*SLBCells).first.sector() - 1, 10);
276 cmsHistos[make_pair((*SLBCells).first.wheel(), (*SLBCells).first.sector())]++;
277 if (((*SLBCells).first.sector() < 13 &&
278 double(cmsHistos[make_pair((*SLBCells).first.wheel(), (*SLBCells).first.sector())]) / 11 >
279 double(percentual) / 100 &&
280 filled[make_pair((*SLBCells).first.wheel(), (*SLBCells).first.sector())] ==
false) ||
281 ((*SLBCells).first.sector() >= 13 &&
282 double(cmsHistos[make_pair((*SLBCells).first.wheel(), (*SLBCells).first.sector())]) / 2 >
283 double(percentual) / 100 &&
284 filled[make_pair((*SLBCells).first.wheel(), (*SLBCells).first.sector())] ==
false)) {
285 filled[make_pair((*SLBCells).first.wheel(), (*SLBCells).first.sector())] =
true;
286 wheelHistos[3]->Fill((*SLBCells).first.sector() - 1, (*SLBCells).first.wheel());
291 for (
map<
DTSuperLayerId, vector<double> >::const_iterator SLUBCells = SuperLayerUnassBadCells.begin();
292 SLUBCells != SuperLayerUnassBadCells.end();
294 if ((*SLUBCells).second[0] / (*SLUBCells).second[1] >
double(percentual / 100)) {
295 if (wheelUnassHistos.find((*SLUBCells).first.wheel()) == wheelUnassHistos.end())
296 bookHistos(ibooker, (*SLUBCells).first.wheel());
297 if (!((*SLUBCells).first.station() == 4 && (*SLUBCells).first.superlayer() == 3))
298 wheelUnassHistos[(*SLUBCells).first.wheel()]->Fill(
299 (*SLUBCells).first.sector() - 1,
300 ((*SLUBCells).first.superlayer() - 1) + 3 * ((*SLUBCells).first.station() - 1));
302 wheelUnassHistos[(*SLUBCells).first.wheel()]->Fill((*SLUBCells).first.sector() - 1, 10);
305 cmsUnassHistos[make_pair((*SLUBCells).first.wheel(), (*SLUBCells).first.sector())]++;
306 if (((*SLUBCells).first.sector() < 13 &&
307 double(cmsUnassHistos[make_pair((*SLUBCells).first.wheel(), (*SLUBCells).first.sector())]) / 11 >
308 double(percentual) / 100 &&
309 UnassFilled[make_pair((*SLUBCells).first.wheel(), (*SLUBCells).first.sector())] ==
false) ||
310 ((*SLUBCells).first.sector() >= 13 &&
311 double(cmsUnassHistos[make_pair((*SLUBCells).first.wheel(), (*SLUBCells).first.sector())]) / 2 >
312 double(percentual) / 100 &&
313 UnassFilled[make_pair((*SLUBCells).first.wheel(), (*SLUBCells).first.sector())] ==
false)) {
314 UnassFilled[make_pair((*SLUBCells).first.wheel(), (*SLUBCells).first.sector())] =
true;
315 wheelUnassHistos[3]->Fill((*SLUBCells).first.sector() - 1, (*SLUBCells).first.wheel());
332 stringstream superLayer;
339 sector.str() +
"/SuperLayer" + superLayer.str() +
"/";
342 "_SL" + superLayer.str() +
"_L" +
layer.str();
354 stringstream superLayer;
360 "W" +
wheel.str() +
"_St" +
station.str() +
"_Sec" + sector.str() +
"_SL" + superLayer.str() +
"_L" +
layer.str();
361 string EfficiencyHistoName =
"Efficiency_" +
HistoName;
362 string UnassEfficiencyHistoName =
"UnassEfficiency_" +
HistoName;
367 EfficiencyHistos[lId] = ibooker.
book1D(EfficiencyHistoName.c_str(),
368 EfficiencyHistoName.c_str(),
369 lastWire - firstWire + 1,
372 UnassEfficiencyHistos[lId] = ibooker.
book1D(UnassEfficiencyHistoName.c_str(),
373 UnassEfficiencyHistoName.c_str(),
374 lastWire - firstWire + 1,
382 if (wheelHistos.find(3) == wheelHistos.end()) {
383 string histoName =
"ESummary_testFailedByAtLeastBadSL";
386 wheelHistos[3]->setBinLabel(1,
"Sector1", 1);
387 wheelHistos[3]->setBinLabel(2,
"Sector2", 1);
388 wheelHistos[3]->setBinLabel(3,
"Sector3", 1);
389 wheelHistos[3]->setBinLabel(4,
"Sector4", 1);
390 wheelHistos[3]->setBinLabel(5,
"Sector5", 1);
391 wheelHistos[3]->setBinLabel(6,
"Sector6", 1);
392 wheelHistos[3]->setBinLabel(7,
"Sector7", 1);
393 wheelHistos[3]->setBinLabel(8,
"Sector8", 1);
394 wheelHistos[3]->setBinLabel(9,
"Sector9", 1);
395 wheelHistos[3]->setBinLabel(10,
"Sector10", 1);
396 wheelHistos[3]->setBinLabel(11,
"Sector11", 1);
397 wheelHistos[3]->setBinLabel(12,
"Sector12", 1);
398 wheelHistos[3]->setBinLabel(13,
"Sector13", 1);
399 wheelHistos[3]->setBinLabel(14,
"Sector14", 1);
400 wheelHistos[3]->setBinLabel(1,
"Wheel-2", 2);
401 wheelHistos[3]->setBinLabel(2,
"Wheel-1", 2);
402 wheelHistos[3]->setBinLabel(3,
"Wheel0", 2);
403 wheelHistos[3]->setBinLabel(4,
"Wheel+1", 2);
404 wheelHistos[3]->setBinLabel(5,
"Wheel+2", 2);
406 if (wheelUnassHistos.find(3) == wheelUnassHistos.end()) {
407 string histoName =
"UESummary_testFailedByAtLeastBadSL";
410 wheelUnassHistos[3]->setBinLabel(1,
"Sector1", 1);
411 wheelUnassHistos[3]->setBinLabel(2,
"Sector2", 1);
412 wheelUnassHistos[3]->setBinLabel(3,
"Sector3", 1);
413 wheelUnassHistos[3]->setBinLabel(4,
"Sector4", 1);
414 wheelUnassHistos[3]->setBinLabel(5,
"Sector5", 1);
415 wheelUnassHistos[3]->setBinLabel(6,
"Sector6", 1);
416 wheelUnassHistos[3]->setBinLabel(7,
"Sector7", 1);
417 wheelUnassHistos[3]->setBinLabel(8,
"Sector8", 1);
418 wheelUnassHistos[3]->setBinLabel(9,
"Sector9", 1);
419 wheelUnassHistos[3]->setBinLabel(10,
"Sector10", 1);
420 wheelUnassHistos[3]->setBinLabel(11,
"Sector11", 1);
421 wheelUnassHistos[3]->setBinLabel(12,
"Sector12", 1);
422 wheelUnassHistos[3]->setBinLabel(13,
"Sector13", 1);
423 wheelUnassHistos[3]->setBinLabel(14,
"Sector14", 1);
424 wheelUnassHistos[3]->setBinLabel(1,
"Wheel-2", 2);
425 wheelUnassHistos[3]->setBinLabel(2,
"Wheel-1", 2);
426 wheelUnassHistos[3]->setBinLabel(3,
"Wheel0", 2);
427 wheelUnassHistos[3]->setBinLabel(4,
"Wheel+1", 2);
428 wheelUnassHistos[3]->setBinLabel(5,
"Wheel+2", 2);
434 if (wheelHistos.find(wh) == wheelHistos.end()) {
438 wheelHistos[wh]->setBinLabel(2,
"Sector2", 1);
439 wheelHistos[wh]->setBinLabel(3,
"Sector3", 1);
440 wheelHistos[wh]->setBinLabel(4,
"Sector4", 1);
441 wheelHistos[wh]->setBinLabel(5,
"Sector5", 1);
442 wheelHistos[wh]->setBinLabel(6,
"Sector6", 1);
443 wheelHistos[wh]->setBinLabel(7,
"Sector7", 1);
444 wheelHistos[wh]->setBinLabel(8,
"Sector8", 1);
445 wheelHistos[wh]->setBinLabel(9,
"Sector9", 1);
446 wheelHistos[wh]->setBinLabel(10,
"Sector10", 1);
447 wheelHistos[wh]->setBinLabel(11,
"Sector11", 1);
448 wheelHistos[wh]->setBinLabel(12,
"Sector12", 1);
449 wheelHistos[wh]->setBinLabel(13,
"Sector13", 1);
450 wheelHistos[wh]->setBinLabel(14,
"Sector14", 1);
451 wheelHistos[wh]->setBinLabel(1,
"MB1_SL1", 2);
452 wheelHistos[wh]->setBinLabel(2,
"MB1_SL2", 2);
453 wheelHistos[wh]->setBinLabel(3,
"MB1_SL3", 2);
454 wheelHistos[wh]->setBinLabel(4,
"MB2_SL1", 2);
455 wheelHistos[wh]->setBinLabel(5,
"MB2_SL2", 2);
456 wheelHistos[wh]->setBinLabel(6,
"MB2_SL3", 2);
457 wheelHistos[wh]->setBinLabel(7,
"MB3_SL1", 2);
458 wheelHistos[wh]->setBinLabel(8,
"MB3_SL2", 2);
459 wheelHistos[wh]->setBinLabel(9,
"MB3_SL3", 2);
460 wheelHistos[wh]->setBinLabel(10,
"MB4_SL1", 2);
461 wheelHistos[wh]->setBinLabel(11,
"MB4_SL3", 2);
463 if (wheelUnassHistos.find(wh) == wheelUnassHistos.end()) {
466 wheelUnassHistos[wh]->
setBinLabel(1,
"Sector1", 1);
467 wheelUnassHistos[wh]->setBinLabel(2,
"Sector2", 1);
468 wheelUnassHistos[wh]->setBinLabel(3,
"Sector3", 1);
469 wheelUnassHistos[wh]->setBinLabel(4,
"Sector4", 1);
470 wheelUnassHistos[wh]->setBinLabel(5,
"Sector5", 1);
471 wheelUnassHistos[wh]->setBinLabel(6,
"Sector6", 1);
472 wheelUnassHistos[wh]->setBinLabel(7,
"Sector7", 1);
473 wheelUnassHistos[wh]->setBinLabel(8,
"Sector8", 1);
474 wheelUnassHistos[wh]->setBinLabel(9,
"Sector9", 1);
475 wheelUnassHistos[wh]->setBinLabel(10,
"Sector10", 1);
476 wheelUnassHistos[wh]->setBinLabel(11,
"Sector11", 1);
477 wheelUnassHistos[wh]->setBinLabel(12,
"Sector12", 1);
478 wheelUnassHistos[wh]->setBinLabel(13,
"Sector13", 1);
479 wheelUnassHistos[wh]->setBinLabel(14,
"Sector14", 1);
480 wheelUnassHistos[wh]->setBinLabel(1,
"MB1_SL1", 2);
481 wheelUnassHistos[wh]->setBinLabel(2,
"MB1_SL2", 2);
482 wheelUnassHistos[wh]->setBinLabel(3,
"MB1_SL3", 2);
483 wheelUnassHistos[wh]->setBinLabel(4,
"MB2_SL1", 2);
484 wheelUnassHistos[wh]->setBinLabel(5,
"MB2_SL2", 2);
485 wheelUnassHistos[wh]->setBinLabel(6,
"MB2_SL3", 2);
486 wheelUnassHistos[wh]->setBinLabel(7,
"MB3_SL1", 2);
487 wheelUnassHistos[wh]->setBinLabel(8,
"MB3_SL2", 2);
488 wheelUnassHistos[wh]->setBinLabel(9,
"MB3_SL3", 2);
489 wheelUnassHistos[wh]->setBinLabel(10,
"MB4_SL1", 2);
490 wheelUnassHistos[wh]->setBinLabel(11,
"MB4_SL3", 2);