Skip to content

Commit 8be92e0

Browse files
committed
Try to use PV and SV to correct track momentum
1 parent 0438000 commit 8be92e0

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-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: 45 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,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
//--------------------------------------------------------------
228258
struct 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

Comments
 (0)