diff --git a/PWGCF/EbyEFluctuations/Tasks/nchCumulantsId.cxx b/PWGCF/EbyEFluctuations/Tasks/nchCumulantsId.cxx index 027f38957c9..a30b976e07e 100644 --- a/PWGCF/EbyEFluctuations/Tasks/nchCumulantsId.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/nchCumulantsId.cxx @@ -212,6 +212,10 @@ struct NchCumulantsId { ConfigurableAxis subSampleAxis{"subSampleAxis", {10, 0., 10.}, "Subsample"}; TRandom3* fRandom = new TRandom3(0); // Random number generator for subsampling int currentSubsample = 0; + Configurable cfgCutPtMinKa{"cfgCutPtMinKa", 0.30, "min pT for kaon eff-correction inclusion"}; + Configurable cfgCutPtMaxKa{"cfgCutPtMaxKa", 1.20, "max pT for kaon eff-correction inclusion (purity cutoff)"}; + Configurable cfgCutPtMinPr{"cfgCutPtMinPr", 0.40, "min pT for proton eff-correction inclusion"}; + Configurable cfgCutPtMaxPr{"cfgCutPtMaxPr", 1.50, "max pT for proton eff-correction inclusion (purity cutoff)"}; } cfgEventSelection; // Configurables for particle Identification @@ -297,9 +301,11 @@ struct NchCumulantsId { double q4 = 0.; }; + static constexpr float KmaxWeight = 10.0f; // secondary safeguard for pr and kaon eff fix + inline void fillEffPower(EffPowerSums& p, float weight) { - if (weight <= 0.f) { + if (weight <= 0.f || weight > KmaxWeight) { return; } @@ -1999,19 +2005,27 @@ struct NchCumulantsId { fillGenTrackQA(genAnalysis, mcTrack); } else if (pdg == kKPlus) { // fillGenTrackQA(genAnalysis, mcTrack); - nKaGen++; + if (mcTrack.pt() >= cfgEventSelection.cfgCutPtMinKa && mcTrack.pt() <= cfgEventSelection.cfgCutPtMaxKa) { + nKaGen++; + } fillGenTrackQA(genAnalysis, mcTrack); } else if (pdg == kKMinus) { // fillGenTrackQA(genAnalysis, mcTrack); - nAKaGen++; + if (mcTrack.pt() >= cfgEventSelection.cfgCutPtMinKa && mcTrack.pt() <= cfgEventSelection.cfgCutPtMaxKa) { + nAKaGen++; + } fillGenTrackQA(genAnalysis, mcTrack); } else if (pdg == kProton) { // fillGenTrackQA(genAnalysis, mcTrack); - nPrGen++; + if (mcTrack.pt() >= cfgEventSelection.cfgCutPtMinPr && mcTrack.pt() <= cfgEventSelection.cfgCutPtMaxPr) { + nPrGen++; + } fillGenTrackQA(genAnalysis, mcTrack); } else if (pdg == kProtonBar) { // fillGenTrackQA(genAnalysis, mcTrack); - nAPrGen++; + if (mcTrack.pt() >= cfgEventSelection.cfgCutPtMinPr && mcTrack.pt() <= cfgEventSelection.cfgCutPtMaxPr) { + nAPrGen++; + } fillGenTrackQA(genAnalysis, mcTrack); } @@ -2176,15 +2190,19 @@ struct NchCumulantsId { } } else if (trackIsKaon) { if (track.sign() > 0) { - nKaRec += hPtEtaForEffCorrection[kKa][kPos]->GetBinContent(ptEtaBin); fillRecoTrackQA(recoAnalysis, track); - float weight = hPtEtaForEffCorrection[kKa][kPos]->GetBinContent(ptEtaBin); - fillEffPower(kapPow, weight); + if (track.pt() >= cfgEventSelection.cfgCutPtMinKa && track.pt() <= cfgEventSelection.cfgCutPtMaxKa) { + nKaRec += hPtEtaForEffCorrection[kKa][kPos]->GetBinContent(ptEtaBin); + float weight = hPtEtaForEffCorrection[kKa][kPos]->GetBinContent(ptEtaBin); + fillEffPower(kapPow, weight); + } } else if (track.sign() < 0) { - nAKaRec += hPtEtaForEffCorrection[kKa][kNeg]->GetBinContent(ptEtaBin); fillRecoTrackQA(recoAnalysis, track); - float weight = hPtEtaForEffCorrection[kKa][kNeg]->GetBinContent(ptEtaBin); - fillEffPower(kamPow, weight); + if (track.pt() >= cfgEventSelection.cfgCutPtMinKa && track.pt() <= cfgEventSelection.cfgCutPtMaxKa) { + nAKaRec += hPtEtaForEffCorrection[kKa][kNeg]->GetBinContent(ptEtaBin); + float weight = hPtEtaForEffCorrection[kKa][kNeg]->GetBinContent(ptEtaBin); + fillEffPower(kamPow, weight); + } } // PID band QA for kaons if (idMethodKa == kTPCidentified) { @@ -2195,15 +2213,19 @@ struct NchCumulantsId { } } else if (trackIsProton) { if (track.sign() > 0) { - nPrRec += hPtEtaForEffCorrection[kPr][kPos]->GetBinContent(ptEtaBin); fillRecoTrackQA(recoAnalysis, track); - float weight = hPtEtaForEffCorrection[kPr][kPos]->GetBinContent(ptEtaBin); - fillEffPower(prPow, weight); + if (track.pt() >= cfgEventSelection.cfgCutPtMinPr && track.pt() <= cfgEventSelection.cfgCutPtMaxPr) { + nPrRec += hPtEtaForEffCorrection[kPr][kPos]->GetBinContent(ptEtaBin); + float weight = hPtEtaForEffCorrection[kPr][kPos]->GetBinContent(ptEtaBin); + fillEffPower(prPow, weight); + } } else if (track.sign() < 0) { - nAPrRec += hPtEtaForEffCorrection[kPr][kNeg]->GetBinContent(ptEtaBin); fillRecoTrackQA(recoAnalysis, track); - float weight = hPtEtaForEffCorrection[kPr][kNeg]->GetBinContent(ptEtaBin); - fillEffPower(aprPow, weight); + if (track.pt() >= cfgEventSelection.cfgCutPtMinPr && track.pt() <= cfgEventSelection.cfgCutPtMaxPr) { + nAPrRec += hPtEtaForEffCorrection[kPr][kNeg]->GetBinContent(ptEtaBin); + float weight = hPtEtaForEffCorrection[kPr][kNeg]->GetBinContent(ptEtaBin); + fillEffPower(aprPow, weight); + } } // PID band QA for protons if (idMethodPr == kTPCidentified) {