CMS 3D CMS Logo

DTResolutionAnalysisTest.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
16 
17 // Geometry
19 
23 
24 #include <string>
25 #include <sstream>
26 #include <cmath>
27 
28 using namespace edm;
29 using namespace std;
30 
32  : muonGeomToken_(esConsumes<edm::Transition::BeginRun>()) {
33  LogTrace("DTDQM|DTMonitorClient|DTResolutionAnalysisTest") << "[DTResolutionAnalysisTest]: Constructor";
34 
35  prescaleFactor = ps.getUntrackedParameter<int>("diagnosticPrescale", 1);
36  // permitted test range
37  maxGoodMeanValue = ps.getUntrackedParameter<double>("maxGoodMeanValue", 0.02);
38  minBadMeanValue = ps.getUntrackedParameter<double>("minBadMeanValue", 0.04);
39  maxGoodSigmaValue = ps.getUntrackedParameter<double>("maxGoodSigmaValue", 0.08);
40  minBadSigmaValue = ps.getUntrackedParameter<double>("minBadSigmaValue", 0.16);
41  // top folder for the histograms in DQMStore
42  topHistoFolder = ps.getUntrackedParameter<string>("topHistoFolder", "DT/02-Segments");
43 
44  doCalibAnalysis = ps.getUntrackedParameter<bool>("doCalibAnalysis", false);
45 }
46 
48  LogTrace("DTDQM|DTMonitorClient|DTResolutionAnalysisTest")
49  << "DTResolutionAnalysisTest: analyzed " << nevents << " events";
50 }
51 
53  LogTrace("DTDQM|DTMonitorClient|DTResolutionAnalysisTest") << "[DTResolutionAnalysisTest]: BeginRun";
54 
55  nevents = 0;
56 
57  // Get the geometry
58  muonGeom = &context.getData(muonGeomToken_);
59 }
60 
62  // global residual summary
63 
66  ibooker.book2D("ResidualsGlbSummary", "# of SLs with good mean and good sigma of residuals", 12, 1, 13, 5, -2, 3);
67 
68  // book summaries for mean and sigma
69  ibooker.setCurrentFolder(topHistoFolder + "/00-MeanRes");
70  meanDistr[-2] = ibooker.book1D("MeanDistr", "Mean value of the residuals all (cm)", 100, -0.1, 0.1);
71  meanDistr[-1] = ibooker.book1D("MeanDistr_Phi", "Mean value of the residuals #phi SL (cm)", 100, -0.1, 0.1);
72  meanDistr[0] =
73  ibooker.book1D("MeanDistr_ThetaWh0", "Mean values of the residuals #theta SL Wh 0 (cm)", 100, -0.1, 0.1);
74  meanDistr[1] =
75  ibooker.book1D("MeanDistr_ThetaWh1", "Mean value of the residuals #theta SL Wh +/-1 (cm)", 100, -0.1, 0.1);
76  meanDistr[2] =
77  ibooker.book1D("MeanDistr_ThetaWh2", "Mean value of the residuals #theta SL Wh +/-2 (cm)", 100, -0.1, 0.1);
78 
79  for (int wh = -2; wh <= 2; wh++) {
80  stringstream wheel;
81  wheel << wh;
82  for (int st = 1; st <= 4; st++) {
83  stringstream station;
84  station << st;
85  for (int sl = 1; sl <= 3; sl++) {
86  if (sl == 2 && st == 4)
87  continue;
88  ibooker.setCurrentFolder(topHistoFolder + "/00-MeanRes/Wheel" + wheel.str());
89  string histoLabel = "MeanDistr";
90  string histoName = histoLabel + "_W" + wheel.str() + "_MB" + station.str() + "_Phi";
91  string histoType = histoLabel + "_Phi";
92  if (sl == 2) {
93  histoName = histoLabel + "_W" + wheel.str() + "_MB" + station.str() + "_Theta";
94  histoType = histoLabel + "_Theta";
95  }
96  (wheelRingHistos[wh][st])[histoType] = ibooker.book1D(histoName, histoLabel, 100, -0.1, 0.1);
97 
98  ibooker.setCurrentFolder(topHistoFolder + "/01-SigmaRes/Wheel" + wheel.str());
99  histoLabel = "SigmaDistr";
100  histoName = histoLabel + "_W" + wheel.str() + "_MB" + station.str() + "_Phi";
101  histoType = histoLabel + "_Phi";
102  if (sl == 2) {
103  histoName = histoLabel + "_W" + wheel.str() + "_MB" + station.str() + "_Theta";
104  histoType = histoLabel + "_Theta";
105  }
106  (wheelRingHistos[wh][st])[histoType] = ibooker.book1D(histoName, histoLabel, 50, 0.0, 0.2);
107  }
108  }
109  }
110 
111  ibooker.setCurrentFolder(topHistoFolder + "/00-MeanRes");
112  string histoTitle = "# of SLs with good mean of residuals";
113  wheelMeanHistos[3] = ibooker.book2D("MeanResGlbSummary", histoTitle.c_str(), 12, 1, 13, 5, -2, 3);
114  wheelMeanHistos[3]->setAxisTitle("Sector", 1);
115  wheelMeanHistos[3]->setAxisTitle("Wheel", 2);
116 
117  ibooker.setCurrentFolder(topHistoFolder + "/01-SigmaRes");
118  sigmaDistr[-2] = ibooker.book1D("SigmaDistr", "Sigma value of the residuals all (cm)", 50, 0.0, 0.2);
119  sigmaDistr[-1] = ibooker.book1D("SigmaDistr_Phi", "Sigma value of the residuals #phi SL (cm)", 50, 0.0, 0.2);
120  sigmaDistr[0] =
121  ibooker.book1D("SigmaDistr_ThetaWh0", "Sigma value of the residuals #theta SL Wh 0 (cm)", 50, 0.0, 0.2);
122  sigmaDistr[1] =
123  ibooker.book1D("SigmaDistr_ThetaWh1", "Sigma value of the residuals #theta SL Wh +/-1 (cm)", 50, 0.0, 0.2);
124  sigmaDistr[2] =
125  ibooker.book1D("SigmaDistr_ThetaWh2", "Sigma value of the residuals #theta SL Wh +/-2 (cm)", 50, 0.0, 0.2);
126 
127  histoTitle = "# of SLs with good sigma of residuals";
128  wheelSigmaHistos[3] = ibooker.book2D("SigmaResGlbSummary", histoTitle.c_str(), 12, 1, 13, 5, -2, 3);
129  wheelSigmaHistos[3]->setAxisTitle("Sector", 1);
130  wheelSigmaHistos[3]->setAxisTitle("Wheel", 2);
131 
132  // loop over all the CMS wheels, sectors & book the summary histos
133  for (int wheel = -2; wheel <= 2; wheel++) {
134  bookHistos(ibooker, wheel);
135  for (int sector = 1; sector <= 12; sector++) {
136  bookHistos(ibooker, wheel, sector);
137  }
138  }
139 }
140 
142  if (!igetter.dirExists(topHistoFolder)) {
143  LogTrace("DTDQM|DTMonitorClient|DTResolutionAnalysisTest")
144  << "[DTResolutionAnalysisTest]: Base folder " << topHistoFolder << " does not exist. Skipping client operation."
145  << endl;
146  return;
147  }
148 
149  bookHistos(ibooker); // histos booked only if top histo folder exist
150  // as Standard/AlcaReco Harvest is performed in the same step
151 
152  LogTrace("DTDQM|DTMonitorClient|DTResolutionAnalysisTest")
153  << "[DTResolutionAnalysisTest]: End of Run transition, performing the DQM client operation" << endl;
154 
155  // reset the ME with fixed scale
156  resetMEs();
157 
158  for (vector<const DTChamber*>::const_iterator ch_it = muonGeom->chambers().begin();
159  ch_it != muonGeom->chambers().end();
160  ++ch_it) { // loop over the chambers
161 
162  DTChamberId chID = (*ch_it)->id();
163 
164  // Fill the test histos
165  for (vector<const DTSuperLayer*>::const_iterator sl_it = (*ch_it)->superLayers().begin();
166  sl_it != (*ch_it)->superLayers().end();
167  ++sl_it) { // loop over SLs
168 
169  DTSuperLayerId slID = (*sl_it)->id();
170  MonitorElement* res_histo = igetter.get(getMEName(slID));
171 
172  if (res_histo) { // Gaussian Fit
173  float statMean = res_histo->getMean(1);
174  float statSigma = res_histo->getRMS(1);
175  double mean = -1;
176  double sigma = -1;
177  TH1F* histo_root = res_histo->getTH1F();
178 
179  // fill the summaries
180  int entry = (chID.station() - 1) * 3;
181  int binSect = slID.sector();
182  if (slID.sector() == 13)
183  binSect = 4;
184  else if (slID.sector() == 14)
185  binSect = 10;
186  int binSL = entry + slID.superLayer();
187  if (chID.station() == 4 && slID.superLayer() == 3)
188  binSL--;
189  if ((slID.sector() == 13 || slID.sector() == 14) && slID.superLayer() == 1)
190  binSL = 12;
191  if ((slID.sector() == 13 || slID.sector() == 14) && slID.superLayer() == 3)
192  binSL = 13;
193 
194  if (histo_root->GetEntries() > 20) {
195  TF1* gfit = new TF1("Gaussian", "gaus", (statMean - (2 * statSigma)), (statMean + (2 * statSigma)));
196  try {
197  histo_root->Fit(gfit, "Q0 SERIAL", "", -0.1, 0.1);
198  } catch (cms::Exception& iException) {
199  LogWarning("DTDQM|DTMonitorModule|DTResolutionAnalysisTask")
200  << "[DTResolutionAnalysisTask]: Exception when fitting SL : " << slID;
201  // FIXME: the SL is set as OK in the summary
202  double weight = 1 / 11.;
203  if ((binSect == 4 || binSect == 10) && slID.station() == 4)
204  weight = 1 / 22.;
205  globalResSummary->Fill(binSect, slID.wheel(), weight);
206  continue;
207  }
208 
209  if (gfit) {
210  // get the mean and the sigma of the distribution
211  mean = gfit->GetParameter(1);
212  sigma = gfit->GetParameter(2);
213 
214  // fill the distributions
215  meanDistr[-2]->Fill(mean);
216  sigmaDistr[-2]->Fill(sigma);
217  if (slID.superlayer() == 2) {
218  meanDistr[abs(slID.wheel())]->Fill(mean);
219  sigmaDistr[abs(slID.wheel())]->Fill(sigma);
220  } else {
221  meanDistr[-1]->Fill(mean);
222  sigmaDistr[-1]->Fill(sigma);
223  }
224 
225  string histoType = "MeanDistr_Phi";
226  if (slID.superlayer() == 2)
227  histoType = "MeanDistr_Theta";
228  (wheelRingHistos[slID.wheel()][slID.station()])[histoType]->Fill(mean);
229 
230  histoType = "SigmaDistr_Phi";
231  if (slID.superlayer() == 2)
232  histoType = "SigmaDistr_Theta";
233  (wheelRingHistos[slID.wheel()][slID.station()])[histoType]->Fill(sigma);
234 
235  // sector summaries
236  MeanHistos[make_pair(slID.wheel(), binSect)]->setBinContent(binSL, mean);
237  SigmaHistos[make_pair(slID.wheel(), binSect)]->setBinContent(binSL, sigma);
238 
239  if ((slID.sector() == 13 || slID.sector() == 14) && binSL == 12)
240  binSL = 10;
241  if ((slID.sector() == 13 || slID.sector() == 14) && binSL == 13)
242  binSL = 11;
243 
244  if ((slID.sector() == 13 || slID.sector() == 14)) {
245  double MeanVal = wheelMeanHistos[slID.wheel()]->getBinContent(binSect, binSL);
246  double MeanBinVal = (MeanVal > 0. && MeanVal < meanInRange(mean)) ? MeanVal : meanInRange(mean);
247  wheelMeanHistos[slID.wheel()]->setBinContent(binSect, binSL, MeanBinVal);
248 
249  double SigmaVal = wheelSigmaHistos[slID.wheel()]->getBinContent(binSect, binSL);
250  double SigmaBinVal = (SigmaVal > 0. && SigmaVal < sigmaInRange(sigma)) ? SigmaVal : sigmaInRange(sigma);
251  wheelSigmaHistos[slID.wheel()]->setBinContent(binSect, binSL, SigmaBinVal);
252 
253  } else {
254  wheelMeanHistos[slID.wheel()]->setBinContent(binSect, binSL, meanInRange(mean));
255  wheelSigmaHistos[slID.wheel()]->setBinContent(binSect, binSL, sigmaInRange(sigma));
256  }
257 
258  // set the weight
259  double weight = 1 / 11.;
260  if ((binSect == 4 || binSect == 10) && slID.station() == 4)
261  weight = 1 / 22.;
262 
263  // test the values of mean and sigma
264  if ((meanInRange(mean) > 0.85) && (sigmaInRange(sigma) > 0.85)) { // sigma and mean ok
265  globalResSummary->Fill(binSect, slID.wheel(), weight);
266  wheelMeanHistos[3]->Fill(binSect, slID.wheel(), weight);
267  wheelSigmaHistos[3]->Fill(binSect, slID.wheel(), weight);
268  } else {
269  if ((meanInRange(mean) < 0.85) && (sigmaInRange(sigma) > 0.85)) { // only sigma ok
270  wheelSigmaHistos[3]->Fill(binSect, slID.wheel(), weight);
271  }
272  if ((meanInRange(mean) > 0.85) && (sigmaInRange(sigma) < 0.85)) { // only mean ok
273  wheelMeanHistos[3]->Fill(binSect, slID.wheel(), weight);
274  }
275  }
276  }
277  delete gfit;
278  } else {
279  LogVerbatim("DTDQM|DTMonitorModule|DTResolutionAnalysisTask")
280  << "[DTResolutionAnalysisTask] Fit of " << slID << " not performed because # entries < 20 ";
281  // FIXME: the SL is set as OK in the summary
282  double weight = 1 / 11.;
283  if ((binSect == 4 || binSect == 10) && slID.station() == 4)
284  weight = 1 / 22.;
285  globalResSummary->Fill(binSect, slID.wheel(), weight);
286  wheelMeanHistos[3]->Fill(binSect, slID.wheel(), weight);
287  wheelSigmaHistos[3]->Fill(binSect, slID.wheel(), weight);
288  wheelMeanHistos[slID.wheel()]->setBinContent(binSect, binSL, 1.);
289  wheelSigmaHistos[slID.wheel()]->setBinContent(binSect, binSL, 1.);
290  }
291  } else {
292  LogWarning("DTDQM|DTMonitorModule|DTResolutionAnalysisTask")
293  << "[DTResolutionAnalysisTask] Histo: " << getMEName(slID) << " not found" << endl;
294  }
295  } // loop on SLs
296  } // Loop on Stations
297 }
298 
300  stringstream wheel;
301  wheel << wh;
302 
303  ibooker.setCurrentFolder(topHistoFolder + "/00-MeanRes");
304  string histoName = "MeanSummaryRes_W" + wheel.str();
305  string histoTitle = "# of SLs with wrong mean of residuals (Wheel " + wheel.str() + ")";
306 
307  wheelMeanHistos[wh] = ibooker.book2D(histoName.c_str(), histoTitle.c_str(), 12, 1, 13, 11, 1, 12);
308  wheelMeanHistos[wh]->setAxisTitle("Sector", 1);
309  wheelMeanHistos[wh]->setBinLabel(1, "MB1_SL1", 2);
310  wheelMeanHistos[wh]->setBinLabel(2, "MB1_SL2", 2);
311  wheelMeanHistos[wh]->setBinLabel(3, "MB1_SL3", 2);
312  wheelMeanHistos[wh]->setBinLabel(4, "MB2_SL1", 2);
313  wheelMeanHistos[wh]->setBinLabel(5, "MB2_SL2", 2);
314  wheelMeanHistos[wh]->setBinLabel(6, "MB2_SL3", 2);
315  wheelMeanHistos[wh]->setBinLabel(7, "MB3_SL1", 2);
316  wheelMeanHistos[wh]->setBinLabel(8, "MB3_SL2", 2);
317  wheelMeanHistos[wh]->setBinLabel(9, "MB3_SL3", 2);
318  wheelMeanHistos[wh]->setBinLabel(10, "MB4_SL1", 2);
319  wheelMeanHistos[wh]->setBinLabel(11, "MB4_SL3", 2);
320 
321  ibooker.setCurrentFolder(topHistoFolder + "/01-SigmaRes");
322  histoName = "SigmaSummaryRes_W" + wheel.str();
323  histoTitle = "# of SLs with wrong sigma of residuals (Wheel " + wheel.str() + ")";
324 
325  wheelSigmaHistos[wh] = ibooker.book2D(histoName.c_str(), histoTitle.c_str(), 12, 1, 13, 11, 1, 12);
326  wheelSigmaHistos[wh]->setAxisTitle("Sector", 1);
327  wheelSigmaHistos[wh]->setBinLabel(1, "MB1_SL1", 2);
328  wheelSigmaHistos[wh]->setBinLabel(2, "MB1_SL2", 2);
329  wheelSigmaHistos[wh]->setBinLabel(3, "MB1_SL3", 2);
330  wheelSigmaHistos[wh]->setBinLabel(4, "MB2_SL1", 2);
331  wheelSigmaHistos[wh]->setBinLabel(5, "MB2_SL2", 2);
332  wheelSigmaHistos[wh]->setBinLabel(6, "MB2_SL3", 2);
333  wheelSigmaHistos[wh]->setBinLabel(7, "MB3_SL1", 2);
334  wheelSigmaHistos[wh]->setBinLabel(8, "MB3_SL2", 2);
335  wheelSigmaHistos[wh]->setBinLabel(9, "MB3_SL3", 2);
336  wheelSigmaHistos[wh]->setBinLabel(10, "MB4_SL1", 2);
337  wheelSigmaHistos[wh]->setBinLabel(11, "MB4_SL3", 2);
338 }
339 
340 void DTResolutionAnalysisTest::bookHistos(DQMStore::IBooker& ibooker, int wh, int sect) {
341  stringstream wheel;
342  wheel << wh;
343  stringstream sector;
344  sector << sect;
345 
346  string MeanHistoName = "MeanTest_W" + wheel.str() + "_Sec" + sector.str();
347  string SigmaHistoName = "SigmaTest_W" + wheel.str() + "_Sec" + sector.str();
348 
349  string folder = topHistoFolder + "/Wheel" + wheel.str() + "/Sector" + sector.str();
350  ibooker.setCurrentFolder(folder);
351 
352  if (sect != 4 && sect != 10) {
353  MeanHistos[make_pair(wh, sect)] =
354 
355  ibooker.book1D(MeanHistoName.c_str(), "Mean (from gaussian fit) of the residuals distribution", 11, 1, 12);
356  } else {
357  MeanHistos[make_pair(wh, sect)] =
358  ibooker.book1D(MeanHistoName.c_str(), "Mean (from gaussian fit) of the residuals distribution", 13, 1, 14);
359  }
360  (MeanHistos[make_pair(wh, sect)])->setBinLabel(1, "MB1_SL1", 1);
361  (MeanHistos[make_pair(wh, sect)])->setBinLabel(2, "MB1_SL2", 1);
362  (MeanHistos[make_pair(wh, sect)])->setBinLabel(3, "MB1_SL3", 1);
363  (MeanHistos[make_pair(wh, sect)])->setBinLabel(4, "MB2_SL1", 1);
364  (MeanHistos[make_pair(wh, sect)])->setBinLabel(5, "MB2_SL2", 1);
365  (MeanHistos[make_pair(wh, sect)])->setBinLabel(6, "MB2_SL3", 1);
366  (MeanHistos[make_pair(wh, sect)])->setBinLabel(7, "MB3_SL1", 1);
367  (MeanHistos[make_pair(wh, sect)])->setBinLabel(8, "MB3_SL2", 1);
368  (MeanHistos[make_pair(wh, sect)])->setBinLabel(9, "MB3_SL3", 1);
369  (MeanHistos[make_pair(wh, sect)])->setBinLabel(10, "MB4_SL1", 1);
370  (MeanHistos[make_pair(wh, sect)])->setBinLabel(11, "MB4_SL3", 1);
371  if (sect == 4) {
372  (MeanHistos[make_pair(wh, sect)])->setBinLabel(12, "MB4S13_SL1", 1);
373  (MeanHistos[make_pair(wh, sect)])->setBinLabel(13, "MB4S13_SL3", 1);
374  }
375  if (sect == 10) {
376  (MeanHistos[make_pair(wh, sect)])->setBinLabel(12, "MB4S14_SL1", 1);
377  (MeanHistos[make_pair(wh, sect)])->setBinLabel(13, "MB4S14_SL3", 1);
378  }
379 
380  if (sect != 4 && sect != 10) {
381  SigmaHistos[make_pair(wh, sect)] =
382  ibooker.book1D(SigmaHistoName.c_str(), "Sigma (from gaussian fit) of the residuals distribution", 11, 1, 12);
383  } else {
384  SigmaHistos[make_pair(wh, sect)] =
385  ibooker.book1D(SigmaHistoName.c_str(), "Sigma (from gaussian fit) of the residuals distribution", 13, 1, 14);
386  }
387  (SigmaHistos[make_pair(wh, sect)])->setBinLabel(1, "MB1_SL1", 1);
388  (SigmaHistos[make_pair(wh, sect)])->setBinLabel(2, "MB1_SL2", 1);
389  (SigmaHistos[make_pair(wh, sect)])->setBinLabel(3, "MB1_SL3", 1);
390  (SigmaHistos[make_pair(wh, sect)])->setBinLabel(4, "MB2_SL1", 1);
391  (SigmaHistos[make_pair(wh, sect)])->setBinLabel(5, "MB2_SL2", 1);
392  (SigmaHistos[make_pair(wh, sect)])->setBinLabel(6, "MB2_SL3", 1);
393  (SigmaHistos[make_pair(wh, sect)])->setBinLabel(7, "MB3_SL1", 1);
394  (SigmaHistos[make_pair(wh, sect)])->setBinLabel(8, "MB3_SL2", 1);
395  (SigmaHistos[make_pair(wh, sect)])->setBinLabel(9, "MB3_SL3", 1);
396  (SigmaHistos[make_pair(wh, sect)])->setBinLabel(10, "MB4_SL1", 1);
397  (SigmaHistos[make_pair(wh, sect)])->setBinLabel(11, "MB4_SL3", 1);
398  if (sect == 4) {
399  (SigmaHistos[make_pair(wh, sect)])->setBinLabel(12, "MB4S13_SL1", 1);
400  (SigmaHistos[make_pair(wh, sect)])->setBinLabel(13, "MB4S13_SL3", 1);
401  }
402  if (sect == 10) {
403  (SigmaHistos[make_pair(wh, sect)])->setBinLabel(12, "MB4S14_SL1", 1);
404  (SigmaHistos[make_pair(wh, sect)])->setBinLabel(13, "MB4S14_SL3", 1);
405  }
406 }
407 
409  stringstream wheel;
410  wheel << slID.wheel();
411  stringstream station;
412  station << slID.station();
413  stringstream sector;
414  sector << slID.sector();
415  stringstream superLayer;
416  superLayer << slID.superlayer();
417 
418  string folderName =
419  topHistoFolder + "/Wheel" + wheel.str() + "/Sector" + sector.str() + "/Station" + station.str() + "/";
420 
421  if (doCalibAnalysis)
422  folderName =
423  "DT/DTCalibValidation/Wheel" + wheel.str() + "/Station" + station.str() + "/Sector" + sector.str() + "/";
424 
425  string histoname = folderName + "hResDist" + "_W" + wheel.str() + "_St" + station.str() + "_Sec" + sector.str() +
426  "_SL" + superLayer.str();
427 
428  if (doCalibAnalysis)
429  histoname = folderName + "hResDist_STEP3" + "_W" + wheel.str() + "_St" + station.str() + "_Sec" + sector.str() +
430  "_SL" + superLayer.str();
431 
432  return histoname;
433 }
434 
435 int DTResolutionAnalysisTest::stationFromBin(int bin) const { return (int)(bin / 3.1) + 1; }
436 
438  int ret = bin % 3;
439  if (ret == 0 || bin == 11)
440  ret = 3;
441 
442  return ret;
443 }
444 
446  double value(0.);
447  if (fabs(mean) <= maxGoodMeanValue) {
448  value = 1.;
449  } else if (fabs(mean) > maxGoodMeanValue && fabs(mean) < minBadMeanValue) {
450  value = 0.9;
451  } else if (fabs(mean) >= minBadMeanValue) {
452  value = 0.1;
453  }
454  return value;
455 }
456 
457 double DTResolutionAnalysisTest::sigmaInRange(double sigma) const {
458  double value(0.);
459  if (sigma <= maxGoodSigmaValue) {
460  value = 1.;
461  } else if (sigma > maxGoodSigmaValue && sigma < minBadSigmaValue) {
462  value = 0.9;
463  } else if (sigma >= minBadSigmaValue) {
464  value = 0.1;
465  }
466  return value;
467 }
468 
471  // Reset the summary histo
472  for (map<int, MonitorElement*>::const_iterator histo = wheelMeanHistos.begin(); histo != wheelMeanHistos.end();
473  histo++) {
474  (*histo).second->Reset();
475  }
476  for (map<int, MonitorElement*>::const_iterator histo = wheelSigmaHistos.begin(); histo != wheelSigmaHistos.end();
477  histo++) {
478  (*histo).second->Reset();
479  }
480 
481  for (int indx = -2; indx != 3; ++indx) {
482  meanDistr[indx]->Reset();
483  sigmaDistr[indx]->Reset();
484  }
485 }
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
std::map< int, MonitorElement * > meanDistr
void bookHistos(DQMStore::IBooker &)
std::map< int, MonitorElement * > wheelMeanHistos
int superLayer() const
Return the superlayer number.
edm::ESGetToken< DTGeometry, MuonGeometryRecord > muonGeomToken_
DTResolutionAnalysisTest(const edm::ParameterSet &ps)
Constructor.
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
ret
prodAgent to be discontinued
virtual bool dirExists(std::string const &path) const
Definition: DQMStore.cc:754
std::string getMEName(const DTSuperLayerId &slID)
Get the ME name.
Definition: weight.py:1
~DTResolutionAnalysisTest() override
Destructor.
#define LogTrace(id)
std::map< std::pair< int, int >, MonitorElement * > SigmaHistos
T getUntrackedParameter(std::string const &, T const &) const
void Fill(long long x)
virtual void Reset()
Remove all data from the ME, keept the empty histogram with all its settings.
virtual double getRMS(int axis=1) const
get RMS of histogram along x, y or z axis (axis=1, 2, 3 respectively)
void beginRun(const edm::Run &r, const edm::EventSetup &c) override
BeginRun.
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
std::map< std::pair< int, int >, MonitorElement * > MeanHistos
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
Transition
Definition: Transition.h:12
Definition: value.py:1
std::map< int, MonitorElement * > wheelSigmaHistos
int superlayer() const
Return the superlayer number (deprecated method name)
std::map< int, MonitorElement * > sigmaDistr
double meanInRange(double mean) 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:697
virtual double getMean(int axis=1) const
get mean value of histogram along x, y or z axis (axis=1, 2, 3 respectively)
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:39
HLT enums.
int sector() const
Definition: DTChamberId.h:49
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
double sigmaInRange(double sigma) const
const std::vector< const DTChamber * > & chambers() const
Return a vector of all Chamber.
Definition: DTGeometry.cc:84
Log< level::Warning, false > LogWarning
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
Definition: Run.h:45
std::map< int, std::map< int, std::map< std::string, MonitorElement * > > > wheelRingHistos