@@ -78,7 +78,9 @@ struct ConfCascadeFilters : o2::framework::ConfigurableGroup {
7878 o2::framework::Configurable<std::vector<float >> posDauTpc{" posDauTpc" , {5 .f }, " Maximum |nsimga_Pion/Proton| TPC for positive daughter tracks" }; \
7979 o2::framework::Configurable<std::vector<float >> negDauTpc{" negDauTpc" , {5 .f }, " Maximum |nsimga_Pion/Proton| TPC for negative daughter tracks" }; \
8080 o2::framework::Configurable<std::vector<float >> posDauTof{" posDauTof" , {}, " Maximum |nsimga_Pion/Proton| TOF for positive daughter tracks" }; \
81- o2::framework::Configurable<std::vector<float >> negDauTof{" negDauTof" , {}, " Maximum |nsigma_Pion/Proton| TOF for negative daughter tracks" };
81+ o2::framework::Configurable<std::vector<float >> negDauTof{" negDauTof" , {}, " Maximum |nsigma_Pion/Proton| TOF for negative daughter tracks" }; \
82+ o2::framework::Configurable<bool > requireTof{" requireTof" , false , " If true, TOF PID is a mandatory selection" }; \
83+ o2::framework::Configurable<bool > keepTracksWithoutTof{" keepTracksWithoutTof" , true , " If true, candidates whose daughters have no TOF signal are kept" };
8284
8385struct ConfXiBits : o2::framework::ConfigurableGroup {
8486 std::string prefix = std::string(" XiBits" );
@@ -242,7 +244,7 @@ class CascadeSelection : public baseselection::BaseSelection<float, o2::analysis
242244 mOmegaMassLowerLimit = filter.rejectMassOmegaMin .value ;
243245 mOmegaMassUpperLimit = filter.rejectMassOmegaMax .value ;
244246 this ->addSelection (kBachelorTpcPion , cascadeSelectionNames.at (kBachelorTpcPion ), config.bachelorTpcPion .value , limits::kAbsUpperLimit , true , true , false );
245- this ->addSelection (kBachelorTofPion , cascadeSelectionNames.at (kBachelorTofPion ), config.bachelorTofPion .value , limits::kAbsUpperLimit , true , true , false );
247+ this ->addSelection (kBachelorTofPion , cascadeSelectionNames.at (kBachelorTofPion ), config.bachelorTofPion .value , limits::kAbsUpperLimit , true , mRequireTof , false );
246248 }
247249 if constexpr (modes::isEqual (cascadeType, modes::Cascade::kOmega )) {
248250 mOmegaMassLowerLimit = filter.massOmegaMin .value ;
@@ -251,7 +253,7 @@ class CascadeSelection : public baseselection::BaseSelection<float, o2::analysis
251253 mXiMassLowerLimit = filter.rejectMassXiMin .value ;
252254 mXiMassUpperLimit = filter.rejectMassXiMax .value ;
253255 this ->addSelection (kBachelorTpcKaon , cascadeSelectionNames.at (kBachelorTpcKaon ), config.bachelorTpcKaon .value , limits::kAbsUpperLimit , true , true , false );
254- this ->addSelection (kBachelorTofKaon , cascadeSelectionNames.at (kBachelorTofKaon ), config.bachelorTofKaon .value , limits::kAbsUpperLimit , true , true , false );
256+ this ->addSelection (kBachelorTofKaon , cascadeSelectionNames.at (kBachelorTofKaon ), config.bachelorTofKaon .value , limits::kAbsUpperLimit , true , mRequireTof , false );
255257 }
256258
257259 mPtMin = filter.ptMin .value ;
@@ -262,11 +264,13 @@ class CascadeSelection : public baseselection::BaseSelection<float, o2::analysis
262264 mPhiMax = filter.phiMax .value ;
263265 mLambdaMassMin = filter.massLambdaMin .value ;
264266 mLambdaMassMax = filter.massLambdaMax .value ;
267+ mRequireTof = config.requireTof .value ;
268+ mKeepTracksWithoutTof = config.keepTracksWithoutTof .value ;
265269
266270 this ->addSelection (kPosDauTpc , cascadeSelectionNames.at (kPosDauTpc ), config.posDauTpc .value , limits::kAbsUpperLimit , true , true , false );
267271 this ->addSelection (kNegDauTpc , cascadeSelectionNames.at (kNegDauTpc ), config.negDauTpc .value , limits::kAbsUpperLimit , true , true , false );
268- this ->addSelection (kPosDauTof , cascadeSelectionNames.at (kPosDauTof ), config.posDauTof .value , limits::kAbsUpperLimit , true , true , false );
269- this ->addSelection (kNegDauTof , cascadeSelectionNames.at (kNegDauTof ), config.negDauTof .value , limits::kAbsUpperLimit , true , true , false );
272+ this ->addSelection (kPosDauTof , cascadeSelectionNames.at (kPosDauTof ), config.posDauTof .value , limits::kAbsUpperLimit , true , mRequireTof , false );
273+ this ->addSelection (kNegDauTof , cascadeSelectionNames.at (kNegDauTof ), config.negDauTof .value , limits::kAbsUpperLimit , true , mRequireTof , false );
270274
271275 this ->addSelection (kCascadeCpaMin , cascadeSelectionNames.at (kCascadeCpaMin ), config.cascadeCpaMin .value , limits::kLowerLimit , true , true , false );
272276 this ->addSelection (kCascadeTransRadMin , cascadeSelectionNames.at (kCascadeTransRadMin ), config.cascadeTransRadMin .value , limits::kLowerLimit , true , true , false );
@@ -336,6 +340,9 @@ class CascadeSelection : public baseselection::BaseSelection<float, o2::analysis
336340 if (bachelor.hasTOF ()) {
337341 this ->evaluateObservable (kBachelorTofPion , bachelor.tofNSigmaPi ());
338342 this ->evaluateObservable (kBachelorTofKaon , bachelor.tofNSigmaKa ());
343+ } else if (mKeepTracksWithoutTof ) {
344+ this ->evaluateObservable (kBachelorTofPion , 0 );
345+ this ->evaluateObservable (kBachelorTofKaon , 0 );
339346 }
340347
341348 // depending on the charge, we check lambda or antilambda hypothesis
@@ -344,18 +351,26 @@ class CascadeSelection : public baseselection::BaseSelection<float, o2::analysis
344351 this ->evaluateObservable (kNegDauTpc , negDaughter.tpcNSigmaPi ());
345352 if (posDaughter.hasTOF ()) {
346353 this ->evaluateObservable (kPosDauTof , posDaughter.tofNSigmaPr ());
354+ } else if (mKeepTracksWithoutTof ) {
355+ this ->evaluateObservable (kPosDauTof , 0 );
347356 }
348357 if (negDaughter.hasTOF ()) {
349358 this ->evaluateObservable (kNegDauTof , negDaughter.tofNSigmaPi ());
359+ } else if (mKeepTracksWithoutTof ) {
360+ this ->evaluateObservable (kNegDauTof , 0 );
350361 }
351362 } else if (cascade.sign () > 0 ) {
352363 this ->evaluateObservable (kPosDauTpc , posDaughter.tpcNSigmaPi ());
353364 this ->evaluateObservable (kNegDauTpc , negDaughter.tpcNSigmaPr ());
354365 if (posDaughter.hasTOF ()) {
355366 this ->evaluateObservable (kPosDauTof , posDaughter.tofNSigmaPi ());
367+ } else if (mKeepTracksWithoutTof ) {
368+ this ->evaluateObservable (kPosDauTof , 0 );
356369 }
357370 if (negDaughter.hasTOF ()) {
358371 this ->evaluateObservable (kNegDauTof , negDaughter.tofNSigmaPr ());
372+ } else if (mKeepTracksWithoutTof ) {
373+ this ->evaluateObservable (kNegDauTof , 0 );
359374 }
360375 } else {
361376 LOG (warn) << " Encountered Cascade candidate with 0 charge" ;
@@ -468,6 +483,8 @@ class CascadeSelection : public baseselection::BaseSelection<float, o2::analysis
468483 float mPhiMax = o2::constants::math::TwoPI;
469484 float mLambdaMassMin = 1 .f;
470485 float mLambdaMassMax = 1 .2f ;
486+ bool mRequireTof = false ;
487+ bool mKeepTracksWithoutTof = false ;
471488};
472489
473490struct CascadeBuilderProducts : o2::framework::ProducesGroup {
@@ -619,20 +636,20 @@ class CascadeBuilder
619636 collisionBuilder.template fillMcCollision <system>(collisionProducts, col, mcCols, mcProducts, mcBuilder);
620637
621638 auto bachelor = cascade.template bachelor_as <T8 >();
622- bachelorIndex = trackBuilder.template getDaughterIndex <system, modes::Track::kCascadeBachelor >(col, collisionBuilder , mcCols, bachelor, trackProducts , mcParticles, mcBuilder, mcProducts);
639+ bachelorIndex = trackBuilder.template getDaughterIndex <system, modes::Track::kCascadeBachelor >(bachelor, trackProducts , mcCols, collisionBuilder , mcParticles, mcBuilder, mcProducts);
623640
624641 auto posDaughter = cascade.template posTrack_as <T8 >();
625- posDaughterIndex = trackBuilder.template getDaughterIndex <system, modes::Track::kV0Daughter >(col, collisionBuilder , mcCols, posDaughter, trackProducts , mcParticles, mcBuilder, mcProducts);
642+ posDaughterIndex = trackBuilder.template getDaughterIndex <system, modes::Track::kV0Daughter >(posDaughter, trackProducts , mcCols, collisionBuilder , mcParticles, mcBuilder, mcProducts);
626643
627644 auto negDaughter = cascade.template negTrack_as <T8 >();
628- negDaughterIndex = trackBuilder.template getDaughterIndex <system, modes::Track::kV0Daughter >(col, collisionBuilder , mcCols, negDaughter, trackProducts , mcParticles, mcBuilder, mcProducts);
645+ negDaughterIndex = trackBuilder.template getDaughterIndex <system, modes::Track::kV0Daughter >(negDaughter, trackProducts , mcCols, collisionBuilder , mcParticles, mcBuilder, mcProducts);
629646
630647 fillCascade (collisionBuilder, cascadeProducts, cascade, col, bachelorIndex, posDaughterIndex, negDaughterIndex);
631648 if constexpr (modes::isEqual (cascadeType, modes::Cascade::kXi )) {
632- mcBuilder.template fillMcXiWithLabel <system>(col, mcCols, cascade, mcParticles, mcProducts);
649+ mcBuilder.template fillMcXiWithLabel <system>(cascade, mcParticles, mcCols , mcProducts);
633650 }
634651 if constexpr (modes::isEqual (cascadeType, modes::Cascade::kOmega )) {
635- mcBuilder.template fillMcOmegaWithLabel <system>(col, mcCols, cascade, mcParticles, mcProducts);
652+ mcBuilder.template fillMcOmegaWithLabel <system>(cascade, mcParticles, mcCols , mcProducts);
636653 }
637654 }
638655 }
@@ -716,7 +733,8 @@ class CascadeBuilder
716733 }
717734 }
718735
719- bool fillAnyTable () { return mFillAnyTable ; }
736+ [[nodiscard]] bool fillAnyTable () const { return mFillAnyTable ; }
737+ [[nodiscard]] bool isPassThrough () const { return mCascadeSelection .isPassThrough (); }
720738
721739 private:
722740 CascadeSelection<cascadeType, SelectionHistName, FilterHistName> mCascadeSelection ;
0 commit comments