CMS 3D CMS Logo

DTEfficiencyTest.cc
Go to the documentation of this file.
1 /*
2  * See header file for a description of this class.
3  *
4  * \author G. Mila - INFN Torino
5  *
6  * threadsafe version (//-) oct/nov 2014 - WATWanAbdullah ncpp-um-my
7  *
8  */
9 
11 
12 // Framework
14 
15 // Geometry
19 
22 
23 #include <cstdio>
24 #include <sstream>
25 #include <cmath>
26 
27 using namespace edm;
28 using namespace std;
29 
31  : muonGeomToken_(esConsumes<edm::Transition::BeginRun>()) {
32  edm::LogVerbatim("efficiency") << "[DTEfficiencyTest]: Constructor";
33 
34  parameters = ps;
35 
36  prescaleFactor = parameters.getUntrackedParameter<int>("diagnosticPrescale", 1);
37 
38  percentual = parameters.getUntrackedParameter<int>("BadSLpercentual", 10);
39 }
40 
42  edm::LogVerbatim("efficiency") << "DTEfficiencyTest: analyzed " << nevents << " events";
43 }
44 
46  edm::LogVerbatim("efficiency") << "[DTEfficiencyTest]: Begin run";
47 
48  nevents = 0;
49 
50  // Get the geometry
51  muonGeom = &context.getData(muonGeomToken_);
52 }
53 
55  DQMStore::IGetter& igetter,
56  edm::LuminosityBlock const& lumiSeg,
57  edm::EventSetup const& context) {
58  for (map<int, MonitorElement*>::const_iterator histo = wheelHistos.begin(); histo != wheelHistos.end(); histo++) {
59  (*histo).second->Reset();
60  }
61 
62  for (map<int, MonitorElement*>::const_iterator histo = wheelUnassHistos.begin(); histo != wheelUnassHistos.end();
63  histo++) {
64  (*histo).second->Reset();
65  }
66 
67  edm::LogVerbatim("efficiency") << "[DTEfficiencyTest]: End of LS transition, performing the DQM client operation";
68 
69  // counts number of lumiSegs
70  nLumiSegs = lumiSeg.id().luminosityBlock();
71 
72  // prescale factor
73  if (nLumiSegs % prescaleFactor != 0)
74  return;
75 
76  edm::LogVerbatim("efficiency") << "[DTEfficiencyTest]: " << nLumiSegs << " updates";
77 
78  vector<const DTChamber*>::const_iterator ch_it = muonGeom->chambers().begin();
79  vector<const DTChamber*>::const_iterator ch_end = muonGeom->chambers().end();
80 
81  edm::LogVerbatim("efficiency") << "[DTEfficiencyTest]: Efficiency tests results";
82 
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;
92  cmsHistos.clear();
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;
97  }
98  }
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;
105  }
106  }
107 
108  // Loop over the chambers
109  for (; ch_it != ch_end; ++ch_it) {
110  DTChamberId chID = (*ch_it)->id();
111  vector<const DTSuperLayer*>::const_iterator sl_it = (*ch_it)->superLayers().begin();
112  vector<const DTSuperLayer*>::const_iterator sl_end = (*ch_it)->superLayers().end();
113 
114  // Loop over the SuperLayers
115  for (; sl_it != sl_end; ++sl_it) {
116  DTSuperLayerId slID = (*sl_it)->id();
117  vector<const DTLayer*>::const_iterator l_it = (*sl_it)->layers().begin();
118  vector<const DTLayer*>::const_iterator l_end = (*sl_it)->layers().end();
119 
120  // Loop over the layers
121  for (; l_it != l_end; ++l_it) {
122  DTLayerId lID = (*l_it)->id();
123 
124  stringstream wheel;
125  wheel << chID.wheel();
126  stringstream station;
127  station << chID.station();
128  stringstream sector;
129  sector << chID.sector();
130  stringstream superLayer;
131  superLayer << slID.superlayer();
132  stringstream layer;
133  layer << lID.layer();
134 
135  string HistoName = "W" + wheel.str() + "_St" + station.str() + "_Sec" + sector.str() + "_SL" +
136  superLayer.str() + "_L" + layer.str();
137 
138  // Get the ME produced by EfficiencyTask Source
139  MonitorElement* occupancy_histo = igetter.get(getMEName("hEffOccupancy", lID));
140  MonitorElement* unassOccupancy_histo = igetter.get(getMEName("hEffUnassOccupancy", lID));
141  MonitorElement* recSegmOccupancy_histo = igetter.get(getMEName("hRecSegmOccupancy", lID));
142 
143  // ME -> TH1F
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();
148 
149  const int firstWire = muonGeom->layer(lID)->specificTopology().firstChannel();
150  const int lastWire = muonGeom->layer(lID)->specificTopology().lastChannel();
151 
152  // Loop over the TH1F bin and fill the ME to be used for the Quality Test
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);
157  float efficiency =
158  occupancy_histo_root->GetBinContent(bin) / recSegmOccupancy_histo_root->GetBinContent(bin);
159  float errorEff = sqrt(efficiency * (1 - efficiency) / recSegmOccupancy_histo_root->GetBinContent(bin));
160  EfficiencyHistos.find(lID)->second->setBinContent(bin, efficiency);
161  EfficiencyHistos.find(lID)->second->setBinError(bin, errorEff);
162 
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);
171  }
172  }
173  }
174  } // loop on layers
175  } // loop on superlayers
176  } //loop on chambers
177 
178  // Efficiency test
179  //cout<<"[DTEfficiencyTest]: Efficiency Tests results"<<endl;
180  string EfficiencyCriterionName = parameters.getUntrackedParameter<string>("EfficiencyTestName", "EfficiencyInRange");
181  for (map<DTLayerId, MonitorElement*>::const_iterator hEff = EfficiencyHistos.begin(); hEff != EfficiencyHistos.end();
182  hEff++) {
183  const QReport* theEfficiencyQReport = (*hEff).second->getQReport(EfficiencyCriterionName);
184  double counter = 0;
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();
188  channel++) {
189  edm::LogError("efficiency") << "LayerID : " << getMEName("hEffOccupancy", (*hEff).first)
190  << " Bad efficiency channels: " << (*channel).getBin()
191  << " Contents : " << (*channel).getContents();
192  counter++;
193  }
194  LayerBadCells[(*hEff).first].push_back(counter);
195  LayerBadCells[(*hEff).first].push_back(muonGeom->layer((*hEff).first)->specificTopology().channels());
196  // FIXME: getMessage() sometimes returns and invalid string (null pointer inside QReport data member)
197  // edm::LogWarning ("efficiency") << "-------- "<<theEfficiencyQReport->getMessage()<<" ------- "<<theEfficiencyQReport->getStatus();
198  }
199  }
200 
201  // UnassEfficiency test
202  //cout<<"[DTEfficiencyTest]: UnassEfficiency Tests results"<<endl;
203  string UnassEfficiencyCriterionName =
204  parameters.getUntrackedParameter<string>("UnassEfficiencyTestName", "UnassEfficiencyInRange");
205  for (map<DTLayerId, MonitorElement*>::const_iterator hUnassEff = UnassEfficiencyHistos.begin();
206  hUnassEff != UnassEfficiencyHistos.end();
207  hUnassEff++) {
208  const QReport* theUnassEfficiencyQReport = (*hUnassEff).second->getQReport(UnassEfficiencyCriterionName);
209  double counter = 0;
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();
213  channel++) {
214  edm::LogError("efficiency") << "Bad unassEfficiency channels: " << (*channel).getBin() << " "
215  << (*channel).getContents();
216  counter++;
217  }
218  LayerUnassBadCells[(*hUnassEff).first].push_back(counter);
219  LayerUnassBadCells[(*hUnassEff).first].push_back(
220  double(muonGeom->layer((*hUnassEff).first)->specificTopology().channels()));
221  // FIXME: getMessage() sometimes returns and invalid string (null pointer inside QReport data member)
222  // edm::LogWarning ("efficiency") << theUnassEfficiencyQReport->getMessage()<<" ------- "<<theUnassEfficiencyQReport->getStatus();
223  }
224  }
225 
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();
231  // Loop over the SLs
232  for (; sl2_it != sl2_end; ++sl2_it) {
233  DTSuperLayerId sl = (*sl2_it)->id();
234  double superLayerBadC = 0;
235  double superLayerTotC = 0;
236  double superLayerUnassBadC = 0;
237  double superLayerUnassTotC = 0;
238  bool fill = false;
239  vector<const DTLayer*>::const_iterator l2_it = (*sl2_it)->layers().begin();
240  vector<const DTLayer*>::const_iterator l2_end = (*sl2_it)->layers().end();
241  // Loop over the Ls
242  for (; l2_it != l2_end; ++l2_it) {
243  DTLayerId layerId = (*l2_it)->id();
244  if (LayerBadCells.find(layerId) != LayerBadCells.end() &&
245  LayerUnassBadCells.find(layerId) != LayerUnassBadCells.end()) {
246  fill = true;
247  superLayerBadC += LayerBadCells[layerId][0];
248  superLayerTotC += LayerBadCells[layerId][1];
249  superLayerUnassBadC += LayerUnassBadCells[layerId][0];
250  superLayerUnassTotC += LayerUnassBadCells[layerId][1];
251  }
252  }
253  if (fill) {
254  SuperLayerBadCells[sl].push_back(superLayerBadC);
255  SuperLayerBadCells[sl].push_back(superLayerTotC);
256  SuperLayerUnassBadCells[sl].push_back(superLayerUnassBadC);
257  SuperLayerUnassBadCells[sl].push_back(superLayerUnassTotC);
258  }
259  }
260  }
261 
262  for (map<DTSuperLayerId, vector<double> >::const_iterator SLBCells = SuperLayerBadCells.begin();
263  SLBCells != SuperLayerBadCells.end();
264  SLBCells++) {
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));
272  else
273  wheelHistos[(*SLBCells).first.wheel()]->Fill((*SLBCells).first.sector() - 1, 10);
274  // fill the cms summary histo if the percentual of SL which have not passed the test
275  // is more than a predefined treshold
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());
287  }
288  }
289  }
290 
291  for (map<DTSuperLayerId, vector<double> >::const_iterator SLUBCells = SuperLayerUnassBadCells.begin();
292  SLUBCells != SuperLayerUnassBadCells.end();
293  SLUBCells++) {
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));
301  else
302  wheelUnassHistos[(*SLUBCells).first.wheel()]->Fill((*SLUBCells).first.sector() - 1, 10);
303  // fill the cms summary histo if the percentual of SL which have not passed the test
304  // is more than a predefined treshold
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());
316  }
317  }
318  }
319 }
320 
322  edm::LogVerbatim("efficiency") << "[DTEfficiencyTest] endjob called!";
323 }
324 
325 string DTEfficiencyTest::getMEName(string histoTag, const DTLayerId& lID) {
326  stringstream wheel;
327  wheel << lID.superlayerId().wheel();
328  stringstream station;
329  station << lID.superlayerId().station();
330  stringstream sector;
331  sector << lID.superlayerId().sector();
332  stringstream superLayer;
333  superLayer << lID.superlayerId().superlayer();
334  stringstream layer;
335  layer << lID.layer();
336 
337  string folderRoot = parameters.getUntrackedParameter<string>("folderRoot", "Collector/FU0/");
338  string folderName = folderRoot + "DT/DTEfficiencyTask/Wheel" + wheel.str() + "/Station" + station.str() + "/Sector" +
339  sector.str() + "/SuperLayer" + superLayer.str() + "/";
340 
341  string histoname = folderName + histoTag + "_W" + wheel.str() + "_St" + station.str() + "_Sec" + sector.str() +
342  "_SL" + superLayer.str() + "_L" + layer.str();
343 
344  return histoname;
345 }
346 
347 void DTEfficiencyTest::bookHistos(DQMStore::IBooker& ibooker, const DTLayerId& lId, int firstWire, int lastWire) {
348  stringstream wheel;
349  wheel << lId.superlayerId().wheel();
350  stringstream station;
351  station << lId.superlayerId().station();
352  stringstream sector;
353  sector << lId.superlayerId().sector();
354  stringstream superLayer;
355  superLayer << lId.superlayerId().superlayer();
356  stringstream layer;
357  layer << lId.layer();
358 
359  string HistoName =
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;
363 
364  ibooker.setCurrentFolder("DT/Tests/DTEfficiency/Wheel" + wheel.str() + "/Station" + station.str() + "/Sector" +
365  sector.str());
366 
367  EfficiencyHistos[lId] = ibooker.book1D(EfficiencyHistoName.c_str(),
368  EfficiencyHistoName.c_str(),
369  lastWire - firstWire + 1,
370  firstWire - 0.5,
371  lastWire + 0.5);
372  UnassEfficiencyHistos[lId] = ibooker.book1D(UnassEfficiencyHistoName.c_str(),
373  UnassEfficiencyHistoName.c_str(),
374  lastWire - firstWire + 1,
375  firstWire - 0.5,
376  lastWire + 0.5);
377 }
378 
380  ibooker.setCurrentFolder("DT/Tests/DTEfficiency/SummaryPlot");
381 
382  if (wheelHistos.find(3) == wheelHistos.end()) {
383  string histoName = "ESummary_testFailedByAtLeastBadSL";
384  wheelHistos[3] = ibooker.book2D(histoName.c_str(), histoName.c_str(), 14, 0, 14, 5, -2, 2);
385  wheelHistos[3]->setBinLabel(1, "Sector1", 1);
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);
405  }
406  if (wheelUnassHistos.find(3) == wheelUnassHistos.end()) {
407  string histoName = "UESummary_testFailedByAtLeastBadSL";
408  wheelUnassHistos[3] = ibooker.book2D(histoName.c_str(), histoName.c_str(), 14, 0, 14, 5, -2, 2);
409  wheelUnassHistos[3]->setBinLabel(1, "Sector1", 1);
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);
429  }
430 
431  stringstream wheel;
432  wheel << wh;
433 
434  if (wheelHistos.find(wh) == wheelHistos.end()) {
435  string histoName = "ESummary_testFailed_W" + wheel.str();
436  wheelHistos[wh] = ibooker.book2D(histoName.c_str(), histoName.c_str(), 14, 0, 14, 11, 0, 11);
437  wheelHistos[wh]->setBinLabel(1, "Sector1", 1);
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);
462  }
463  if (wheelUnassHistos.find(wh) == wheelUnassHistos.end()) {
464  string histoName = "UESummary_testFailed_W" + wheel.str();
465  wheelUnassHistos[wh] = ibooker.book2D(histoName.c_str(), histoName.c_str(), 14, 0, 14, 11, 0, 11);
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);
491  }
492 }
Log< level::Info, true > LogVerbatim
int station() const
Return the station number.
Definition: DTChamberId.h:42
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
LuminosityBlockNumber_t luminosityBlock() const
void beginRun(const edm::Run &r, const edm::EventSetup &c) override
beginrun
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
const std::vector< DQMChannel > & getBadChannels() const
edm::ParameterSet parameters
~DTEfficiencyTest() override
Destructor.
Log< level::Error, false > LogError
void bookHistos(DQMStore::IBooker &, const DTLayerId &ch, int firstWire, int lastWire)
book the new ME
DTEfficiencyTest(const edm::ParameterSet &ps)
Constructor.
constexpr std::array< uint8_t, layerIndexSize > layer
T getUntrackedParameter(std::string const &, T const &) const
int firstChannel() const
Returns the wire number of the first wire.
Definition: DTTopology.h:79
std::map< int, MonitorElement * > wheelHistos
T sqrt(T t)
Definition: SSEVec.h:19
std::map< DTLayerId, MonitorElement * > UnassEfficiencyHistos
Transition
Definition: Transition.h:12
std::map< int, MonitorElement * > wheelUnassHistos
const DTTopology & specificTopology() const
Definition: DTLayer.cc:37
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
unsigned int nLumiSegs
void dqmEndLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
DQM Client Diagnostic.
int superlayer() const
Return the superlayer number (deprecated method name)
LuminosityBlockID id() const
virtual TH1F * getTH1F() const
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:212
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:673
std::string HistoName
int layer() const
Return the layer number.
Definition: DTLayerId.h:42
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:39
HLT enums.
int sector() const
Definition: DTChamberId.h:49
std::map< DTLayerId, MonitorElement * > EfficiencyHistos
int lastChannel() const
Returns the wire number of the last wire.
Definition: DTTopology.h:81
DTSuperLayerId superlayerId() const
Return the corresponding SuperLayerId.
Definition: DTLayerId.h:45
const std::vector< const DTChamber * > & chambers() const
Return a vector of all Chamber.
Definition: DTGeometry.cc:84
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
int channels() const
Returns the number of wires in the layer.
Definition: DTTopology.h:76
edm::ESGetToken< DTGeometry, MuonGeometryRecord > muonGeomToken_
const DTGeometry * muonGeom
Definition: Run.h:45
std::string getMEName(std::string histoTag, const DTLayerId &lID)
Get the ME name.
const DTLayer * layer(const DTLayerId &id) const
Return a layer given its id.
Definition: DTGeometry.cc:96