@@ -78,19 +78,20 @@ struct Alice3TrackingPerformance {
7878 }
7979 const std::string tag = " _" + prefix;
8080 prefix += " /" ;
81- particlePtDistribution[pdg] = histos.add <TH1 >(prefix + " particlePtDistribution" + tag, " " , kTH1D , {ptAxis});
82- particleEtaDistribution[pdg] = histos.add <TH1 >(prefix + " particleEtaDistribution" + tag, " " , kTH1D , {etaAxis});
81+ auto histoName = [&](const std::string& name) { return Form (" %s%s%s" , prefix.c_str (), name.c_str (), tag.c_str ()); };
82+ particlePtDistribution[pdg] = histos.add <TH1 >(histoName (" particlePtDistribution" ), " " , kTH1D , {ptAxis});
83+ particleEtaDistribution[pdg] = histos.add <TH1 >(histoName (" particleEtaDistribution" ), " " , kTH1D , {etaAxis});
8384
84- ptDistribution[pdg] = histos.add <TH1 >(prefix + " ptDistribution" + tag , " " , kTH1D , {ptAxis});
85- ptResolutionVsPt[pdg] = histos.add <TH2 >(prefix + " ptResolutionVsPt" + tag , " " , kTH2D , {ptAxis, axisPtDelta});
86- ptResolutionVsEta[pdg] = histos.add <TProfile2D>(prefix + " ptResolutionVsEta" + tag , " " , kTProfile2D , {ptAxis, etaAxis});
87- invPtResolutionVsPt[pdg] = histos.add <TH2 >(prefix + " invPtResolutionVsPt" + tag , " " , kTH2D , {ptAxis, invPtDeltaAxis});
88- invPtResolutionVsEta[pdg] = histos.add <TProfile2D>(prefix + " invPtResolutionVsEta" + tag , " " , kTProfile2D , {ptAxis, etaAxis});
89- dcaXyResolutionVsPt[pdg] = histos.add <TH2 >(prefix + " dcaXyResolutionVsPt" + tag , " " , kTH2D , {ptAxis, axisDcaXy});
90- dcaZResolutionVsPt[pdg] = histos.add <TH2 >(prefix + " dcaZResolutionVsPt" + tag , " " , kTH2D , {ptAxis, axisDcaZ});
91- covariancePtPtVsPt[pdg] = histos.add <TH2 >(prefix + " covariancePtPtVsPt" + tag , " " , kTH2D , {ptAxis, axisCovariancePtPt});
92- covarianceDcaXyDcaXyVsPt[pdg] = histos.add <TH2 >(prefix + " covarianceDcaXyDcaXyVsPt" + tag , " " , kTH2D , {ptAxis, axisCovarianceDcaXyDcaXy});
93- covarianceDcaZDcaZVsPt[pdg] = histos.add <TH2 >(prefix + " covarianceDcaZDcaZVsPt" + tag , " " , kTH2D , {ptAxis, axisCovarianceDcaZDcaZ});
85+ ptDistribution[pdg] = histos.add <TH1 >(histoName ( " ptDistribution" ) , " " , kTH1D , {ptAxis});
86+ ptResolutionVsPt[pdg] = histos.add <TH2 >(histoName ( " ptResolutionVsPt" ) , " " , kTH2D , {ptAxis, axisPtDelta});
87+ ptResolutionVsEta[pdg] = histos.add <TProfile2D>(histoName ( " ptResolutionVsEta" ) , " " , kTProfile2D , {ptAxis, etaAxis});
88+ invPtResolutionVsPt[pdg] = histos.add <TH2 >(histoName ( " invPtResolutionVsPt" ) , " " , kTH2D , {ptAxis, invPtDeltaAxis});
89+ invPtResolutionVsEta[pdg] = histos.add <TProfile2D>(histoName ( " invPtResolutionVsEta" ) , " " , kTProfile2D , {ptAxis, etaAxis});
90+ dcaXyResolutionVsPt[pdg] = histos.add <TH2 >(histoName ( " dcaXyResolutionVsPt" ) , " " , kTH2D , {ptAxis, axisDcaXy});
91+ dcaZResolutionVsPt[pdg] = histos.add <TH2 >(histoName ( " dcaZResolutionVsPt" ) , " " , kTH2D , {ptAxis, axisDcaZ});
92+ covariancePtPtVsPt[pdg] = histos.add <TH2 >(histoName ( " covariancePtPtVsPt" ) , " " , kTH2D , {ptAxis, axisCovariancePtPt});
93+ covarianceDcaXyDcaXyVsPt[pdg] = histos.add <TH2 >(histoName ( " covarianceDcaXyDcaXyVsPt" ) , " " , kTH2D , {ptAxis, axisCovarianceDcaXyDcaXy});
94+ covarianceDcaZDcaZVsPt[pdg] = histos.add <TH2 >(histoName ( " covarianceDcaZDcaZVsPt" ) , " " , kTH2D , {ptAxis, axisCovarianceDcaZDcaZ});
9495 }
9596 }
9697
@@ -102,10 +103,7 @@ struct Alice3TrackingPerformance {
102103 return false ;
103104 }
104105 const int etaBin = particleEtaDistribution[0 ]->GetXaxis ()->FindBin (p.eta ());
105- if (etaBin < 1 || etaBin > particleEtaDistribution[0 ]->GetXaxis ()->GetNbins ()) {
106- return false ;
107- }
108- return true ;
106+ return etaBin >= 1 && etaBin <= particleEtaDistribution[0 ]->GetXaxis ()->GetNbins ();
109107 };
110108
111109 for (const auto & mcParticle : mcParticles) {
@@ -115,7 +113,7 @@ struct Alice3TrackingPerformance {
115113 }
116114 particlePtDistribution[0 ]->Fill (mcParticle.pt ());
117115 particleEtaDistribution[0 ]->Fill (mcParticle.eta ());
118- if (particlePtDistribution.find (mcParticle.pdgCode ()) == particlePtDistribution. end ( )) {
116+ if (! particlePtDistribution.contains (mcParticle.pdgCode ())) {
119117 continue ;
120118 }
121119 particlePtDistribution[mcParticle.pdgCode ()]->Fill (mcParticle.pt ());
@@ -148,7 +146,7 @@ struct Alice3TrackingPerformance {
148146 if (!isParticleSelected (mcParticle)) {
149147 continue ;
150148 }
151- if (ptResolutionVsPt.find (mcParticle.pdgCode ()) == ptResolutionVsPt. end ( )) {
149+ if (! ptResolutionVsPt.contains (mcParticle.pdgCode ())) {
152150 continue ;
153151 }
154152 fillResolutionHistograms (mcParticle.pdgCode ());
0 commit comments