From fbf4d3f14f546888384e794950b1ff9f89e13279 Mon Sep 17 00:00:00 2001 From: creetz16 Date: Mon, 10 Aug 2026 14:23:44 +0200 Subject: [PATCH] Add MC table to store ITS track DCA to SV --- PWGLF/DataModel/Vtx3BodyTables.h | 8 +++--- .../Nuspex/trackedHypertritonRecoTask.cxx | 26 ++++++++++++++++--- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/PWGLF/DataModel/Vtx3BodyTables.h b/PWGLF/DataModel/Vtx3BodyTables.h index a2c8ad8a396..76a89e80193 100644 --- a/PWGLF/DataModel/Vtx3BodyTables.h +++ b/PWGLF/DataModel/Vtx3BodyTables.h @@ -141,8 +141,8 @@ DECLARE_SOA_COLUMN(IsReco, isreco, int); //! flag if candidate was DECLARE_SOA_COLUMN(MotherLabel, motherLabel, int); //! label of the mother particle (signal: MC index, bkg: negative value) // strangeness tracking information -DECLARE_SOA_COLUMN(ITSTrackDCAXYToSVXY, itsTrackDcaXYToSv, float); //! DCAxy of ITS track to SV -DECLARE_SOA_COLUMN(ITSTrackDCAZToSVXY, itsTrackDcaZToSv, float); //! DCAz of ITS track to SV +DECLARE_SOA_COLUMN(ITSTrackDCAXYToSV, itsTrackDcaXYToSv, float); //! DCAxy of ITS track to SV +DECLARE_SOA_COLUMN(ITSTrackDCAZToSV, itsTrackDcaZToSv, float); //! DCAz of ITS track to SV // Derived expressions // Momenta @@ -264,8 +264,8 @@ DECLARE_SOA_TABLE(Vtx3BodyCovs, "AOD", "VTX3BODYCOV", //! // strangeness tracked extra table DECLARE_SOA_TABLE(Vtx3BodyTrackedInfo, "AOD", "VTX3BODYTR", //! - vtx3body::ITSTrackDCAXYToSVXY, - vtx3body::ITSTrackDCAZToSVXY); + vtx3body::ITSTrackDCAXYToSV, + vtx3body::ITSTrackDCAZToSV); // MC candidate table for analysis DECLARE_SOA_TABLE(McVtx3BodyDatas, "AOD", "MC3BODYDATA", //! diff --git a/PWGLF/TableProducer/Nuspex/trackedHypertritonRecoTask.cxx b/PWGLF/TableProducer/Nuspex/trackedHypertritonRecoTask.cxx index bb15833d0e1..d45040524d8 100644 --- a/PWGLF/TableProducer/Nuspex/trackedHypertritonRecoTask.cxx +++ b/PWGLF/TableProducer/Nuspex/trackedHypertritonRecoTask.cxx @@ -773,6 +773,16 @@ struct TrackedHypertritonRecoTask { return deuteronTOFPIDMC.GetTOFNSigma(tofResponse, track, originalCollision, collision); } + template + std::array getItsTrackDCAToSV(TTracked3body tracked3Body) + { + const auto itsTrack = tracked3Body.template itsTrack_as(); + auto itsTrackParCov = getTrackParCov(itsTrack); + std::array dcaInfo{}; + o2::base::Propagator::Instance()->propagateToDCABxByBz({builder3Body.decay3body.position[0], builder3Body.decay3body.position[1], builder3Body.decay3body.position[2]}, itsTrackParCov, 2.f, fitter2Body.getMatCorrType(), &dcaInfo); + return dcaInfo; + } + void fillThreeBodyTables() { const auto& candidate = builder3Body.decay3body; @@ -831,6 +841,8 @@ struct TrackedHypertritonRecoTask { static_cast(info.isReco), info.motherLabel, info.motherPdgCode, info.protonPdgCode, info.pionPdgCode, info.deuteronPdgCode, info.isDeuteronPrimary, static_cast(info.survivedEventSelection)); + vtx3BodyCovs(candidate.covProton.data(), candidate.covPion.data(), candidate.covDeuteron.data(), candidate.covariance.data()); + vtx3BodyTrackedInfo(candidate.itsTrackDCAToSV[0], candidate.itsTrackDCAToSV[1]); } void fillGeneratedThreeBodyMCTable(ThreeBodyMCInfo const& info) @@ -926,10 +938,7 @@ struct TrackedHypertritonRecoTask { threeBody.useSelections, threeBody.useChi2Selection, threeBody.useTPCforPion, threeBody.acceptTPCOnly, threeBody.askOnlyITSMatch, threeBody.calculateCovariance)) { // get DCA of ITS track to SV - const auto itsTrack = tracked3Body.itsTrack_as(); - auto itsTrackParCov = getTrackParCov(itsTrack); - std::array dcaInfoItsTrack{}; - o2::base::Propagator::Instance()->propagateToDCABxByBz({builder3Body.decay3body.position[0], builder3Body.decay3body.position[1], builder3Body.decay3body.position[2]}, itsTrackParCov, 2.f, fitter2Body.getMatCorrType(), &dcaInfoItsTrack); + std::array dcaInfoItsTrack = getItsTrackDCAToSV(tracked3Body); builder3Body.decay3body.itsTrackDCAToSV[0] = dcaInfoItsTrack[0]; builder3Body.decay3body.itsTrackDCAToSV[1] = dcaInfoItsTrack[1]; 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 { if (mcInfo.motherLabel < 0 && !mc.storeBackground) { continue; } + + // get DCA of ITS track to SV + std::array dcaInfoItsTrack = getItsTrackDCAToSV(tracked3Body); + builder3Body.decay3body.itsTrackDCAToSV[0] = dcaInfoItsTrack[0]; + builder3Body.decay3body.itsTrackDCAToSV[1] = dcaInfoItsTrack[1]; + if (threeBody.useSelections && (std::abs(builder3Body.decay3body.itsTrackDCAToSV[0]) > threeBody.maxITSDCAxytrackToSV || std::abs(builder3Body.decay3body.itsTrackDCAToSV[1]) > threeBody.maxITSDCAztrackToSV)) { + continue; + } + fillThreeBodyMCTable(mcInfo); if (mcInfo.motherLabel >= 0) { reconstructedThreeBody[mcInfo.motherLabel] = true;