@@ -212,6 +212,10 @@ struct NchCumulantsId {
212212 ConfigurableAxis subSampleAxis{" subSampleAxis" , {10 , 0 ., 10 .}, " Subsample" };
213213 TRandom3* fRandom = new TRandom3(0 ); // Random number generator for subsampling
214214 int currentSubsample = 0 ;
215+ Configurable<float > cfgCutPtMinKa{" cfgCutPtMinKa" , 0.30 , " min pT for kaon eff-correction inclusion" };
216+ Configurable<float > cfgCutPtMaxKa{" cfgCutPtMaxKa" , 1.20 , " max pT for kaon eff-correction inclusion (purity cutoff)" };
217+ Configurable<float > cfgCutPtMinPr{" cfgCutPtMinPr" , 0.40 , " min pT for proton eff-correction inclusion" };
218+ Configurable<float > cfgCutPtMaxPr{" cfgCutPtMaxPr" , 1.50 , " max pT for proton eff-correction inclusion (purity cutoff)" };
215219 } cfgEventSelection;
216220
217221 // Configurables for particle Identification
@@ -297,9 +301,11 @@ struct NchCumulantsId {
297301 double q4 = 0 .;
298302 };
299303
304+ static constexpr float KmaxWeight = 10 .0f ; // secondary safeguard for pr and kaon eff fix
305+
300306 inline void fillEffPower (EffPowerSums& p, float weight)
301307 {
302- if (weight <= 0 .f ) {
308+ if (weight <= 0 .f || weight > KmaxWeight ) {
303309 return ;
304310 }
305311
@@ -1999,19 +2005,27 @@ struct NchCumulantsId {
19992005 fillGenTrackQA<genAnalysisDir, kPi , kNeg >(genAnalysis, mcTrack);
20002006 } else if (pdg == kKPlus ) {
20012007 // fillGenTrackQA<genAnalysisDir, kKa>(genAnalysis, mcTrack);
2002- nKaGen++;
2008+ if (mcTrack.pt () >= cfgEventSelection.cfgCutPtMinKa && mcTrack.pt () <= cfgEventSelection.cfgCutPtMaxKa ) {
2009+ nKaGen++;
2010+ }
20032011 fillGenTrackQA<genAnalysisDir, kKa , kPos >(genAnalysis, mcTrack);
20042012 } else if (pdg == kKMinus ) {
20052013 // fillGenTrackQA<genAnalysisDir, kKa>(genAnalysis, mcTrack);
2006- nAKaGen++;
2014+ if (mcTrack.pt () >= cfgEventSelection.cfgCutPtMinKa && mcTrack.pt () <= cfgEventSelection.cfgCutPtMaxKa ) {
2015+ nAKaGen++;
2016+ }
20072017 fillGenTrackQA<genAnalysisDir, kKa , kNeg >(genAnalysis, mcTrack);
20082018 } else if (pdg == kProton ) {
20092019 // fillGenTrackQA<genAnalysisDir, kPr>(genAnalysis, mcTrack);
2010- nPrGen++;
2020+ if (mcTrack.pt () >= cfgEventSelection.cfgCutPtMinPr && mcTrack.pt () <= cfgEventSelection.cfgCutPtMaxPr ) {
2021+ nPrGen++;
2022+ }
20112023 fillGenTrackQA<genAnalysisDir, kPr , kPos >(genAnalysis, mcTrack);
20122024 } else if (pdg == kProtonBar ) {
20132025 // fillGenTrackQA<genAnalysisDir, kPr>(genAnalysis, mcTrack);
2014- nAPrGen++;
2026+ if (mcTrack.pt () >= cfgEventSelection.cfgCutPtMinPr && mcTrack.pt () <= cfgEventSelection.cfgCutPtMaxPr ) {
2027+ nAPrGen++;
2028+ }
20152029 fillGenTrackQA<genAnalysisDir, kPr , kNeg >(genAnalysis, mcTrack);
20162030 }
20172031
@@ -2176,15 +2190,19 @@ struct NchCumulantsId {
21762190 }
21772191 } else if (trackIsKaon) {
21782192 if (track.sign () > 0 ) {
2179- nKaRec += hPtEtaForEffCorrection[kKa ][kPos ]->GetBinContent (ptEtaBin);
21802193 fillRecoTrackQA<recoAnalysisDir, kKa , kPos >(recoAnalysis, track);
2181- float weight = hPtEtaForEffCorrection[kKa ][kPos ]->GetBinContent (ptEtaBin);
2182- fillEffPower (kapPow, weight);
2194+ if (track.pt () >= cfgEventSelection.cfgCutPtMinKa && track.pt () <= cfgEventSelection.cfgCutPtMaxKa ) {
2195+ nKaRec += hPtEtaForEffCorrection[kKa ][kPos ]->GetBinContent (ptEtaBin);
2196+ float weight = hPtEtaForEffCorrection[kKa ][kPos ]->GetBinContent (ptEtaBin);
2197+ fillEffPower (kapPow, weight);
2198+ }
21832199 } else if (track.sign () < 0 ) {
2184- nAKaRec += hPtEtaForEffCorrection[kKa ][kNeg ]->GetBinContent (ptEtaBin);
21852200 fillRecoTrackQA<recoAnalysisDir, kKa , kNeg >(recoAnalysis, track);
2186- float weight = hPtEtaForEffCorrection[kKa ][kNeg ]->GetBinContent (ptEtaBin);
2187- fillEffPower (kamPow, weight);
2201+ if (track.pt () >= cfgEventSelection.cfgCutPtMinKa && track.pt () <= cfgEventSelection.cfgCutPtMaxKa ) {
2202+ nAKaRec += hPtEtaForEffCorrection[kKa ][kNeg ]->GetBinContent (ptEtaBin);
2203+ float weight = hPtEtaForEffCorrection[kKa ][kNeg ]->GetBinContent (ptEtaBin);
2204+ fillEffPower (kamPow, weight);
2205+ }
21882206 }
21892207 // PID band QA for kaons
21902208 if (idMethodKa == kTPCidentified ) {
@@ -2195,15 +2213,19 @@ struct NchCumulantsId {
21952213 }
21962214 } else if (trackIsProton) {
21972215 if (track.sign () > 0 ) {
2198- nPrRec += hPtEtaForEffCorrection[kPr ][kPos ]->GetBinContent (ptEtaBin);
21992216 fillRecoTrackQA<recoAnalysisDir, kPr , kPos >(recoAnalysis, track);
2200- float weight = hPtEtaForEffCorrection[kPr ][kPos ]->GetBinContent (ptEtaBin);
2201- fillEffPower (prPow, weight);
2217+ if (track.pt () >= cfgEventSelection.cfgCutPtMinPr && track.pt () <= cfgEventSelection.cfgCutPtMaxPr ) {
2218+ nPrRec += hPtEtaForEffCorrection[kPr ][kPos ]->GetBinContent (ptEtaBin);
2219+ float weight = hPtEtaForEffCorrection[kPr ][kPos ]->GetBinContent (ptEtaBin);
2220+ fillEffPower (prPow, weight);
2221+ }
22022222 } else if (track.sign () < 0 ) {
2203- nAPrRec += hPtEtaForEffCorrection[kPr ][kNeg ]->GetBinContent (ptEtaBin);
22042223 fillRecoTrackQA<recoAnalysisDir, kPr , kNeg >(recoAnalysis, track);
2205- float weight = hPtEtaForEffCorrection[kPr ][kNeg ]->GetBinContent (ptEtaBin);
2206- fillEffPower (aprPow, weight);
2224+ if (track.pt () >= cfgEventSelection.cfgCutPtMinPr && track.pt () <= cfgEventSelection.cfgCutPtMaxPr ) {
2225+ nAPrRec += hPtEtaForEffCorrection[kPr ][kNeg ]->GetBinContent (ptEtaBin);
2226+ float weight = hPtEtaForEffCorrection[kPr ][kNeg ]->GetBinContent (ptEtaBin);
2227+ fillEffPower (aprPow, weight);
2228+ }
22072229 }
22082230 // PID band QA for protons
22092231 if (idMethodPr == kTPCidentified ) {
0 commit comments