@@ -64,10 +64,10 @@ struct ConfKinkFilters : o2::framework::ConfigurableGroup {
6464// selections bits for all kinks
6565#define KINK_DEFAULT_BITS \
6666 o2::framework::Configurable<std::vector<float >> kinkTopoDcaMax{" kinkTopoDcaMax" , {2 .0f }, " Maximum kink topological DCA" }; \
67- o2::framework::Configurable<std::vector<float >> transRadMin{" transRadMin" , {0 . 2f }, " Minimum transverse radius (cm)" }; \
67+ o2::framework::Configurable<std::vector<float >> transRadMin{" transRadMin" , {20 . f }, " Minimum transverse radius (cm)" }; \
6868 o2::framework::Configurable<std::vector<float >> transRadMax{" transRadMax" , {100 .f }, " Maximum transverse radius (cm)" }; \
69- o2::framework::Configurable<std::vector<float >> dauAbsEtaMax{" dauAbsEtaMax" , {0 . 8f }, " Maximum absolute pseudorapidity for daughter track" }; \
70- o2::framework::Configurable<std::vector<float >> dauDcaPvMin{" dauDcaPvMin" , {0 .0f }, " Minimum DCA of daughter from primary vertex (cm)" }; \
69+ o2::framework::Configurable<std::vector<float >> dauAbsEtaMax{" dauAbsEtaMax" , {1 . 0f }, " Maximum absolute pseudorapidity for daughter track" }; \
70+ o2::framework::Configurable<std::vector<float >> dauDcaPvMin{" dauDcaPvMin" , {0 .1f }, " Minimum DCA of daughter from primary vertex (cm)" }; \
7171 o2::framework::Configurable<std::vector<float >> mothDcaPvMax{" mothDcaPvMax" , {1 .0f }, " Maximum DCA of mother from primary vertex (cm)" }; \
7272 o2::framework::Configurable<std::vector<float >> alphaAPMin{" alphaAPMin" , {-1 .0f }, " Minimum Alpha_AP for Sigma candidates" }; \
7373 o2::framework::Configurable<std::vector<float >> alphaAPMax{" alphaAPMax" , {0 .0f }, " Maximum Alpha_AP for Sigma candidates" }; \
@@ -224,8 +224,8 @@ class KinkSelection : public BaseSelection<float, o2::aod::femtodatatypes::KinkM
224224 this ->setupContainers <HistName>(registry);
225225 };
226226
227- template <typename T1, typename T2>
228- void computeQaVariables (T1 const & kinkCand, T2 const & /* tracks*/ )
227+ template <typename T1, typename T2, typename T3 >
228+ void computeKinkKinematics (T1 const & kinkCand, T2 const & /* tracks*/ , T3 const & col )
229229 {
230230 std::array<float , 3 > momMother = {kinkCand.pxMoth (), kinkCand.pyMoth (), kinkCand.pzMoth ()};
231231 float kinkMomP = RecoDecay::p (momMother);
@@ -244,7 +244,7 @@ class KinkSelection : public BaseSelection<float, o2::aod::femtodatatypes::KinkM
244244 float p2A = kinkDauP * kinkDauP;
245245 mQtAp = std::sqrt (std::max (0 .f , p2A - dp * dp / p2V0));
246246
247- std::array<float , 3 > vMother = {kinkCand.xDecVtx (), kinkCand.yDecVtx (), kinkCand.zDecVtx ()};
247+ std::array<float , 3 > vMother = {kinkCand.xDecVtx () - col. posX () , kinkCand.yDecVtx () - col. posY () , kinkCand.zDecVtx () - col. posZ ()};
248248 float vMotherNorm = std::sqrt (std::inner_product (vMother.begin (), vMother.end (), vMother.begin (), 0 .f ));
249249 mCosPointingAngle = (vMotherNorm > 0 .f && kinkMomP > 0 .f ) ? (std::inner_product (momMother.begin (), momMother.end (), vMother.begin (), 0 .f )) / (kinkMomP * vMotherNorm) : 0 .f ;
250250 mTransRadius = std::hypot (kinkCand.xDecVtx (), kinkCand.yDecVtx ());
@@ -313,13 +313,8 @@ class KinkSelection : public BaseSelection<float, o2::aod::femtodatatypes::KinkM
313313 mKinkMotherPhi = RecoDecay::phi (momMother);
314314
315315 // Recalculate pT using kinematic constraints
316- float ptRecalc = utils::calcPtnew (momMother[0 ], momMother[1 ], momMother[2 ],
317- momDaughter[0 ], momDaughter[1 ], momDaughter[2 ]);
318- if (ptRecalc > 0 .f ) {
319- mKinkMotherPt = ptRecalc;
320- } else {
321- mKinkMotherPt = -1 .f ;
322- }
316+ float ptRecalc = utils::calcPtnew (momMother[0 ], momMother[1 ], momMother[2 ], momDaughter[0 ], momDaughter[1 ], momDaughter[2 ]);
317+ mKinkMotherPt = (ptRecalc > 0 .f ) ? ptRecalc : std::hypot (momMother[0 ], momMother[1 ]);
323318 }
324319
325320 template <typename T>
@@ -435,8 +430,8 @@ class KinkBuilder
435430 LOG (info) << " Initialization done..." ;
436431 }
437432
438- template <modes::System system, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9 >
439- void fillKinks (T1 const & col, T2& collisionBuilder, T3& collisionProducts, T4& trackProducts, T5& kinkProducts, T6 const & kinks, T7 const & tracks, T8 const & tracksWithItsPid, T9 & trackBuilder)
433+ template <modes::System system, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8>
434+ void fillKinks (T1 const & col, T2& collisionBuilder, T3& collisionProducts, T4& trackProducts, T5& kinkProducts, T6 const & kinks, T7 const & tracks, T8& trackBuilder)
440435 {
441436 if (!mFillAnyTable ) {
442437 return ;
@@ -450,20 +445,15 @@ class KinkBuilder
450445 continue ;
451446 }
452447 // compute qa variables before applying selections
453- mKinkSelection .computeQaVariables (kink, tracks);
448+ mKinkSelection .computeKinkKinematics (kink, tracks, col );
454449 mKinkSelection .applySelections (kink, tracks);
455450 if (!mKinkSelection .passesAllRequiredSelections ()) {
456451 continue ;
457452 }
458453
459454 collisionBuilder.template fillCollision <system>(collisionProducts, col);
460- // cleaner, but without ITS pid: auto daughter = kink.template trackDaug_as<T7>();
461- int64_t idx = kink.trackDaugId () - tracksWithItsPid.offset ();
462- // check for valid index
463- if (idx < 0 || idx >= static_cast <int64_t >(tracksWithItsPid.size ())) {
464- return ;
465- }
466- auto daughter = tracksWithItsPid.iteratorAt (idx);
455+
456+ auto daughter = kink.template trackDaug_as <T7>();
467457 daughterIndex = trackBuilder.template getDaughterIndex <modes::Track::kKinkDaughter >(daughter, trackProducts, collisionProducts);
468458 if constexpr (modes::isEqual (kinkType, modes::Kink::kSigma )) {
469459 fillSigma (collisionProducts, kinkProducts, kink, daughterIndex);
@@ -474,8 +464,8 @@ class KinkBuilder
474464 }
475465 }
476466
477- template <modes::System system, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13 >
478- void fillMcKinks (T1 const & col, T2& collisionBuilder, T3& collisionProducts, T4 const & mcCols, T5& trackProducts, T6& kinkProducts, T7 const & kinks, T8 const & tracks, T9 const & tracksWithItsPid , T10& trackBuilder, T11 const & mcParticles, T12 & mcBuilder, T13 & mcProducts)
467+ template <modes::System system, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12>
468+ void fillMcKinks (T1 const & col, T2& collisionBuilder, T3& collisionProducts, T4 const & mcCols, T5& trackProducts, T6& kinkProducts, T7 const & kinks, T8 const & tracks, T9& trackBuilder , T10 const & mcParticles, T11 & mcBuilder, T12 & mcProducts)
479469 {
480470
481471 if (!mFillAnyTable ) {
@@ -489,22 +479,16 @@ class KinkBuilder
489479 continue ;
490480 }
491481 // compute qa variables before applying selections
492- mKinkSelection .computeQaVariables (kink, tracks);
482+ mKinkSelection .computeKinkKinematics (kink, tracks, col );
493483 mKinkSelection .applySelections (kink, tracks);
494484 if (!mKinkSelection .passesAllRequiredSelections ()) {
495485 continue ;
496486 }
497487
498488 collisionBuilder.template fillMcCollision <system>(collisionProducts, col, mcCols, mcProducts, mcBuilder);
499489
500- int64_t idx = kink.trackDaugId () - tracks.offset ();
501- // check for valid index
502- if (idx < 0 || idx >= static_cast <int64_t >(tracks.size ())) {
503- return ;
504- }
505- auto daughter = tracks.iteratorAt (idx);
506- auto daughterWithItsPid = tracksWithItsPid.iteratorAt (idx);
507- daughterIndex = trackBuilder.template getDaughterIndex <system, modes::Track::kKinkDaughter >(col, collisionProducts, mcCols, daughter, daughterWithItsPid, trackProducts, mcParticles, mcBuilder, mcProducts);
490+ auto daughter = kink.template trackDaug_as <T8>();
491+ daughterIndex = trackBuilder.template getDaughterIndex <system, modes::Track::kKinkDaughter >(col, collisionProducts, mcCols, daughter, trackProducts, mcParticles, mcBuilder, mcProducts);
508492
509493 if constexpr (modes::isEqual (kinkType, modes::Kink::kSigma )) {
510494 fillSigma (collisionProducts, kinkProducts, kink, daughterIndex);
0 commit comments