25 theMuonCollectionLabel_ = consumes<edm::View<reco::Muon> >(
parameters.getParameter<
edm::InputTag>(
"MuonCollection"));
26 theVertexLabel_ = consumes<reco::VertexCollection>(pSet.
getParameter<
InputTag>(
"inputTagVertex"));
28 dcsStatusCollection_ =
59 theFolder =
parameters.getParameter<
string>(
"folder");
69 muReco = ibooker.
book1D(
"muReco",
"muon reconstructed tracks", 6, 1, 7);
71 muReco->setBinLabel(2,
"glb+sta");
72 muReco->setBinLabel(3,
"tk+sta");
73 muReco->setBinLabel(4,
"tk");
74 muReco->setBinLabel(5,
"sta");
75 muReco->setBinLabel(6,
"calo");
87 "Res_TkGlb_eta",
"#eta_{TKfromGLB} - #eta_{GLB}",
etaBin * binFactor,
etaMin / 3000,
etaMax / 3000));
89 "Res_GlbSta_eta",
"#eta_{GLB} - #eta_{STAfromGLB}",
etaBin * binFactor,
etaMin / 100,
etaMax / 100));
91 "Res_TkSta_eta",
"#eta_{TKfromGLB} - #eta_{STAfromGLB}",
etaBin * binFactor,
etaMin / 100,
etaMax / 100));
93 "(#eta_{TKfromGLB} - #eta_{GLB}) vs #eta_{GLB}",
101 "(#eta_{GLB} - #eta_{STAfromGLB}) vs #eta_{GLB}",
109 "(#eta_{TKfromGLB} - #eta_{STAfromGLB}) vs #eta_{TKfromGLB}",
116 etaPull = ibooker.
book1D(
"Pull_TkSta_eta",
"#eta_{TKfromGLB} - #eta_{GLB} / error", 100, -10, 10);
120 etaEfficiency.push_back(
129 thetaGlbTrack[1]->setAxisTitle(
"rad");
131 thetaGlbTrack[2]->setAxisTitle(
"rad");
132 thetaResolution.push_back(ibooker.
book1D(
"Res_TkGlb_theta",
133 "#theta_{TKfromGLB} - #theta_{GLB}",
137 thetaResolution[0]->setAxisTitle(
"rad");
138 thetaResolution.push_back(ibooker.
book1D(
"Res_GlbSta_theta",
139 "#theta_{GLB} - #theta_{STAfromGLB}",
143 thetaResolution[1]->setAxisTitle(
"rad");
144 thetaResolution.push_back(ibooker.
book1D(
"Res_TkSta_theta",
145 "#theta_{TKfromGLB} - #theta_{STAfromGLB}",
149 thetaResolution[2]->setAxisTitle(
"rad");
150 thetaResolution.push_back(ibooker.
book2D(
"ResVsTheta_TkGlb_theta",
151 "(#theta_{TKfromGLB} - #theta_{GLB}) vs #theta_{GLB}",
158 thetaResolution[3]->setAxisTitle(
"rad", 1);
159 thetaResolution[3]->setAxisTitle(
"rad", 2);
160 thetaResolution.push_back(ibooker.
book2D(
"ResVsTheta_GlbSta_theta",
161 "(#theta_{GLB} - #theta_{STAfromGLB}) vs #theta_{GLB}",
168 thetaResolution[4]->setAxisTitle(
"rad", 1);
169 thetaResolution[4]->setAxisTitle(
"rad", 2);
170 thetaResolution.push_back(ibooker.
book2D(
"ResVsTheta_TkSta_theta",
171 "(#theta_{TKfromGLB} - #theta_{STAfromGLB}) vs #theta_{TKfromGLB}",
178 thetaResolution[5]->setAxisTitle(
"rad", 1);
179 thetaResolution[5]->setAxisTitle(
"rad", 2);
180 thetaPull = ibooker.
book1D(
"Pull_TkSta_theta",
"#theta_{TKfromGLB} - #theta_{STAfromGLB} / error", 100, -10, 10);
187 tunePResolution = ibooker.
book1D(
194 phiGlbTrack[1]->setAxisTitle(
"rad");
196 phiGlbTrack[2]->setAxisTitle(
"rad");
198 "Res_TkGlb_phi",
"#phi_{TKfromGLB} - #phi_{GLB}",
phiBin * binFactor,
phiMin / 3000,
phiMax / 3000));
201 "Res_GlbSta_phi",
"#phi_{GLB} - #phi_{STAfromGLB}",
phiBin * binFactor,
phiMin / 100,
phiMax / 100));
204 "Res_TkSta_phi",
"#phi_{TKfromGLB} - #phi_{STAfromGLB}",
phiBin * binFactor,
phiMin / 100,
phiMax / 100));
207 "(#phi_{TKfromGLB} - #phi_{GLB}) vs #phi_GLB",
217 "(#phi_{GLB} - #phi_{STAfromGLB}) vs #phi_{GLB}",
227 "(#phi_{TKfromGLB} - #phi_{STAfromGLB}) vs #phi_{TKfromGLB}",
236 phiPull = ibooker.
book1D(
"Pull_TkSta_phi",
"#phi_{TKfromGLB} - #phi_{STAfromGLB} / error", 100, -10, 10);
242 phiEfficiency[0]->setAxisTitle(
"rad");
243 phiEfficiency.push_back(
245 phiEfficiency[1]->setAxisTitle(
"rad");
248 chi2OvDFGlbTrack.push_back(
250 chi2OvDFGlbTrack.push_back(
252 chi2OvDFGlbTrack.push_back(
257 probchi2GlbTrack.push_back(ibooker.
book1D(histname +
"Glb_probchi",
"Prob #chi_{GLB}", 120,
chi2Min, 1.20));
258 probchi2GlbTrack.push_back(ibooker.
book1D(histname +
"Tk_probchi",
"Prob #chi_{TKfromGLB}", 120,
chi2Min, 1.20));
259 probchi2GlbTrack.push_back(ibooker.
book1D(histname +
"Sta_probchi",
"Prob #chi_{STAfromGLB}", 120,
chi2Min, 1.20));
260 probchi2Track = ibooker.
book1D(
"TkMuon_probchi",
"Prob #chi_{TK}", 120,
chi2Min, 1.20);
261 probchi2StaTrack = ibooker.
book1D(
"StaMuon_probchi",
"Prob #chi_{STA}", 120,
chi2Min, 1.20);
266 pGlbTrack.push_back(ibooker.
book1D(histname +
"Tk_p",
"p_{TKfromGLB}",
pBin,
pMin,
pMax));
267 pGlbTrack[1]->setAxisTitle(
"GeV");
268 pGlbTrack.push_back(ibooker.
book1D(histname +
"Sta_p",
"p_{STAfromGLB}",
pBin,
pMin,
pMax));
269 pGlbTrack[2]->setAxisTitle(
"GeV");
277 ptGlbTrack[0]->setAxisTitle(
"GeV");
279 ptGlbTrack[1]->setAxisTitle(
"GeV");
281 ptGlbTrack[2]->setAxisTitle(
"GeV");
289 ptSoftMuonMVA = ibooker.
book1D(
"ptSoftMuonMVA",
"pt_{SoftMuon}", 50, 0, 50);
290 deltaRSoftMuonMVA = ibooker.
book1D(
"deltaRSoftMuonMVA",
"#Delta R", 50, 0, 5);
291 gNchi2SoftMuonMVA = ibooker.
book1D(
"gNchi2SoftMuonMVA",
"gNchi2", 50, 0, 3);
292 vMuHitsSoftMuonMVA = ibooker.
book1D(
"vMuHitsSoftMuonMVA",
"vMuHits", 50, 0, 50);
293 mNuStationsSoftMuonMVA = ibooker.
book1D(
"mNuStationsSoftMuonMVA",
"mNuStations", 6, 0, 6);
294 dxyRefSoftMuonMVA = ibooker.
book1D(
"dxyRefSoftMuonMVA",
"dxyRef", 50, -0.1, 0.1);
295 dzRefSoftMuonMVA = ibooker.
book1D(
"dzRefSoftMuonMVA",
"dzRef", 50, -0.1, 0.1);
296 LWHSoftMuonMVA = ibooker.
book1D(
"LWHSoftMuonMVA",
"LWH", 20, 0, 20);
297 valPixHitsSoftMuonMVA = ibooker.
book1D(
"valPixHitsSoftMuonMVA",
"valPixHits", 8, 0, 8);
298 innerChi2SoftMuonMVA = ibooker.
book1D(
"innerChi2SoftMuonMVA",
"innerChi2", 50, 0, 3);
299 outerChi2SoftMuonMVA = ibooker.
book1D(
"outerChi2SoftMuonMVA",
"outerChi2", 50, 0, 4);
300 iValFracSoftMuonMVA = ibooker.
book1D(
"iValFracSoftMuonMVA",
"iValFrac", 50, 0.5, 1.0);
301 segCompSoftMuonMVA = ibooker.
book1D(
"segCompSoftMuonMVA",
"segComp", 50, 0, 1.2);
302 chi2LocMomSoftMuonMVA = ibooker.
book1D(
"chi2LocMomSoftMuonMVA",
"chi2LocMom", 50, 0, 40);
303 chi2LocPosSoftMuonMVA = ibooker.
book1D(
"chi2LocPosSoftMuonMVA",
"chi2LocPos", 0, 0, 8);
304 glbTrackTailProbSoftMuonMVA = ibooker.
book1D(
"glbTrackTailProbSoftMuonMVA",
"glbTrackTailProb", 50, 0, 8);
305 NTrkVHitsSoftMuonMVA = ibooker.
book1D(
"NTrkVHitsSoftMuonMVA",
"NTrkVHits", 50, 0, 35);
306 kinkFinderSoftMuonMVA = ibooker.
book1D(
"kinkFinderSoftMuonMVA",
"kinkFinder", 50, 0, 30);
307 vRPChitsSoftMuonMVA = ibooker.
book1D(
"vRPChitsSoftMuonMVA",
"vRPChits", 50, 0, 50);
308 glbKinkFinderSoftMuonMVA = ibooker.
book1D(
"glbKinkFinderSoftMuonMVA",
"glbKinkFinder", 50, 0, 50);
309 glbKinkFinderLogSoftMuonMVA = ibooker.
book1D(
"glbKinkFinderLogSoftMuonMVA",
"glbKinkFinderLog", 50, 0, 50);
310 staRelChi2SoftMuonMVA = ibooker.
book1D(
"staRelChi2SoftMuonMVA",
"staRelChi2", 50, 0, 2);
311 glbDeltaEtaPhiSoftMuonMVA = ibooker.
book1D(
"glbDeltaEtaPhiSoftMuonMVA",
"glbDeltaEtaPhi", 50, 0, 0.15);
312 trkRelChi2SoftMuonMVA = ibooker.
book1D(
"trkRelChi2SoftMuonMVA",
"trkRelChi2", 50, 0, 1.2);
313 vDThitsSoftMuonMVA = ibooker.
book1D(
"vDThitsSoftMuonMVA",
"vDThits", 50, 0, 50);
314 vCSChitsSoftMuonMVA = ibooker.
book1D(
"vCSChitsSoftMuonMVA",
"vCSChits", 50, 0, 50);
315 timeAtIpInOutSoftMuonMVA = ibooker.
book1D(
"timeAtIpInOutSoftMuonMVA",
"timeAtIpInOut", 50, -10.0, 10.0);
316 timeAtIpInOutErrSoftMuonMVA = ibooker.
book1D(
"timeAtIpInOutErrSoftMuonMVA",
"timeAtIpInOutErr", 50, 0, 3.5);
317 getMuonHitsPerStationSoftMuonMVA =
318 ibooker.
book1D(
"getMuonHitsPerStationSoftMuonMVA",
"getMuonHitsPerStation", 6, 0, 6);
319 QprodSoftMuonMVA = ibooker.
book1D(
"QprodSoftMuonMVA",
"Qprod", 4, -2, 2);
322 qGlbTrack.push_back(ibooker.
book1D(histname +
"Glb_q",
"q_{GLB}", 5, -2.5, 2.5));
323 qGlbTrack.push_back(ibooker.
book1D(histname +
"Tk_q",
"q_{TKfromGLB}", 5, -2.5, 2.5));
324 qGlbTrack.push_back(ibooker.
book1D(histname +
"Sta_q",
"q_{STAformGLB}", 5, -2.5, 2.5));
325 qGlbTrack.push_back(ibooker.
book1D(
326 histname +
"qComparison",
"comparison between q_{GLB} and q_{TKfromGLB}, q_{STAfromGLB}", 8, 0.5, 8.5));
328 qGlbTrack[3]->setBinLabel(2,
"qGlb!=qSta");
329 qGlbTrack[3]->setBinLabel(3,
"qGlb=qTk");
330 qGlbTrack[3]->setBinLabel(4,
"qGlb!=qTk");
331 qGlbTrack[3]->setBinLabel(5,
"qSta=qTk");
332 qGlbTrack[3]->setBinLabel(6,
"qSta!=qTk");
333 qGlbTrack[3]->setBinLabel(7,
"qGlb!=qSta,qGlb!=Tk");
334 qGlbTrack[3]->setBinLabel(8,
"qGlb=qSta,qGlb=Tk");
335 qTrack = ibooker.
book1D(
"TkMuon_q",
"q_{TK}", 5, -2.5, 2.5);
336 qStaTrack = ibooker.
book1D(
"StaMuon_q",
"q_{STA}", 5, -2.5, 2.5);
340 qOverpResolution.push_back(ibooker.
book1D(
341 "Res_TkGlb_qOverp",
"(q/p)_{TKfromGLB} - (q/p)_{GLB}",
pResBin * binFactor * 2,
pResMin / 10,
pResMax / 10));
343 qOverpResolution.push_back(
345 qOverpResolution[1]->setAxisTitle(
"GeV^{-1}");
346 qOverpResolution.push_back(ibooker.
book1D(
347 "Res_TkSta_qOverp",
"(q/p)_{TKfromGLB} - (q/p)_{STAfromGLB}",
pResBin * binFactor,
pResMin,
pResMax));
348 qOverpResolution[2]->setAxisTitle(
"GeV^{-1}");
349 qOverpPull = ibooker.
book1D(
"Pull_TkSta_qOverp",
"(q/p)_{TKfromGLB} - (q/p)_{STAfromGLB} / error", 100, -10, 10);
351 oneOverpResolution.push_back(ibooker.
book1D(
352 "Res_TkGlb_oneOverp",
"(1/p)_{TKfromGLB} - (1/p)_{GLB}",
pResBin * binFactor * 2,
pResMin / 10,
pResMax / 10));
354 oneOverpResolution.push_back(
356 oneOverpResolution[1]->setAxisTitle(
"GeV^{-1}");
357 oneOverpResolution.push_back(ibooker.
book1D(
358 "Res_TkSta_oneOverp",
"(q/p)_{TKfromGLB} - (q/p)_{STAfromGLB}",
pResBin * binFactor,
pResMin,
pResMax));
359 oneOverpResolution[2]->setAxisTitle(
"GeV^{-1}");
360 oneOverpPull = ibooker.
book1D(
"Pull_TkSta_oneOverp",
"(1/p)_{TKfromGLB} - (1/p)_{STAfromGLB} / error", 100, -10, 10);
362 qOverptResolution.push_back(ibooker.
book1D(
"Res_TkGlb_qOverpt",
363 "(q/p_{t})_{TKfromGLB} - (q/p_{t})_{GLB}",
368 qOverptResolution.push_back(ibooker.
book1D(
369 "Res_GlbSta_qOverpt",
"(q/p_{t})_{GLB} - (q/p_{t})_{STAfromGLB}",
pResBin * binFactor,
pResMin,
pResMax));
370 qOverptResolution[1]->setAxisTitle(
"GeV^{-1}");
371 qOverptResolution.push_back(ibooker.
book1D(
372 "Res_TkSta_qOverpt",
"(q/p_{t})_{TKfromGLB} - (q/p_{t})_{STAfromGLB}",
pResBin * binFactor,
pResMin,
pResMax));
373 qOverptResolution[2]->setAxisTitle(
"GeV^{-1}");
374 qOverptPull = ibooker.
book1D(
"Pull_TkSta_qOverpt",
"(q/pt)_{TKfromGLB} - (q/pt)_{STAfromGLB} / error", 100, -10, 10);
376 oneOverptResolution.push_back(ibooker.
book1D(
"Res_TkGlb_oneOverpt",
377 "(1/p_{t})_{TKfromGLB} - (1/p_{t})_{GLB}",
382 oneOverptResolution.push_back(ibooker.
book1D(
383 "Res_GlbSta_oneOverpt",
"(1/p_{t})_{GLB} - (1/p_{t})_{STAfromGLB}",
pResBin * binFactor,
pResMin,
pResMax));
384 oneOverptResolution[1]->setAxisTitle(
"GeV^{-1}");
385 oneOverptResolution.push_back(ibooker.
book1D(
386 "Res_TkSta_oneOverpt",
"(1/p_{t})_{TKfromGLB} - (1/p_{t})_{STAfromGLB}",
pResBin * binFactor,
pResMin,
pResMax));
387 oneOverptResolution[2]->setAxisTitle(
"GeV^{-1}");
388 oneOverptResolution.push_back(ibooker.
book2D(
"ResVsEta_TkGlb_oneOverpt",
389 "(#eta_{TKfromGLB} - #eta_{GLB}) vs (1/p_{t})_{GLB}",
396 oneOverptResolution[3]->setAxisTitle(
"GeV^{-1}", 2);
397 oneOverptResolution.push_back(ibooker.
book2D(
"ResVsEta_GlbSta_oneOverpt",
398 "(#eta_{GLB} - #eta_{STAfromGLB} vs (1/p_{t})_{GLB}",
405 oneOverptResolution[4]->setAxisTitle(
"GeV^{-1}", 2);
406 oneOverptResolution.push_back(ibooker.
book2D(
"ResVsEta_TkSta_oneOverpt",
407 "(#eta_{TKfromGLB} - #eta_{STAfromGLB}) vs (1/p_{t})_{TKfromGLB}",
414 oneOverptResolution[5]->setAxisTitle(
"GeV^{-1}", 2);
415 oneOverptResolution.push_back(ibooker.
book2D(
"ResVsPhi_TkGlb_oneOverpt",
416 "(#phi_{TKfromGLB} - #phi_{GLB}) vs (1/p_{t})_{GLB}",
423 oneOverptResolution[6]->setAxisTitle(
"rad", 1);
424 oneOverptResolution[6]->setAxisTitle(
"GeV^{-1}", 2);
425 oneOverptResolution.push_back(ibooker.
book2D(
"ResVsPhi_GlbSta_oneOverpt",
426 "(#phi_{GLB} - #phi_{STAfromGLB} vs (1/p_{t})_{GLB}",
433 oneOverptResolution[7]->setAxisTitle(
"rad", 1);
434 oneOverptResolution[7]->setAxisTitle(
"GeV^{-1}", 2);
435 oneOverptResolution.push_back(ibooker.
book2D(
"ResVsPhi_TkSta_oneOverpt",
436 "(#phi_{TKfromGLB} - #phi_{STAfromGLB}) vs (1/p_{t})_{TKfromGLB}",
443 oneOverptResolution[8]->setAxisTitle(
"rad", 1);
444 oneOverptResolution[8]->setAxisTitle(
"GeV^{-1}", 2);
445 oneOverptResolution.push_back(ibooker.
book2D(
"ResVsPt_TkGlb_oneOverpt",
446 "((1/p_{t})_{TKfromGLB} - (1/p_{t})_{GLB}) vs (1/p_{t})_{GLB}",
453 oneOverptResolution[9]->setAxisTitle(
"GeV^{-1}", 1);
454 oneOverptResolution[9]->setAxisTitle(
"GeV^{-1}", 2);
455 oneOverptResolution.push_back(ibooker.
book2D(
"ResVsPt_GlbSta_oneOverpt",
456 "((1/p_{t})_{GLB} - (1/p_{t})_{STAfromGLB} vs (1/p_{t})_{GLB}",
463 oneOverptResolution[10]->setAxisTitle(
"GeV^{-1}", 1);
464 oneOverptResolution[10]->setAxisTitle(
"GeV^{-1}", 2);
465 oneOverptResolution.push_back(
466 ibooker.
book2D(
"ResVsPt_TkSta_oneOverpt",
467 "((1/p_{t})_{TKfromGLB} - (1/p_{t})_{STAfromGLB}) vs (1/p_{t})_{TKfromGLB}",
474 oneOverptResolution[11]->setAxisTitle(
"GeV^{-1}", 1);
475 oneOverptResolution[11]->setAxisTitle(
"GeV^{-1}", 2);
477 ibooker.
book1D(
"Pull_TkSta_oneOverpt",
"(1/pt)_{TKfromGLB} - (1/pt)_{STAfromGLB} / error", 100, -10, 10);
481 phiVsetaGlbTrack.push_back(ibooker.
book2D(
483 phiVsetaGlbTrack.push_back(ibooker.
book2D(
485 phiVsetaGlbTrack.push_back(ibooker.
book2D(
488 phiVsetaGlbTrack_badlumi.push_back(ibooker.
book2D(
490 phiVsetaGlbTrack_badlumi.push_back(ibooker.
book2D(histname +
"Tk_phiVSeta_badlumi",
491 "#phi vs #eta (TKfromGLB)",
498 phiVsetaGlbTrack_badlumi.push_back(ibooker.
book2D(histname +
"Sta_phiVseta_badlumi",
499 "#phi vs #eta (STAfromGLB)",
509 rhAnalysis.push_back(ibooker.
book1D(
"StaRh_Frac_inGlb",
"recHits_{STAinGLB} / recHits_{GLB}",
rhBin,
rhMin,
rhMax));
510 rhAnalysis.push_back(ibooker.
book1D(
"TkRh_Frac_inGlb",
"recHits_{TKinGLB} / recHits_{GLB}",
rhBin,
rhMin,
rhMax));
511 rhAnalysis.push_back(
512 ibooker.
book1D(
"StaRh_inGlb_Div_RhAssoSta",
"recHits_{STAinGLB} / recHits_{STAfromGLB}",
rhBin,
rhMin,
rhMax));
513 rhAnalysis.push_back(
514 ibooker.
book1D(
"TkRh_inGlb_Div_RhAssoTk",
"recHits_{TKinGLB} / recHits_{TKfromGLB}",
rhBin,
rhMin,
rhMax));
515 rhAnalysis.push_back(ibooker.
book1D(
516 "GlbRh_Div_RhAssoStaTk",
"recHits_{GLB} / (recHits_{TKfromGLB}+recHits_{STAfromGLB})",
rhBin,
rhMin,
rhMax));
517 rhAnalysis.push_back(ibooker.
book1D(
"invalidRh_Frac_inTk",
"Invalid recHits / rechits_{GLB}",
rhBin,
rhMin,
rhMax));
521 muVStkSytemRotation.push_back(ibooker.
book2D(
522 "muVStkSytemRotation_posMu",
"pT_{TK} / pT_{GLB} vs pT_{GLB} for #mu^{+}", 50, 0, 200, 100, 0.8, 1.2));
523 muVStkSytemRotation.push_back(ibooker.
book2D(
524 "muVStkSytemRotation_negMu",
"pT_{TK} / pT_{GLB} vs pT_{GLB} for #mu^{-}", 50, 0, 200, 100, 0.8, 1.2));
528 float p1 = 0,
p2 = 0, p1e = 1, p2e = 1;
532 p1e =
t1->etaError();
534 p2e =
t2->etaError();
535 }
else if (par ==
"theta") {
537 p1e =
t1->thetaError();
539 p2e =
t2->thetaError();
540 }
else if (par ==
"phi") {
542 p1e =
t1->phiError();
544 p2e =
t2->phiError();
545 }
else if (par ==
"qOverp") {
546 p1 =
t1->charge() /
t1->p();
547 p1e =
t1->qoverpError();
548 p2 =
t2->charge() /
t2->p();
549 p2e =
t2->qoverpError();
550 }
else if (par ==
"oneOverp") {
552 p1e =
t1->qoverpError();
554 p2e =
t2->qoverpError();
555 }
else if (par ==
"qOverpt") {
556 p1 =
t1->charge() /
t1->pt();
557 p1e =
t1->ptError() *
p1 *
p1;
558 p2 =
t2->charge() /
t2->pt();
559 p2e =
t2->ptError() *
p2 *
p2;
560 }
else if (par ==
"oneOverpt") {
562 p1e =
t1->ptError() *
p1 *
p1;
564 p2e =
t2->ptError() *
p2 *
p2;
568 if (p1e != 0 || p2e != 0)
569 pull =
res /
sqrt(p1e * p1e + p2e * p2e);
587 edm::LogInfo(
"MuonRecoAnalyzer") <<
"Error: Can't get the beamspot" << endl;
592 edm::LogInfo(
"MuonRecoAnalyzer") <<
"Error: Can't get the vertex collection" << endl;
599 bool fillBadLumi =
false;
600 if (
iEvent.getByToken(dcsStatusCollection_, dcsStatus) && dcsStatus.
isValid()) {
601 for (
auto const& dcsStatusItr : *dcsStatus) {
652 float res = 0, pull = 0;
653 if (!
muons.isValid())
669 pvIndex = getPv(iTrack.
index(), &(*vertex));
671 refPoint =
vertex->at(pvIndex).position();
676 edm::LogInfo(
"MuonRecoAnalyzer") <<
"ERROR: No beam sport found!" << endl;
680 ptSoftMuonMVA->Fill(iTrack->eta());
681 deltaRSoftMuonMVA->Fill(getDeltaR(*iTrack, *oTrack));
682 gNchi2SoftMuonMVA->Fill(gTrack->normalizedChi2());
684 mNuStationsSoftMuonMVA->Fill(
muon->numberOfMatchedStations());
686 dxyRefSoftMuonMVA->Fill(iTrack->dxy(refPoint));
687 dzRefSoftMuonMVA->Fill(iTrack->dz(refPoint));
691 innerChi2SoftMuonMVA->Fill(iTrack->normalizedChi2());
692 outerChi2SoftMuonMVA->Fill(oTrack->normalizedChi2());
693 iValFracSoftMuonMVA->Fill(iTrack->validFraction());
699 kinkFinderSoftMuonMVA->Fill(muonQuality.
trkKink);
701 glbKinkFinderSoftMuonMVA->Fill(muonQuality.
glbKink);
702 glbKinkFinderLogSoftMuonMVA->Fill(TMath::Log(2 + muonQuality.
glbKink));
703 staRelChi2SoftMuonMVA->Fill(muonQuality.
staRelChi2);
705 trkRelChi2SoftMuonMVA->Fill(muonQuality.
trkRelChi2);
708 timeAtIpInOutSoftMuonMVA->Fill(
muon->time().timeAtIpInOut);
709 timeAtIpInOutErrSoftMuonMVA->Fill(
muon->time().timeAtIpInOutErr);
711 QprodSoftMuonMVA->Fill((iTrack->charge() * oTrack->charge()));
714 if (
muon->isGlobalMuon()) {
715 LogTrace(
metname) <<
"[MuonRecoAnalyzer] The mu is global - filling the histos";
716 if (
muon->isTrackerMuon() &&
muon->isStandAloneMuon())
718 if (!(
muon->isTrackerMuon()) &&
muon->isStandAloneMuon())
720 if (!
muon->isStandAloneMuon())
721 LogTrace(
metname) <<
"[MuonRecoAnalyzer] ERROR: the mu is global but not standalone!";
729 etaGlbTrack[0]->Fill(recoCombinedGlbTrack->eta());
730 etaGlbTrack[1]->Fill(recoTkGlbTrack->eta());
731 etaGlbTrack[2]->Fill(recoStaGlbTrack->eta());
733 phiVsetaGlbTrack[0]->Fill(recoCombinedGlbTrack->eta(), recoCombinedGlbTrack->phi());
734 phiVsetaGlbTrack[1]->Fill(recoTkGlbTrack->eta(), recoTkGlbTrack->phi());
735 phiVsetaGlbTrack[2]->Fill(recoStaGlbTrack->eta(), recoStaGlbTrack->phi());
738 phiVsetaGlbTrack_badlumi[0]->Fill(recoCombinedGlbTrack->eta(), recoCombinedGlbTrack->phi());
739 phiVsetaGlbTrack_badlumi[1]->Fill(recoTkGlbTrack->eta(), recoTkGlbTrack->phi());
740 phiVsetaGlbTrack_badlumi[2]->Fill(recoStaGlbTrack->eta(), recoStaGlbTrack->phi());
743 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"eta",
res, pull);
745 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"eta",
res, pull);
747 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"eta",
res, pull);
750 etaResolution[3]->Fill(recoCombinedGlbTrack->eta(), recoTkGlbTrack->eta() - recoCombinedGlbTrack->eta());
751 etaResolution[4]->Fill(recoCombinedGlbTrack->eta(), -recoStaGlbTrack->eta() + recoCombinedGlbTrack->eta());
752 etaResolution[5]->Fill(recoCombinedGlbTrack->eta(), recoTkGlbTrack->eta() - recoStaGlbTrack->eta());
754 thetaGlbTrack[0]->Fill(recoCombinedGlbTrack->theta());
755 thetaGlbTrack[1]->Fill(recoTkGlbTrack->theta());
756 thetaGlbTrack[2]->Fill(recoStaGlbTrack->theta());
757 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"theta",
res, pull);
758 thetaResolution[0]->Fill(
res);
759 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"theta",
res, pull);
760 thetaResolution[1]->Fill(
res);
762 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"theta",
res, pull);
763 thetaResolution[2]->Fill(
res);
764 thetaPull->Fill(pull);
765 thetaResolution[3]->Fill(recoCombinedGlbTrack->theta(), recoTkGlbTrack->theta() - recoCombinedGlbTrack->theta());
766 thetaResolution[4]->Fill(recoCombinedGlbTrack->theta(),
767 -recoStaGlbTrack->theta() + recoCombinedGlbTrack->theta());
768 thetaResolution[5]->Fill(recoCombinedGlbTrack->theta(), recoTkGlbTrack->theta() - recoStaGlbTrack->theta());
770 phiGlbTrack[0]->Fill(recoCombinedGlbTrack->phi());
771 phiGlbTrack[1]->Fill(recoTkGlbTrack->phi());
772 phiGlbTrack[2]->Fill(recoStaGlbTrack->phi());
773 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"phi",
res, pull);
775 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"phi",
res, pull);
777 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"phi",
res, pull);
780 phiResolution[3]->Fill(recoCombinedGlbTrack->phi(), recoTkGlbTrack->phi() - recoCombinedGlbTrack->phi());
781 phiResolution[4]->Fill(recoCombinedGlbTrack->phi(), -recoStaGlbTrack->phi() + recoCombinedGlbTrack->phi());
782 phiResolution[5]->Fill(recoCombinedGlbTrack->phi(), recoTkGlbTrack->phi() - recoStaGlbTrack->phi());
784 chi2OvDFGlbTrack[0]->Fill(recoCombinedGlbTrack->normalizedChi2());
785 chi2OvDFGlbTrack[1]->Fill(recoTkGlbTrack->normalizedChi2());
786 chi2OvDFGlbTrack[2]->Fill(recoStaGlbTrack->normalizedChi2());
790 probchi2GlbTrack[0]->Fill(TMath::Prob(recoCombinedGlbTrack->chi2(), recoCombinedGlbTrack->ndof()));
791 probchi2GlbTrack[1]->Fill(TMath::Prob(recoTkGlbTrack->chi2(), recoTkGlbTrack->ndof()));
792 probchi2GlbTrack[2]->Fill(TMath::Prob(recoStaGlbTrack->chi2(), recoStaGlbTrack->ndof()));
796 pGlbTrack[0]->Fill(recoCombinedGlbTrack->p());
797 pGlbTrack[1]->Fill(recoTkGlbTrack->p());
798 pGlbTrack[2]->Fill(recoStaGlbTrack->p());
800 ptGlbTrack[0]->Fill(recoCombinedGlbTrack->pt());
801 ptGlbTrack[1]->Fill(recoTkGlbTrack->pt());
802 ptGlbTrack[2]->Fill(recoStaGlbTrack->pt());
804 qGlbTrack[0]->Fill(recoCombinedGlbTrack->charge());
805 qGlbTrack[1]->Fill(recoTkGlbTrack->charge());
806 qGlbTrack[2]->Fill(recoStaGlbTrack->charge());
807 if (recoCombinedGlbTrack->charge() == recoStaGlbTrack->charge())
808 qGlbTrack[3]->
Fill(1);
810 qGlbTrack[3]->Fill(2);
811 if (recoCombinedGlbTrack->charge() == recoTkGlbTrack->charge())
812 qGlbTrack[3]->
Fill(3);
814 qGlbTrack[3]->Fill(4);
815 if (recoStaGlbTrack->charge() == recoTkGlbTrack->charge())
816 qGlbTrack[3]->
Fill(5);
818 qGlbTrack[3]->Fill(6);
819 if (recoCombinedGlbTrack->charge() != recoStaGlbTrack->charge() &&
820 recoCombinedGlbTrack->charge() != recoTkGlbTrack->charge())
821 qGlbTrack[3]->
Fill(7);
822 if (recoCombinedGlbTrack->charge() == recoStaGlbTrack->charge() &&
823 recoCombinedGlbTrack->charge() == recoTkGlbTrack->charge())
824 qGlbTrack[3]->
Fill(8);
826 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"qOverp",
res, pull);
827 qOverpResolution[0]->Fill(
res);
828 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"qOverp",
res, pull);
829 qOverpResolution[1]->Fill(
res);
830 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"qOverp",
res, pull);
831 qOverpResolution[2]->Fill(
res);
832 qOverpPull->Fill(pull);
834 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"oneOverp",
res, pull);
835 oneOverpResolution[0]->Fill(
res);
836 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"oneOverp",
res, pull);
837 oneOverpResolution[1]->Fill(
res);
838 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"oneOverp",
res, pull);
839 oneOverpResolution[2]->Fill(
res);
840 oneOverpPull->Fill(pull);
842 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"qOverpt",
res, pull);
843 qOverptResolution[0]->Fill(
res);
844 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"qOverpt",
res, pull);
845 qOverptResolution[1]->Fill(
res);
846 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"qOverpt",
res, pull);
847 qOverptResolution[2]->Fill(
res);
848 qOverptPull->Fill(pull);
850 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"oneOverpt",
res, pull);
851 oneOverptResolution[0]->Fill(
res);
852 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"oneOverpt",
res, pull);
853 oneOverptResolution[1]->Fill(
res);
854 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"oneOverpt",
res, pull);
855 oneOverptResolution[2]->Fill(
res);
856 oneOverptPull->Fill(pull);
864 double bestTrackPt = recoBestTrack->pt();
866 double tunePBestTrackPt = recoTunePBestTrack->pt();
868 double tunePBestTrackRes = (bestTrackPt - tunePBestTrackPt) / bestTrackPt;
870 tunePResolution->Fill(tunePBestTrackRes);
872 oneOverptResolution[3]->Fill(recoCombinedGlbTrack->eta(),
873 (1 / recoTkGlbTrack->pt()) - (1 / recoCombinedGlbTrack->pt()));
874 oneOverptResolution[4]->Fill(recoCombinedGlbTrack->eta(),
875 -(1 / recoStaGlbTrack->pt()) + (1 / recoCombinedGlbTrack->pt()));
876 oneOverptResolution[5]->Fill(recoCombinedGlbTrack->eta(),
877 (1 / recoTkGlbTrack->pt()) - (1 / recoStaGlbTrack->pt()));
878 oneOverptResolution[6]->Fill(recoCombinedGlbTrack->phi(),
879 (1 / recoTkGlbTrack->pt()) - (1 / recoCombinedGlbTrack->pt()));
880 oneOverptResolution[7]->Fill(recoCombinedGlbTrack->phi(),
881 -(1 / recoStaGlbTrack->pt()) + (1 / recoCombinedGlbTrack->pt()));
882 oneOverptResolution[8]->Fill(recoCombinedGlbTrack->phi(),
883 (1 / recoTkGlbTrack->pt()) - (1 / recoStaGlbTrack->pt()));
884 oneOverptResolution[9]->Fill(recoCombinedGlbTrack->pt(),
885 (1 / recoTkGlbTrack->pt()) - (1 / recoCombinedGlbTrack->pt()));
886 oneOverptResolution[10]->Fill(recoCombinedGlbTrack->pt(),
887 -(1 / recoStaGlbTrack->pt()) + (1 / recoCombinedGlbTrack->pt()));
888 oneOverptResolution[11]->Fill(recoCombinedGlbTrack->pt(),
889 (1 / recoTkGlbTrack->pt()) - (1 / recoStaGlbTrack->pt()));
893 double rhGlb = recoCombinedGlbTrack->found();
895 double rhGlb_StaProvenance = 0;
897 double rhGlb_TkProvenance = 0;
900 recHit != recoCombinedGlbTrack->recHitsEnd();
902 if ((*recHit)->isValid()) {
903 DetId id = (*recHit)->geographicalId();
905 rhGlb_StaProvenance++;
907 rhGlb_TkProvenance++;
911 double rhStaGlb = recoStaGlbTrack->recHitsSize();
913 double rhTkGlb = recoTkGlbTrack->found();
915 double rhTkGlb_notValid = recoTkGlbTrack->lost();
918 rhAnalysis[0]->Fill(rhGlb_StaProvenance / rhGlb);
919 rhAnalysis[1]->Fill(rhGlb_TkProvenance / rhGlb);
920 rhAnalysis[2]->Fill(rhGlb_StaProvenance / rhStaGlb);
921 rhAnalysis[3]->Fill(rhGlb_TkProvenance / rhTkGlb);
922 rhAnalysis[4]->Fill(rhGlb / (rhStaGlb + rhTkGlb));
923 rhAnalysis[5]->Fill(rhTkGlb_notValid / rhGlb);
926 if (recoCombinedGlbTrack->charge() > 0)
927 muVStkSytemRotation[0]->
Fill(recoCombinedGlbTrack->pt(), recoTkGlbTrack->pt() / recoCombinedGlbTrack->pt());
929 muVStkSytemRotation[1]->Fill(recoCombinedGlbTrack->pt(), recoTkGlbTrack->pt() / recoCombinedGlbTrack->pt());
932 if (
muon->isTrackerMuon() && !(
muon->isGlobalMuon())) {
933 LogTrace(
metname) <<
"[MuonRecoAnalyzer] The mu is tracker only - filling the histos";
934 if (
muon->isStandAloneMuon())
936 if (!(
muon->isStandAloneMuon()))
942 etaTrack->Fill(recoTrack->eta());
943 thetaTrack->Fill(recoTrack->theta());
944 phiTrack->Fill(recoTrack->phi());
945 chi2OvDFTrack->Fill(recoTrack->normalizedChi2());
946 probchi2Track->Fill(TMath::Prob(recoTrack->chi2(), recoTrack->ndof()));
947 pTrack->Fill(recoTrack->p());
948 ptTrack->Fill(recoTrack->pt());
949 qTrack->Fill(recoTrack->charge());
952 if (
muon->isStandAloneMuon() && !(
muon->isGlobalMuon())) {
953 LogTrace(
metname) <<
"[MuonRecoAnalyzer] The mu is STA only - filling the histos";
954 if (!(
muon->isTrackerMuon()))
960 etaStaTrack->Fill(recoStaTrack->eta());
961 thetaStaTrack->Fill(recoStaTrack->theta());
962 phiStaTrack->Fill(recoStaTrack->phi());
963 chi2OvDFStaTrack->Fill(recoStaTrack->normalizedChi2());
964 probchi2StaTrack->Fill(TMath::Prob(recoStaTrack->chi2(), recoStaTrack->ndof()));
965 pStaTrack->Fill(recoStaTrack->p());
966 ptStaTrack->Fill(recoStaTrack->pt());
967 qStaTrack->Fill(recoStaTrack->charge());
970 if (
muon->isCaloMuon() && !(
muon->isGlobalMuon()) && !(
muon->isTrackerMuon()) && !(
muon->isStandAloneMuon()))
978 if (
muon->isStandAloneMuon()) {
979 etaEfficiency[0]->Fill(recoStaGlbTrack->eta());
980 phiEfficiency[0]->Fill(recoStaGlbTrack->phi());
982 if (
muon->isStandAloneMuon() &&
muon->isGlobalMuon()) {
983 etaEfficiency[1]->Fill(recoStaGlbTrack->eta());
984 phiEfficiency[1]->Fill(recoStaGlbTrack->phi());
991 double dphi = acos(
cos(track1.
phi() - track2.
phi()));
992 double deta = track1.
eta() - track2.
eta();
993 return sqrt(dphi * dphi + deta * deta);
999 for (
unsigned int i = 0;
i < vc->size(); ++
i) {
1003 for (v1TrackIter = v1TrackBegin; v1TrackIter != v1TrackEnd; v1TrackIter++) {
1004 if (static_cast<unsigned int>(tidx) == v1TrackIter->key())