28 for (
unsigned int ww = 0; ww <
associators.size(); ww++) {
29 for (
unsigned int www = 0; www <
label.size(); www++) {
34 dirName += algo.
process() +
"_";
35 if (!algo.
label().empty())
36 dirName += algo.
label();
39 if (dirName.find(
"Tracks") < dirName.length()) {
40 dirName.replace(dirName.find(
"Tracks"), 6,
"Trks");
42 if (dirName.find(
"UpdatedAtVtx") < dirName.length()) {
43 dirName.replace(dirName.find(
"UpdatedAtVtx"), 12,
"UpdAtVtx");
46 if (assoc.find(
"tpToTkmuTrackAssociation") < assoc.length()) {
52 h_tracks.push_back(ibooker.
book1D(
"Ntracks",
"Number of reconstructed tracks", 100, -0.5, 99.5));
53 h_fakes.push_back(ibooker.
book1D(
"Nfakes",
"Number of fake reco tracks", 20, -0.5, 19.5));
54 h_charge.push_back(ibooker.
book1D(
"Ncharge",
"track charge", 3, -1.5, 1.5));
57 h_assoceta.push_back(ibooker.
book1D(
58 "num_assoSimToReco_eta",
"N of associated tracks (simToReco) vs eta",
nintEta,
minEta,
maxEta));
59 h_assoc2eta.push_back(ibooker.
book1D(
60 "num_assoRecoToSim_eta",
"N of associated (recoToSim) tracks vs eta",
nintEta,
minEta,
maxEta));
62 h_misideta.push_back(ibooker.
book1D(
"num_chargemisid_eta",
63 "N of associated (simToReco) tracks with charge misID vs eta",
74 h_misidpT.push_back(ibooker.
book1D(
75 "num_chargemisid_pT",
"N of associated (simToReco) tracks with charge misID vs pT",
nintPt,
minPt,
maxPt));
78 h_assocphi.push_back(ibooker.
book1D(
79 "num_assoSimToReco_phi",
"N of associated tracks (simToReco) vs phi",
nintPhi,
minPhi,
maxPhi));
80 h_assoc2phi.push_back(ibooker.
book1D(
81 "num_assoRecoToSim_phi",
"N of associated (recoToSim) tracks vs phi",
nintPhi,
minPhi,
maxPhi));
83 h_misidphi.push_back(ibooker.
book1D(
"num_chargemisid_phi",
84 "N of associated (simToReco) tracks with charge misID vs phi",
90 h_assochit.push_back(ibooker.
book1D(
92 h_assoc2hit.push_back(ibooker.
book1D(
96 h_misidhit.push_back(ibooker.
book1D(
"num_chargemisid_hit",
97 "N of associated (recoToSim) tracks with charge misID vs N RecHits",
103 h_assocdxy.push_back(ibooker.
book1D(
104 "num_assoSimToReco_dxy",
"N of associated tracks (simToReco) vs dxy",
nintDxy,
minDxy,
maxDxy));
105 h_assoc2dxy.push_back(ibooker.
book1D(
106 "num_assoRecoToSim_dxy",
"N of associated (recoToSim) tracks vs dxy",
nintDxy,
minDxy,
maxDxy));
108 h_misiddxy.push_back(ibooker.
book1D(
"num_chargemisid_dxy",
109 "N of associated (simToReco) tracks with charge misID vs dxy",
115 ibooker.
book1D(
"num_assoSimToReco_dz",
"N of associated tracks (simToReco) vs dz",
nintDz,
minDz,
maxDz));
116 h_assoc2dz.push_back(
117 ibooker.
book1D(
"num_assoRecoToSim_dz",
"N of associated (recoToSim) tracks vs dz",
nintDz,
minDz,
maxDz));
119 h_misiddz.push_back(ibooker.
book1D(
120 "num_chargemisid_dz",
"N of associated (simToReco) tracks with charge misID vs dz",
nintDz,
minDz,
maxDz));
122 h_assocRpos.push_back(ibooker.
book1D(
124 h_simulRpos.push_back(
127 h_assocZpos.push_back(ibooker.
book1D(
133 ibooker.
book1D(
"num_assoSimToReco_pu",
"N of associated tracks (simToReco) vs pu",
nintPU,
minPU,
maxPU));
134 h_assoc2pu.push_back(
135 ibooker.
book1D(
"num_assoRecoToSim_pu",
"N of associated (recoToSim) tracks vs pu",
nintPU,
minPU,
maxPU));
137 h_misidpu.push_back(ibooker.
book1D(
138 "num_chargemisid_pu",
"N of associated (simToReco) charge misIDed tracks vs pu",
nintPU,
minPU,
maxPU));
140 h_nchi2.push_back(ibooker.
book1D(
"chi2",
"Track normalized #chi^{2}", 80, 0., 20.));
141 h_nchi2_prob.push_back(ibooker.
book1D(
"chi2prob",
"Probability of track normalized #chi^{2}", 100, 0., 1.));
143 chi2_vs_nhits.push_back(
149 nhits_vs_eta.push_back(
151 nhits_vs_phi.push_back(
155 nDThits_vs_eta.push_back(ibooker.
book2D(
157 nCSChits_vs_eta.push_back(ibooker.
book2D(
159 nRPChits_vs_eta.push_back(ibooker.
book2D(
162 nGEMhits_vs_eta.push_back(ibooker.
book2D(
165 nME0hits_vs_eta.push_back(ibooker.
book2D(
170 nTRK_LayersWithMeas_vs_eta.push_back(ibooker.
book2D(
"nTRK_LayersWithMeas_vs_eta",
171 "# TRK Layers with measurement vs eta",
178 nPixel_LayersWithMeas_vs_eta.push_back(ibooker.
book2D(
"nPixel_LayersWithMeas_vs_eta",
179 "Number of Pixel Layers with measurement vs eta",
186 h_nmisslayers_inner.push_back(ibooker.
book1D(
188 h_nmisslayers_outer.push_back(ibooker.
book1D(
190 h_nlosthits.push_back(ibooker.
book1D(
"nlosthits",
"Number of lost hits per track", 6, -0.5, 5.5));
191 nlosthits_vs_eta.push_back(ibooker.
book2D(
192 "nlosthits_vs_eta",
"Number of lost hits per track vs eta",
nintEta,
minEta,
maxEta, 6, -0.5, 5.5));
195 ptres_vs_eta.push_back(ibooker.
book2D(
"ptres_vs_eta",
196 "p_{T} Relative Residual vs #eta",
203 ptres_vs_phi.push_back(ibooker.
book2D(
"ptres_vs_phi",
204 "p_{T} Relative Residual vs #phi",
211 ptres_vs_pt.push_back(ibooker.
book2D(
"ptres_vs_pt",
212 "p_{T} Relative Residual vs p_{T}",
219 h_ptpull.push_back(ibooker.
book1D(
"ptpull",
"p_{T} Pull", 100, -10., 10.));
220 ptpull_vs_eta.push_back(
222 ptpull_vs_phi.push_back(
224 h_qoverppull.push_back(ibooker.
book1D(
"qoverppull",
"q/p Pull", 100, -10., 10.));
227 etares_vs_eta.push_back(ibooker.
book2D(
"etares_vs_eta",
228 "#eta Residual vs #eta",
236 thetaCotres_vs_eta.push_back(ibooker.
book2D(
"thetaCotres_vs_eta",
237 "cot(#theta) Residual vs #eta",
244 thetaCotres_vs_pt.push_back(ibooker.
book2D(
"thetaCotres_vs_pt",
245 "cot(#theta) Residual vs p_{T}",
252 h_thetapull.push_back(ibooker.
book1D(
"thetapull",
"#theta Pull", 100, -10., 10.));
253 thetapull_vs_eta.push_back(
255 thetapull_vs_phi.push_back(
258 phires_vs_eta.push_back(ibooker.
book2D(
"phires_vs_eta",
259 "#phi Residual vs #eta",
266 phires_vs_pt.push_back(ibooker.
book2D(
268 phires_vs_phi.push_back(ibooker.
book2D(
"phires_vs_phi",
269 "#phi Residual vs #phi",
276 h_phipull.push_back(ibooker.
book1D(
"phipull",
"#phi Pull", 100, -10., 10.));
277 phipull_vs_eta.push_back(
279 phipull_vs_phi.push_back(
282 dxyres_vs_eta.push_back(ibooker.
book2D(
"dxyres_vs_eta",
283 "dxy Residual vs #eta",
290 dxyres_vs_pt.push_back(ibooker.
book2D(
292 h_dxypull.push_back(ibooker.
book1D(
"dxypull",
"dxy Pull", 100, -10., 10.));
293 dxypull_vs_eta.push_back(
296 dzres_vs_eta.push_back(ibooker.
book2D(
298 dzres_vs_pt.push_back(ibooker.
book2D(
300 h_dzpull.push_back(ibooker.
book1D(
"dzpull",
"dz Pull", 100, -10., 10.));
301 dzpull_vs_eta.push_back(
304 nRecHits_vs_nSimHits.push_back(ibooker.
book2D(
308 h_PurityVsQuality.push_back(
309 ibooker.
book2D(
"PurityVsQuality",
"Purity vs Quality (MABH)", 20, 0.01, 1.01, 20, 0.01, 1.01));
313 h_assochi2.push_back(ibooker.
book1D(
"assocChi2",
"track association #chi^{2}", 1000, 0., 100.));
314 h_assochi2_prob.push_back(ibooker.
book1D(
"assocChi2_prob",
"probability of association #chi^{2}", 100, 0., 1.));
315 }
else if (
associators[ww] ==
"trackAssociatorByHits") {
316 h_assocFraction.push_back(ibooker.
book1D(
"assocFraction",
"fraction of shared hits", 22, 0., 1.1));
317 h_assocSharedHit.push_back(ibooker.
book1D(
"assocSharedHit",
"number of shared hits", 41, -0.5, 40.5));
321 BinLogX(h_simulpT.back()->getTH1F());
322 BinLogX(h_assocpT.back()->getTH1F());
323 BinLogX(h_recopT.back()->getTH1F());
324 BinLogX(h_assoc2pT.back()->getTH1F());
325 BinLogX(h_misidpT.back()->getTH1F());
327 BinLogX(phires_vs_pt.back()->getTH2F());
328 BinLogX(thetaCotres_vs_pt.back()->getTH2F());
329 BinLogX(dxyres_vs_pt.back()->getTH2F());
330 BinLogX(dzres_vs_pt.back()->getTH2F());
331 BinLogX(ptres_vs_pt.back()->getTH2F());
339 using namespace reco;
341 edm::LogInfo(
"MuonTrackValidator") <<
"\n====================================================" 343 <<
"Analyzing new event" 345 <<
"====================================================\n" 349 int PU_NumInteractions(-1);
352 std::unique_ptr<ParametersDefinerForTP> Cosmic_parametersDefinerTP;
358 event.getByToken(pileupinfo_Token, puinfoH);
359 for (std::vector<PileupSummaryInfo>::const_iterator puInfoIt = puinfoH->begin(); puInfoIt != puinfoH->end();
361 if (puInfoIt->getBunchCrossing() == 0) {
362 PU_NumInteractions = puInfoIt->getPU_NumInteractions();
372 Cosmic_parametersDefinerTP = _Cosmic_parametersDefinerTP->
clone();
376 event.getByToken(_simHitTpMapTag, simHitsTPAssoc);
377 Cosmic_parametersDefinerTP->initEvent(simHitsTPAssoc);
378 cosmictpSelector.initEvent(simHitsTPAssoc);
385 event.getByToken(tp_effic_Token, TPCollectionHeff);
389 event.getByToken(tp_fake_Token, TPCollectionHfake);
392 event.getByToken(bsSrc_Token, recoBeamSpotHandle);
395 std::vector<const reco::TrackToTrackingParticleAssociator*>
associator;
400 associator.push_back(theAssociator.
product());
405 for (
unsigned int ww = 0; ww <
associators.size(); ww++) {
406 for (
unsigned int www = 0; www <
label.size(); www++) {
411 unsigned int trackCollectionSize = 0;
417 if (!event.
getByToken(track_Collection_Token[www], trackCollection) && ignoremissingtkcollection_) {
424 trackCollectionSize = trackCollection->size();
428 <<
"Analyzing " <<
label[www].process() <<
":" <<
label[www].label() <<
":" <<
label[www].instance()
431 LogTrace(
"MuonTrackValidator") <<
"Calling associateRecoToSim method" 433 recSimColl = associator[ww]->associateRecoToSim(trackCollection, TPCollectionHfake);
434 LogTrace(
"MuonTrackValidator") <<
"Calling associateSimToReco method" 436 simRecColl = associator[ww]->associateSimToReco(trackCollection, TPCollectionHeff);
439 <<
"Analyzing " <<
label[www].process() <<
":" <<
label[www].label() <<
":" <<
label[www].instance()
444 event.getByToken(simToRecoCollection_Token, simtorecoCollectionH);
445 simRecColl = *simtorecoCollectionH.
product();
448 event.getByToken(recoToSimCollection_Token, recotosimCollectionH);
449 recSimColl = *recotosimCollectionH.
product();
456 edm::LogVerbatim(
"MuonTrackValidator") <<
"\n# of TrackingParticles: " << tPCeff.size() <<
"\n";
460 bool TP_is_matched =
false;
461 bool isChargeOK =
true;
475 LogTrace(
"MuonTrackValidator") <<
"TrackingParticle " <<
i;
488 if (!cosmictpSelector(tpr, &bs, event, setup))
490 momentumTP = Cosmic_parametersDefinerTP->momentum(event, setup, tpr);
491 vertexTP = Cosmic_parametersDefinerTP->vertex(event, setup, tpr);
495 edm::LogVerbatim(
"MuonTrackValidator") <<
"--------------------Selected TrackingParticle #" << tpr.
key();
497 <<
"momentumTP: pt = " <<
sqrt(momentumTP.perp2()) <<
", pz = " << momentumTP.z()
498 <<
", \t vertexTP: radius = " <<
sqrt(vertexTP.perp2()) <<
", z = " << vertexTP.z() <<
"\n";
501 double TPeta = momentumTP.eta();
502 double xTPeta = getEta(TPeta);
503 double TPpt =
sqrt(momentumTP.perp2());
504 double xTPpt = getPt(TPpt);
505 double TPphi = momentumTP.phi();
506 double TPrpos =
sqrt(vertexTP.perp2());
507 double TPzpos = vertexTP.z();
512 nSimHits = tpr.
get()->numberOfHits();
514 nSimHits = tpr.
get()->numberOfHits() - tpr.
get()->numberOfTrackerHits();
516 nSimHits = tpr.
get()->numberOfTrackerHits();
518 edm::LogVerbatim(
"MuonTrackValidator") <<
"\t N simhits = " << nSimHits <<
"\n";
520 int assoc_recoTrack_NValidHits = 0;
521 if (simRecColl.
find(tpr) != simRecColl.
end()) {
522 auto const& rt = simRecColl[tpr];
526 <<
"-----------------------------associated Track #" << assoc_recoTrack.
key();
527 TP_is_matched =
true;
529 if (assoc_recoTrack->
charge() != tpr->charge())
531 quality = rt.begin()->second;
534 <<
"TrackingParticle #" << tpr.
key() <<
" with pt=" <<
sqrt(momentumTP.perp2())
535 <<
" associated with quality:" << quality <<
"\n";
539 <<
"TrackingParticle #" << tpr.
key() <<
" with pt,eta,phi: " <<
sqrt(momentumTP.perp2()) <<
" , " 540 << momentumTP.eta() <<
" , " << momentumTP.phi() <<
" , " 541 <<
" NOT associated to any reco::Track" 547 fillPlotNoFlow(h_simuleta[w], xTPeta);
549 fillPlotNoFlow(h_assoceta[w], xTPeta);
551 fillPlotNoFlow(h_misideta[w], xTPeta);
555 fillPlotNoFlow(h_simulphi[w], TPphi);
557 fillPlotNoFlow(h_assocphi[w], TPphi);
559 fillPlotNoFlow(h_misidphi[w], TPphi);
563 fillPlotNoFlow(h_simulpT[w], xTPpt);
565 fillPlotNoFlow(h_assocpT[w], xTPpt);
567 fillPlotNoFlow(h_misidpT[w], xTPpt);
571 fillPlotNoFlow(h_simuldxy[w], dxySim);
573 fillPlotNoFlow(h_assocdxy[w], dxySim);
575 fillPlotNoFlow(h_misiddxy[w], dxySim);
579 fillPlotNoFlow(h_simuldz[w], dzSim);
581 fillPlotNoFlow(h_assocdz[w], dzSim);
583 fillPlotNoFlow(h_misiddz[w], dzSim);
587 fillPlotNoFlow(h_simulRpos[w], TPrpos);
589 fillPlotNoFlow(h_assocRpos[w], TPrpos);
592 fillPlotNoFlow(h_simulZpos[w], TPzpos);
594 fillPlotNoFlow(h_assocZpos[w], TPzpos);
597 fillPlotNoFlow(h_simulhit[w], nSimHits);
599 fillPlotNoFlow(h_assochit[w], nSimHits);
600 nRecHits_vs_nSimHits[
w]->Fill(nSimHits, assoc_recoTrack_NValidHits);
607 fillPlotNoFlow(h_simulpu[w], PU_NumInteractions);
609 fillPlotNoFlow(h_assocpu[w], PU_NumInteractions);
611 fillPlotNoFlow(h_misidpu[w], PU_NumInteractions);
620 <<
"\n# of reco::Tracks with " <<
label[www].process() <<
":" <<
label[www].label() <<
":" 621 <<
label[www].instance() <<
": " << trackCollectionSize <<
"\n";
626 bool Track_is_matched =
false;
627 bool isChargeOK =
true;
631 std::vector<std::pair<TrackingParticleRef, double> > tp;
636 edm::LogVerbatim(
"MuonTrackValidator") <<
"----------------------------------------Track #" << track.
key();
638 if (recSimColl.
find(track) != recSimColl.
end()) {
639 tp = recSimColl[
track];
641 tpr = tp.begin()->first;
643 if (simRecColl.
find(tpr) != simRecColl.
end()) {
644 auto const& assoc_track_checkback = simRecColl[tpr].
begin()->first;
646 if (assoc_track_checkback.key() == track.
key()) {
648 <<
"------------------associated TrackingParticle #" << tpr.
key();
649 Track_is_matched =
true;
651 if (track->
charge() != tpr->charge())
653 double Purity = tp.begin()->second;
655 edm::LogVerbatim(
"MuonTrackValidator") <<
"reco::Track #" << track.
key() <<
" with pt=" << track->
pt()
656 <<
" associated with purity:" << Purity <<
"\n";
658 h_PurityVsQuality[
w]->Fill(Quality, Purity);
664 if (!Track_is_matched)
665 edm::LogVerbatim(
"MuonTrackValidator") <<
"reco::Track #" << track.
key() <<
" with pt=" << track->
pt()
666 <<
" NOT associated to any TrackingParticle" 671 if (recSimColl.
find(track) != recSimColl.
end()) {
672 tp = recSimColl[
track];
674 tpr = tp.begin()->first;
675 Track_is_matched =
true;
677 if (track->
charge() != tpr->charge())
679 edm::LogVerbatim(
"MuonTrackValidator") <<
"reco::Track #" << track.
key() <<
" with pt=" << track->
pt()
680 <<
" associated with quality:" << tp.begin()->second <<
"\n";
683 edm::LogVerbatim(
"MuonTrackValidator") <<
"reco::Track #" << track.
key() <<
" with pt=" << track->
pt()
684 <<
" NOT associated to any TrackingParticle" 691 edm::LogVerbatim(
"MuonTrackValidator") <<
"\t N valid rechits = " << nRecHits <<
"\n";
693 double etaRec = track->
eta();
694 double xetaRec = getEta(etaRec);
696 double ptRec = track->
pt();
697 double xptRec = getPt(ptRec);
699 double qoverpRec = track->
qoverp();
700 double phiRec = track->
phi();
701 double thetaRec = track->
theta();
706 double ptError = track->
ptError();
709 double dxyError = track->
dxyError();
710 double dzError = track->
dzError();
713 fillPlotNoFlow(h_recoeta[w], xetaRec);
714 if (Track_is_matched) {
715 fillPlotNoFlow(h_assoc2eta[w], xetaRec);
719 fillPlotNoFlow(h_recophi[w], phiRec);
720 if (Track_is_matched) {
721 fillPlotNoFlow(h_assoc2phi[w], phiRec);
725 fillPlotNoFlow(h_recopT[w], xptRec);
726 if (Track_is_matched) {
727 fillPlotNoFlow(h_assoc2pT[w], xptRec);
731 fillPlotNoFlow(h_recodxy[w], dxyRec);
732 if (Track_is_matched) {
733 fillPlotNoFlow(h_assoc2dxy[w], dxyRec);
737 fillPlotNoFlow(h_recodz[w], dzRec);
738 if (Track_is_matched) {
739 fillPlotNoFlow(h_assoc2dz[w], dzRec);
743 fillPlotNoFlow(h_recohit[w], nRecHits);
744 if (Track_is_matched) {
745 fillPlotNoFlow(h_assoc2hit[w], nRecHits);
748 fillPlotNoFlow(h_misidhit[w], nRecHits);
752 fillPlotNoFlow(h_recopu[w], PU_NumInteractions);
753 if (Track_is_matched) {
754 fillPlotNoFlow(h_assoc2pu[w], PU_NumInteractions);
768 momentumTP = Lhc_parametersDefinerTP->
momentum(event, setup, tpr);
769 vertexTP = Lhc_parametersDefinerTP->
vertex(event, setup, tpr);
773 if (!(Track_is_matched && cosmictpSelector(tpr, &bs, event, setup)))
776 momentumTP = Cosmic_parametersDefinerTP->momentum(event, setup, tpr);
777 vertexTP = Cosmic_parametersDefinerTP->vertex(event, setup, tpr);
783 double assocChi2 = -tp.begin()->second;
784 h_assochi2[www]->Fill(assocChi2);
785 h_assochi2_prob[www]->Fill(TMath::Prob((assocChi2)*5, 5));
786 }
else if (
associators[ww] ==
"trackAssociatorByHits") {
787 double fraction = tp.begin()->second;
788 h_assocFraction[www]->Fill(fraction);
789 h_assocSharedHit[www]->Fill(fraction * nRecHits);
792 h_charge[
w]->Fill(track->
charge());
795 h_nhits[
w]->Fill(nRecHits);
796 nhits_vs_eta[
w]->Fill(xetaRec, nRecHits);
797 nhits_vs_phi[
w]->Fill(phiRec, nRecHits);
820 h_nchi2_prob[
w]->Fill(TMath::Prob(track->
chi2(), (
int)track->
ndof()));
825 double ptSim =
sqrt(momentumTP.perp2());
826 double xptSim = getPt(ptSim);
827 double qoverpSim = tpr->charge() /
sqrt(momentumTP.x() * momentumTP.x() + momentumTP.y() * momentumTP.y() +
828 momentumTP.z() * momentumTP.z());
829 double etaSim = momentumTP.eta();
830 double thetaSim = momentumTP.theta();
831 double phiSim = momentumTP.phi();
835 double etares = etaRec - etaSim;
836 double ptRelRes = (ptRec - ptSim) / ptSim;
837 double ptPull = (ptRec - ptSim) / ptError;
838 double qoverpPull = (qoverpRec - qoverpSim) / qoverpError;
839 double thetaPull = (thetaRec - thetaSim) / thetaError;
840 double phiDiff = phiRec - phiSim;
843 phiDiff = phiDiff - 2. *
M_PI;
845 phiDiff = phiDiff + 2. *
M_PI;
847 double phiPull = phiDiff /
phiError;
848 double dxyPull = (dxyRec - dxySim) / dxyError;
849 double dzPull = (dzRec - dzSim) / dzError;
851 h_etaRes[
w]->Fill(etares);
852 etares_vs_eta[
w]->Fill(xetaRec, etares);
854 ptres_vs_eta[
w]->Fill(xetaRec, ptRelRes);
855 ptres_vs_pt[
w]->Fill(xptSim, ptRelRes);
856 ptres_vs_phi[
w]->Fill(phiRec, ptRelRes);
857 h_ptpull[
w]->Fill(ptPull);
858 ptpull_vs_eta[
w]->Fill(xetaRec, ptPull);
859 ptpull_vs_phi[
w]->Fill(phiRec, ptPull);
860 h_qoverppull[
w]->Fill(qoverpPull);
862 thetaCotres_vs_eta[
w]->Fill(xetaRec,
cos(thetaRec) /
sin(thetaRec) -
cos(thetaSim) /
sin(thetaSim));
863 thetaCotres_vs_pt[
w]->Fill(xptSim,
cos(thetaRec) /
sin(thetaRec) -
cos(thetaSim) /
sin(thetaSim));
864 h_thetapull[
w]->Fill(thetaPull);
865 thetapull_vs_eta[
w]->Fill(xetaRec, thetaPull);
866 thetapull_vs_phi[
w]->Fill(phiRec, thetaPull);
868 phires_vs_eta[
w]->Fill(xetaRec, phiDiff);
869 phires_vs_pt[
w]->Fill(xptSim, phiDiff);
870 phires_vs_phi[
w]->Fill(phiRec, phiDiff);
871 h_phipull[
w]->Fill(phiPull);
872 phipull_vs_eta[
w]->Fill(xetaRec, phiPull);
873 phipull_vs_phi[
w]->Fill(phiRec, phiPull);
875 dxyres_vs_eta[
w]->Fill(xetaRec, dxyRec - dxySim);
876 dxyres_vs_pt[
w]->Fill(xptSim, dxyRec - dxySim);
877 h_dxypull[
w]->Fill(dxyPull);
878 dxypull_vs_eta[
w]->Fill(xetaRec, dxyPull);
880 dzres_vs_eta[
w]->Fill(xetaRec, dzRec - dzSim);
881 dzres_vs_pt[
w]->Fill(xptSim, dzRec - dzSim);
882 h_dzpull[
w]->Fill(dzPull);
883 dzpull_vs_eta[
w]->Fill(xetaRec, dzPull);
885 double contrib_Qoverp = qoverpPull * qoverpPull / 5;
886 double contrib_dxy = dxyPull * dxyPull / 5;
887 double contrib_dz = dzPull * dzPull / 5;
888 double contrib_theta = thetaPull * thetaPull / 5;
889 double contrib_phi = phiPull * phiPull / 5;
890 double assoChi2 = contrib_Qoverp + contrib_dxy + contrib_dz + contrib_theta + contrib_phi;
892 edm::LogVerbatim(
"MuonTrackValidator") <<
"normalized Chi2 (track 5-dofs matching) = " << assoChi2 <<
"\n" 893 <<
"\t contrib_Qoverp = " << contrib_Qoverp <<
"\n" 894 <<
"\t contrib_theta = " << contrib_theta <<
"\n" 895 <<
"\t contrib_phi = " << contrib_phi <<
"\n" 896 <<
"\t contrib_dxy = " << contrib_dxy <<
"\n" 897 <<
"\t contrib_dz = " << contrib_dz <<
"\n";
900 <<
"etaRec = " << etaRec <<
"\n" 901 <<
"qoverpRec = " << qoverpRec <<
"\n" 902 <<
"thetaRec = " << thetaRec <<
"\n" 903 <<
"phiRec = " << phiRec <<
"\n" 904 <<
"dxyRec = " << dxyRec <<
"\n" 905 <<
"dzRec = " << dzRec <<
"\n" 908 <<
"qoverpError = " << qoverpError <<
"\n" 909 <<
"thetaError = " << thetaError <<
"\n" 910 <<
"phiError = " << phiError <<
"\n" 911 <<
"dxyError = " << dxyError <<
"\n" 912 <<
"dzError = " << dzError <<
"\n" 915 <<
"ptSim = " << ptSim <<
"\n" 916 <<
"etaSim = " << etaSim <<
"\n" 917 <<
"qoverpSim = " << qoverpSim <<
"\n" 918 <<
"thetaSim = " << thetaSim <<
"\n" 919 <<
"phiSim = " << phiSim <<
"\n" 920 <<
"dxySim = " << dxySim <<
"\n" 921 <<
"dzSim = " << dzSim <<
"\n";
924 h_tracks[
w]->Fill(at);
925 h_fakes[
w]->Fill(rT - at);
927 <<
"Total Associated (simToReco): " << ats <<
"\n" 928 <<
"Total Reconstructed: " << rT <<
"\n" 929 <<
"Total Associated (recoToSim): " << at <<
"\n" 930 <<
"Total Fakes: " << rT - at <<
"\n";
double qoverp() const
q / p
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX)
std::vector< TrackingParticle > TrackingParticleCollection
Vector momentum() const
spatial momentum vector
const_iterator end() const
last iterator over the map (read only)
double normalizedChi2() const
chi-squared divided by n.d.o.f. (or chi-squared * 1e6 if n.d.o.f. is zero)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
double theta() const
polar angle
double dxyError() const
error on dxy
void setCurrentFolder(std::string const &fullpath)
Sin< T >::type sin(const T &t)
const_iterator find(const key_type &k) const
find element with specified reference key
def replace(string, replacements)
double phi() const
azimuthal angle of momentum vector
unsigned short numberOfLostHits() const
number of cases where track crossed a layer without getting a hit.
key_type key() const
Accessor for product key.
int pixelLayersWithMeasurement() const
int trackerLayersWithMeasurement() const
int numberOfValidMuonCSCHits() const
int numberOfValidMuonRPCHits() const
math::XYZPointD Point
point in the space
BiDirectional_RecoToSim_association
double eta() const
pseudorapidity of momentum vector
double chi2() const
chi-squared of the fit
auto dz(const T_Vertex &vertex, const T_Momentum &momentum, const T_Point &point)
void post_insert()
post insert action
double ndof() const
number of degrees of freedom of the fit
double pt() const
track transverse momentum
Cos< T >::type cos(const T &t)
double ptError() const
error on Pt (set to 1000 TeV if charge==0 for safety)
double phiError() const
error on phi
Abs< T >::type abs(const T &t)
virtual TrackingParticle::Vector momentum(const edm::Event &iEvent, const edm::EventSetup &iSetup, const Charge ch, const Point &vtx, const LorentzVector &lv) const
unsigned short numberOfValidHits() const
number of valid hits found
T const * get() const
Returns C++ pointer to the item.
double qoverpError() const
error on signed transverse curvature
double dz() const
dz parameter (= dsz/cos(lambda)). This is the track z0 w.r.t (0,0,0) only if the refPoint is close to...
double dzError() const
error on dz
T const * product() const
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
int numberOfLostHits(HitCategory category) const
Point vertex() const
Parent vertex position.
void bookHistograms(DQMEDAnalyzer::DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Method called at the end of the event loop.
std::unique_ptr< ParametersDefinerForTP > clone() const override
int numberOfValidMuonGEMHits() const
auto dxy(const T_Vertex &vertex, const T_Momentum &momentum, const T_Point &point)
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
int numberOfValidMuonME0Hits() const
int numberOfValidMuonDTHits() const
void analyze(const edm::Event &, const edm::EventSetup &) override
Method called before the event loop.
Monte Carlo truth information used for tracking validation.
int charge() const
track electric charge
const Point & position() const
position
const_iterator begin() const
first iterator over the map (read only)
math::XYZVectorD Vector
point in the space
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
double thetaError() const
error on theta
virtual TrackingParticle::Point vertex(const edm::Event &iEvent, const edm::EventSetup &iSetup, const Charge ch, const Point &vtx, const LorentzVector &lv) const