Skip to content

Commit 8df7e8c

Browse files
authored
[PWGLF] Add ITS track DCA to SV storing to MC process in trackedHypertritonRecoTask (#17395)
1 parent 6618a9c commit 8df7e8c

2 files changed

Lines changed: 26 additions & 8 deletions

File tree

PWGLF/DataModel/Vtx3BodyTables.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ DECLARE_SOA_COLUMN(IsReco, isreco, int); //! flag if candidate was
141141
DECLARE_SOA_COLUMN(MotherLabel, motherLabel, int); //! label of the mother particle (signal: MC index, bkg: negative value)
142142

143143
// strangeness tracking information
144-
DECLARE_SOA_COLUMN(ITSTrackDCAXYToSVXY, itsTrackDcaXYToSv, float); //! DCAxy of ITS track to SV
145-
DECLARE_SOA_COLUMN(ITSTrackDCAZToSVXY, itsTrackDcaZToSv, float); //! DCAz of ITS track to SV
144+
DECLARE_SOA_COLUMN(ITSTrackDCAXYToSV, itsTrackDcaXYToSv, float); //! DCAxy of ITS track to SV
145+
DECLARE_SOA_COLUMN(ITSTrackDCAZToSV, itsTrackDcaZToSv, float); //! DCAz of ITS track to SV
146146

147147
// Derived expressions
148148
// Momenta
@@ -264,8 +264,8 @@ DECLARE_SOA_TABLE(Vtx3BodyCovs, "AOD", "VTX3BODYCOV", //!
264264

265265
// strangeness tracked extra table
266266
DECLARE_SOA_TABLE(Vtx3BodyTrackedInfo, "AOD", "VTX3BODYTR", //!
267-
vtx3body::ITSTrackDCAXYToSVXY,
268-
vtx3body::ITSTrackDCAZToSVXY);
267+
vtx3body::ITSTrackDCAXYToSV,
268+
vtx3body::ITSTrackDCAZToSV);
269269

270270
// MC candidate table for analysis
271271
DECLARE_SOA_TABLE(McVtx3BodyDatas, "AOD", "MC3BODYDATA", //!

PWGLF/TableProducer/Nuspex/trackedHypertritonRecoTask.cxx

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -773,6 +773,16 @@ struct TrackedHypertritonRecoTask {
773773
return deuteronTOFPIDMC.GetTOFNSigma(tofResponse, track, originalCollision, collision);
774774
}
775775

776+
template <class TTracksTo, typename TTracked3body>
777+
std::array<float, 2> getItsTrackDCAToSV(TTracked3body tracked3Body)
778+
{
779+
const auto itsTrack = tracked3Body.template itsTrack_as<TTracksTo>();
780+
auto itsTrackParCov = getTrackParCov(itsTrack);
781+
std::array<float, 2> dcaInfo{};
782+
o2::base::Propagator::Instance()->propagateToDCABxByBz({builder3Body.decay3body.position[0], builder3Body.decay3body.position[1], builder3Body.decay3body.position[2]}, itsTrackParCov, 2.f, fitter2Body.getMatCorrType(), &dcaInfo);
783+
return dcaInfo;
784+
}
785+
776786
void fillThreeBodyTables()
777787
{
778788
const auto& candidate = builder3Body.decay3body;
@@ -831,6 +841,8 @@ struct TrackedHypertritonRecoTask {
831841
static_cast<int>(info.isReco), info.motherLabel, info.motherPdgCode,
832842
info.protonPdgCode, info.pionPdgCode, info.deuteronPdgCode,
833843
info.isDeuteronPrimary, static_cast<int>(info.survivedEventSelection));
844+
vtx3BodyCovs(candidate.covProton.data(), candidate.covPion.data(), candidate.covDeuteron.data(), candidate.covariance.data());
845+
vtx3BodyTrackedInfo(candidate.itsTrackDCAToSV[0], candidate.itsTrackDCAToSV[1]);
834846
}
835847

836848
void fillGeneratedThreeBodyMCTable(ThreeBodyMCInfo const& info)
@@ -926,10 +938,7 @@ struct TrackedHypertritonRecoTask {
926938
threeBody.useSelections, threeBody.useChi2Selection, threeBody.useTPCforPion,
927939
threeBody.acceptTPCOnly, threeBody.askOnlyITSMatch, threeBody.calculateCovariance)) {
928940
// get DCA of ITS track to SV
929-
const auto itsTrack = tracked3Body.itsTrack_as<Tracks>();
930-
auto itsTrackParCov = getTrackParCov(itsTrack);
931-
std::array<float, 2> dcaInfoItsTrack{};
932-
o2::base::Propagator::Instance()->propagateToDCABxByBz({builder3Body.decay3body.position[0], builder3Body.decay3body.position[1], builder3Body.decay3body.position[2]}, itsTrackParCov, 2.f, fitter2Body.getMatCorrType(), &dcaInfoItsTrack);
941+
std::array<float, 2> dcaInfoItsTrack = getItsTrackDCAToSV<Tracks>(tracked3Body);
933942
builder3Body.decay3body.itsTrackDCAToSV[0] = dcaInfoItsTrack[0];
934943
builder3Body.decay3body.itsTrackDCAToSV[1] = dcaInfoItsTrack[1];
935944
if (threeBody.useSelections && (std::abs(builder3Body.decay3body.itsTrackDCAToSV[0]) > threeBody.maxITSDCAxytrackToSV || std::abs(builder3Body.decay3body.itsTrackDCAToSV[1]) > threeBody.maxITSDCAztrackToSV)) {
@@ -1025,6 +1034,15 @@ struct TrackedHypertritonRecoTask {
10251034
if (mcInfo.motherLabel < 0 && !mc.storeBackground) {
10261035
continue;
10271036
}
1037+
1038+
// get DCA of ITS track to SV
1039+
std::array<float, 2> dcaInfoItsTrack = getItsTrackDCAToSV<TracksMC>(tracked3Body);
1040+
builder3Body.decay3body.itsTrackDCAToSV[0] = dcaInfoItsTrack[0];
1041+
builder3Body.decay3body.itsTrackDCAToSV[1] = dcaInfoItsTrack[1];
1042+
if (threeBody.useSelections && (std::abs(builder3Body.decay3body.itsTrackDCAToSV[0]) > threeBody.maxITSDCAxytrackToSV || std::abs(builder3Body.decay3body.itsTrackDCAToSV[1]) > threeBody.maxITSDCAztrackToSV)) {
1043+
continue;
1044+
}
1045+
10281046
fillThreeBodyMCTable(mcInfo);
10291047
if (mcInfo.motherLabel >= 0) {
10301048
reconstructedThreeBody[mcInfo.motherLabel] = true;

0 commit comments

Comments
 (0)