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 string histoTitle =
"# of SLs with good mean of residuals";
81 wheelMeanHistos[3] = ibooker.
book2D(
"MeanResGlbSummary", histoTitle.c_str(), 12, 1, 13, 5, -2, 3);
83 wheelMeanHistos[3]->setAxisTitle(
"Wheel", 2);
86 sigmaDistr[-2] = ibooker.
book1D(
"SigmaDistr",
"Sigma value of the residuals all (cm)", 50, 0.0, 0.2);
87 sigmaDistr[-1] = ibooker.
book1D(
"SigmaDistr_Phi",
"Sigma value of the residuals #phi SL (cm)", 50, 0.0, 0.2);
89 ibooker.
book1D(
"SigmaDistr_ThetaWh0",
"Sigma value of the residuals #theta SL Wh 0 (cm)", 50, 0.0, 0.2);
91 ibooker.
book1D(
"SigmaDistr_ThetaWh1",
"Sigma value of the residuals #theta SL Wh +/-1 (cm)", 50, 0.0, 0.2);
93 ibooker.
book1D(
"SigmaDistr_ThetaWh2",
"Sigma value of the residuals #theta SL Wh +/-2 (cm)", 50, 0.0, 0.2);
95 histoTitle =
"# of SLs with good sigma of residuals";
96 wheelSigmaHistos[3] = ibooker.
book2D(
"SigmaResGlbSummary", histoTitle.c_str(), 12, 1, 13, 5, -2, 3);
98 wheelSigmaHistos[3]->setAxisTitle(
"Wheel", 2);
103 for (
int sector = 1; sector <= 12; sector++) {
111 LogTrace(
"DTDQM|DTMonitorClient|DTResolutionAnalysisTest")
112 <<
"[DTResolutionAnalysisTest]: Base folder " <<
topHistoFolder <<
" does not exist. Skipping client operation."
120 LogTrace(
"DTDQM|DTMonitorClient|DTResolutionAnalysisTest")
121 <<
"[DTResolutionAnalysisTest]: End of Run transition, performing the DQM client operation" << endl;
126 for (vector<const DTChamber*>::const_iterator ch_it = muonGeom->chambers().begin();
127 ch_it != muonGeom->chambers().end();
133 for (vector<const DTSuperLayer*>::const_iterator sl_it = (*ch_it)->superLayers().begin();
134 sl_it != (*ch_it)->superLayers().end();
141 float statMean = res_histo->
getMean(1);
142 float statSigma = res_histo->
getRMS(1);
145 TH1F* histo_root = res_histo->
getTH1F();
149 int binSect = slID.
sector();
152 else if (slID.
sector() == 14)
162 if (histo_root->GetEntries() > 20) {
163 TF1* gfit =
new TF1(
"Gaussian",
"gaus", (statMean - (2 * statSigma)), (statMean + (2 * statSigma)));
165 histo_root->Fit(gfit,
"Q0 SERIAL",
"", -0.1, 0.1);
167 LogWarning(
"DTDQM|DTMonitorModule|DTResolutionAnalysisTask")
168 <<
"[DTResolutionAnalysisTask]: Exception when fitting SL : " << slID;
171 if ((binSect == 4 || binSect == 10) && slID.
station() == 4)
173 globalResSummary->Fill(binSect, slID.
wheel(),
weight);
179 mean = gfit->GetParameter(1);
180 sigma = gfit->GetParameter(2);
183 meanDistr[-2]->Fill(
mean);
184 sigmaDistr[-2]->Fill(sigma);
189 meanDistr[-1]->Fill(
mean);
190 sigmaDistr[-1]->Fill(sigma);
194 MeanHistos[make_pair(slID.
wheel(), binSect)]->setBinContent(binSL,
mean);
195 SigmaHistos[make_pair(slID.
wheel(), binSect)]->setBinContent(binSL, sigma);
197 if ((slID.
sector() == 13 || slID.
sector() == 14) && binSL == 12)
199 if ((slID.
sector() == 13 || slID.
sector() == 14) && binSL == 13)
203 double MeanVal = wheelMeanHistos[slID.
wheel()]->getBinContent(binSect, binSL);
204 double MeanBinVal = (MeanVal > 0. && MeanVal < meanInRange(
mean)) ? MeanVal : meanInRange(
mean);
205 wheelMeanHistos[slID.
wheel()]->setBinContent(binSect, binSL, MeanBinVal);
207 double SigmaVal = wheelSigmaHistos[slID.
wheel()]->getBinContent(binSect, binSL);
208 double SigmaBinVal = (SigmaVal > 0. && SigmaVal < sigmaInRange(sigma)) ? SigmaVal : sigmaInRange(sigma);
209 wheelSigmaHistos[slID.
wheel()]->setBinContent(binSect, binSL, SigmaBinVal);
212 wheelMeanHistos[slID.
wheel()]->setBinContent(binSect, binSL, meanInRange(
mean));
213 wheelSigmaHistos[slID.
wheel()]->setBinContent(binSect, binSL, sigmaInRange(sigma));
218 if ((binSect == 4 || binSect == 10) && slID.
station() == 4)
222 if ((meanInRange(
mean) > 0.85) && (sigmaInRange(sigma) > 0.85)) {
223 globalResSummary->Fill(binSect, slID.
wheel(),
weight);
224 wheelMeanHistos[3]->Fill(binSect, slID.
wheel(),
weight);
225 wheelSigmaHistos[3]->Fill(binSect, slID.
wheel(),
weight);
227 if ((meanInRange(
mean) < 0.85) && (sigmaInRange(sigma) > 0.85)) {
228 wheelSigmaHistos[3]->Fill(binSect, slID.
wheel(),
weight);
230 if ((meanInRange(
mean) > 0.85) && (sigmaInRange(sigma) < 0.85)) {
231 wheelMeanHistos[3]->Fill(binSect, slID.
wheel(),
weight);
237 LogVerbatim(
"DTDQM|DTMonitorModule|DTResolutionAnalysisTask")
238 <<
"[DTResolutionAnalysisTask] Fit of " << slID <<
" not performed because # entries < 20 ";
241 if ((binSect == 4 || binSect == 10) && slID.
station() == 4)
243 globalResSummary->Fill(binSect, slID.
wheel(),
weight);
244 wheelMeanHistos[3]->Fill(binSect, slID.
wheel(),
weight);
245 wheelSigmaHistos[3]->Fill(binSect, slID.
wheel(),
weight);
246 wheelMeanHistos[slID.
wheel()]->setBinContent(binSect, binSL, 1.);
247 wheelSigmaHistos[slID.
wheel()]->setBinContent(binSect, binSL, 1.);
250 LogWarning(
"DTDQM|DTMonitorModule|DTResolutionAnalysisTask")
251 <<
"[DTResolutionAnalysisTask] Histo: " << getMEName(slID) <<
" not found" << endl;
263 string histoTitle =
"# of SLs with wrong mean of residuals (Wheel " +
wheel.str() +
")";
265 wheelMeanHistos[wh] = ibooker.
book2D(
histoName.c_str(), histoTitle.c_str(), 12, 1, 13, 11, 1, 12);
267 wheelMeanHistos[wh]->setBinLabel(1,
"MB1_SL1", 2);
268 wheelMeanHistos[wh]->setBinLabel(2,
"MB1_SL2", 2);
269 wheelMeanHistos[wh]->setBinLabel(3,
"MB1_SL3", 2);
270 wheelMeanHistos[wh]->setBinLabel(4,
"MB2_SL1", 2);
271 wheelMeanHistos[wh]->setBinLabel(5,
"MB2_SL2", 2);
272 wheelMeanHistos[wh]->setBinLabel(6,
"MB2_SL3", 2);
273 wheelMeanHistos[wh]->setBinLabel(7,
"MB3_SL1", 2);
274 wheelMeanHistos[wh]->setBinLabel(8,
"MB3_SL2", 2);
275 wheelMeanHistos[wh]->setBinLabel(9,
"MB3_SL3", 2);
276 wheelMeanHistos[wh]->setBinLabel(10,
"MB4_SL1", 2);
277 wheelMeanHistos[wh]->setBinLabel(11,
"MB4_SL3", 2);
281 histoTitle =
"# of SLs with wrong sigma of residuals (Wheel " +
wheel.str() +
")";
283 wheelSigmaHistos[wh] = ibooker.
book2D(
histoName.c_str(), histoTitle.c_str(), 12, 1, 13, 11, 1, 12);
285 wheelSigmaHistos[wh]->setBinLabel(1,
"MB1_SL1", 2);
286 wheelSigmaHistos[wh]->setBinLabel(2,
"MB1_SL2", 2);
287 wheelSigmaHistos[wh]->setBinLabel(3,
"MB1_SL3", 2);
288 wheelSigmaHistos[wh]->setBinLabel(4,
"MB2_SL1", 2);
289 wheelSigmaHistos[wh]->setBinLabel(5,
"MB2_SL2", 2);
290 wheelSigmaHistos[wh]->setBinLabel(6,
"MB2_SL3", 2);
291 wheelSigmaHistos[wh]->setBinLabel(7,
"MB3_SL1", 2);
292 wheelSigmaHistos[wh]->setBinLabel(8,
"MB3_SL2", 2);
293 wheelSigmaHistos[wh]->setBinLabel(9,
"MB3_SL3", 2);
294 wheelSigmaHistos[wh]->setBinLabel(10,
"MB4_SL1", 2);
295 wheelSigmaHistos[wh]->setBinLabel(11,
"MB4_SL3", 2);
304 string MeanHistoName =
"MeanTest_W" +
wheel.str() +
"_Sec" + sector.str();
305 string SigmaHistoName =
"SigmaTest_W" +
wheel.str() +
"_Sec" + sector.str();
310 if (sect != 4 && sect != 10) {
311 MeanHistos[make_pair(wh, sect)] =
313 ibooker.
book1D(MeanHistoName.c_str(),
"Mean (from gaussian fit) of the residuals distribution", 11, 1, 12);
315 MeanHistos[make_pair(wh, sect)] =
316 ibooker.
book1D(MeanHistoName.c_str(),
"Mean (from gaussian fit) of the residuals distribution", 13, 1, 14);
318 (MeanHistos[make_pair(wh, sect)])->setBinLabel(1,
"MB1_SL1", 1);
319 (MeanHistos[make_pair(wh, sect)])->setBinLabel(2,
"MB1_SL2", 1);
320 (MeanHistos[make_pair(wh, sect)])->setBinLabel(3,
"MB1_SL3", 1);
321 (MeanHistos[make_pair(wh, sect)])->setBinLabel(4,
"MB2_SL1", 1);
322 (MeanHistos[make_pair(wh, sect)])->setBinLabel(5,
"MB2_SL2", 1);
323 (MeanHistos[make_pair(wh, sect)])->setBinLabel(6,
"MB2_SL3", 1);
324 (MeanHistos[make_pair(wh, sect)])->setBinLabel(7,
"MB3_SL1", 1);
325 (MeanHistos[make_pair(wh, sect)])->setBinLabel(8,
"MB3_SL2", 1);
326 (MeanHistos[make_pair(wh, sect)])->setBinLabel(9,
"MB3_SL3", 1);
327 (MeanHistos[make_pair(wh, sect)])->setBinLabel(10,
"MB4_SL1", 1);
328 (MeanHistos[make_pair(wh, sect)])->setBinLabel(11,
"MB4_SL3", 1);
330 (MeanHistos[make_pair(wh, sect)])->setBinLabel(12,
"MB4S13_SL1", 1);
331 (MeanHistos[make_pair(wh, sect)])->setBinLabel(13,
"MB4S13_SL3", 1);
334 (MeanHistos[make_pair(wh, sect)])->setBinLabel(12,
"MB4S14_SL1", 1);
335 (MeanHistos[make_pair(wh, sect)])->setBinLabel(13,
"MB4S14_SL3", 1);
338 if (sect != 4 && sect != 10) {
339 SigmaHistos[make_pair(wh, sect)] =
340 ibooker.
book1D(SigmaHistoName.c_str(),
"Sigma (from gaussian fit) of the residuals distribution", 11, 1, 12);
342 SigmaHistos[make_pair(wh, sect)] =
343 ibooker.
book1D(SigmaHistoName.c_str(),
"Sigma (from gaussian fit) of the residuals distribution", 13, 1, 14);
345 (SigmaHistos[make_pair(wh, sect)])->setBinLabel(1,
"MB1_SL1", 1);
346 (SigmaHistos[make_pair(wh, sect)])->setBinLabel(2,
"MB1_SL2", 1);
347 (SigmaHistos[make_pair(wh, sect)])->setBinLabel(3,
"MB1_SL3", 1);
348 (SigmaHistos[make_pair(wh, sect)])->setBinLabel(4,
"MB2_SL1", 1);
349 (SigmaHistos[make_pair(wh, sect)])->setBinLabel(5,
"MB2_SL2", 1);
350 (SigmaHistos[make_pair(wh, sect)])->setBinLabel(6,
"MB2_SL3", 1);
351 (SigmaHistos[make_pair(wh, sect)])->setBinLabel(7,
"MB3_SL1", 1);
352 (SigmaHistos[make_pair(wh, sect)])->setBinLabel(8,
"MB3_SL2", 1);
353 (SigmaHistos[make_pair(wh, sect)])->setBinLabel(9,
"MB3_SL3", 1);
354 (SigmaHistos[make_pair(wh, sect)])->setBinLabel(10,
"MB4_SL1", 1);
355 (SigmaHistos[make_pair(wh, sect)])->setBinLabel(11,
"MB4_SL3", 1);
357 (SigmaHistos[make_pair(wh, sect)])->setBinLabel(12,
"MB4S13_SL1", 1);
358 (SigmaHistos[make_pair(wh, sect)])->setBinLabel(13,
"MB4S13_SL3", 1);
361 (SigmaHistos[make_pair(wh, sect)])->setBinLabel(12,
"MB4S14_SL1", 1);
362 (SigmaHistos[make_pair(wh, sect)])->setBinLabel(13,
"MB4S14_SL3", 1);
373 stringstream superLayer;
381 "DT/DTCalibValidation/Wheel" +
wheel.str() +
"/Station" +
station.str() +
"/Sector" + sector.str() +
"/";
383 string histoname =
folderName +
"hResDist" +
"_W" +
wheel.str() +
"_St" +
station.str() +
"_Sec" + sector.str() +
384 "_SL" + superLayer.str();
387 histoname =
folderName +
"hResDist_STEP3" +
"_W" +
wheel.str() +
"_St" +
station.str() +
"_Sec" + sector.str() +
388 "_SL" + superLayer.str();
397 if (
ret == 0 ||
bin == 11)
428 globalResSummary->Reset();
430 for (map<int, MonitorElement*>::const_iterator
histo = wheelMeanHistos.begin();
histo != wheelMeanHistos.end();
432 (*histo).second->Reset();
434 for (map<int, MonitorElement*>::const_iterator
histo = wheelSigmaHistos.begin();
histo != wheelSigmaHistos.end();
436 (*histo).second->Reset();
439 for (
int indx = -2; indx != 3; ++indx) {
440 meanDistr[indx]->Reset();
441 sigmaDistr[indx]->Reset();