@@ -80,6 +80,8 @@ constexpr std::array<int, kNDaughterType> kDaughterPDG = {
8080 PDG_t::kNeutron ,
8181 PDG_t::kPi0 };
8282
83+ const std::array<float , 6 > covPosSV{6 .4462712107237135f , 0 .1309793068144521f , 6 .626654155592929f , -0 .4510297694023185f , 0 .16996629627762413f , 4 .109195981415627f };
84+
8385std::shared_ptr<TH1> hMotherCounter;
8486std::shared_ptr<TH1> hMother2BCounter;
8587std::shared_ptr<TH1> hDauCounter[kNChargedDaughterType ];
@@ -224,6 +226,41 @@ float getTPCNSigma(const TTrack& track, const int daughterType)
224226 return nSigma;
225227}
226228
229+ // --------------------------------------------------------------
230+ // Refit the momentum of the mother track
231+ template <typename TCollision, typename TTrack>
232+ std::array<float , 3 > refitMotherTrack (TCollision& collision, TTrack& track, std::array<float , 3 > posSV)
233+ {
234+ auto trackPar = getTrackParCov (track);
235+
236+ float trackIUPos[2 ] = {track.y (), track.z ()};
237+ float trackIUCov[3 ] = {track.cYY (), track.cZY (), track.cZZ ()};
238+ o2::dataformats::VertexBase primaryVtx = {{collision.posX (), collision.posY (), collision.posZ ()}, {collision.covXX (), collision.covXY (), collision.covYY (), collision.covXZ (), collision.covYZ (), collision.covZZ ()}};
239+ o2::dataformats::VertexBase secondaryVtx = {{posSV[0 ], posSV[1 ], posSV[2 ]}, {covPosSV[0 ], covPosSV[1 ], covPosSV[2 ], covPosSV[3 ], covPosSV[4 ], covPosSV[5 ]}};
240+
241+ o2::base::Propagator::Instance ()->propagateToDCABxByBz (primaryVtx, trackPar, 2 .f , o2::base::Propagator::MatCorrType::USEMatCorrLUT);
242+
243+ trackPar.resetCovariance (999 .f );
244+ std::array<float , 3 > refitP = {-999 .f , -999 .f , -999 .f };
245+ if (!trackPar.update (primaryVtx, 999 .f )) {
246+ return refitP;
247+ }
248+
249+ trackPar.rotate (track.alpha ());
250+ o2::base::Propagator::Instance ()->PropagateToXBxByBz (trackPar, track.x ());
251+ if (!trackPar.update (trackIUPos, trackIUCov)) {
252+ return refitP;
253+ }
254+
255+ o2::base::Propagator::Instance ()->propagateToDCABxByBz (secondaryVtx, trackPar, 2 .f , o2::base::Propagator::MatCorrType::USEMatCorrLUT);
256+ if (!trackPar.update (secondaryVtx, 999 .f )) {
257+ return refitP;
258+ }
259+
260+ trackPar.getPxPyPzGlo (refitP);
261+ return refitP;
262+ }
263+
227264// --------------------------------------------------------------
228265struct Hyphe4sCandidate {
229266
@@ -475,12 +512,19 @@ struct Hyperhelium4sigmaRecoTask {
475512 Hyphe4sCandidate hyphe4sCand;
476513 fillCandidate (hyphe4sCand, collision, kinkCand, motherTrack, dauTrack);
477514
515+ std::array<float , 3 > posDecVtx = {kinkCand.xDecVtx () + collision.posX (), kinkCand.yDecVtx () + collision.posY (), kinkCand.zDecVtx () + collision.posZ ()};
516+ auto refitP = refitMotherTrack (collision, motherTrack, posDecVtx);
517+ for (size_t i = 0 ; i < refitP.size (); ++i) {
518+ refitP[i] *= 2 .f ;
519+ }
520+
478521 outputDataTable (
479522 hyphe4sCand.primVtx [0 ], hyphe4sCand.primVtx [1 ], hyphe4sCand.primVtx [2 ],
480523 hyphe4sCand.decVtx [0 ], hyphe4sCand.decVtx [1 ], hyphe4sCand.decVtx [2 ],
481524 hyphe4sCand.isMatter ,
482525 hyphe4sCand.lastPosMoth [0 ], hyphe4sCand.lastPosMoth [1 ], hyphe4sCand.lastPosMoth [2 ],
483526 hyphe4sCand.momMoth [0 ], hyphe4sCand.momMoth [1 ], hyphe4sCand.momMoth [2 ],
527+ refitP[0 ], refitP[1 ], refitP[2 ],
484528 hyphe4sCand.momDaug [0 ], hyphe4sCand.momDaug [1 ], hyphe4sCand.momDaug [2 ],
485529 hyphe4sCand.dcaXYMothPv , hyphe4sCand.dcaXYDauPv , hyphe4sCand.dcaKinkTopo ,
486530 hyphe4sCand.chi2ITSMoth , hyphe4sCand.itsClusterSizeMoth , hyphe4sCand.itsClusterSizeDau ,
@@ -554,6 +598,12 @@ struct Hyperhelium4sigmaRecoTask {
554598 Hyphe4sCandidate hyphe4sCand;
555599 fillCandidate (hyphe4sCand, collision, kinkCand, motherTrack, dauTrack);
556600
601+ std::array<float , 3 > posDecVtx = {kinkCand.xDecVtx () + collision.posX (), kinkCand.yDecVtx () + collision.posY (), kinkCand.zDecVtx () + collision.posZ ()};
602+ auto refitP = refitMotherTrack (collision, motherTrack, posDecVtx);
603+ for (size_t i = 0 ; i < refitP.size (); ++i) {
604+ refitP[i] *= 2 .f ;
605+ }
606+
557607 // qa for true signal
558608 if (isTrueSignal) {
559609 auto mcMotherTrack = motherTrack.mcParticle_as <aod::McParticles>();
@@ -620,6 +670,7 @@ struct Hyperhelium4sigmaRecoTask {
620670 hyphe4sCand.isMatter ,
621671 hyphe4sCand.lastPosMoth [0 ], hyphe4sCand.lastPosMoth [1 ], hyphe4sCand.lastPosMoth [2 ],
622672 hyphe4sCand.momMoth [0 ], hyphe4sCand.momMoth [1 ], hyphe4sCand.momMoth [2 ],
673+ refitP[0 ], refitP[1 ], refitP[2 ],
623674 hyphe4sCand.momDaug [0 ], hyphe4sCand.momDaug [1 ], hyphe4sCand.momDaug [2 ],
624675 hyphe4sCand.dcaXYMothPv , hyphe4sCand.dcaXYDauPv , hyphe4sCand.dcaKinkTopo ,
625676 hyphe4sCand.chi2ITSMoth , hyphe4sCand.itsClusterSizeMoth , hyphe4sCand.itsClusterSizeDau ,
@@ -661,6 +712,7 @@ struct Hyperhelium4sigmaRecoTask {
661712 -1 , -1 , -1 ,
662713 -1 , -1 , -1 ,
663714 -1 , -1 , -1 ,
715+ -1 , -1 , -1 ,
664716 -1 , -1 ,
665717 true , false , isReconstructedMCCollisions[mcparticle.mcCollisionId ()], isSelectedMCCollisions[mcparticle.mcCollisionId ()],
666718 hyphe4sCand.trueDecVtx [0 ], hyphe4sCand.trueDecVtx [1 ], hyphe4sCand.trueDecVtx [2 ],
0 commit comments