@@ -85,6 +85,7 @@ struct ConfLambdaBits : o2::framework::ConfigurableGroup {
8585 o2::framework::Configurable<std::vector<float >> posDauTofProton{" posDauTofProton" , {}, " Maximum |nsigma_Proton| TOF for positive daughter tracks" };
8686 o2::framework::Configurable<std::vector<float >> negDauTofPion{" negDauTofPion" , {}, " Maximum |nsigma_Pion| TOF for negative daughter tracks" };
8787 o2::framework::Configurable<std::vector<float >> negDauTofProton{" negDauTofProton" , {}, " Maximum |nsigma_Proton| TOF for negative daughter tracks" };
88+ o2::framework::Configurable<bool > requireTof{" requireTof" , false , " If true, only keep candidates whose daughters have a TOF signal" };
8889};
8990
9091// derived selection bits for K0Short
@@ -95,6 +96,7 @@ struct ConfK0shortBits : o2::framework::ConfigurableGroup {
9596 o2::framework::Configurable<std::vector<float >> negDauTpcPion{" negDauTpcPion" , {5 .f }, " Maximum |nsimga_Pion| TPC for negative daughter tracks" };
9697 o2::framework::Configurable<std::vector<float >> posDauTofPion{" posDauTofPion" , {}, " Maximum |nsigma_Pion| TOF for positive daughter tracks" };
9798 o2::framework::Configurable<std::vector<float >> negDauTofPion{" negDauTofPion" , {}, " Maximum |nsigma_Pion| TOF for negative daughter tracks" };
99+ o2::framework::Configurable<bool > requireTof{" requireTof" , false , " If true, only keep candidates whose daughters have a TOF signal" };
98100};
99101
100102#undef V0_DEFAULT_BITS
@@ -246,6 +248,7 @@ class V0Selection : public baseselection::BaseSelection<float, datatypes::V0Mask
246248 mEtaMax = filter.etaMax .value ;
247249 mPhiMin = filter.phiMin .value ;
248250 mPhiMax = filter.phiMax .value ;
251+ mRequireTof = config.requireTof .value ;
249252
250253 if constexpr (modes::isEqual (v0Type, modes::V0 ::kLambda ) || modes::isEqual (v0Type, modes::V0 ::kAntiLambda )) {
251254 mMassLambdaLowerLimit = filter.massMinLambda .value ;
@@ -257,15 +260,15 @@ class V0Selection : public baseselection::BaseSelection<float, datatypes::V0Mask
257260 if constexpr (modes::isEqual (v0Type, modes::V0 ::kLambda )) {
258261 this ->addSelection (kPosDaughTpcProton , v0SelectionNames.at (kPosDaughTpcProton ), config.posDauTpcProton .value , limits::kAbsUpperLimit , true , true , false );
259262 this ->addSelection (kNegDaughTpcPion , v0SelectionNames.at (kNegDaughTpcPion ), config.negDauTpcPion .value , limits::kAbsUpperLimit , true , true , false );
260- this ->addSelection (kPosDaughTofProton , v0SelectionNames.at (kPosDaughTofProton ), config.posDauTofProton .value , limits::kAbsUpperLimit , true , true , false );
261- this ->addSelection (kNegDaughTofPion , v0SelectionNames.at (kNegDaughTofPion ), config.negDauTofPion .value , limits::kAbsUpperLimit , true , true , false );
263+ this ->addSelection (kPosDaughTofProton , v0SelectionNames.at (kPosDaughTofProton ), config.posDauTofProton .value , limits::kAbsUpperLimit , true , false , false );
264+ this ->addSelection (kNegDaughTofPion , v0SelectionNames.at (kNegDaughTofPion ), config.negDauTofPion .value , limits::kAbsUpperLimit , true , false , false );
262265 }
263266
264267 if constexpr (modes::isEqual (v0Type, modes::V0 ::kAntiLambda )) {
265268 this ->addSelection (kPosDaughTpcPion , v0SelectionNames.at (kPosDaughTpcPion ), config.posDauTpcPion .value , limits::kAbsUpperLimit , true , true , false );
266269 this ->addSelection (kNegDaughTpcProton , v0SelectionNames.at (kNegDaughTpcProton ), config.negDauTpcProton .value , limits::kAbsUpperLimit , true , true , false );
267- this ->addSelection (kPosDaughTofPion , v0SelectionNames.at (kPosDaughTofPion ), config.posDauTofPion .value , limits::kAbsUpperLimit , true , true , false );
268- this ->addSelection (kNegDaughTofProton , v0SelectionNames.at (kNegDaughTofProton ), config.negDauTofProton .value , limits::kAbsUpperLimit , true , true , false );
270+ this ->addSelection (kPosDaughTofPion , v0SelectionNames.at (kPosDaughTofPion ), config.posDauTofPion .value , limits::kAbsUpperLimit , true , false , false );
271+ this ->addSelection (kNegDaughTofProton , v0SelectionNames.at (kNegDaughTofProton ), config.negDauTofProton .value , limits::kAbsUpperLimit , true , false , false );
269272 }
270273 }
271274 if constexpr (modes::isEqual (v0Type, modes::V0 ::kK0short )) {
@@ -277,8 +280,8 @@ class V0Selection : public baseselection::BaseSelection<float, datatypes::V0Mask
277280
278281 this ->addSelection (kPosDaughTpcPion , v0SelectionNames.at (kPosDaughTpcPion ), config.posDauTpcPion .value , limits::kAbsUpperLimit , true , true , false );
279282 this ->addSelection (kNegDaughTpcPion , v0SelectionNames.at (kNegDaughTpcPion ), config.negDauTpcPion .value , limits::kAbsUpperLimit , true , true , false );
280- this ->addSelection (kPosDaughTofPion , v0SelectionNames.at (kPosDaughTofPion ), config.posDauTofPion .value , limits::kAbsUpperLimit , true , true , false );
281- this ->addSelection (kNegDaughTofPion , v0SelectionNames.at (kNegDaughTofPion ), config.negDauTofPion .value , limits::kAbsUpperLimit , true , true , false );
283+ this ->addSelection (kPosDaughTofPion , v0SelectionNames.at (kPosDaughTofPion ), config.posDauTofPion .value , limits::kAbsUpperLimit , true , false , false );
284+ this ->addSelection (kNegDaughTofPion , v0SelectionNames.at (kNegDaughTofPion ), config.negDauTofPion .value , limits::kAbsUpperLimit , true , false , false );
282285 }
283286
284287 this ->addSelection (kDcaDaughMax , v0SelectionNames.at (kDcaDaughMax ), config.dcaDauMax .value , limits::kAbsUpperLimit , true , true , false );
@@ -345,10 +348,16 @@ class V0Selection : public baseselection::BaseSelection<float, datatypes::V0Mask
345348 if (posDaughter.hasTOF ()) {
346349 this ->evaluateObservable (kPosDaughTofPion , posDaughter.tofNSigmaPi ());
347350 this ->evaluateObservable (kPosDaughTofProton , posDaughter.tofNSigmaPr ());
351+ } else if (!mRequireTof ) {
352+ this ->setBitmask (kPosDaughTofPion , std::numeric_limits<datatypes::V0MaskType>::max ());
353+ this ->setBitmask (kPosDaughTofProton , std::numeric_limits<datatypes::V0MaskType>::max ());
348354 }
349355 if (negDaughter.hasTOF ()) {
350356 this ->evaluateObservable (kNegDaughTofPion , negDaughter.tofNSigmaPi ());
351357 this ->evaluateObservable (kNegDaughTofProton , negDaughter.tofNSigmaPr ());
358+ } else if (!mRequireTof ) {
359+ this ->setBitmask (kNegDaughTofPion , std::numeric_limits<datatypes::V0MaskType>::max ());
360+ this ->setBitmask (kNegDaughTofProton , std::numeric_limits<datatypes::V0MaskType>::max ());
352361 }
353362
354363 this ->assembleBitmask <SelectionHistName>();
@@ -452,6 +461,8 @@ class V0Selection : public baseselection::BaseSelection<float, datatypes::V0Mask
452461 float mEtaMax = 1 .f;
453462 float mPhiMin = 0 .f;
454463 float mPhiMax = o2::constants::math::TwoPI;
464+
465+ bool mRequireTof = false ;
455466};
456467
457468struct V0BuilderProducts : o2::framework::ProducesGroup {
0 commit comments