diff --git a/PWGCF/Femto/Core/cascadeBuilder.h b/PWGCF/Femto/Core/cascadeBuilder.h index 1cd12cc1c7b..e2f2d7767c4 100644 --- a/PWGCF/Femto/Core/cascadeBuilder.h +++ b/PWGCF/Femto/Core/cascadeBuilder.h @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -78,7 +79,9 @@ struct ConfCascadeFilters : o2::framework::ConfigurableGroup { o2::framework::Configurable> posDauTpc{"posDauTpc", {5.f}, "Maximum |nsimga_Pion/Proton| TPC for positive daughter tracks"}; \ o2::framework::Configurable> negDauTpc{"negDauTpc", {5.f}, "Maximum |nsimga_Pion/Proton| TPC for negative daughter tracks"}; \ o2::framework::Configurable> posDauTof{"posDauTof", {}, "Maximum |nsimga_Pion/Proton| TOF for positive daughter tracks"}; \ - o2::framework::Configurable> negDauTof{"negDauTof", {}, "Maximum |nsigma_Pion/Proton| TOF for negative daughter tracks"}; + o2::framework::Configurable> negDauTof{"negDauTof", {}, "Maximum |nsigma_Pion/Proton| TOF for negative daughter tracks"}; \ + o2::framework::Configurable requireTof{"requireTof", false, "If true, TOF PID is a mandatory selection"}; \ + o2::framework::Configurable keepTracksWithoutTof{"keepTracksWithoutTof", true, "If true, candidates whose daughters have no TOF signal are kept"}; struct ConfXiBits : o2::framework::ConfigurableGroup { std::string prefix = std::string("XiBits"); @@ -242,7 +245,7 @@ class CascadeSelection : public baseselection::BaseSelectionaddSelection(kBachelorTpcPion, cascadeSelectionNames.at(kBachelorTpcPion), config.bachelorTpcPion.value, limits::kAbsUpperLimit, true, true, false); - this->addSelection(kBachelorTofPion, cascadeSelectionNames.at(kBachelorTofPion), config.bachelorTofPion.value, limits::kAbsUpperLimit, true, true, false); + this->addSelection(kBachelorTofPion, cascadeSelectionNames.at(kBachelorTofPion), config.bachelorTofPion.value, limits::kAbsUpperLimit, true, mRequireTof, false); } if constexpr (modes::isEqual(cascadeType, modes::Cascade::kOmega)) { mOmegaMassLowerLimit = filter.massOmegaMin.value; @@ -251,7 +254,7 @@ class CascadeSelection : public baseselection::BaseSelectionaddSelection(kBachelorTpcKaon, cascadeSelectionNames.at(kBachelorTpcKaon), config.bachelorTpcKaon.value, limits::kAbsUpperLimit, true, true, false); - this->addSelection(kBachelorTofKaon, cascadeSelectionNames.at(kBachelorTofKaon), config.bachelorTofKaon.value, limits::kAbsUpperLimit, true, true, false); + this->addSelection(kBachelorTofKaon, cascadeSelectionNames.at(kBachelorTofKaon), config.bachelorTofKaon.value, limits::kAbsUpperLimit, true, mRequireTof, false); } mPtMin = filter.ptMin.value; @@ -262,11 +265,13 @@ class CascadeSelection : public baseselection::BaseSelectionaddSelection(kPosDauTpc, cascadeSelectionNames.at(kPosDauTpc), config.posDauTpc.value, limits::kAbsUpperLimit, true, true, false); this->addSelection(kNegDauTpc, cascadeSelectionNames.at(kNegDauTpc), config.negDauTpc.value, limits::kAbsUpperLimit, true, true, false); - this->addSelection(kPosDauTof, cascadeSelectionNames.at(kPosDauTof), config.posDauTof.value, limits::kAbsUpperLimit, true, true, false); - this->addSelection(kNegDauTof, cascadeSelectionNames.at(kNegDauTof), config.negDauTof.value, limits::kAbsUpperLimit, true, true, false); + this->addSelection(kPosDauTof, cascadeSelectionNames.at(kPosDauTof), config.posDauTof.value, limits::kAbsUpperLimit, true, mRequireTof, false); + this->addSelection(kNegDauTof, cascadeSelectionNames.at(kNegDauTof), config.negDauTof.value, limits::kAbsUpperLimit, true, mRequireTof, false); this->addSelection(kCascadeCpaMin, cascadeSelectionNames.at(kCascadeCpaMin), config.cascadeCpaMin.value, limits::kLowerLimit, true, true, false); this->addSelection(kCascadeTransRadMin, cascadeSelectionNames.at(kCascadeTransRadMin), config.cascadeTransRadMin.value, limits::kLowerLimit, true, true, false); @@ -336,6 +341,9 @@ class CascadeSelection : public baseselection::BaseSelectionevaluateObservable(kBachelorTofPion, bachelor.tofNSigmaPi()); this->evaluateObservable(kBachelorTofKaon, bachelor.tofNSigmaKa()); + } else if (mKeepTracksWithoutTof) { + this->setBitmask(kBachelorTofPion, 0); + this->setBitmask(kBachelorTofKaon, 0); } // depending on the charge, we check lambda or antilambda hypothesis @@ -344,18 +352,26 @@ class CascadeSelection : public baseselection::BaseSelectionevaluateObservable(kNegDauTpc, negDaughter.tpcNSigmaPi()); if (posDaughter.hasTOF()) { this->evaluateObservable(kPosDauTof, posDaughter.tofNSigmaPr()); + } else if (mKeepTracksWithoutTof) { + this->setBitmask(kPosDauTof, 0); } if (negDaughter.hasTOF()) { this->evaluateObservable(kNegDauTof, negDaughter.tofNSigmaPi()); + } else if (mKeepTracksWithoutTof) { + this->setBitmask(kNegDauTof, 0); } } else if (cascade.sign() > 0) { this->evaluateObservable(kPosDauTpc, posDaughter.tpcNSigmaPi()); this->evaluateObservable(kNegDauTpc, negDaughter.tpcNSigmaPr()); if (posDaughter.hasTOF()) { this->evaluateObservable(kPosDauTof, posDaughter.tofNSigmaPi()); + } else if (mKeepTracksWithoutTof) { + this->setBitmask(kPosDauTof, 0); } if (negDaughter.hasTOF()) { this->evaluateObservable(kNegDauTof, negDaughter.tofNSigmaPr()); + } else if (mKeepTracksWithoutTof) { + this->setBitmask(kNegDauTof, 0); } } else { LOG(warn) << "Encountered Cascade candidate with 0 charge"; @@ -468,6 +484,8 @@ class CascadeSelection : public baseselection::BaseSelection #include #include +#include #include #include #include @@ -85,6 +86,8 @@ struct ConfLambdaBits : o2::framework::ConfigurableGroup { o2::framework::Configurable> posDauTofProton{"posDauTofProton", {}, "Maximum |nsigma_Proton| TOF for positive daughter tracks"}; o2::framework::Configurable> negDauTofPion{"negDauTofPion", {}, "Maximum |nsigma_Pion| TOF for negative daughter tracks"}; o2::framework::Configurable> negDauTofProton{"negDauTofProton", {}, "Maximum |nsigma_Proton| TOF for negative daughter tracks"}; + o2::framework::Configurable requireTof{"requireTof", false, "If true, TOF PID is a mandatory selection"}; + o2::framework::Configurable keepTracksWithoutTof{"keepTracksWithoutTof", true, "If true, candidates whose daughters have no TOF signal are kept"}; }; // derived selection bits for K0Short @@ -95,6 +98,8 @@ struct ConfK0shortBits : o2::framework::ConfigurableGroup { o2::framework::Configurable> negDauTpcPion{"negDauTpcPion", {5.f}, "Maximum |nsimga_Pion| TPC for negative daughter tracks"}; o2::framework::Configurable> posDauTofPion{"posDauTofPion", {}, "Maximum |nsigma_Pion| TOF for positive daughter tracks"}; o2::framework::Configurable> negDauTofPion{"negDauTofPion", {}, "Maximum |nsigma_Pion| TOF for negative daughter tracks"}; + o2::framework::Configurable requireTof{"requireTof", false, "If true, TOF PID is a mandatory selection"}; + o2::framework::Configurable keepTracksWithoutTof{"keepTracksWithoutTof", true, "If true, candidates whose daughters have no TOF signal are kept"}; }; #undef V0_DEFAULT_BITS @@ -246,6 +251,8 @@ class V0Selection : public baseselection::BaseSelectionaddSelection(kPosDaughTpcProton, v0SelectionNames.at(kPosDaughTpcProton), config.posDauTpcProton.value, limits::kAbsUpperLimit, true, true, false); this->addSelection(kNegDaughTpcPion, v0SelectionNames.at(kNegDaughTpcPion), config.negDauTpcPion.value, limits::kAbsUpperLimit, true, true, false); - this->addSelection(kPosDaughTofProton, v0SelectionNames.at(kPosDaughTofProton), config.posDauTofProton.value, limits::kAbsUpperLimit, true, true, false); - this->addSelection(kNegDaughTofPion, v0SelectionNames.at(kNegDaughTofPion), config.negDauTofPion.value, limits::kAbsUpperLimit, true, true, false); + this->addSelection(kPosDaughTofProton, v0SelectionNames.at(kPosDaughTofProton), config.posDauTofProton.value, limits::kAbsUpperLimit, true, mRequireTof, false); + this->addSelection(kNegDaughTofPion, v0SelectionNames.at(kNegDaughTofPion), config.negDauTofPion.value, limits::kAbsUpperLimit, true, mRequireTof, false); } if constexpr (modes::isEqual(v0Type, modes::V0::kAntiLambda)) { this->addSelection(kPosDaughTpcPion, v0SelectionNames.at(kPosDaughTpcPion), config.posDauTpcPion.value, limits::kAbsUpperLimit, true, true, false); this->addSelection(kNegDaughTpcProton, v0SelectionNames.at(kNegDaughTpcProton), config.negDauTpcProton.value, limits::kAbsUpperLimit, true, true, false); - this->addSelection(kPosDaughTofPion, v0SelectionNames.at(kPosDaughTofPion), config.posDauTofPion.value, limits::kAbsUpperLimit, true, true, false); - this->addSelection(kNegDaughTofProton, v0SelectionNames.at(kNegDaughTofProton), config.negDauTofProton.value, limits::kAbsUpperLimit, true, true, false); + this->addSelection(kPosDaughTofPion, v0SelectionNames.at(kPosDaughTofPion), config.posDauTofPion.value, limits::kAbsUpperLimit, true, mRequireTof, false); + this->addSelection(kNegDaughTofProton, v0SelectionNames.at(kNegDaughTofProton), config.negDauTofProton.value, limits::kAbsUpperLimit, true, mRequireTof, false); } } if constexpr (modes::isEqual(v0Type, modes::V0::kK0short)) { @@ -277,8 +284,8 @@ class V0Selection : public baseselection::BaseSelectionaddSelection(kPosDaughTpcPion, v0SelectionNames.at(kPosDaughTpcPion), config.posDauTpcPion.value, limits::kAbsUpperLimit, true, true, false); this->addSelection(kNegDaughTpcPion, v0SelectionNames.at(kNegDaughTpcPion), config.negDauTpcPion.value, limits::kAbsUpperLimit, true, true, false); - this->addSelection(kPosDaughTofPion, v0SelectionNames.at(kPosDaughTofPion), config.posDauTofPion.value, limits::kAbsUpperLimit, true, true, false); - this->addSelection(kNegDaughTofPion, v0SelectionNames.at(kNegDaughTofPion), config.negDauTofPion.value, limits::kAbsUpperLimit, true, true, false); + this->addSelection(kPosDaughTofPion, v0SelectionNames.at(kPosDaughTofPion), config.posDauTofPion.value, limits::kAbsUpperLimit, true, mRequireTof, false); + this->addSelection(kNegDaughTofPion, v0SelectionNames.at(kNegDaughTofPion), config.negDauTofPion.value, limits::kAbsUpperLimit, true, mRequireTof, false); } this->addSelection(kDcaDaughMax, v0SelectionNames.at(kDcaDaughMax), config.dcaDauMax.value, limits::kAbsUpperLimit, true, true, false); @@ -345,10 +352,16 @@ class V0Selection : public baseselection::BaseSelectionevaluateObservable(kPosDaughTofPion, posDaughter.tofNSigmaPi()); this->evaluateObservable(kPosDaughTofProton, posDaughter.tofNSigmaPr()); + } else if (mKeepTracksWithoutTof) { + this->setBitmask(kPosDaughTofPion, 0); + this->setBitmask(kPosDaughTofProton, 0); } if (negDaughter.hasTOF()) { this->evaluateObservable(kNegDaughTofPion, negDaughter.tofNSigmaPi()); this->evaluateObservable(kNegDaughTofProton, negDaughter.tofNSigmaPr()); + } else if (mKeepTracksWithoutTof) { + this->setBitmask(kNegDaughTofPion, 0); + this->setBitmask(kNegDaughTofProton, 0); } this->assembleBitmask(); @@ -452,6 +465,9 @@ class V0Selection : public baseselection::BaseSelection