33 LogTrace(
"DTDQM|DTMonitorClient|DTResolutionAnalysisTest") <<
"[DTResolutionAnalysisTest]: Constructor";
48 LogTrace(
"DTDQM|DTMonitorClient|DTResolutionAnalysisTest")
49 <<
"DTResolutionAnalysisTest: analyzed " <<
nevents <<
" events";
53 LogTrace(
"DTDQM|DTMonitorClient|DTResolutionAnalysisTest") <<
"[DTResolutionAnalysisTest]: BeginRun";
66 ibooker.
book2D(
"ResidualsGlbSummary",
"# of SLs with good mean and good sigma of residuals", 12, 1, 13, 5, -2, 3);
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);
73 ibooker.
book1D(
"MeanDistr_ThetaWh0",
"Mean values of the residuals #theta SL Wh 0 (cm)", 100, -0.1, 0.1);
75 ibooker.
book1D(
"MeanDistr_ThetaWh1",
"Mean value of the residuals #theta SL Wh +/-1 (cm)", 100, -0.1, 0.1);
77 ibooker.
book1D(
"MeanDistr_ThetaWh2",
"Mean value of the residuals #theta SL Wh +/-2 (cm)", 100, -0.1, 0.1);
79 for (
int wh = -2; wh <= 2; wh++) {
82 for (
int st = 1; st <= 4; st++) {
85 for (
int sl = 1; sl <= 3; sl++) {
86 if (sl == 2 && st == 4)
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);
115 wheelMeanHistos[3]->setAxisTitle(
"Wheel", 2);
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);
121 ibooker.
book1D(
"SigmaDistr_ThetaWh0",
"Sigma value of the residuals #theta SL Wh 0 (cm)", 50, 0.0, 0.2);
123 ibooker.
book1D(
"SigmaDistr_ThetaWh1",
"Sigma value of the residuals #theta SL Wh +/-1 (cm)", 50, 0.0, 0.2);
125 ibooker.
book1D(
"SigmaDistr_ThetaWh2",
"Sigma value of the residuals #theta SL Wh +/-2 (cm)", 50, 0.0, 0.2);
127 histoTitle =
"# of SLs with good sigma of residuals";
128 wheelSigmaHistos[3] = ibooker.
book2D(
"SigmaResGlbSummary", histoTitle.c_str(), 12, 1, 13, 5, -2, 3);
130 wheelSigmaHistos[3]->setAxisTitle(
"Wheel", 2);
135 for (
int sector = 1; sector <= 12; sector++) {
143 LogTrace(
"DTDQM|DTMonitorClient|DTResolutionAnalysisTest")
144 <<
"[DTResolutionAnalysisTest]: Base folder " <<
topHistoFolder <<
" does not exist. Skipping client operation."
152 LogTrace(
"DTDQM|DTMonitorClient|DTResolutionAnalysisTest")
153 <<
"[DTResolutionAnalysisTest]: End of Run transition, performing the DQM client operation" << endl;
158 for (vector<const DTChamber*>::const_iterator ch_it = muonGeom->chambers().begin();
159 ch_it != muonGeom->chambers().end();
165 for (vector<const DTSuperLayer*>::const_iterator sl_it = (*ch_it)->superLayers().begin();
166 sl_it != (*ch_it)->superLayers().end();
173 float statMean = res_histo->
getMean(1);
174 float statSigma = res_histo->
getRMS(1);
177 TH1F* histo_root = res_histo->
getTH1F();
181 int binSect = slID.
sector();
184 else if (slID.
sector() == 14)
194 if (histo_root->GetEntries() > 20) {
195 TF1* gfit =
new TF1(
"Gaussian",
"gaus", (statMean - (2 * statSigma)), (statMean + (2 * statSigma)));
197 histo_root->Fit(gfit,
"Q0 SERIAL",
"", -0.1, 0.1);
199 LogWarning(
"DTDQM|DTMonitorModule|DTResolutionAnalysisTask")
200 <<
"[DTResolutionAnalysisTask]: Exception when fitting SL : " << slID;
203 if ((binSect == 4 || binSect == 10) && slID.
station() == 4)
205 globalResSummary->Fill(binSect, slID.
wheel(),
weight);
211 mean = gfit->GetParameter(1);
212 sigma = gfit->GetParameter(2);
215 meanDistr[-2]->Fill(
mean);
216 sigmaDistr[-2]->Fill(sigma);
221 meanDistr[-1]->Fill(
mean);
222 sigmaDistr[-1]->Fill(sigma);
225 string histoType =
"MeanDistr_Phi";
227 histoType =
"MeanDistr_Theta";
230 histoType =
"SigmaDistr_Phi";
232 histoType =
"SigmaDistr_Theta";
236 MeanHistos[make_pair(slID.
wheel(), binSect)]->setBinContent(binSL,
mean);
237 SigmaHistos[make_pair(slID.
wheel(), binSect)]->setBinContent(binSL, sigma);
239 if ((slID.
sector() == 13 || slID.
sector() == 14) && binSL == 12)
241 if ((slID.
sector() == 13 || slID.
sector() == 14) && binSL == 13)
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);
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);
254 wheelMeanHistos[slID.
wheel()]->setBinContent(binSect, binSL, meanInRange(
mean));
255 wheelSigmaHistos[slID.
wheel()]->setBinContent(binSect, binSL, sigmaInRange(sigma));
260 if ((binSect == 4 || binSect == 10) && slID.
station() == 4)
264 if ((meanInRange(
mean) > 0.85) && (sigmaInRange(sigma) > 0.85)) {
265 globalResSummary->Fill(binSect, slID.
wheel(),
weight);
266 wheelMeanHistos[3]->Fill(binSect, slID.
wheel(),
weight);
267 wheelSigmaHistos[3]->Fill(binSect, slID.
wheel(),
weight);
269 if ((meanInRange(
mean) < 0.85) && (sigmaInRange(sigma) > 0.85)) {
270 wheelSigmaHistos[3]->Fill(binSect, slID.
wheel(),
weight);
272 if ((meanInRange(
mean) > 0.85) && (sigmaInRange(sigma) < 0.85)) {
273 wheelMeanHistos[3]->Fill(binSect, slID.
wheel(),
weight);
279 LogVerbatim(
"DTDQM|DTMonitorModule|DTResolutionAnalysisTask")
280 <<
"[DTResolutionAnalysisTask] Fit of " << slID <<
" not performed because # entries < 20 ";
283 if ((binSect == 4 || binSect == 10) && slID.
station() == 4)
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.);
292 LogWarning(
"DTDQM|DTMonitorModule|DTResolutionAnalysisTask")
293 <<
"[DTResolutionAnalysisTask] Histo: " << getMEName(slID) <<
" not found" << endl;
305 string histoTitle =
"# of SLs with wrong mean of residuals (Wheel " +
wheel.str() +
")";
307 wheelMeanHistos[wh] = ibooker.
book2D(
histoName.c_str(), histoTitle.c_str(), 12, 1, 13, 11, 1, 12);
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);
323 histoTitle =
"# of SLs with wrong sigma of residuals (Wheel " +
wheel.str() +
")";
325 wheelSigmaHistos[wh] = ibooker.
book2D(
histoName.c_str(), histoTitle.c_str(), 12, 1, 13, 11, 1, 12);
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);
346 string MeanHistoName =
"MeanTest_W" +
wheel.str() +
"_Sec" + sector.str();
347 string SigmaHistoName =
"SigmaTest_W" +
wheel.str() +
"_Sec" + sector.str();
352 if (sect != 4 && sect != 10) {
353 MeanHistos[make_pair(wh, sect)] =
355 ibooker.
book1D(MeanHistoName.c_str(),
"Mean (from gaussian fit) of the residuals distribution", 11, 1, 12);
357 MeanHistos[make_pair(wh, sect)] =
358 ibooker.
book1D(MeanHistoName.c_str(),
"Mean (from gaussian fit) of the residuals distribution", 13, 1, 14);
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);
372 (MeanHistos[make_pair(wh, sect)])->setBinLabel(12,
"MB4S13_SL1", 1);
373 (MeanHistos[make_pair(wh, sect)])->setBinLabel(13,
"MB4S13_SL3", 1);
376 (MeanHistos[make_pair(wh, sect)])->setBinLabel(12,
"MB4S14_SL1", 1);
377 (MeanHistos[make_pair(wh, sect)])->setBinLabel(13,
"MB4S14_SL3", 1);
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);
384 SigmaHistos[make_pair(wh, sect)] =
385 ibooker.
book1D(SigmaHistoName.c_str(),
"Sigma (from gaussian fit) of the residuals distribution", 13, 1, 14);
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);
399 (SigmaHistos[make_pair(wh, sect)])->setBinLabel(12,
"MB4S13_SL1", 1);
400 (SigmaHistos[make_pair(wh, sect)])->setBinLabel(13,
"MB4S13_SL3", 1);
403 (SigmaHistos[make_pair(wh, sect)])->setBinLabel(12,
"MB4S14_SL1", 1);
404 (SigmaHistos[make_pair(wh, sect)])->setBinLabel(13,
"MB4S14_SL3", 1);
415 stringstream superLayer;
423 "DT/DTCalibValidation/Wheel" +
wheel.str() +
"/Station" +
station.str() +
"/Sector" + sector.str() +
"/";
425 string histoname =
folderName +
"hResDist" +
"_W" +
wheel.str() +
"_St" +
station.str() +
"_Sec" + sector.str() +
426 "_SL" + superLayer.str();
429 histoname =
folderName +
"hResDist_STEP3" +
"_W" +
wheel.str() +
"_St" +
station.str() +
"_Sec" + sector.str() +
430 "_SL" + superLayer.str();
439 if (
ret == 0 ||
bin == 11)
470 globalResSummary->Reset();
472 for (map<int, MonitorElement*>::const_iterator
histo = wheelMeanHistos.begin();
histo != wheelMeanHistos.end();
474 (*histo).second->Reset();
476 for (map<int, MonitorElement*>::const_iterator
histo = wheelSigmaHistos.begin();
histo != wheelSigmaHistos.end();
478 (*histo).second->Reset();
481 for (
int indx = -2; indx != 3; ++indx) {
482 meanDistr[indx]->Reset();
483 sigmaDistr[indx]->Reset();