@@ -118,30 +118,44 @@ struct PseudorapidityDensityMFT {
118118
119119 HistogramRegistry registry{
120120 " registry" ,
121- {
122- {" TracksEtaZvtx" ,
123- " ; #eta; #it{z}_{vtx} (cm); tracks" ,
124- {HistType::kTH2F , {EtaAxis, ZAxis}}}, //
125- {" Tracks/EtaZvtx_gt0" ,
126- " ; #eta; #it{z}_{vtx} (cm); tracks" ,
127- {HistType::kTH2F , {EtaAxis, ZAxis}}}, //
128- {" TracksPhiEta" ,
129- " ; #varphi; #eta; tracks" ,
130- {HistType::kTH2F , {PhiAxis, EtaAxis}}}, //
131- {" TracksPhiZvtx" ,
132- " ; #varphi; #it{z}_{vtx} (cm); tracks" ,
133- {HistType::kTH2F , {PhiAxis, ZAxis}}}, //
134- {" TracksPtEta" ,
135- " ; p_{T} (GeV/c); #eta" ,
136- {HistType::kTH2F , {PtAxis, EtaAxis}}}, //
137- {" EventSelection" ,
138- " ;status;events" ,
139- {HistType::kTH1F , {{15 , 0.5 , 15.5 }}}},
140- {" EventCounts" ,
141- " ;status;events" ,
142- {HistType::kTH1F , {{2 , 0.5 , 2.5 }}}},
143- {" Tracks/Control/TrackCount" , " ;status;Track counts" , {HistType::kTH1F , {{15 , 0.5 , 15.5 }}}}, // added
144- }};
121+ {{" TracksEtaZvtx" ,
122+ " ; #eta; #it{z}_{vtx} (cm); tracks" ,
123+ {HistType::kTH2F , {EtaAxis, ZAxis}}}, //
124+ {" Tracks/EtaZvtx_gt0" ,
125+ " ; #eta; #it{z}_{vtx} (cm); tracks" ,
126+ {HistType::kTH2F , {EtaAxis, ZAxis}}}, //
127+ {" TracksPhiEta" ,
128+ " ; #varphi; #eta; tracks" ,
129+ {HistType::kTH2F , {PhiAxis, EtaAxis}}}, //
130+ {" TracksPhiZvtx" ,
131+ " ; #varphi; #it{z}_{vtx} (cm); tracks" ,
132+ {HistType::kTH2F , {PhiAxis, ZAxis}}}, //
133+ {" TracksPtEta" ,
134+ " ; p_{T} (GeV/c); #eta" ,
135+ {HistType::kTH2F , {PtAxis, EtaAxis}}}, //
136+ {" EventSelection" ,
137+ " ;status;events" ,
138+ {HistType::kTH1F , {{15 , 0.5 , 15.5 }}}},
139+ {" EventCounts" ,
140+ " ;status;events" ,
141+ {HistType::kTH1F , {{2 , 0.5 , 2.5 }}}},
142+ {" Tracks/Control/TrackCount" , " ;status;Track counts" , {HistType::kTH1F , {{15 , 0.5 , 15.5 }}}}, // added
143+ // Purity-related histograms
144+ {" Purity/SelectedAfterDCAxy/All" ,
145+ " ;bin;counts" ,
146+ {HistType::kTH1F , {{1 , 0.5 , 1.5 }}}},
147+ {" Purity/SelectedAfterDCAxy/AllEta" ,
148+ " ;#eta;counts" ,
149+ {HistType::kTH1F , {EtaAxis}}},
150+ {" Purity/Gen/PrimaryEta" ,
151+ " ;#eta;primaries" ,
152+ {HistType::kTH1F , {EtaAxis}}},
153+ {" Purity/Gen/All" ,
154+ " ;bin;counts" ,
155+ {HistType::kTH1F , {{1 , 0.5 , 1.5 }}}},
156+ {" Purity/Gen/AllEta" ,
157+ " ;#eta;counts" ,
158+ {HistType::kTH1F , {EtaAxis}}}}};
145159
146160 void init (InitContext&)
147161 {
@@ -725,6 +739,9 @@ struct PseudorapidityDensityMFT {
725739 continue ;
726740 }
727741 }
742+ // Purity denominator: all tracks that pass the DCA selection and other quality cuts
743+ registry.fill (HIST (" Purity/SelectedAfterDCAxy/All" ), 1 .);
744+ registry.fill (HIST (" Purity/SelectedAfterDCAxy/AllEta" ), track.eta ());
728745 registry.fill (HIST (" TracksEtaZvtx" ), track.eta (), z);
729746 if (midtracks.size () > 0 && retrack.ambDegree () > 0 ) {
730747 registry.fill (HIST (" Tracks/EtaZvtx_gt0" ), track.eta (), z);
@@ -1049,6 +1066,13 @@ struct PseudorapidityDensityMFT {
10491066 continue ;
10501067 }
10511068 if (cfgnEta1 < particle.eta () && particle.eta () < cfgnEta2 && (phi > cfgPhiCut1 && phi < cfgPhiCut2)) {
1069+ // Purity numerator reference at generator level: physical primaries in the same eta window
1070+ if (particle.isPhysicalPrimary ()) {
1071+ registry.fill (HIST (" Purity/Gen/PrimaryEta" ), particle.eta ());
1072+ // Truth-side total counters for primaries in acceptance (for purity calculations)
1073+ registry.fill (HIST (" Purity/Gen/All" ), 1 .);
1074+ registry.fill (HIST (" Purity/Gen/AllEta" ), particle.eta ());
1075+ }
10521076 registry.fill (HIST (" TracksEtaZvtxGen_t" ), particle.eta (),
10531077 mcCollision.posZ ());
10541078 if (perCollisionMCSampleCentral.size () > 0 ) {
0 commit comments