21 #include "DQMOffline/Muon/test/langauFit.C"
35 resEtaSpread_tkGlb = ps.
getParameter<
double>(
"resEtaSpread_tkGlb");
36 resEtaSpread_glbSta = ps.
getParameter<
double>(
"resEtaSpread_glbSta");
37 resPhiSpread_tkGlb = ps.
getParameter<
double>(
"resPhiSpread_tkGlb");
38 resPhiSpread_glbSta = ps.
getParameter<
double>(
"resPhiSpread_glbSta");
39 resOneOvPSpread_tkGlb = ps.
getParameter<
double>(
"resOneOvPSpread_tkGlb");
40 resOneOvPSpread_glbSta = ps.
getParameter<
double>(
"resOneOvPSpread_glbSta");
41 pullEtaSpread = ps.
getParameter<
double>(
"pullEtaSpread");
42 pullPhiSpread = ps.
getParameter<
double>(
"pullPhiSpread");
43 pullOneOvPSpread = ps.
getParameter<
double>(
"pullOneOvPSpread");
44 resChargeLimit_tkGlb = ps.
getParameter<
double>(
"resChargeLimit_tkGlb");
45 resChargeLimit_glbSta = ps.
getParameter<
double>(
"resChargeLimit_glbSta");
46 resChargeLimit_tkSta = ps.
getParameter<
double>(
"resChargeLimit_tkSta");
47 numMatchedExpected_min = ps.
getParameter<
double>(
"numMatchedExpected_min");
48 numMatchedExpected_max = ps.
getParameter<
double>(
"numMatchedExpected_max");
49 matchesFractionDt_min = ps.
getParameter<
double>(
"matchesFractionDt_min");
50 matchesFractionDt_max = ps.
getParameter<
double>(
"matchesFractionDt_max");
51 matchesFractionCsc_min = ps.
getParameter<
double>(
"matchesFractionCsc_min");
52 matchesFractionCsc_max = ps.
getParameter<
double>(
"matchesFractionCsc_max");
53 resSegmTrack_rms_min = ps.
getParameter<
double>(
"resSegmTrack_rms_min");
54 resSegmTrack_rms_max = ps.
getParameter<
double>(
"resSegmTrack_rms_max");
55 resSegmTrack_mean_min = ps.
getParameter<
double>(
"resSegmTrack_mean_min");
56 resSegmTrack_mean_max = ps.
getParameter<
double>(
"resSegmTrack_mean_max");
57 expPeakEcalS9_min = ps.
getParameter<
double>(
"expPeakEcalS9_min");
58 expPeakEcalS9_max = ps.
getParameter<
double>(
"expPeakEcalS9_max");
59 expPeakHadS9_min = ps.
getParameter<
double>(
"expPeakHadS9_min");
60 expPeakHadS9_max = ps.
getParameter<
double>(
"expPeakHadS9_max");
61 expMultiplicityGlb_max = ps.
getParameter<
double>(
"expMultiplicityGlb_max");
62 expMultiplicityTk_max = ps.
getParameter<
double>(
"expMultiplicityTk_max");
63 expMultiplicitySta_max = ps.
getParameter<
double>(
"expMultiplicitySta_max");
64 expMultiplicityGlb_min = ps.
getParameter<
double>(
"expMultiplicityGlb_min");
65 expMultiplicityTk_min = ps.
getParameter<
double>(
"expMultiplicityTk_min");
66 expMultiplicitySta_min = ps.
getParameter<
double>(
"expMultiplicitySta_min");
78 kinematicsSummaryMap = ibooker.
book2D(
"kinematicsSummaryMap",
"Kinematics test summary",5,1,6,3,1,4);
80 kinematicsSummaryMap->setBinLabel(1,
"GLB",1);
81 kinematicsSummaryMap->setBinLabel(2,
"TKfromGLB",1);
82 kinematicsSummaryMap->setBinLabel(3,
"STAfromGLB",1);
83 kinematicsSummaryMap->setBinLabel(4,
"TK",1);
84 kinematicsSummaryMap->setBinLabel(5,
"STA",1);
85 kinematicsSummaryMap->setAxisTitle(
"parameter tested",2);
86 kinematicsSummaryMap->setBinLabel(1,
"#chi^{2}",2);
87 kinematicsSummaryMap->setBinLabel(2,
"#eta",2);
88 kinematicsSummaryMap->setBinLabel(3,
"#phi",2);
91 chi2TestSummaryMap = ibooker.
book2D(
"chi2TestSummaryMap",
"#chi2 quality test summary",5,1,6,5,1,6);
93 chi2TestSummaryMap->setBinLabel(1,
"GLB",1);
94 chi2TestSummaryMap->setBinLabel(2,
"TKfromGLB",1);
95 chi2TestSummaryMap->setBinLabel(3,
"STAfromGLB",1);
96 chi2TestSummaryMap->setBinLabel(4,
"TK",1);
97 chi2TestSummaryMap->setBinLabel(5,
"STA",1);
98 chi2TestSummaryMap->setAxisTitle(
"parameter tested",2);
99 chi2TestSummaryMap->setBinLabel(1,
"#chi^{2}",2);
100 chi2TestSummaryMap->setBinLabel(2,
"#eta",2);
101 chi2TestSummaryMap->setBinLabel(3,
"#phi",2);
102 chi2TestSummaryMap->setBinLabel(4,
"#pt",2);
103 chi2TestSummaryMap->setBinLabel(5,
"#q",2);
106 KolmogorovTestSummaryMap = ibooker.
book2D(
"KolmogorovTestSummaryMap",
"Kolmogorov quality test summary",5,1,6,5,1,6);
107 KolmogorovTestSummaryMap->
setAxisTitle(
"track monitored",1);
108 KolmogorovTestSummaryMap->setBinLabel(1,
"GLB",1);
109 KolmogorovTestSummaryMap->setBinLabel(2,
"TKfromGLB",1);
110 KolmogorovTestSummaryMap->setBinLabel(3,
"STAfromGLB",1);
111 KolmogorovTestSummaryMap->setBinLabel(4,
"TK",1);
112 KolmogorovTestSummaryMap->setBinLabel(5,
"STA",1);
113 KolmogorovTestSummaryMap->setAxisTitle(
"parameter tested",2);
114 KolmogorovTestSummaryMap->setBinLabel(1,
"#chi^{2}",2);
115 KolmogorovTestSummaryMap->setBinLabel(2,
"#eta",2);
116 KolmogorovTestSummaryMap->setBinLabel(3,
"#phi",2);
117 KolmogorovTestSummaryMap->setBinLabel(4,
"#pt",2);
118 KolmogorovTestSummaryMap->setBinLabel(5,
"#q",2);
122 residualsSummaryMap = ibooker.
book2D(
"residualsSummaryMap",
"Residuals test summary",4,1,5,4,1,5);
124 residualsSummaryMap->setBinLabel(1,
"TK-GLB",1);
125 residualsSummaryMap->setBinLabel(2,
"GLB-STA",1);
126 residualsSummaryMap->setBinLabel(3,
"TK-STA",1);
127 residualsSummaryMap->setBinLabel(4,
"TK-STA Pull",1);
128 residualsSummaryMap->setAxisTitle(
"parameter tested",2);
129 residualsSummaryMap->setBinLabel(1,
"#eta",2);
130 residualsSummaryMap->setBinLabel(2,
"#phi",2);
131 residualsSummaryMap->setBinLabel(3,
"1/p",2);
132 residualsSummaryMap->setBinLabel(4,
"q",2);
135 muonIdSummaryMap = ibooker.
book2D(
"muonIdSummaryMap",
"muonId test summary",4,1,5, 5,1,6);
137 muonIdSummaryMap->setBinLabel(1,
"GLB DT",1);
138 muonIdSummaryMap->setBinLabel(2,
"GLB CSC",1);
139 muonIdSummaryMap->setBinLabel(3,
"TK DT",1);
140 muonIdSummaryMap->setBinLabel(4,
"TK CSC",1);
141 muonIdSummaryMap->setAxisTitle(
"tests",2);
142 muonIdSummaryMap->setBinLabel(1,
"#assSeg",2);
143 muonIdSummaryMap->setBinLabel(2,
"x mean",2);
144 muonIdSummaryMap->setBinLabel(3,
"x rms",2);
145 muonIdSummaryMap->setBinLabel(4,
"y mean",2);
146 muonIdSummaryMap->setBinLabel(5,
"y rms",2);
149 energySummaryMap = ibooker.
book2D(
"energySummaryMap",
"Energy deposits test summary",3,1,4,3,1,4);
151 energySummaryMap->setBinLabel(1,
"GLB",1);
152 energySummaryMap->setBinLabel(2,
"TK",1);
153 energySummaryMap->setBinLabel(3,
"STA",1);
154 energySummaryMap->setAxisTitle(
"calorimeter tested",2);
155 energySummaryMap->setBinLabel(1,
"ECAL",2);
156 energySummaryMap->setBinLabel(2,
"HAD",2);
157 energySummaryMap->setBinLabel(3,
"H0",2);
160 multiplicitySummaryMap = ibooker.
book1D(
"multiplicitySummaryMap",
"muon multiplicity test summary",3,1,4);
162 multiplicitySummaryMap->setBinLabel(1,
"GLB");
163 multiplicitySummaryMap->setBinLabel(2,
"TK");
164 multiplicitySummaryMap->setBinLabel(3,
"STA");
169 summaryReport = ibooker.
bookFloat(
"reportSummary");
171 summaryReportMap = ibooker.
book2D(
"reportSummaryMap",
"Muon Report Summary Map",3,1,4,7,1,8);
173 summaryReportMap->setBinLabel(1,
"GLB",1);
174 summaryReportMap->setBinLabel(2,
"TK",1);
175 summaryReportMap->setBinLabel(3,
"STA",1);
176 summaryReportMap->setAxisTitle(
"test",2);
177 summaryReportMap->setBinLabel(1,
"#chi^{2}/Df",2);
178 summaryReportMap->setBinLabel(2,
"#eta",2);
179 summaryReportMap->setBinLabel(3,
"#phi",2);
180 summaryReportMap->setBinLabel(4,
"residuals",2);
181 summaryReportMap->setBinLabel(5,
"muonId",2);
182 summaryReportMap->setBinLabel(6,
"energyDeposits",2);
183 summaryReportMap->setBinLabel(7,
"multiplicity",2);
186 theSummaryContents.push_back(ibooker.
bookFloat(
"kinematics_GLB"));
187 theSummaryContents.push_back(ibooker.
bookFloat(
"muonId_GLB"));
188 theSummaryContents.push_back(ibooker.
bookFloat(
"residuals_GLB"));
189 theSummaryContents.push_back(ibooker.
bookFloat(
"GLB"));
190 theSummaryContents.push_back(ibooker.
bookFloat(
"kinematics_TK"));
191 theSummaryContents.push_back(ibooker.
bookFloat(
"muonId_TK"));
192 theSummaryContents.push_back(ibooker.
bookFloat(
"residuals_TK"));
193 theSummaryContents.push_back(ibooker.
bookFloat(
"TK"));
194 theSummaryContents.push_back(ibooker.
bookFloat(
"kinematics_STA"));
195 theSummaryContents.push_back(ibooker.
bookFloat(
"residuals_STA"));
196 theSummaryContents.push_back(ibooker.
bookFloat(
"STA"));
197 theSummaryContents.push_back(ibooker.
bookFloat(
"energyDeposits"));
198 theSummaryContents.push_back(ibooker.
bookFloat(
"multiplicity"));
202 summaryCertification = ibooker.
bookFloat(
"CertificationSummary");
203 summaryCertification->
Fill(-1);
205 summaryCertificationMap = ibooker.
book2D(
"CertificationSummaryMap",
"Muon Certification Summary Map",9,1,10,7,1,8);
207 summaryCertificationMap->setBinLabel(1,
"GLB_Tot",1);
208 summaryCertificationMap->setBinLabel(2,
"TK_Tot",1);
209 summaryCertificationMap->setBinLabel(3,
"STA_tot",1);
210 summaryCertificationMap->setBinLabel(4,
"GLB_B",1);
211 summaryCertificationMap->setBinLabel(5,
"TK_B",1);
212 summaryCertificationMap->setBinLabel(6,
"STA_B",1);
213 summaryCertificationMap->setBinLabel(7,
"GLB_EC",1);
214 summaryCertificationMap->setBinLabel(8,
"TK_EC",1);
215 summaryCertificationMap->setBinLabel(9,
"STA_EC",1);
216 summaryCertificationMap->setAxisTitle(
"test",2);
217 summaryCertificationMap->setBinLabel(1,
"#chi^{2}/Df",2);
218 summaryCertificationMap->setBinLabel(2,
"#eta",2);
219 summaryCertificationMap->setBinLabel(3,
"#phi",2);
220 summaryCertificationMap->setBinLabel(4,
"residuals",2);
221 summaryCertificationMap->setBinLabel(5,
"muonId",2);
222 summaryCertificationMap->setBinLabel(6,
"energyDeposits",2);
223 summaryCertificationMap->setBinLabel(7,
"multiplicity",2);
226 theCertificationContents.push_back(ibooker.
bookFloat(
"GLB_Tot"));
227 theCertificationContents.push_back(ibooker.
bookFloat(
"STA_Tot"));
228 theCertificationContents.push_back(ibooker.
bookFloat(
"TK_Tot"));
229 theCertificationContents.push_back(ibooker.
bookFloat(
"GLB_B"));
230 theCertificationContents.push_back(ibooker.
bookFloat(
"STA_B"));
231 theCertificationContents.push_back(ibooker.
bookFloat(
"TK_B"));
232 theCertificationContents.push_back(ibooker.
bookFloat(
"GLB_EC"));
233 theCertificationContents.push_back(ibooker.
bookFloat(
"STA_EC"));
234 theCertificationContents.push_back(ibooker.
bookFloat(
"TK_EC"));
237 for (
unsigned int icert=0;icert <theCertificationContents.size();icert++){
238 theCertificationContents[icert]->Fill(-1);
242 for(
int xBin=1; xBin<=5; xBin++){
244 kinematicsSummaryMap->Fill(xBin,
yBin,1);
247 chi2TestSummaryMap->Fill(xBin,
yBin,1);
248 KolmogorovTestSummaryMap->Fill(xBin,
yBin,1);
251 for(
int xBin=1; xBin<=residualsSummaryMap->getNbinsX(); xBin++){
252 for(
int yBin=1;
yBin<=residualsSummaryMap->getNbinsY();
yBin++){
253 residualsSummaryMap->Fill(xBin,
yBin,1);
256 residualsSummaryMap->setBinContent(4, 4, 1);
258 for(
int xBin=1; xBin<=muonIdSummaryMap->getNbinsX(); xBin++){
259 for(
int yBin=1;
yBin<=muonIdSummaryMap->getNbinsY();
yBin++){
260 muonIdSummaryMap->Fill(xBin,
yBin,1);
263 for(
int xBin=1; xBin<=3; xBin++){
265 energySummaryMap->Fill(xBin,
yBin,1);
268 for(
int xBin=1; xBin<=3; xBin++){
269 multiplicitySummaryMap->Fill(xBin,1);
271 for(
int xBin=1; xBin<=3; xBin++){
273 summaryReportMap->Fill(xBin,
yBin,1);
276 for(
int xBin=1; xBin<=9; xBin++){
278 summaryCertificationMap->Fill(xBin,
yBin,1);
285 doKinematicsTests(igetter,
"GlbMuon_Glb_", 1);
286 doKinematicsTests(igetter,
"GlbMuon_Tk_", 2);
287 doKinematicsTests(igetter,
"GlbMuon_Sta_",3);
288 doKinematicsTests(igetter,
"TkMuon_", 4);
289 doKinematicsTests(igetter,
"StaMuon_", 5);
292 doResidualsTests(igetter,
"TkGlb",
"eta", 1);
293 doResidualsTests(igetter,
"GlbSta",
"eta", 2);
294 doResidualsTests(igetter,
"TkSta",
"eta", 3);
295 doResidualsTests(igetter,
"TkGlb",
"phi", 1);
296 doResidualsTests(igetter,
"GlbSta",
"phi", 2);
297 doResidualsTests(igetter,
"TkSta",
"phi", 3);
298 doResidualsTests(igetter,
"TkGlb",
"oneOverp", 1);
299 doResidualsTests(igetter,
"GlbSta",
"oneOverp", 2);
300 doResidualsTests(igetter,
"TkSta",
"oneOverp", 3);
301 doResidualsTests(igetter,
"GlbMuon",
"qComparison", -1);
304 doMuonIDTests(igetter);
307 doEnergyTests(igetter,
"ecalS9PointingMuDepositedEnergy_",
"Glb_muons", 1);
308 doEnergyTests(igetter,
"hadS9PointingMuDepositedEnergy_",
"Glb_muons", 1);
309 doEnergyTests(igetter,
"hoS9PointingMuDepositedEnergy_",
"Glb_muons", 1);
310 doEnergyTests(igetter,
"ecalS9PointingMuDepositedEnergy_",
"Tk_muons", 2);
311 doEnergyTests(igetter,
"hadS9PointingMuDepositedEnergy_",
"Tk_muons", 2);
312 doEnergyTests(igetter,
"hoS9PointingMuDepositedEnergy_",
"Tk_muons", 2);
313 doEnergyTests(igetter,
"ecalS9PointingMuDepositedEnergy_",
"Sta_muons", 3);
314 doEnergyTests(igetter,
"hadS9PointingMuDepositedEnergy_",
"Sta_muons", 3);
315 doEnergyTests(igetter,
"hoS9PointingMuDepositedEnergy_",
"Sta_muons", 3);
318 doMultiplicityTests(igetter);
322 summaryReportMap->setBinContent(1,1,
double(KolmogorovTestSummaryMap->getBinContent(1,1)+KolmogorovTestSummaryMap->getBinContent(2,1)+KolmogorovTestSummaryMap->getBinContent(3,1))/3.0);
323 summaryReportMap->setBinContent(2,1,KolmogorovTestSummaryMap->getBinContent(4,1));
324 summaryReportMap->setBinContent(3,1,KolmogorovTestSummaryMap->getBinContent(5,1));
325 summaryReportMap->setBinContent(1,2,
double(KolmogorovTestSummaryMap->getBinContent(1,2)+KolmogorovTestSummaryMap->getBinContent(2,2)+KolmogorovTestSummaryMap->getBinContent(3,2))/3.0);
326 summaryReportMap->setBinContent(2,2,KolmogorovTestSummaryMap->getBinContent(4,2));
327 summaryReportMap->setBinContent(3,2,KolmogorovTestSummaryMap->getBinContent(5,2));
328 summaryReportMap->setBinContent(1,3,
double(KolmogorovTestSummaryMap->getBinContent(1,3)+KolmogorovTestSummaryMap->getBinContent(2,3)+KolmogorovTestSummaryMap->getBinContent(3,3))/3.0);
329 summaryReportMap->setBinContent(2,3,KolmogorovTestSummaryMap->getBinContent(4,3));
330 summaryReportMap->setBinContent(3,3,KolmogorovTestSummaryMap->getBinContent(5,3));
333 double residualsSummary = 0;
336 for(
int i=3;
i<=residualsSummaryMap->getNbinsX();
i++)
337 for (
int j=1;
j<=residualsSummaryMap->getNbinsY();
j++)
338 residualsSummary += residualsSummaryMap->getBinContent(
i,
j);
339 residualsSummary /=2*residualsSummaryMap->getNbinsY();
340 summaryReportMap->setBinContent(1,4, residualsSummary);
343 for(
int i=1;
i<=1;
i++)
344 for (
int j=1;
j<=residualsSummaryMap->getNbinsY();
j++)
345 residualsSummary += residualsSummaryMap->getBinContent(
i,
j);
346 residualsSummary /=1*residualsSummaryMap->getNbinsY();
347 summaryReportMap->setBinContent(2,4,residualsSummary);
350 for(
int i=2;
i<=2;
i++)
351 for (
int j=1;
j<=residualsSummaryMap->getNbinsY();
j++)
352 residualsSummary += residualsSummaryMap->getBinContent(
i,
j);
353 residualsSummary /=1*residualsSummaryMap->getNbinsY();
354 summaryReportMap->setBinContent(3,4,residualsSummary);
362 for(
int i=1;
i<=2;
i++)
363 for(
int j=1;
j<=5;
j++) {
364 if(
j==3 ||
j==5)
continue;
365 idtest+=muonIdSummaryMap->getBinContent(
i,
j);
369 summaryReportMap->setBinContent(1,5, idtest);
371 for(
int i=3;
i<=4;
i++)
372 for(
int j=1;
j<=5;
j++) {
373 if(
j==3 ||
j==5)
continue;
374 idtest+=muonIdSummaryMap->getBinContent(
i,
j);
378 summaryReportMap->setBinContent(2,5,idtest);
379 summaryReportMap->setBinContent(3,5,-1.0/6.0);
382 summaryReportMap->setBinContent(1,6,
double(energySummaryMap->getBinContent(1,1)+energySummaryMap->getBinContent(1,2))/2.0);
383 summaryReportMap->setBinContent(2,6,
double(energySummaryMap->getBinContent(2,1)+energySummaryMap->getBinContent(2,2))/2.0);
384 summaryReportMap->setBinContent(3,6,
double(energySummaryMap->getBinContent(3,1)+energySummaryMap->getBinContent(3,2))/2.0);
385 summaryReportMap->setBinContent(1,7,multiplicitySummaryMap->getBinContent(1));
386 summaryReportMap->setBinContent(2,7,multiplicitySummaryMap->getBinContent(2));
387 summaryReportMap->setBinContent(3,7,multiplicitySummaryMap->getBinContent(3));
390 double kinematics_GLB = double(summaryReportMap->getBinContent(1,1)+summaryReportMap->getBinContent(1,2)+summaryReportMap->getBinContent(1,3))/3.0;
391 theSummaryContents[0]->Fill(kinematics_GLB);
392 double muonId_GLB = double(summaryReportMap->getBinContent(1,5));
393 theSummaryContents[1]->Fill(muonId_GLB);
394 double residuals_GLB = double(summaryReportMap->getBinContent(1,4));
395 theSummaryContents[2]->Fill(residuals_GLB);
396 double GLB = (kinematics_GLB+muonId_GLB+residuals_GLB)/3.0;
397 theSummaryContents[3]->Fill(GLB);
399 double kinematics_TK = double(summaryReportMap->getBinContent(2,1)+summaryReportMap->getBinContent(2,2)+summaryReportMap->getBinContent(2,3))/3.0;
400 theSummaryContents[4]->Fill(kinematics_TK);
401 double muonId_TK = double(summaryReportMap->getBinContent(2,5));
402 theSummaryContents[5]->Fill(muonId_TK);
403 double residuals_TK = double(summaryReportMap->getBinContent(2,4));
404 theSummaryContents[6]->Fill(residuals_TK);
405 double TK = double(kinematics_TK+muonId_TK+residuals_TK)/3.0;
406 theSummaryContents[7]->Fill(TK);
408 double kinematics_STA = double(summaryReportMap->getBinContent(3,1)+summaryReportMap->getBinContent(3,2)+summaryReportMap->getBinContent(3,3))/3.0;
409 theSummaryContents[8]->Fill(kinematics_STA);
410 double residuals_STA = double(summaryReportMap->getBinContent(3,4));
411 theSummaryContents[9]->Fill(residuals_STA);
412 double STA = double(kinematics_STA+residuals_STA)/2.0;
413 theSummaryContents[10]->Fill(STA);
414 double energyDeposits = double(summaryReportMap->getBinContent(1,6)+summaryReportMap->getBinContent(2,6)+summaryReportMap->getBinContent(3,6))/3.0;
415 theSummaryContents[11]->Fill(energyDeposits);
416 double multiplicity = double(summaryReportMap->getBinContent(1,7)+summaryReportMap->getBinContent(2,7)+summaryReportMap->getBinContent(3,7))/3.0;
417 theSummaryContents[12]->Fill(multiplicity);
419 summaryReport->Fill((GLB+TK+STA+energyDeposits+multiplicity)/5.0);
423 float muonIDsummary=0;
428 muonIDsummary += muonIdSummaryMap->getBinContent(1, 2);
429 muonIDsummary += muonIdSummaryMap->getBinContent(1, 4);
430 summaryCertificationMap->setBinContent(4, 5, muonIDsummary/2.);
437 muonIDsummary += muonIdSummaryMap->getBinContent(2, 2);
438 muonIDsummary += muonIdSummaryMap->getBinContent(2, 4);
439 summaryCertificationMap->setBinContent(7, 5, muonIDsummary/2.);
446 muonIDsummary += muonIdSummaryMap->getBinContent(3, 2);
447 muonIDsummary += muonIdSummaryMap->getBinContent(3, 4);
448 summaryCertificationMap->setBinContent(5, 5, muonIDsummary/2.);
455 muonIDsummary += muonIdSummaryMap->getBinContent(4, 2);
456 muonIDsummary += muonIdSummaryMap->getBinContent(4, 4);
457 summaryCertificationMap->setBinContent(8, 5, muonIDsummary/2.);
460 double muonId_GLB_B = double(summaryCertificationMap->getBinContent(4,5));
461 theCertificationContents[3]->Fill(muonId_GLB_B);
462 double muonId_GLB_EC = double(summaryCertificationMap->getBinContent(7,5));
463 theCertificationContents[6]->Fill(muonId_GLB_EC);
465 double muonId_TK_B = double(summaryCertificationMap->getBinContent(5,5));
466 theCertificationContents[5]->Fill(muonId_TK_B);
467 double muonId_TK_EC = double(summaryCertificationMap->getBinContent(8,5));
468 theCertificationContents[8]->Fill(muonId_TK_EC);
475 string path =
"Muons/MuonRecoAnalyzer/" + muonType +
"chi2OverDf";
479 TH1F * chi2Histo_root = chi2Histo->
getTH1F();
480 if(chi2Histo_root->GetEntries()>20){
483 LogTrace(
metname)<<
"chi2 kin test based on fraction for "<<muonType<<endl;
484 int maxBin = chi2Histo_root->GetMaximumBin();
485 if(chi2Histo_root->Integral(maxBin+1,chi2Histo_root->GetNbinsX())!=0){
486 double fraction = double(chi2Histo_root->Integral(1,maxBin))/
double(chi2Histo_root->Integral(maxBin+1,chi2Histo_root->GetNbinsX()));
487 LogTrace(
metname)<<
"chi2 fraction for "<<muonType<<
" : "<<fraction<<
" must be within "<< chi2Fraction-chi2Spread<<
","<<chi2Fraction+chi2Spread<<endl;
488 if(fraction>(chi2Fraction-chi2Spread) && fraction<(chi2Fraction+chi2Spread))
489 kinematicsSummaryMap->setBinContent(bin,1,1);
491 kinematicsSummaryMap->setBinContent(bin,1,0);
495 LogTrace(
metname)<<
"chi2 kin test based on comp wrt reference on terms of chi2 for "<<muonType<<endl;
502 LogTrace(
metname) <<
"qtresult " <<qtresult <<
" qtstatus "<<qtstatus<<endl;
503 chi2TestSummaryMap->setBinContent(bin,1,qtresult);
506 LogTrace(
metname)<<
"chi2 kin test based on comp wrt reference using kolmogorov for "<<muonType<<endl;
511 int qtstatus = myQReportKolmo->
getStatus() ;
513 LogTrace(
metname) <<
"qtresult " <<qtresult<<
" qtstatus "<<qtstatus<<endl;
514 KolmogorovTestSummaryMap->setBinContent(bin,1,qtresult);
519 LogTrace(
metname) <<
"[MuonTestSummary]: Test of Chi2 Kin not performed for "<< muonType <<
" because # entries < 20 ";
526 path =
"Muons/MuonRecoAnalyzer/" + muonType +
"eta";
530 TH1F * etaHisto_root = etaHisto->
getTH1F();
531 if (etaHisto_root ->GetEntries()>20){
534 LogTrace(
metname)<<
"eta kin test based on fraction for "<<muonType<<endl;
535 double binSize = (etaHisto_root->GetXaxis()->GetXmax()-etaHisto_root->GetXaxis()->GetXmin())/etaHisto_root->GetNbinsX();
536 int binZero = int((0-etaHisto_root->GetXaxis()->GetXmin())/binSize);
537 if(etaHisto_root->Integral(1,binZero-1)!=0 && etaHisto_root->Integral(binZero,etaHisto_root->GetNbinsX())!=0){
538 double symmetryFactor =
539 double(etaHisto_root->Integral(1,binZero-1)) /
double(etaHisto_root->Integral(binZero,etaHisto_root->GetNbinsX()));
540 double errSymmetryFactor =
541 symmetryFactor*
sqrt(1.0/
double(etaHisto_root->Integral(1,binZero-1)) + 1.0/
double(etaHisto_root->Integral(binZero,etaHisto_root->GetNbinsX())));
542 LogTrace(
metname)<<
"eta symmetryFactor for "<<muonType<<
" : "<<symmetryFactor<<
" (expected :" <<etaExpected <<
")"<<endl;
543 LogTrace(
metname)<<
"eta errSymmetryFactor for "<<muonType<<
" : "<<errSymmetryFactor<<endl;
545 if((symmetryFactor-etaExpected)>0) tParameter=double(symmetryFactor-etaExpected)/errSymmetryFactor;
546 else tParameter=double(-symmetryFactor+etaExpected)/errSymmetryFactor;
547 LogTrace(
metname)<<
"eta tParameter for "<<muonType<<
" : "<<tParameter<<
" (expected < 1.95)" <<endl;
549 kinematicsSummaryMap->setBinContent(bin,2,1);
551 kinematicsSummaryMap->setBinContent(bin,2,0);
555 LogTrace(
metname)<<
"eta kin test based on comp wrt reference on terms of chi2 for "<<muonType<<endl;
562 LogTrace(
metname) <<
"qtresult " <<qtresult <<
" qtstatus "<<qtstatus<<endl;
563 chi2TestSummaryMap->setBinContent(bin,2,qtresult);
567 LogTrace(
metname)<<
"eta kin test based on comp wrt reference using kolmogorov for "<<muonType<<endl;
572 int qtstatus = myQReportKolmo->
getStatus() ;
574 LogTrace(
metname) <<
"qtresult " <<qtresult<<
" qtstatus "<<qtstatus<<endl;
575 KolmogorovTestSummaryMap->setBinContent(bin,2,qtresult);
580 LogTrace(
metname) <<
"[MuonTestSummary]: Test of Eta Kin not performed for "<< muonType <<
" because # entries < 20 ";
587 path =
"Muons/MuonRecoAnalyzer/" + muonType +
"phi";
591 TH1F * phiHisto_root = phiHisto->
getTH1F();
592 if(phiHisto_root ->GetEntries()>20){
595 LogTrace(
metname)<<
"phi kin test based on fraction for "<<muonType<<endl;
596 double binSize = (phiHisto_root->GetXaxis()->GetXmax()-phiHisto_root->GetXaxis()->GetXmin())/phiHisto_root->GetNbinsX();
597 int binZero = int((0-phiHisto_root->GetXaxis()->GetXmin())/binSize);
598 if(phiHisto_root->Integral(binZero+1,phiHisto_root->GetNbinsX())!=0 && phiHisto_root->Integral(1,binZero)!=0){
599 double symmetryFactor =
600 double(phiHisto_root->Integral(binZero+1,phiHisto_root->GetNbinsX())) / double(phiHisto_root->Integral(1,binZero));
601 double errSymmetryFactor =
602 symmetryFactor*
sqrt(1.0/
double(phiHisto_root->Integral(binZero+1,phiHisto_root->GetNbinsX())) + 1.0/double(phiHisto_root->Integral(1,binZero)));
603 LogTrace(
metname)<<
"phi symmetryFactor for "<<muonType<<
" : "<<symmetryFactor<<
"(phi expected :" <<phiExpected <<
")"<<endl;
604 LogTrace(
metname)<<
"phi errSymmetryFactor for "<<muonType<<
" : "<<errSymmetryFactor<<endl;
606 if((symmetryFactor-phiExpected)>0) tParameter=double(symmetryFactor-phiExpected)/errSymmetryFactor;
607 else tParameter=double(-symmetryFactor+phiExpected)/errSymmetryFactor;
608 LogTrace(
metname)<<
"phi tParameter for "<<muonType<<
" : "<<tParameter<<
" (expected < 1.95)" <<endl;
610 kinematicsSummaryMap->setBinContent(bin,3,1);
612 kinematicsSummaryMap->setBinContent(bin,3,0);
616 LogTrace(
metname)<<
"phi kin test based on comp wrt reference on terms of chi2 for "<<muonType<<endl;
623 LogTrace(
metname) <<
"qtresult " <<qtresult<<
" qtstatus "<<qtstatus<<endl;
624 chi2TestSummaryMap->setBinContent(bin,3,qtresult);
628 LogTrace(
metname)<<
"phi kin test based on comp wrt reference using kolmogorov for "<<muonType<<endl;
633 int qtstatus = myQReportKolmo->
getStatus() ;
635 LogTrace(
metname) <<
"qtresult " <<qtresult<<
" qtstatus "<<qtstatus<<endl;
636 KolmogorovTestSummaryMap->setBinContent(bin,3,qtresult);
641 LogTrace(
metname) <<
"[MuonTestSummary]: Test of Phi Kin not performed for "<< muonType <<
" because # entries < 20 ";
646 path =
"Muons/MuonRecoAnalyzer/" + muonType +
"pt";
650 TH1F * ptHisto_root = ptHisto->
getTH1F();
651 if(ptHisto_root ->GetEntries()>20){
654 LogTrace(
metname)<<
"pt kin test based on comp wrt reference on terms of chi2 for "<<muonType<<endl;
661 LogTrace(
metname) <<
"qtresult " <<qtresult<<
" qtstatus "<<qtstatus<<endl;
662 chi2TestSummaryMap->setBinContent(bin,4,qtresult);
666 LogTrace(
metname)<<
"pt kin test based on comp wrt reference using kolmogorov for "<<muonType<<endl;
671 int qtstatus = myQReportKolmo->
getStatus() ;
673 LogTrace(
metname) <<
"qtresult " <<qtresult<<
" qtstatus "<<qtstatus<<endl;
674 KolmogorovTestSummaryMap->setBinContent(bin,4,qtresult);
678 LogTrace(
metname) <<
"[MuonTestSummary]: Test of Pt Kin not performed for "<< muonType <<
" because # entries < 20 ";
683 path =
"Muons/MuonRecoAnalyzer/" + muonType +
"q";
687 TH1F * qHisto_root = qHisto->
getTH1F();
688 if(qHisto_root ->GetEntries()>20){
691 LogTrace(
metname)<<
"q kin test based on comp wrt reference on terms of chi2 for "<<muonType<<endl;
698 LogTrace(
metname) <<
"qtresult " <<qtresult<<
" qtstatus "<<qtstatus<<endl;
699 chi2TestSummaryMap->setBinContent(bin,5,qtresult);
703 LogTrace(
metname)<<
"q kin test based on comp wrt reference using kolmogorov for "<<muonType<<endl;
708 int qtstatus = myQReportKolmo->
getStatus() ;
710 LogTrace(
metname) <<
"qtresult " <<qtresult<<
" qtstatus "<<qtstatus<<endl;
711 KolmogorovTestSummaryMap->setBinContent(bin,5,qtresult);
715 LogTrace(
metname) <<
"[MuonTestSummary]: Test of q Kin not performed for "<< muonType <<
" because # entries < 20 ";
724 float statMean = Histo->
getMean(1);
725 float statSigma = Histo->
getRMS(1);
726 TH1F * histo_root = Histo->
getTH1F();
727 if(histo_root->GetEntries()>20){
728 TF1 *gfit =
new TF1(
"Gaussian",
"gaus",(statMean-(2*statSigma)),(statMean+(2*statSigma)));
730 histo_root->Fit(gfit,
"Q0");
732 edm::LogError (
metname)<<
"[MuonTestSummary]: Exception when fitting Res_"<<type<<
"_"<<parameter;
740 mean = gfit->GetParameter(1);
741 mean_err = gfit->GetParErrors()[2];
742 sigma = gfit->GetParameter(2);
743 sigma_err = gfit->GetParErrors()[2];
744 LogTrace(
metname)<<
"Gaussian fit mean: "<<mean<<
" +- "<<mean_err<<
" for "<<type<<
"_"<<parameter<<endl;
745 LogTrace(
metname)<<
"Gaussina fit sigma: "<<sigma<<
" +- "<<sigma_err<<
" for "<<type<<
"_"<<parameter<<endl;
749 LogTrace(
metname) <<
"[MuonTestSummary]: Test of Res_"<<type<<
"_"<<parameter<<
" not performed because # entries < 20 ";
761 string path =
"Muons/MuonRecoAnalyzer/Res_" + type +
"_" + parameter;
767 float sigma_err = -1;
771 LogTrace(
metname) <<
"[MuonTestSummary]: Starting Gaussian fit for Test of Res_"<<type<<
"_"<<parameter<< endl;
772 GaussFit( type, parameter, residualsHisto, mean, mean_err, sigma, sigma_err);
774 if(sigma!=-1 && parameter==
"eta" && type==
"TkGlb"){
775 if(sigma-sigma_err<resEtaSpread_tkGlb) residualsSummaryMap->setBinContent(bin, 1, 1);
776 else residualsSummaryMap->setBinContent(bin, 1, 0);
778 if(sigma!=-1 && parameter==
"eta" && (type==
"GlbSta" || type==
"TkSta")) {
779 if(sigma-sigma_err<resEtaSpread_glbSta) residualsSummaryMap->setBinContent(bin, 1, 1);
780 else residualsSummaryMap->setBinContent(bin, 1, 0);
782 if(sigma!=-1 && parameter==
"phi" && type==
"TkGlb"){
783 if(sigma-sigma_err<resPhiSpread_tkGlb) residualsSummaryMap->setBinContent(bin, 2, 1);
784 else residualsSummaryMap->setBinContent(bin, 2, 0);
786 if(sigma!=-1 && parameter==
"phi" && (type==
"GlbSta" || type==
"TkSta")){
787 if(sigma-sigma_err<resPhiSpread_glbSta) residualsSummaryMap->setBinContent(bin, 2, 1);
788 else residualsSummaryMap->setBinContent(bin, 2, 0);
790 if(sigma!=-1 && parameter==
"oneOverp" && type==
"TkGlb"){
791 if(sigma-sigma_err<resOneOvPSpread_tkGlb) residualsSummaryMap->setBinContent(bin, 3, 1);
792 else residualsSummaryMap->setBinContent(bin, 3, 0);
794 if(sigma!=-1 && parameter==
"oneOverp" && (type==
"GlbSta" || type==
"TkSta")) {
795 if(sigma-sigma_err<resOneOvPSpread_glbSta) residualsSummaryMap->setBinContent(bin, 3, 1);
796 else residualsSummaryMap->setBinContent(bin, 3, 0);
805 string path =
"Muons/MuonRecoAnalyzer/Pull_" + type +
"_" + parameter;
810 LogTrace(
metname) <<
"[MuonTestSummary]: Starting Gaussian fit for Test of Pull_"<<type<<
"_"<<parameter<< endl;
811 GaussFit( type, parameter, pullHisto, mean, mean_err, sigma, sigma_err);
813 if(sigma!=-1 && parameter==
"eta" ){
814 if(sigma-sigma_err<pullEtaSpread) residualsSummaryMap->setBinContent(4, 1, 1);
815 else residualsSummaryMap->setBinContent(4, 1, 0);
817 if(sigma!=-1 && parameter==
"phi"){
818 if(sigma-sigma_err<pullPhiSpread) residualsSummaryMap->setBinContent(4, 2, 1);
819 else residualsSummaryMap->setBinContent(4, 2, 0);
821 if(sigma!=-1 && parameter==
"oneOverp"){
822 if(sigma-sigma_err<pullOneOvPSpread) residualsSummaryMap->setBinContent(4, 3, 1);
823 else residualsSummaryMap->setBinContent(4, 3, 0);
832 string path =
"Muons/MuonRecoAnalyzer/" + type +
"_" + parameter;
836 LogTrace(
metname) <<
"[MuonTestSummary]: Test of Charge Comparison "<<type<<
"_"<<parameter<< endl;
840 residualsSummaryMap->setBinContent(1, 4, 1);
842 residualsSummaryMap->setBinContent(1, 4, 0);
847 residualsSummaryMap->setBinContent(2, 4, 1);
849 residualsSummaryMap->setBinContent(2, 4, 0);
854 residualsSummaryMap->setBinContent(3, 4, 1);
856 residualsSummaryMap->setBinContent(3, 4, 0);
865 vector<string> muType;
866 muType.push_back(
"GlobalMuons");
867 muType.push_back(
"TrackerMuons");
869 for(
int i=0;
i<=1;
i++){
872 string path =
"Muons/MuonIdDQM/" + muType[
i] +
"/hNumMatches";
876 TH1F * matchesHisto_root = matchesHisto->
getTH1F();
877 if(matchesHisto_root->GetMaximumBin() >= numMatchedExpected_min && matchesHisto_root->GetMaximumBin() <= numMatchedExpected_max)
878 muonIdSummaryMap->setBinContent(
i+1,1,1);
880 muonIdSummaryMap->setBinContent(
i+1,1,0);
885 double numOneSegm_dt = 0;
888 MonitorElement * DT1Histo = igetter.
get(
"Muons/MuonIdDQM/" + muType[
i] +
"/hDT1NumSegments");
892 MonitorElement * DT2Histo = igetter.
get(
"Muons/MuonIdDQM/" + muType[
i] +
"/hDT2NumSegments");
896 MonitorElement * DT3Histo = igetter.
get(
"Muons/MuonIdDQM/" + muType[
i] +
"/hDT3NumSegments");
900 MonitorElement * DT4Histo = igetter.
get(
"Muons/MuonIdDQM/" + muType[
i] +
"/hDT4NumSegments");
904 double fraction_dt=0;
905 if(numOneSegm_dt!=0){
906 fraction_dt = numOneSegm_dt/double(numHistos_dt);
910 double numOneSegm_csc = 0;
911 MonitorElement * CSC1Histo = igetter.
get(
"Muons/MuonIdDQM/" + muType[
i] +
"/hCSC1NumSegments");
915 MonitorElement * CSC2Histo = igetter.
get(
"Muons/MuonIdDQM/" + muType[
i] +
"/hCSC2NumSegments");
919 MonitorElement * CSC3Histo = igetter.
get(
"Muons/MuonIdDQM/" + muType[
i] +
"/hCSC3NumSegments");
923 MonitorElement * CSC4Histo = igetter.
get(
"Muons/MuonIdDQM/" + muType[
i] +
"/hCSC4NumSegments");
927 double fraction_csc=0;
928 if(numOneSegm_csc!=0){
929 fraction_csc = numOneSegm_csc/double(numHistos_csc);
930 LogTrace(
metname)<<
"fraction_csc: "<<fraction_csc<<
" for "<<muType[
i]<<endl;
937 if(fraction_dt>matchesFractionDt_min && fraction_dt<matchesFractionDt_max)
938 muonIdSummaryMap->setBinContent(2*
i+1,1,1);
940 muonIdSummaryMap->setBinContent(2*
i+1,1,0);
942 if(fraction_csc>matchesFractionCsc_min && fraction_csc<matchesFractionCsc_max)
943 muonIdSummaryMap->setBinContent(2*
i+2,1,1);
945 muonIdSummaryMap->setBinContent(2*
i+2,1,0);
952 vector<string> DTXresHistos, DTYresHistos, CSCXresHistos, CSCYresHistos;
953 DTXresHistos.push_back(
"hDT1Pullx");
954 DTXresHistos.push_back(
"hDT2Pullx");
955 DTXresHistos.push_back(
"hDT3Pullx");
956 DTXresHistos.push_back(
"hDT4Pullx");
958 DTYresHistos.push_back(
"hDT1Pully");
959 DTYresHistos.push_back(
"hDT2Pully");
960 DTYresHistos.push_back(
"hDT3Pully");
962 CSCXresHistos.push_back(
"hCSC1Pullx");
963 CSCXresHistos.push_back(
"hCSC2Pullx");
964 CSCXresHistos.push_back(
"hCSC3Pullx");
965 CSCXresHistos.push_back(
"hCSC4Pullx");
967 CSCYresHistos.push_back(
"hCSC1Pully");
968 CSCYresHistos.push_back(
"hCSC2Pully");
969 CSCYresHistos.push_back(
"hCSC3Pully");
970 CSCYresHistos.push_back(
"hCSC4Pully");
972 int numPlot_dtX, numPlot_dtY, numPlot_cscX, numPlot_cscY;
973 double dtSigmaX, dtSigmaY, cscSigmaX, cscSigmaY;
974 double dtSigmaX_err, dtSigmaY_err, cscSigmaX_err, cscSigmaY_err;
975 double dtMeanX, dtMeanY, cscMeanX, cscMeanY;
976 double dtMeanX_err, dtMeanY_err, cscMeanX_err, cscMeanY_err;
983 LogTrace(
metname)<<
"DT mean must be between: "<<resSegmTrack_mean_min <<
" and "<<resSegmTrack_mean_max<<endl;
984 LogTrace(
metname)<<
"DT rms must be between: "<<resSegmTrack_rms_min <<
" and "<<resSegmTrack_rms_max<<endl;
985 LogTrace(
metname)<<
"DT X residual "<< muType[
i]<<
" mean: " << dtMeanX<<
" +- "<< dtMeanX_err
986 <<
", sigma: "<< dtSigmaX <<
" +- "<<dtSigmaX_err<< endl;
987 LogTrace(
metname)<<
"DT Y residual "<< muType[
i]<<
" mean: " << dtMeanY<<
" +- "<< dtMeanY_err
988 <<
", sigma: "<< dtSigmaY <<
" +- "<<dtSigmaY_err<< endl;
989 LogTrace(
metname)<<
"CSC X residual "<< muType[
i]<<
" mean: " << cscMeanX<<
" +- "<< cscMeanX_err
990 <<
", sigma: "<< cscSigmaX <<
" +- "<<cscSigmaX_err<< endl;
991 LogTrace(
metname)<<
"CSC Y residual "<< muType[
i]<<
" mean: " << cscMeanY<<
" +- "<< cscMeanY_err
992 <<
", sigma: "<< cscSigmaY <<
" +- "<<cscSigmaY_err<< endl;
997 if(numPlot_dtX > 0 ) {
998 if( dtMeanX + nsig*dtMeanX_err>resSegmTrack_mean_min &&
999 dtMeanX - nsig*dtMeanX_err<resSegmTrack_mean_max)
1000 muonIdSummaryMap->setBinContent(2*i+1,2,1);
1002 muonIdSummaryMap->setBinContent(2*i+1,2,0);
1004 if( dtSigmaX + nsig*dtSigmaX_err>resSegmTrack_rms_min &&
1005 dtSigmaX - nsig*dtSigmaX_err<resSegmTrack_rms_max)
1006 muonIdSummaryMap->setBinContent(2*i+1,3,1);
1008 muonIdSummaryMap->setBinContent(2*i+1,3,0);
1010 if(numPlot_dtY > 0 ){
1011 if( dtMeanY + nsig*dtMeanY_err>resSegmTrack_mean_min &&
1012 dtMeanY - nsig*dtMeanY_err<resSegmTrack_mean_max)
1013 muonIdSummaryMap->setBinContent(2*i+1,4,1);
1015 muonIdSummaryMap->setBinContent(2*i+1,4,0);
1017 if( dtSigmaY + nsig*dtSigmaY_err>resSegmTrack_rms_min &&
1018 dtSigmaY - nsig*dtSigmaX_err<resSegmTrack_rms_max)
1019 muonIdSummaryMap->setBinContent(2*i+1,5,1);
1021 muonIdSummaryMap->setBinContent(2*i+1,5,0);
1025 if(numPlot_cscX > 0 ) {
1026 if( cscMeanX + nsig*cscMeanX_err>resSegmTrack_mean_min &&
1027 cscMeanX - nsig*cscMeanX_err<resSegmTrack_mean_max)
1028 muonIdSummaryMap->setBinContent(2*i+2,2,1);
1030 muonIdSummaryMap->setBinContent(2*i+2,2,0);
1032 if( cscSigmaX + nsig*cscSigmaX_err>resSegmTrack_rms_min &&
1033 cscSigmaX - nsig*cscSigmaX_err<resSegmTrack_rms_max)
1034 muonIdSummaryMap->setBinContent(2*i+2,3,1);
1036 muonIdSummaryMap->setBinContent(2*i+2,3,0);
1038 if(numPlot_cscY > 0 ){
1039 if( cscMeanY + nsig*cscMeanY_err>resSegmTrack_mean_min &&
1040 cscMeanY - nsig*cscMeanY_err<resSegmTrack_mean_max)
1041 muonIdSummaryMap->setBinContent(2*i+2,4,1);
1043 muonIdSummaryMap->setBinContent(2*i+2,4,0);
1045 if( cscSigmaY + nsig*cscSigmaY_err>resSegmTrack_rms_min &&
1046 cscSigmaY - nsig*cscSigmaY_err<resSegmTrack_rms_max)
1047 muonIdSummaryMap->setBinContent(2*i+2,5,1);
1049 muonIdSummaryMap->setBinContent(2*i+2,5,0);
1070 TH1F * resHisto_root = resHisto->
getTH1F();
1071 if(resHisto_root->GetEntries() < 20) {
1072 LogTrace(
metname) <<
"[MuonTestSummary]: Test of "<< muType<<
" for " <<resHistos[
name]<<
" not performed because # entries < 20 ";
1080 float mean = resHisto_root->GetBinLowEdge(resHisto_root->GetMaximumBin());
1081 TF1 *gfit =
new TF1(
"Gaussian",
"gaus",mean-3,mean+3);
1085 resHisto_root->Fit(gfit,
"Q0");
1091 double mean = gfit->GetParameter(1);
1092 double mean_err = gfit->GetParError(1);
1093 double sigma = gfit->GetParameter(2);
1094 double sigma_err = gfit->GetParError(2);
1096 LogTrace(
metname)<<
"sigmaRes: "<<sigma<<
" +- "<<sigma_err<<
" for "<<resHistos[
name]<<endl;
1099 Mean_err +=mean_err * mean_err;
1101 Sigma_err +=sigma_err * sigma_err;
1116 Mean_err =
sqrt(Mean_err);
1120 Sigma_err =
sqrt(Sigma_err);
1130 string path =
"Muons/MuonEnergyDepositAnalyzer/"+histname+muonType;
1132 Double_t hPeak=-1, hFWHM=-1;
1134 TH1F * energyHisto_root = energyHisto->
getTH1F();
1137 Double_t fitRange[2];
1138 Double_t startValues[4], parlimitslo[4], parlimitshi[4], fitPar[4], fitParErr[4];
1141 if(histname==
"ecalS9PointingMuDepositedEnergy_"){
1145 startValues[0]=0.036; startValues[1]=0.193; startValues[2]=110.0; startValues[3]=0.06;
1146 parlimitslo[0]=0.0; parlimitslo[1]=0.; parlimitslo[2]=1.0; parlimitslo[3]=0.;
1147 parlimitshi[0]=0.05; parlimitshi[1]=0.5; parlimitshi[2]=80000.0; parlimitshi[3]=0.1;
1151 TF1 *fit = langaufit(energyHisto_root,fitRange,startValues,parlimitslo,parlimitshi,fitPar,fitParErr,&chisqr,&ndf);
1154 LogTrace(
metname)<<
"hPeak from langau fit: "<<hPeak<<
" for: "<<histname+muonType<<endl;
1155 LogTrace(
metname)<<
"hFWHM from langau fit: "<<hFWHM<<
" for: "<<histname+muonType<<endl;
1159 if(histname==
"hadS9PointingMuDepositedEnergy_"){
1163 startValues[0]=2.0; startValues[1]=2.4; startValues[2]=110.0; startValues[3]=4.0;
1164 parlimitslo[0]=0.0; parlimitslo[1]=0.; parlimitslo[2]=1.0; parlimitslo[3]=0.;
1165 parlimitshi[0]=4.0; parlimitshi[1]=4.0; parlimitshi[2]=80000.0; parlimitshi[3]=8.0;
1169 TF1 *fit = langaufit(energyHisto_root,fitRange,startValues,parlimitslo,parlimitshi,fitPar,fitParErr,&chisqr,&ndf);
1172 LogTrace(
metname)<<
"hPeak from langau fit: "<<hPeak<<
" for: "<<histname+muonType<<endl;
1173 LogTrace(
metname)<<
"hFWHM from langau fit: "<<hFWHM<<
" for: "<<histname+muonType<<endl;
1178 LogTrace(
metname) <<
"[MuonTestSummary]: Test of Energy for "<< histname+muonType <<
" not performed because # entries < 20 ";
1182 if(histname==
"ecalS9PointingMuDepositedEnergy_" && hPeak>expPeakEcalS9_min && hPeak<expPeakEcalS9_max)
1183 energySummaryMap->setBinContent(binNumber,1, 1);
1184 if(histname==
"ecalS9PointingMuDepositedEnergy_" && (hPeak!=-1) &&!(hPeak>expPeakEcalS9_min && hPeak<expPeakEcalS9_max))
1185 energySummaryMap->setBinContent(binNumber,1, 0);
1187 if(histname==
"hadS9PointingMuDepositedEnergy_" && hPeak>expPeakHadS9_min && hPeak<expPeakHadS9_max)
1188 energySummaryMap->setBinContent(binNumber,2, 1);
1189 if(histname==
"hadS9PointingMuDepositedEnergy_" && (hPeak!=-1) && !(hPeak>expPeakHadS9_min && hPeak<expPeakHadS9_max))
1190 energySummaryMap->setBinContent(binNumber,2, 0);
1196 MonitorElement* multiplicityHisto = igetter.
get(
"Muons/MuonRecoAnalyzer/muReco");
1198 if(multiplicityHisto){
1201 LogTrace(
metname)<<
"multiplicity_GLB: "<<multiplicity_GLB<<
" ExpMultiplicityGlb_min " <<expMultiplicityGlb_min <<
" ExpMultiplicityGlb_max " <<expMultiplicityGlb_max<<endl;
1203 LogTrace(
metname)<<
"multiplicity_TK: "<<multiplicity_TK<<
" ExpMultiplicityTk_min " <<expMultiplicityTk_min <<
" ExpMultiplicityTk_max " <<expMultiplicityTk_max<<endl;
1205 LogTrace(
metname)<<
"multiplicity_STA: "<<multiplicity_STA<<
" ExpMultiplicitySta_min " <<expMultiplicitySta_min <<
" ExpMultiplicitySta_max " <<expMultiplicitySta_max<<endl;
1207 if(multiplicity_GLB>expMultiplicityGlb_min && multiplicity_GLB<expMultiplicityGlb_max)
1208 multiplicitySummaryMap->setBinContent(1,1);
1210 multiplicitySummaryMap->setBinContent(1,0);
1212 if(multiplicity_TK>expMultiplicityTk_min && multiplicity_TK<expMultiplicityTk_max)
1213 multiplicitySummaryMap->setBinContent(2,1);
1215 multiplicitySummaryMap->setBinContent(2,0);
1217 if(multiplicity_STA>expMultiplicitySta_min && multiplicity_STA<expMultiplicitySta_max)
1218 multiplicitySummaryMap->setBinContent(3,1);
1220 multiplicitySummaryMap->setBinContent(3,0);
1223 LogTrace(
metname) <<
"[MuonTestSummary]: Test of Multiplicity not performed because # entries < 20 ";
T getParameter(std::string const &) const
const QReport * getQReport(const std::string &qtname) const
get QReport corresponding to <qtname> (null pointer if QReport does not exist)
void ResidualCheck(DQMStore::IGetter &, std::string muType, const std::vector< std::string > &resHistos, int &numPlot, double &Mean, double &Mean_err, double &Sigma, double &Sigma_err)
const std::string metname
MonitorElement * get(const std::string &path)
void doMultiplicityTests(DQMStore::IGetter &)
double getEntries(void) const
get # of entries
double getMean(int axis=1) const
get mean value of histogram along x, y or z axis (axis=1, 2, 3 respectively)
const std::string & getMessage(void) const
get message attached to test
virtual ~MuonTestSummary()
Destructor.
void doMuonIDTests(DQMStore::IGetter &)
MonitorElement * book1D(Args &&...args)
int getStatus(void) const
get test status (see Core/interface/QTestStatus.h)
int32_t langaupro(double *params, double &maxx, double &FWHM)
void setCurrentFolder(const std::string &fullpath)
MonitorElement * book2D(Args &&...args)
TH1F * getTH1F(void) const
void doKinematicsTests(DQMStore::IGetter &, std::string, int)
test operations
float getQTresult(void) const
get test result i.e. prob value
double getBinContent(int binx) const
get content of bin (1-D)
void doEnergyTests(DQMStore::IGetter &, std::string nameHisto, std::string muonType, int bin)
double getRMS(int axis=1) const
get RMS of histogram along x, y or z axis (axis=1, 2, 3 respectively)
void GaussFit(std::string type, std::string parameter, MonitorElement *Histo, float &mean, float &mean_err, float &sigma, float &sigma_err)
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
MonitorElement * bookFloat(Args &&...args)
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
MuonTestSummary(const edm::ParameterSet &ps)
Constructor.
void doResidualsTests(DQMStore::IGetter &, std::string, std::string, int)