From e02225734e15dae83fe340be75e3580e131d6a4a Mon Sep 17 00:00:00 2001 From: Swati Saha Date: Tue, 2 Jun 2026 18:09:56 +0530 Subject: [PATCH 1/2] Bug with efficiency correction --- PWGCF/EbyEFluctuations/Tasks/v0ptHadPiKaProt.cxx | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/v0ptHadPiKaProt.cxx b/PWGCF/EbyEFluctuations/Tasks/v0ptHadPiKaProt.cxx index a83f25f8e3b..fddd5815ce1 100644 --- a/PWGCF/EbyEFluctuations/Tasks/v0ptHadPiKaProt.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/v0ptHadPiKaProt.cxx @@ -942,11 +942,10 @@ struct V0ptHadPiKaProt { } int bin = hEffAllCharged->FindBin(candidate.pt()); float eff = hEffAllCharged->GetBinContent(bin); - float ptweight = 1.0 / eff; if (!std::isfinite(ptweight) || ptweight <= 0) { return 1.0; } - return ptweight; + return eff; } template @@ -957,11 +956,10 @@ struct V0ptHadPiKaProt { } int bin = hEffPion->FindBin(candidate.pt()); float eff = hEffPion->GetBinContent(bin); - float ptweight = 1.0 / eff; if (!std::isfinite(ptweight) || ptweight <= 0) { return 1.0; } - return ptweight; + return eff; } template @@ -972,11 +970,10 @@ struct V0ptHadPiKaProt { } int bin = hEffKaon->FindBin(candidate.pt()); float eff = hEffKaon->GetBinContent(bin); - float ptweight = 1.0 / eff; if (!std::isfinite(ptweight) || ptweight <= 0) { return 1.0; } - return ptweight; + return eff; } template @@ -987,11 +984,10 @@ struct V0ptHadPiKaProt { } int bin = hEffProton->FindBin(candidate.pt()); float eff = hEffProton->GetBinContent(bin); - float ptweight = 1.0 / eff; if (!std::isfinite(ptweight) || ptweight <= 0) { return 1.0; } - return ptweight; + return eff; } void processMCGen(aod::McCollision const& mcCollision, aod::McParticles const& mcParticles, const soa::SmallGroups& collisions, MyMCTracks const& tracks) From 1bbcb169487733d18b2365a6197eb764994c2012 Mon Sep 17 00:00:00 2001 From: Swati Saha Date: Tue, 2 Jun 2026 18:21:21 +0530 Subject: [PATCH 2/2] Fix --- .../Tasks/v0ptHadPiKaProt.cxx | 28 +++++++++++-------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/v0ptHadPiKaProt.cxx b/PWGCF/EbyEFluctuations/Tasks/v0ptHadPiKaProt.cxx index fddd5815ce1..921c33cfed4 100644 --- a/PWGCF/EbyEFluctuations/Tasks/v0ptHadPiKaProt.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/v0ptHadPiKaProt.cxx @@ -935,59 +935,63 @@ struct V0ptHadPiKaProt { } template - float getEffAllCharged(const T& candidate) + float getEffWeightAllCharged(const T& candidate) { if (!cfgLoadPtEffWeights || !hEffAllCharged) { return 1.0; } int bin = hEffAllCharged->FindBin(candidate.pt()); float eff = hEffAllCharged->GetBinContent(bin); + float ptweight = 1.0 / eff; if (!std::isfinite(ptweight) || ptweight <= 0) { return 1.0; } - return eff; + return ptweight; } template - float getEffPion(const T& candidate) + float getEffWeightPion(const T& candidate) { if (!cfgLoadPtEffWeights || !hEffPion) { return 1.0; } int bin = hEffPion->FindBin(candidate.pt()); float eff = hEffPion->GetBinContent(bin); + float ptweight = 1.0 / eff; if (!std::isfinite(ptweight) || ptweight <= 0) { return 1.0; } - return eff; + return ptweight; } template - float getEffKaon(const T& candidate) + float getEffWeightKaon(const T& candidate) { if (!cfgLoadPtEffWeights || !hEffKaon) { return 1.0; } int bin = hEffKaon->FindBin(candidate.pt()); float eff = hEffKaon->GetBinContent(bin); + float ptweight = 1.0 / eff; if (!std::isfinite(ptweight) || ptweight <= 0) { return 1.0; } - return eff; + return ptweight; } template - float getEffProton(const T& candidate) + float getEffWeightProton(const T& candidate) { if (!cfgLoadPtEffWeights || !hEffProton) { return 1.0; } int bin = hEffProton->FindBin(candidate.pt()); float eff = hEffProton->GetBinContent(bin); + float ptweight = 1.0 / eff; if (!std::isfinite(ptweight) || ptweight <= 0) { return 1.0; } - return eff; + return ptweight; } void processMCGen(aod::McCollision const& mcCollision, aod::McParticles const& mcParticles, const soa::SmallGroups& collisions, MyMCTracks const& tracks) @@ -1401,7 +1405,7 @@ struct V0ptHadPiKaProt { double effweight = 1.0; if (cfgLoadPtEffWeights) { - effweight = 1.0 / getEffAllCharged(track); // NUE weight + effweight = getEffWeightAllCharged(track); // NUE weight } // inclusive charged particles @@ -1519,9 +1523,9 @@ struct V0ptHadPiKaProt { double effweightKaon = 1.0; double effweightProton = 1.0; if (cfgLoadPtEffWeights) { - effweightPion = 1.0 / getEffPion(track); // NUE weight for pion - effweightKaon = 1.0 / getEffKaon(track); // NUE weight for kaon - effweightProton = 1.0 / getEffProton(track); // NUE weight for proton + effweightPion = getEffWeightPion(track); // NUE weight for pion + effweightKaon = getEffWeightKaon(track); // NUE weight for kaon + effweightProton = getEffWeightProton(track); // NUE weight for proton } if (track.sign() != 0) {