@@ -160,18 +160,14 @@ void MuonTrackValidator::bookHistograms(DQMEDAnalyzer::DQMStore::IBooker& ibooke
160160 minNHit,
161161 maxNHit));
162162
163- int bindR{200 };
164- double mindR{0.0 };
165- double maxdR{10.0 };
166-
167- h_recodR.push_back (ibooker.book1D (" num_reco_dR" , " N of reco track vs dR2" , bindR, mindR, maxdR));
163+ h_recodR.push_back (ibooker.book1D (" num_reco_dR" , " N of reco track vs dR" , nintdR, mindR, maxdR));
168164 h_assocdR.push_back (
169- ibooker.book1D (" num_assoSimToReco_dR" , " N of associated tracks (simToReco) vs dR2 " , bindR , mindR, maxdR));
165+ ibooker.book1D (" num_assoSimToReco_dR" , " N of associated tracks (simToReco) vs dR " , nintdR , mindR, maxdR));
170166 h_assoc2dR.push_back (
171- ibooker.book1D (" num_assoRecoToSim_dR" , " N of associated (recoToSim) tracks vs dR2 " , bindR , mindR, maxdR));
172- h_simuldR.push_back (ibooker.book1D (" num_simul_dR" , " N of simulated tracks vs dR2 " , bindR , mindR, maxdR));
167+ ibooker.book1D (" num_assoRecoToSim_dR" , " N of associated (recoToSim) tracks vs dR " , nintdR , mindR, maxdR));
168+ h_simuldR.push_back (ibooker.book1D (" num_simul_dR" , " N of simulated tracks vs dR " , nintdR , mindR, maxdR));
173169 h_misiddR.push_back (ibooker.book1D (
174- " num_chargemisid_dR" , " N of associated (simToReco) tracks with charge misID vs dR2 " , bindR , mindR, maxdR));
170+ " num_chargemisid_dR" , " N of associated (simToReco) tracks with charge misID vs dR " , nintdR , mindR, maxdR));
175171
176172 h_recodxy.push_back (ibooker.book1D (" num_reco_dxy" , " N of reco track vs dxy" , nintDxy, minDxy, maxDxy));
177173 h_assocdxy.push_back (ibooker.book1D (
@@ -540,14 +536,13 @@ void MuonTrackValidator::analyze(const edm::Event& event, const edm::EventSetup&
540536 int ats = 0 ;
541537 int st = 0 ;
542538
543- std::optional<double > dR2 = [&]() -> std::optional<double > {
544- if (tPC.size () == 2 ) {
545- TrackingParticle::Vector p1 = lhcParametersDefinerTP_->momentum (event, setup, tPC[0 ]);
546- TrackingParticle::Vector p2 = lhcParametersDefinerTP_->momentum (event, setup, tPC[1 ]);
547-
548- return reco::deltaR2 (p1, p2);
539+ std::optional<double > dR = [&]() -> std::optional<double > {
540+ if (tpSelector.isSignalOnly () && tPC.size () == 2 ) {
541+ const auto & tp1 = *tPC[0 ];
542+ const auto & tp2 = *tPC[1 ];
543+ return reco::deltaR (tp1.momentum (), tp2.momentum ());
549544 }
550- return {} ;
545+ return std:: nullopt ;
551546 }();
552547
553548 for (size_t i = 0 ; i < tPC.size (); i++) {
@@ -664,12 +659,13 @@ void MuonTrackValidator::analyze(const edm::Event& event, const edm::EventSetup&
664659 fillPlotNoFlow (h_misidphi[w], TPphi);
665660 }
666661
667- if (dR2.has_value ()) {
668- fillPlotNoFlow (h_simuldR[w], *dR2);
662+ // histos for efficiency vs dR
663+ if (dR) {
664+ fillPlotNoFlow (h_simuldR[w], *dR);
669665 if (TP_is_matched) {
670- fillPlotNoFlow (h_assocdR[w], *dR2 );
666+ fillPlotNoFlow (h_assocdR[w], *dR );
671667 if (!isChargeOK)
672- fillPlotNoFlow (h_misiddR[w], *dR2 );
668+ fillPlotNoFlow (h_misiddR[w], *dR );
673669 }
674670 }
675671
@@ -852,10 +848,10 @@ void MuonTrackValidator::analyze(const edm::Event& event, const edm::EventSetup&
852848 fillPlotNoFlow (h_assoc2pT[w], xptRec);
853849 }
854850
855- if (dR2. has_value () ) {
856- fillPlotNoFlow (h_recodR[w], *dR2 );
851+ if (dR ) {
852+ fillPlotNoFlow (h_recodR[w], *dR );
857853 if (Track_is_matched) {
858- fillPlotNoFlow (h_assoc2pT [w], *dR2 );
854+ fillPlotNoFlow (h_assoc2dR [w], *dR );
859855 }
860856 }
861857
0 commit comments