28 for (
unsigned int www=0;www<
label.size();www++){
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(
"num_assoSimToReco_eta",
"N of associated tracks (simToReco) vs eta",
nintEta,
minEta,
maxEta) );
58 h_assoc2eta.push_back( ibooker.
book1D(
"num_assoRecoToSim_eta",
"N of associated (recoToSim) tracks vs eta",
nintEta,
minEta,
maxEta) );
60 h_misideta.push_back( ibooker.
book1D(
"num_chargemisid_eta",
"N of associated (simToReco) tracks with charge misID vs eta",
nintEta,
minEta,
maxEta) );
63 h_assocpT.push_back( ibooker.
book1D(
"num_assoSimToReco_pT",
"N of associated tracks (simToReco) vs pT",
nintPt,
minPt,
maxPt) );
64 h_assoc2pT.push_back( ibooker.
book1D(
"num_assoRecoToSim_pT",
"N of associated (recoToSim) tracks vs pT",
nintPt,
minPt,
maxPt) );
66 h_misidpT.push_back( ibooker.
book1D(
"num_chargemisid_pT",
"N of associated (simToReco) tracks with charge misID vs pT",
nintPt,
minPt,
maxPt) );
69 h_assocphi.push_back( ibooker.
book1D(
"num_assoSimToReco_phi",
"N of associated tracks (simToReco) vs phi",
nintPhi,
minPhi,
maxPhi) );
70 h_assoc2phi.push_back( ibooker.
book1D(
"num_assoRecoToSim_phi",
"N of associated (recoToSim) tracks vs phi",
nintPhi,
minPhi,
maxPhi) );
72 h_misidphi.push_back( ibooker.
book1D(
"num_chargemisid_phi",
"N of associated (simToReco) tracks with charge misID vs phi",
nintPhi,
minPhi,
maxPhi) );
75 h_assochit.push_back( ibooker.
book1D(
"num_assoSimToReco_hit",
"N of associated tracks (simToReco) vs N SimHits",
nintNHit,
minNHit,
maxNHit) );
76 h_assoc2hit.push_back( ibooker.
book1D(
"num_assoRecoToSim_hit",
"N of associated (recoToSim) tracks vs N Rechits",
nintNHit,
minNHit,
maxNHit) );
78 h_misidhit.push_back( ibooker.
book1D(
"num_chargemisid_hit",
"N of associated (recoToSim) tracks with charge misID vs N RecHits",
nintNHit,
minNHit,
maxNHit) );
81 h_assocdxy.push_back( ibooker.
book1D(
"num_assoSimToReco_dxy",
"N of associated tracks (simToReco) vs dxy",
nintDxy,
minDxy,
maxDxy) );
82 h_assoc2dxy.push_back( ibooker.
book1D(
"num_assoRecoToSim_dxy",
"N of associated (recoToSim) tracks vs dxy",
nintDxy,
minDxy,
maxDxy) );
84 h_misiddxy.push_back( ibooker.
book1D(
"num_chargemisid_dxy",
"N of associated (simToReco) tracks with charge misID vs dxy",
nintDxy,
minDxy,
maxDxy) );
86 h_assocdz.push_back( ibooker.
book1D(
"num_assoSimToReco_dz",
"N of associated tracks (simToReco) vs dz",
nintDz,
minDz,
maxDz) );
87 h_assoc2dz.push_back( ibooker.
book1D(
"num_assoRecoToSim_dz",
"N of associated (recoToSim) tracks vs dz",
nintDz,
minDz,
maxDz) );
89 h_misiddz.push_back( ibooker.
book1D(
"num_chargemisid_dz",
"N of associated (simToReco) tracks with charge misID vs dz",
nintDz,
minDz,
maxDz) );
91 h_assocRpos.push_back( ibooker.
book1D(
"num_assoSimToReco_Rpos",
"N of associated tracks (simToReco) vs Radius",
nintRpos,
minRpos,
maxRpos) );
98 h_assocpu.push_back( ibooker.
book1D(
"num_assoSimToReco_pu",
"N of associated tracks (simToReco) vs pu",
nintPU,
minPU,
maxPU) );
99 h_assoc2pu.push_back( ibooker.
book1D(
"num_assoRecoToSim_pu",
"N of associated (recoToSim) tracks vs pu",
nintPU,
minPU,
maxPU) );
101 h_misidpu.push_back( ibooker.
book1D(
"num_chargemisid_pu",
"N of associated (simToReco) charge misIDed tracks vs pu",
nintPU,
minPU,
maxPU) );
103 h_nchi2.push_back( ibooker.
book1D(
"chi2",
"Track normalized #chi^{2}", 80, 0., 20.) );
104 h_nchi2_prob.push_back( ibooker.
book1D(
"chi2prob",
"Probability of track normalized #chi^{2}",100,0.,1.) );
126 nTRK_LayersWithMeas_vs_eta.push_back(ibooker.
book2D(
"nTRK_LayersWithMeas_vs_eta",
"# TRK Layers with measurement vs eta",
128 nPixel_LayersWithMeas_vs_eta.push_back(ibooker.
book2D(
"nPixel_LayersWithMeas_vs_eta",
"Number of Pixel Layers with measurement vs eta",
132 h_nlosthits.push_back( ibooker.
book1D(
"nlosthits",
"Number of lost hits per track", 6,-0.5,5.5 ) );
133 nlosthits_vs_eta.push_back( ibooker.
book2D(
"nlosthits_vs_eta",
"Number of lost hits per track vs eta",
nintEta,
minEta,
maxEta,6,-0.5,5.5) );
136 ptres_vs_eta.push_back(ibooker.
book2D(
"ptres_vs_eta",
"p_{T} Relative Residual vs #eta",
138 ptres_vs_phi.push_back( ibooker.
book2D(
"ptres_vs_phi",
"p_{T} Relative Residual vs #phi",
140 ptres_vs_pt.push_back(ibooker.
book2D(
"ptres_vs_pt",
"p_{T} Relative Residual vs p_{T}",
142 h_ptpull.push_back( ibooker.
book1D(
"ptpull",
"p_{T} Pull", 100, -10., 10.) );
145 h_qoverppull.push_back( ibooker.
book1D(
"qoverppull",
"q/p Pull", 100, -10., 10.) );
148 etares_vs_eta.push_back( ibooker.
book2D(
"etares_vs_eta",
"#eta Residual vs #eta",
151 thetaCotres_vs_eta.push_back(ibooker.
book2D(
"thetaCotres_vs_eta",
"cot(#theta) Residual vs #eta",
153 thetaCotres_vs_pt.push_back(ibooker.
book2D(
"thetaCotres_vs_pt",
"cot(#theta) Residual vs p_{T}",
155 h_thetapull.push_back( ibooker.
book1D(
"thetapull",
"#theta Pull",100,-10.,10.) );
159 phires_vs_eta.push_back(ibooker.
book2D(
"phires_vs_eta",
"#phi Residual vs #eta",
161 phires_vs_pt.push_back(ibooker.
book2D(
"phires_vs_pt",
"#phi Residual vs p_{T}",
163 phires_vs_phi.push_back(ibooker.
book2D(
"phires_vs_phi",
"#phi Residual vs #phi",
165 h_phipull.push_back( ibooker.
book1D(
"phipull",
"#phi Pull",100,-10.,10.) );
169 dxyres_vs_eta.push_back(ibooker.
book2D(
"dxyres_vs_eta",
"dxy Residual vs #eta",
171 dxyres_vs_pt.push_back( ibooker.
book2D(
"dxyres_vs_pt",
"dxy Residual vs p_{T}",
173 h_dxypull.push_back( ibooker.
book1D(
"dxypull",
"dxy Pull",100,-10.,10.) );
176 dzres_vs_eta.push_back(ibooker.
book2D(
"dzres_vs_eta",
"dz Residual vs #eta",
178 dzres_vs_pt.push_back(ibooker.
book2D(
"dzres_vs_pt",
"dz Residual vs p_{T}",
180 h_dzpull.push_back( ibooker.
book1D(
"dzpull",
"dz Pull",100,-10.,10.) );
186 h_PurityVsQuality.push_back
187 (ibooker.
book2D(
"PurityVsQuality",
"Purity vs Quality (MABH)",20,0.01,1.01,20,0.01,1.01) );
191 h_assochi2.push_back( ibooker.
book1D(
"assocChi2",
"track association #chi^{2}",1000,0.,100.) );
192 h_assochi2_prob.push_back(ibooker.
book1D(
"assocChi2_prob",
"probability of association #chi^{2}",100,0.,1.));
193 }
else if (
associators[ww]==
"trackAssociatorByHits"){
194 h_assocFraction.push_back( ibooker.
book1D(
"assocFraction",
"fraction of shared hits",22,0.,1.1) );
195 h_assocSharedHit.push_back(ibooker.
book1D(
"assocSharedHit",
"number of shared hits",41,-0.5,40.5));
199 BinLogX(h_simulpT.back()->getTH1F());
200 BinLogX(h_assocpT.back()->getTH1F());
201 BinLogX(h_recopT.back()->getTH1F());
202 BinLogX(h_assoc2pT.back()->getTH1F());
203 BinLogX(h_misidpT.back()->getTH1F());
205 BinLogX(phires_vs_pt.back()->getTH2F());
206 BinLogX(thetaCotres_vs_pt.back()->getTH2F());
207 BinLogX(dxyres_vs_pt.back()->getTH2F());
208 BinLogX(dzres_vs_pt.back()->getTH2F());
209 BinLogX(ptres_vs_pt.back()->getTH2F());
218 using namespace reco;
220 edm::LogInfo(
"NewMuonTrackValidator") <<
"\n====================================================" <<
"\n" 221 <<
"Analyzing new event" <<
"\n" 222 <<
"====================================================\n" <<
"\n";
225 int PU_NumInteractions(-1);
228 std::unique_ptr<ParametersDefinerForTP> Cosmic_parametersDefinerTP;
234 event.getByToken(pileupinfo_Token,puinfoH);
235 for (std::vector<PileupSummaryInfo>::const_iterator puInfoIt = puinfoH->begin(); puInfoIt != puinfoH->end(); ++puInfoIt) {
236 if (puInfoIt->getBunchCrossing()==0) {
237 PU_NumInteractions = puInfoIt->getPU_NumInteractions();
248 Cosmic_parametersDefinerTP = _Cosmic_parametersDefinerTP->
clone();
252 event.getByToken(_simHitTpMapTag,simHitsTPAssoc);
253 Cosmic_parametersDefinerTP->initEvent(simHitsTPAssoc);
254 cosmictpSelector.initEvent(simHitsTPAssoc);
262 event.getByToken(tp_effic_Token,TPCollectionHeff);
266 event.getByToken(tp_fake_Token,TPCollectionHfake);
269 event.getByToken(bsSrc_Token,recoBeamSpotHandle);
272 std::vector<const reco::TrackToTrackingParticleAssociator*>
associator;
277 associator.push_back( theAssociator.
product() );
282 for (
unsigned int ww=0;ww<
associators.size();ww++) {
283 for (
unsigned int www=0;www<
label.size();www++) {
288 if(!event.
getByToken(track_Collection_Token[www], trackCollection) && ignoremissingtkcollection_)
continue;
298 <<
label[www].process()<<
":" 299 <<
label[www].label()<<
":" 300 <<
label[www].instance()<<
" with " 303 LogTrace(
"NewMuonTrackValidator") <<
"Calling associateRecoToSim method" <<
"\n";
306 recSimCollL =
std::move(associator[ww]->associateRecoToSim(trackCollection,
308 recSimCollP = &recSimCollL;
310 LogTrace(
"NewMuonTrackValidator") <<
"Calling associateSimToReco method" <<
"\n";
313 simRecCollL =
std::move(associator[ww]->associateSimToReco(trackCollection,
315 simRecCollP = &simRecCollL;
320 <<
label[www].process()<<
":" 321 <<
label[www].label()<<
":" 322 <<
label[www].instance()<<
" with " 328 event.getByToken(simToRecoCollection_Token,simtorecoCollectionH);
330 simRecCollP = simtorecoCollectionH.
product();
333 event.getByToken(recoToSimCollection_Token,recotosimCollectionH);
335 recSimCollP = recotosimCollectionH.
product();
344 edm::LogVerbatim(
"NewMuonTrackValidator") <<
"\n# of TrackingParticles: " << tPCeff.size() <<
"\n";
348 bool TP_is_matched =
false;
349 bool isChargeOK =
true;
364 LogTrace(
"NewMuonTrackValidator") <<
"TrackingParticle "<<
i;
377 if(! cosmictpSelector(tpr,&bs,event,setup))
continue;
378 momentumTP = Cosmic_parametersDefinerTP->momentum(event,setup,tpr);
379 vertexTP = Cosmic_parametersDefinerTP->vertex(event,setup,tpr);
383 edm::LogVerbatim(
"NewMuonTrackValidator") <<
"--------------------Selected TrackingParticle #"<<tpr.
key();
384 edm::LogVerbatim(
"NewMuonTrackValidator") <<
"momentumTP: pt = "<<
sqrt(momentumTP.perp2())<<
", pz = "<<momentumTP.z()
385 <<
", \t vertexTP: radius = "<<
sqrt(vertexTP.perp2())<<
", z = "<<vertexTP.z() <<
"\n";
388 double TPeta = momentumTP.eta();
389 double xTPeta =
getEta(TPeta);
390 double TPpt =
sqrt(momentumTP.perp2());
391 double xTPpt = getPt(TPpt);
392 double TPphi = momentumTP.phi();
393 double TPrpos =
sqrt(vertexTP.perp2());
394 double TPzpos = vertexTP.z();
399 nSimHits= tpr.
get()->numberOfHits();
402 nSimHits= tpr.
get()->numberOfHits() - tpr.
get()->numberOfTrackerHits();
405 nSimHits=tpr.
get()->numberOfTrackerHits();
407 edm::LogVerbatim(
"NewMuonTrackValidator") <<
"\t N simhits = "<< nSimHits<<
"\n";
409 int assoc_recoTrack_NValidHits = 0;
410 if(simRecColl.
find(tpr) != simRecColl.
end()) {
411 auto const & rt = simRecColl[tpr];
414 edm::LogVerbatim(
"NewMuonTrackValidator")<<
"-----------------------------associated Track #"<<assoc_recoTrack.
key();
415 TP_is_matched =
true;
417 if (assoc_recoTrack->
charge() != tpr->charge()) isChargeOK =
false;
418 quality = rt.begin()->second;
421 <<
" with pt=" <<
sqrt(momentumTP.perp2())
422 <<
" associated with quality:" << quality <<
"\n";
426 <<
"TrackingParticle #" << tpr.
key()
427 <<
" with pt,eta,phi: " 428 <<
sqrt(momentumTP.perp2()) <<
" , "<< momentumTP.eta() <<
" , "<< momentumTP.phi() <<
" , " 429 <<
" NOT associated to any reco::Track" <<
"\n";
433 fillPlotNoFlow(h_simuleta[w], xTPeta);
435 fillPlotNoFlow(h_assoceta[w], xTPeta);
436 if (!isChargeOK) fillPlotNoFlow(h_misideta[w], xTPeta);
440 fillPlotNoFlow(h_simulphi[w], TPphi);
442 fillPlotNoFlow(h_assocphi[w], TPphi);
443 if (!isChargeOK) fillPlotNoFlow(h_misidphi[w], TPphi);
447 fillPlotNoFlow(h_simulpT[w], xTPpt);
449 fillPlotNoFlow(h_assocpT[w], xTPpt);
450 if (!isChargeOK) fillPlotNoFlow(h_misidpT[w], xTPpt);
454 fillPlotNoFlow(h_simuldxy[w], dxySim);
456 fillPlotNoFlow(h_assocdxy[w], dxySim);
457 if (!isChargeOK) fillPlotNoFlow(h_misiddxy[w], dxySim);
461 fillPlotNoFlow(h_simuldz[w], dzSim);
463 fillPlotNoFlow(h_assocdz[w], dzSim);
464 if (!isChargeOK) fillPlotNoFlow(h_misiddz[w], dzSim);
468 fillPlotNoFlow(h_simulRpos[w], TPrpos);
469 if (TP_is_matched) fillPlotNoFlow(h_assocRpos[w], TPrpos);
472 fillPlotNoFlow(h_simulZpos[w], TPzpos);
473 if (TP_is_matched) fillPlotNoFlow(h_assocZpos[w], TPzpos);
476 fillPlotNoFlow(h_simulhit[w], nSimHits );
478 fillPlotNoFlow(h_assochit[w], nSimHits );
479 nRecHits_vs_nSimHits[
w]->Fill(nSimHits, assoc_recoTrack_NValidHits);
486 fillPlotNoFlow(h_simulpu[w], PU_NumInteractions);
488 fillPlotNoFlow(h_assocpu[w], PU_NumInteractions);
489 if (!isChargeOK) fillPlotNoFlow(h_misidpu[w], PU_NumInteractions);
498 <<
label[www].process()<<
":" 499 <<
label[www].label()<<
":" 500 <<
label[www].instance()
501 <<
": " << trackCollection->size() <<
"\n";
505 bool Track_is_matched =
false;
506 bool isChargeOK =
true;
510 std::vector<std::pair<TrackingParticleRef, double> > tp;
515 edm::LogVerbatim(
"NewMuonTrackValidator")<<
"----------------------------------------Track #"<< track.
key();
517 if(recSimColl.
find(track) != recSimColl.
end()) {
518 tp = recSimColl[
track];
519 if (tp.size() != 0) {
520 tpr = tp.begin()->first;
522 if(simRecColl.
find(tpr) != simRecColl.
end()) {
523 auto const & assoc_track_checkback = simRecColl[tpr].
begin()->first;
525 if ( assoc_track_checkback.key() == track.
key() ) {
526 edm::LogVerbatim(
"NewMuonTrackValidator")<<
"------------------associated TrackingParticle #"<<tpr.
key();
527 Track_is_matched =
true;
529 if (track->
charge() != tpr->charge()) isChargeOK =
false;
530 double Purity = tp.begin()->second;
532 edm::LogVerbatim(
"NewMuonTrackValidator") <<
"reco::Track #" << track.
key() <<
" with pt=" << track->
pt()
533 <<
" associated with purity:" << Purity <<
"\n";
534 if (
MABH) h_PurityVsQuality[
w]->Fill(Quality,Purity);
540 if (!Track_is_matched)
542 <<
"reco::Track #" << track.
key() <<
" with pt=" << track->
pt() <<
" NOT associated to any TrackingParticle" <<
"\n";
546 if(recSimColl.
find(track) != recSimColl.
end()){
547 tp = recSimColl[
track];
549 tpr = tp.begin()->first;
550 Track_is_matched =
true;
552 if (track->
charge() != tpr->charge()) isChargeOK =
false;
553 edm::LogVerbatim(
"NewMuonTrackValidator") <<
"reco::Track #" << track.
key() <<
" with pt=" << track->
pt()
554 <<
" associated with quality:" << tp.begin()->second <<
"\n";
557 edm::LogVerbatim(
"NewMuonTrackValidator") <<
"reco::Track #" << track.
key() <<
" with pt=" << track->
pt()
558 <<
" NOT associated to any TrackingParticle" <<
"\n";
564 edm::LogVerbatim(
"NewMuonTrackValidator") <<
"\t N valid rechits = "<< nRecHits <<
"\n";
566 double etaRec = track->
eta();
567 double xetaRec =
getEta(etaRec);
569 double ptRec = track->
pt();
570 double xptRec = getPt(ptRec);
572 double qoverpRec = track->
qoverp();
573 double phiRec = track->
phi();
574 double thetaRec = track->
theta();
579 double ptError = track->
ptError();
582 double dxyError = track->
dxyError();
583 double dzError = track->
dzError();
586 fillPlotNoFlow(h_recoeta[w], xetaRec);
587 if (Track_is_matched) {
588 fillPlotNoFlow(h_assoc2eta[w], xetaRec);
592 fillPlotNoFlow(h_recophi[w], phiRec);
593 if (Track_is_matched) {
594 fillPlotNoFlow(h_assoc2phi[w], phiRec);
598 fillPlotNoFlow(h_recopT[w], xptRec);
599 if (Track_is_matched) {
600 fillPlotNoFlow(h_assoc2pT[w], xptRec);
604 fillPlotNoFlow(h_recodxy[w], dxyRec);
605 if (Track_is_matched) {
606 fillPlotNoFlow(h_assoc2dxy[w], dxyRec);
610 fillPlotNoFlow(h_recodz[w], dzRec);
611 if (Track_is_matched) {
612 fillPlotNoFlow(h_assoc2dz[w], dzRec);
616 fillPlotNoFlow(h_recohit[w], nRecHits);
617 if (Track_is_matched) {
618 fillPlotNoFlow(h_assoc2hit[w], nRecHits);
620 if (!isChargeOK) fillPlotNoFlow(h_misidhit[w], nRecHits);
624 fillPlotNoFlow(h_recopu[w], PU_NumInteractions);
625 if (Track_is_matched) {
626 fillPlotNoFlow(h_assoc2pu[w], PU_NumInteractions);
637 if (! (Track_is_matched &&
tpSelector(*tpp)) )
continue;
639 momentumTP = Lhc_parametersDefinerTP->
momentum(event,setup,tpr) ;
640 vertexTP = Lhc_parametersDefinerTP->
vertex(event,setup,tpr);
645 if (! (Track_is_matched && cosmictpSelector(tpr,&bs,event,setup)) )
continue;
647 momentumTP = Cosmic_parametersDefinerTP->momentum(event,setup,tpr) ;
648 vertexTP = Cosmic_parametersDefinerTP->vertex(event,setup,tpr);
654 double assocChi2 = -tp.begin()->second;
655 h_assochi2[www]->Fill(assocChi2);
656 h_assochi2_prob[www]->Fill(TMath::Prob((assocChi2)*5,5));
658 else if (
associators[ww]==
"trackAssociatorByHits"){
659 double fraction = tp.begin()->second;
660 h_assocFraction[www]->Fill(fraction);
661 h_assocSharedHit[www]->Fill(fraction*nRecHits);
664 h_charge[
w]->Fill(track->
charge());
667 h_nhits[
w]->Fill(nRecHits);
668 nhits_vs_eta[
w]->Fill(xetaRec, nRecHits);
669 nhits_vs_phi[
w]->Fill(phiRec, nRecHits);
690 h_nchi2_prob[
w]->Fill(TMath::Prob(track->
chi2(),(
int)track->
ndof()));
695 double ptSim =
sqrt(momentumTP.perp2());
696 double xptSim = getPt(ptSim);
697 double qoverpSim = tpr->charge() /
698 sqrt(momentumTP.x()*momentumTP.x()+momentumTP.y()*momentumTP.y()+momentumTP.z()*momentumTP.z());
699 double etaSim = momentumTP.eta();
700 double thetaSim = momentumTP.theta();
701 double phiSim = momentumTP.phi();
705 double etares = etaRec - etaSim;
706 double ptRelRes = (ptRec - ptSim) / ptSim;
707 double ptPull = (ptRec - ptSim) / ptError;
708 double qoverpPull = (qoverpRec-qoverpSim) / qoverpError;
709 double thetaPull = (thetaRec - thetaSim) / thetaError;
710 double phiDiff = phiRec - phiSim;
712 if (phiDiff >0.) phiDiff = phiDiff - 2.*
M_PI;
713 else phiDiff = phiDiff + 2.*
M_PI;
715 double phiPull = phiDiff /
phiError;
716 double dxyPull = (dxyRec-dxySim) / dxyError;
717 double dzPull = (dzRec-dzSim) / dzError;
719 h_etaRes[
w]->Fill(etares);
720 etares_vs_eta[
w]->Fill(xetaRec, etares);
722 ptres_vs_eta[
w]->Fill(xetaRec,ptRelRes);
723 ptres_vs_pt[
w]->Fill(xptSim,ptRelRes);
724 ptres_vs_phi[
w]->Fill(phiRec,ptRelRes);
725 h_ptpull[
w]->Fill(ptPull);
726 ptpull_vs_eta[
w]->Fill(xetaRec,ptPull);
727 ptpull_vs_phi[
w]->Fill(phiRec,ptPull);
728 h_qoverppull[
w]->Fill(qoverpPull);
730 thetaCotres_vs_eta[
w]->Fill(xetaRec,
cos(thetaRec)/
sin(thetaRec) -
cos(thetaSim)/
sin(thetaSim));
731 thetaCotres_vs_pt[
w]->Fill(xptSim,
cos(thetaRec)/
sin(thetaRec) -
cos(thetaSim)/
sin(thetaSim));
732 h_thetapull[
w]->Fill(thetaPull);
733 thetapull_vs_eta[
w]->Fill(xetaRec,thetaPull);
734 thetapull_vs_phi[
w]->Fill(phiRec,thetaPull);
736 phires_vs_eta[
w]->Fill(xetaRec,phiDiff);
737 phires_vs_pt[
w]->Fill(xptSim,phiDiff);
738 phires_vs_phi[
w]->Fill(phiRec,phiDiff);
739 h_phipull[
w]->Fill(phiPull);
740 phipull_vs_eta[
w]->Fill(xetaRec,phiPull);
741 phipull_vs_phi[
w]->Fill(phiRec,phiPull);
743 dxyres_vs_eta[
w]->Fill(xetaRec,dxyRec-dxySim);
744 dxyres_vs_pt[
w]->Fill(xptSim,dxyRec-dxySim);
745 h_dxypull[
w]->Fill(dxyPull);
746 dxypull_vs_eta[
w]->Fill(xetaRec,dxyPull);
748 dzres_vs_eta[
w]->Fill(xetaRec,dzRec-dzSim);
749 dzres_vs_pt[
w]->Fill(xptSim,dzRec-dzSim);
750 h_dzpull[
w]->Fill(dzPull);
751 dzpull_vs_eta[
w]->Fill(xetaRec,dzPull);
753 double contrib_Qoverp = qoverpPull*qoverpPull/5;
754 double contrib_dxy = dxyPull*dxyPull/5;
755 double contrib_dz = dzPull*dzPull/5;
756 double contrib_theta = thetaPull*thetaPull/5;
757 double contrib_phi = phiPull*phiPull/5;
758 double assoChi2 = contrib_Qoverp+contrib_dxy+contrib_dz+contrib_theta+contrib_phi;
760 edm::LogVerbatim(
"NewMuonTrackValidator") <<
"normalized Chi2 (track 5-dofs matching) = "<<assoChi2 <<
"\n" 761 <<
"\t contrib_Qoverp = " << contrib_Qoverp <<
"\n" 762 <<
"\t contrib_theta = " << contrib_theta <<
"\n" 763 <<
"\t contrib_phi = " << contrib_phi <<
"\n" 764 <<
"\t contrib_dxy = " << contrib_dxy <<
"\n" 765 <<
"\t contrib_dz = " << contrib_dz <<
"\n";
768 <<
"etaRec = " << etaRec <<
"\n" 769 <<
"qoverpRec = " << qoverpRec <<
"\n" 770 <<
"thetaRec = " << thetaRec <<
"\n" 771 <<
"phiRec = " << phiRec <<
"\n" 772 <<
"dxyRec = " << dxyRec <<
"\n" 773 <<
"dzRec = " << dzRec <<
"\n" 775 <<
"qoverpError = " << qoverpError <<
"\n" 776 <<
"thetaError = " << thetaError <<
"\n" 777 <<
"phiError = " << phiError <<
"\n" 778 <<
"dxyError = " << dxyError <<
"\n" 779 <<
"dzError = " << dzError <<
"\n" 781 <<
"ptSim = " << ptSim <<
"\n" 782 <<
"etaSim = " << etaSim <<
"\n" 783 <<
"qoverpSim = " << qoverpSim <<
"\n" 784 <<
"thetaSim = " << thetaSim <<
"\n" 785 <<
"phiSim = " << phiSim <<
"\n" 786 <<
"dxySim = " << dxySim <<
"\n" 787 <<
"dzSim = " << dzSim <<
"\n";
790 h_tracks[
w]->Fill(at);
791 h_fakes[
w]->Fill(rT-at);
792 edm::LogVerbatim(
"NewMuonTrackValidator") <<
"Total Simulated: " << st <<
"\n" 793 <<
"Total Associated (simToReco): " << ats <<
"\n" 794 <<
"Total Reconstructed: " << rT <<
"\n" 795 <<
"Total Associated (recoToSim): " << at <<
"\n" 796 <<
"Total Fakes: " << rT-at <<
"\n";
double qoverp() const
q / p
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
Sin< T >::type sin(const T &t)
const_iterator find(const key_type &k) const
find element with specified reference key
static float getEta(float eta, int bits=5)
def replace(string, replacements)
def setup(process, global_tag, zero_tesla=False)
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
void analyze(const edm::Event &, const edm::EventSetup &) override
Method called before the event loop.
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)
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
MonitorElement * book1D(Args &&...args)
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.
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Method called at the end of the event loop.
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
void setCurrentFolder(const std::string &fullpath)
T const * product() const
MonitorElement * book2D(Args &&...args)
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
Point vertex() const
Parent vertex position.
std::unique_ptr< ParametersDefinerForTP > clone() const override
int numberOfValidMuonGEMHits() const
auto dxy(const T_Vertex &vertex, const T_Momentum &momentum, const T_Point &point)
int numberOfValidMuonME0Hits() const
int numberOfValidMuonDTHits() const
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...
int numberOfHits(HitCategory category) const
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