1313// /
1414// / \brief This task produces the tracking performance
1515// /
16- // / \author Nicolò Jacazio, Universita del Piemonte Orientale (IT)
16+ // / \author Nicolò Jacazio, Università del Piemonte Orientale (IT)
1717// / \since May 27, 2025
1818// /
1919
@@ -46,7 +46,9 @@ std::map<int, std::shared_ptr<TH1>> particlePtDistribution;
4646std::map<int , std::shared_ptr<TH1>> particleEtaDistribution;
4747std::map<int , std::shared_ptr<TH1>> ptDistribution;
4848std::map<int , std::shared_ptr<TH2>> ptResolutionVsPt;
49+ std::map<int , std::shared_ptr<TProfile2D>> ptResolutionVsEta;
4950std::map<int , std::shared_ptr<TH2>> invPtResolutionVsPt;
51+ std::map<int , std::shared_ptr<TProfile2D>> invPtResolutionVsEta;
5052std::map<int , std::shared_ptr<TH2>> dcaXyResolutionVsPt;
5153std::map<int , std::shared_ptr<TH2>> dcaZResolutionVsPt;
5254
@@ -57,26 +59,30 @@ struct Alice3TrackingPerformance {
5759
5860 void init (o2::framework::InitContext&)
5961 {
60- const AxisSpec axisPt{100 , 0 , 10 , " p_{ T} (GeV/c )" };
62+ const AxisSpec axisPt{500 , 0 , 100 , " #it{p}_{ T} (GeV/#it{c} )" };
6163 const AxisSpec axisEta{100 , etaRange.value .first , etaRange.value .second , " #eta" };
62- const AxisSpec axisPtDelta{100 , -1 , 1 , " p_{ T}^{gen } - p_{ T}^{reco} (GeV/c) " };
63- const AxisSpec axisInvPtDelta{100 , -1 , 1 , " 1./p_{ T}^{gen} - 1./p_{ T}^{reco} (GeV/c )^{-1}" };
64+ const AxisSpec axisPtDelta{100 , -1 , 1 , " (#it{p}_{ T}^{reco } - #it{p}_{ T}^{gen}) / #it{p}_{T}^{gen} " };
65+ const AxisSpec axisInvPtDelta{100 , -1 , 1 , " 1./#it{p}_{ T}^{gen} - 1./#it{p}_{ T}^{reco} (GeV/#it{c} )^{-1}" };
6466 const AxisSpec axisDcaXy{100 , -1 , 1 , " DCA_{xy} (cm)" };
6567 const AxisSpec axisDcaZ{100 , -1 , 1 , " DCA_{z} (cm)" };
6668 particlePdgCodes = histos.add <TH1>(" particlePdgCodes" , " " , kTH1D , {AxisSpec{100 , -0.5 , 99.5 , " PDG Code" }});
6769 for (const int & pdg : pdgCodes.value ) {
68- std::string tag = Form (" _%d " , pdg);
70+ std::string prefix = Form (" %i " , pdg);
6971 if (pdg < 0 ) {
70- tag = Form (" _m%d " , -pdg);
72+ prefix = Form (" m%i " , -pdg);
7173 }
72- particlePtDistribution[pdg] = histos.add <TH1>(" particlePtDistribution" + tag, " " , kTH1D , {axisPt});
73- particleEtaDistribution[pdg] = histos.add <TH1>(" particleEtaDistribution" + tag, " " , kTH1D , {axisEta});
74+ const std::string tag = " _" + prefix;
75+ prefix += " /" ;
76+ particlePtDistribution[pdg] = histos.add <TH1>(prefix + " particlePtDistribution" + tag, " " , kTH1D , {axisPt});
77+ particleEtaDistribution[pdg] = histos.add <TH1>(prefix + " particleEtaDistribution" + tag, " " , kTH1D , {axisEta});
7478
75- ptDistribution[pdg] = histos.add <TH1>(" ptDistribution" + tag, " " , kTH1D , {axisPt});
76- ptResolutionVsPt[pdg] = histos.add <TH2>(" ptResolutionVsPt" + tag, " " , kTH2D , {axisPt, axisPtDelta});
77- invPtResolutionVsPt[pdg] = histos.add <TH2>(" invPtResolutionVsPt" + tag, " " , kTH2D , {axisPt, axisInvPtDelta});
78- dcaXyResolutionVsPt[pdg] = histos.add <TH2>(" dcaXyResolutionVsPt" + tag, " " , kTH2D , {axisPt, axisDcaXy});
79- dcaZResolutionVsPt[pdg] = histos.add <TH2>(" dcaZResolutionVsPt" + tag, " " , kTH2D , {axisPt, axisDcaZ});
79+ ptDistribution[pdg] = histos.add <TH1>(prefix + " ptDistribution" + tag, " " , kTH1D , {axisPt});
80+ ptResolutionVsPt[pdg] = histos.add <TH2>(prefix + " ptResolutionVsPt" + tag, " " , kTH2D , {axisPt, axisPtDelta});
81+ ptResolutionVsEta[pdg] = histos.add <TProfile2D>(prefix + " ptResolutionVsEta" + tag, " " , kTProfile2D , {axisPt, axisEta});
82+ invPtResolutionVsPt[pdg] = histos.add <TH2>(prefix + " invPtResolutionVsPt" + tag, " " , kTH2D , {axisPt, axisInvPtDelta});
83+ invPtResolutionVsEta[pdg] = histos.add <TProfile2D>(prefix + " invPtResolutionVsEta" + tag, " " , kTProfile2D , {axisPt, axisEta});
84+ dcaXyResolutionVsPt[pdg] = histos.add <TH2>(prefix + " dcaXyResolutionVsPt" + tag, " " , kTH2D , {axisPt, axisDcaXy});
85+ dcaZResolutionVsPt[pdg] = histos.add <TH2>(prefix + " dcaZResolutionVsPt" + tag, " " , kTH2D , {axisPt, axisDcaZ});
8086 }
8187 }
8288
@@ -110,26 +116,32 @@ struct Alice3TrackingPerformance {
110116 particleEtaDistribution[mcParticle.pdgCode ()]->Fill (mcParticle.eta ());
111117 }
112118 for (const auto & track : tracks) {
113- ptDistribution[0 ]->Fill (track.pt ());
114119 if (!track.has_mcParticle ()) {
115120 continue ;
116121 }
117122 const auto & mcParticle = track.mcParticle ();
118- ptResolutionVsPt[0 ]->Fill (mcParticle.pt (), mcParticle.pt () - track.pt ());
119- invPtResolutionVsPt[0 ]->Fill (mcParticle.pt (), 1 .f / mcParticle.pt () - 1 .f / track.pt ());
120- dcaXyResolutionVsPt[0 ]->Fill (mcParticle.pt (), track.dcaXY ());
121- dcaZResolutionVsPt[0 ]->Fill (mcParticle.pt (), track.dcaZ ());
123+ const float ptResolution = (track.pt () - mcParticle.pt ()) / mcParticle.pt ();
124+ const float invptResolution = 1 .f / track.pt () - 1 .f / mcParticle.pt ();
125+
126+ auto fillResolutionHistograms = [&](const int p) {
127+ ptDistribution[p]->Fill (track.pt ());
128+ ptResolutionVsPt[p]->Fill (mcParticle.pt (), ptResolution);
129+ ptResolutionVsEta[p]->Fill (mcParticle.pt (), mcParticle.eta (), ptResolution);
130+ invPtResolutionVsPt[p]->Fill (mcParticle.pt (), invptResolution);
131+ invPtResolutionVsEta[p]->Fill (mcParticle.pt (), mcParticle.eta (), invptResolution);
132+ dcaXyResolutionVsPt[p]->Fill (mcParticle.pt (), track.dcaXY ());
133+ dcaZResolutionVsPt[p]->Fill (mcParticle.pt (), track.dcaZ ());
134+ };
135+
136+ fillResolutionHistograms (0 );
137+
122138 if (!isParticleSelected (mcParticle)) {
123139 continue ;
124140 }
125141 if (ptResolutionVsPt.find (mcParticle.pdgCode ()) == ptResolutionVsPt.end ()) {
126142 continue ;
127143 }
128- ptDistribution[mcParticle.pdgCode ()]->Fill (mcParticle.pt ());
129- ptResolutionVsPt[mcParticle.pdgCode ()]->Fill (mcParticle.pt (), mcParticle.pt () - track.pt ());
130- invPtResolutionVsPt[mcParticle.pdgCode ()]->Fill (mcParticle.pt (), 1 .f / mcParticle.pt () - 1 .f / track.pt ());
131- dcaXyResolutionVsPt[mcParticle.pdgCode ()]->Fill (mcParticle.pt (), track.dcaXY ());
132- dcaZResolutionVsPt[mcParticle.pdgCode ()]->Fill (mcParticle.pt (), track.dcaZ ());
144+ fillResolutionHistograms (mcParticle.pdgCode ());
133145 }
134146 }
135147};
0 commit comments