Skip to content

Commit 5f358d6

Browse files
authored
[PWGLF] Try to use PV and SV to correct momentum of short tracks (#12024)
1 parent 4664832 commit 5f358d6

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed

PWGLF/DataModel/LFHyperhelium4sigmaTables.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ DECLARE_SOA_COLUMN(ZMoth, zMoth, float); // Z o
3636
DECLARE_SOA_COLUMN(PxMoth, pxMoth, float); //! Px of the mother track at the decay vertex
3737
DECLARE_SOA_COLUMN(PyMoth, pyMoth, float); //! Py of the mother track at the decay vertex
3838
DECLARE_SOA_COLUMN(PzMoth, pzMoth, float); //! Pz of the mother track at the decay vertex
39+
DECLARE_SOA_COLUMN(RefitPxMoth, refitPxMoth, float); //! Refit Px of the mother track at the decay vertex
40+
DECLARE_SOA_COLUMN(RefitPyMoth, refitPyMoth, float); //! Refit Py of the mother track at the decay vertex
41+
DECLARE_SOA_COLUMN(RefitPzMoth, refitPzMoth, float); //! Refit Pz of the mother track at the decay vertex
3942
DECLARE_SOA_COLUMN(PxAlpha, pxAlpha, float); //! Px of the daughter alpha track at the decay vertex
4043
DECLARE_SOA_COLUMN(PyAlpha, pyAlpha, float); //! Py of the daughter alpha track at the decay vertex
4144
DECLARE_SOA_COLUMN(PzAlpha, pzAlpha, float); //! Pz of the daughter alpha track at the decay vertex
@@ -77,6 +80,7 @@ DECLARE_SOA_TABLE(He4S2BCands, "AOD", "HE4S2BCANDS",
7780
he4scand::IsMatter,
7881
he4scand::XMoth, he4scand::YMoth, he4scand::ZMoth,
7982
he4scand::PxMoth, he4scand::PyMoth, he4scand::PzMoth,
83+
he4scand::RefitPxMoth, he4scand::RefitPyMoth, he4scand::RefitPzMoth,
8084
he4scand::PxAlpha, he4scand::PyAlpha, he4scand::PzAlpha,
8185
he4scand::DcaMothPv, he4scand::DcaAlphaPv, he4scand::DcaKinkTopo,
8286
he4scand::ItsChi2Moth, he4scand::ItsClusterSizesMoth, he4scand::ItsClusterSizesAlpha,
@@ -89,6 +93,7 @@ DECLARE_SOA_TABLE(MCHe4S2BCands, "AOD", "MCHE4S2BCANDS",
8993
he4scand::IsMatter,
9094
he4scand::XMoth, he4scand::YMoth, he4scand::ZMoth,
9195
he4scand::PxMoth, he4scand::PyMoth, he4scand::PzMoth,
96+
he4scand::RefitPxMoth, he4scand::RefitPyMoth, he4scand::RefitPzMoth,
9297
he4scand::PxAlpha, he4scand::PyAlpha, he4scand::PzAlpha,
9398
he4scand::DcaMothPv, he4scand::DcaAlphaPv, he4scand::DcaKinkTopo,
9499
he4scand::ItsChi2Moth, he4scand::ItsClusterSizesMoth, he4scand::ItsClusterSizesAlpha,

PWGLF/TableProducer/Nuspex/hyperhelium4sigmaRecoTask.cxx

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
8385
std::shared_ptr<TH1> hMotherCounter;
8486
std::shared_ptr<TH1> hMother2BCounter;
8587
std::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
//--------------------------------------------------------------
228265
struct 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

Comments
 (0)