From 6e880f3aeac0f4a5f050b8d06abadbd382f1d6de Mon Sep 17 00:00:00 2001 From: Gijs van Weelden <55794847+GijsvWeelden@users.noreply.github.com> Date: Fri, 29 Aug 2025 14:30:53 +0200 Subject: [PATCH] [PWGLF] V0 Selector: * Bug fix: check randomSelection flag before randomly selecting V0s * Random selection flag is now off by default * Added flags for turning on or off K0S/Lambda/AntiLambda cuts --- PWGLF/TableProducer/Strangeness/v0selector.cxx | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/PWGLF/TableProducer/Strangeness/v0selector.cxx b/PWGLF/TableProducer/Strangeness/v0selector.cxx index 7d06871d78c..1d5d392b358 100644 --- a/PWGLF/TableProducer/Strangeness/v0selector.cxx +++ b/PWGLF/TableProducer/Strangeness/v0selector.cxx @@ -36,6 +36,10 @@ using namespace o2::framework::expressions; struct V0SelectorTask { Produces v0FlagTable; + Configurable selectK0S{"selectK0S", true, "Check V0s for K0S cuts"}; + Configurable selectLambda{"selectLambda", true, "Check V0s for Lambda cuts"}; + Configurable selectAntiLambda{"selectAntiLambda", true, "Check V0s for AntiLambda cuts"}; + Configurable> K0SPtBins{"K0SPtBins", {0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 10.0, 15.0, 20.0, 25.0, 30.0}, "K0S pt Vals"}; Configurable> K0SRminVals{"K0SRminVals", {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}, "K0S min R values"}; Configurable> K0SRmaxVals{"K0SRmaxVals", {40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0}, "K0S max R values"}; @@ -85,7 +89,7 @@ struct V0SelectorTask { Configurable> AntiLambdaMassLowVals{"AntiLambdaMassLowVals", {1.08, 1.08, 1.08, 1.08, 1.08, 1.08, 1.08, 1.08}, "AntiLambda mass cut lower values (MeV)"}; Configurable> AntiLambdaMassHighVals{"AntiLambdaMassHighVals", {1.125, 1.125, 1.125, 1.125, 1.125, 1.125, 1.125, 1.125}, "AntiLambda mass cut upper values (MeV)"}; - Configurable randomSelection{"randomSelection", true, "Randomly select V0s"}; + Configurable randomSelection{"randomSelection", false, "Randomly select V0s"}; Configurable> K0SFraction{"K0SFraction", {2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0}, "Fraction of K0S to randomly select"}; Configurable> LambdaFraction{"LambdaFraction", {2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0}, "Fraction of Lambda to randomly select"}; Configurable> AntiLambdaFraction{"AntiLambdaFraction", {2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0}, "Fraction of AntiLambda to randomly select"}; @@ -277,13 +281,16 @@ struct V0SelectorTask { { for (const auto& v0 : v0s) { uint8_t flag = 0; - flag += K0SCuts(collision, v0) * aod::v0flags::FK0S; - flag += LambdaCuts(collision, v0) * aod::v0flags::FLAMBDA; - flag += AntiLambdaCuts(collision, v0) * aod::v0flags::FANTILAMBDA; + if (selectK0S) + flag += K0SCuts(collision, v0) * aod::v0flags::FK0S; + if (selectLambda) + flag += LambdaCuts(collision, v0) * aod::v0flags::FLAMBDA; + if (selectAntiLambda) + flag += AntiLambdaCuts(collision, v0) * aod::v0flags::FANTILAMBDA; if (flag == 0) flag += aod::v0flags::FREJECTED; - else + else if (randomSelection) flag += RandomlyReject(v0, flag) * aod::v0flags::FREJECTED; v0FlagTable(flag);