@@ -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 computeQaVariables (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,10 @@ 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+ // Cosine of pointing angle
248+ std::array<float , 3 > vMother = {kinkCand.xDecVtx () - col.posX (),
249+ kinkCand.yDecVtx () - col.posY (),
250+ kinkCand.zDecVtx () - col.posZ ()};
248251 float vMotherNorm = std::sqrt (std::inner_product (vMother.begin (), vMother.end (), vMother.begin (), 0 .f ));
249252 mCosPointingAngle = (vMotherNorm > 0 .f && kinkMomP > 0 .f ) ? (std::inner_product (momMother.begin (), momMother.end (), vMother.begin (), 0 .f )) / (kinkMomP * vMotherNorm) : 0 .f ;
250253 mTransRadius = std::hypot (kinkCand.xDecVtx (), kinkCand.yDecVtx ());
@@ -315,11 +318,7 @@ class KinkSelection : public BaseSelection<float, o2::aod::femtodatatypes::KinkM
315318 // Recalculate pT using kinematic constraints
316319 float ptRecalc = utils::calcPtnew (momMother[0 ], momMother[1 ], momMother[2 ],
317320 momDaughter[0 ], momDaughter[1 ], momDaughter[2 ]);
318- if (ptRecalc > 0 .f ) {
319- mKinkMotherPt = ptRecalc;
320- } else {
321- mKinkMotherPt = -1 .f ;
322- }
321+ mKinkMotherPt = (ptRecalc > 0 .f ) ? ptRecalc : std::hypot (momMother[0 ], momMother[1 ]);
323322 }
324323
325324 template <typename T>
@@ -450,20 +449,18 @@ class KinkBuilder
450449 continue ;
451450 }
452451 // compute qa variables before applying selections
453- mKinkSelection .computeQaVariables (kink, tracks);
452+ mKinkSelection .computeQaVariables (kink, tracks, col );
454453 mKinkSelection .applySelections (kink, tracks);
455454 if (!mKinkSelection .passesAllRequiredSelections ()) {
456455 continue ;
457456 }
458457
459458 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);
459+ // int64_t idx = kink.trackDaugId() - tracksWithItsPid.offset();
460+ // if (idx < 0 || idx >= static_cast<int64_t>(tracksWithItsPid.size())) {
461+ // return;
462+ // }
463+ auto daughter = kink.template trackDaug_as <T7 >();
467464 daughterIndex = trackBuilder.template getDaughterIndex <modes::Track::kKinkDaughter >(daughter, trackProducts, collisionProducts);
468465 if constexpr (modes::isEqual (kinkType, modes::Kink::kSigma )) {
469466 fillSigma (collisionProducts, kinkProducts, kink, daughterIndex);
@@ -489,21 +486,19 @@ class KinkBuilder
489486 continue ;
490487 }
491488 // compute qa variables before applying selections
492- mKinkSelection .computeQaVariables (kink, tracks);
489+ mKinkSelection .computeQaVariables (kink, tracks, col );
493490 mKinkSelection .applySelections (kink, tracks);
494491 if (!mKinkSelection .passesAllRequiredSelections ()) {
495492 continue ;
496493 }
497494
498495 collisionBuilder.template fillMcCollision <system>(collisionProducts, col, mcCols, mcProducts, mcBuilder);
499496
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);
497+ // Same fix as fillKinks: relationship navigation on T8 (tracks) resolves cross-collision
498+ // daughters. T8 = Run3McRecoTracks has MC labels needed for MC processing. ITS NSigma
499+ // is unavailable (stored as 0.f via fillTrack's if constexpr), which is acceptable.
500+ auto daughter = kink.template trackDaug_as <T8 >();
501+ auto daughterWithItsPid = kink.template trackDaug_as <T8 >();
507502 daughterIndex = trackBuilder.template getDaughterIndex <system, modes::Track::kKinkDaughter >(col, collisionProducts, mcCols, daughter, daughterWithItsPid, trackProducts, mcParticles, mcBuilder, mcProducts);
508503
509504 if constexpr (modes::isEqual (kinkType, modes::Kink::kSigma )) {
0 commit comments