@@ -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,34 @@ 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+ std::array<float , 3 > innermostPos = {0 .f };
237+ std::array<float , 21 > innermostCov = {0 .f };
238+ trackPar.getXYZGlo (innermostPos);
239+ trackPar.getCovXYZPxPyPzGlo (innermostCov);
240+
241+ o2::dataformats::VertexBase primaryVtx = {{collision.posX (), collision.posY (), collision.posZ ()}, {collision.covXX (), collision.covXY (), collision.covYY (), collision.covXZ (), collision.covYZ (), collision.covZZ ()}};
242+ o2::dataformats::VertexBase innermostVtx = {{innermostPos[0 ], innermostPos[1 ], innermostPos[2 ]}, {innermostCov[0 ], innermostCov[1 ], innermostCov[2 ], innermostCov[3 ], innermostCov[4 ], innermostCov[5 ]}};
243+ o2::dataformats::VertexBase secondaryVtx = {{posSV[0 ], posSV[1 ], posSV[2 ]}, {covPosSV[0 ], covPosSV[1 ], covPosSV[2 ], covPosSV[3 ], covPosSV[4 ], covPosSV[5 ]}};
244+
245+ o2::base::Propagator::Instance ()->propagateToDCABxByBz (primaryVtx, trackPar, 2 .f , o2::base::Propagator::MatCorrType::USEMatCorrNONE);
246+
247+ trackPar.resetCovariance (999 .f );
248+ std::array<float , 3 > refitP = {-999 .f , -999 .f , -999 .f };
249+ if (!trackPar.update (primaryVtx, 999 .f ) || !trackPar.update (innermostVtx, 999 .f ) || !trackPar.update (secondaryVtx, 999 .f )) {
250+ return refitP;
251+ }
252+
253+ trackPar.getPxPyPzGlo (refitP);
254+ return refitP;
255+ }
256+
227257// --------------------------------------------------------------
228258struct Hyphe4sCandidate {
229259
@@ -475,12 +505,19 @@ struct Hyperhelium4sigmaRecoTask {
475505 Hyphe4sCandidate hyphe4sCand;
476506 fillCandidate (hyphe4sCand, collision, kinkCand, motherTrack, dauTrack);
477507
508+ std::array<float , 3 > posDecVtx = {kinkCand.xDecVtx () + collision.posX (), kinkCand.yDecVtx () + collision.posY (), kinkCand.zDecVtx () + collision.posZ ()};
509+ auto refitP = refitMotherTrack (collision, motherTrack, posDecVtx);
510+ for (int i = 0 ; i < refitP.size (); ++i) {
511+ refitP[i] *= 2 .f ;
512+ }
513+
478514 outputDataTable (
479515 hyphe4sCand.primVtx [0 ], hyphe4sCand.primVtx [1 ], hyphe4sCand.primVtx [2 ],
480516 hyphe4sCand.decVtx [0 ], hyphe4sCand.decVtx [1 ], hyphe4sCand.decVtx [2 ],
481517 hyphe4sCand.isMatter ,
482518 hyphe4sCand.lastPosMoth [0 ], hyphe4sCand.lastPosMoth [1 ], hyphe4sCand.lastPosMoth [2 ],
483519 hyphe4sCand.momMoth [0 ], hyphe4sCand.momMoth [1 ], hyphe4sCand.momMoth [2 ],
520+ refitP[0 ], refitP[1 ], refitP[2 ],
484521 hyphe4sCand.momDaug [0 ], hyphe4sCand.momDaug [1 ], hyphe4sCand.momDaug [2 ],
485522 hyphe4sCand.dcaXYMothPv , hyphe4sCand.dcaXYDauPv , hyphe4sCand.dcaKinkTopo ,
486523 hyphe4sCand.chi2ITSMoth , hyphe4sCand.itsClusterSizeMoth , hyphe4sCand.itsClusterSizeDau ,
@@ -554,6 +591,12 @@ struct Hyperhelium4sigmaRecoTask {
554591 Hyphe4sCandidate hyphe4sCand;
555592 fillCandidate (hyphe4sCand, collision, kinkCand, motherTrack, dauTrack);
556593
594+ std::array<float , 3 > posDecVtx = {kinkCand.xDecVtx () + collision.posX (), kinkCand.yDecVtx () + collision.posY (), kinkCand.zDecVtx () + collision.posZ ()};
595+ auto refitP = refitMotherTrack (collision, motherTrack, posDecVtx);
596+ for (int i = 0 ; i < refitP.size (); ++i) {
597+ refitP[i] *= 2 .f ;
598+ }
599+
557600 // qa for true signal
558601 if (isTrueSignal) {
559602 auto mcMotherTrack = motherTrack.mcParticle_as <aod::McParticles>();
@@ -620,6 +663,7 @@ struct Hyperhelium4sigmaRecoTask {
620663 hyphe4sCand.isMatter ,
621664 hyphe4sCand.lastPosMoth [0 ], hyphe4sCand.lastPosMoth [1 ], hyphe4sCand.lastPosMoth [2 ],
622665 hyphe4sCand.momMoth [0 ], hyphe4sCand.momMoth [1 ], hyphe4sCand.momMoth [2 ],
666+ refitP[0 ], refitP[1 ], refitP[2 ],
623667 hyphe4sCand.momDaug [0 ], hyphe4sCand.momDaug [1 ], hyphe4sCand.momDaug [2 ],
624668 hyphe4sCand.dcaXYMothPv , hyphe4sCand.dcaXYDauPv , hyphe4sCand.dcaKinkTopo ,
625669 hyphe4sCand.chi2ITSMoth , hyphe4sCand.itsClusterSizeMoth , hyphe4sCand.itsClusterSizeDau ,
@@ -661,6 +705,7 @@ struct Hyperhelium4sigmaRecoTask {
661705 -1 , -1 , -1 ,
662706 -1 , -1 , -1 ,
663707 -1 , -1 , -1 ,
708+ -1 , -1 , -1 ,
664709 -1 , -1 ,
665710 true , false , isReconstructedMCCollisions[mcparticle.mcCollisionId ()], isSelectedMCCollisions[mcparticle.mcCollisionId ()],
666711 hyphe4sCand.trueDecVtx [0 ], hyphe4sCand.trueDecVtx [1 ], hyphe4sCand.trueDecVtx [2 ],
0 commit comments