diff --git a/PWGCF/Femto/Core/collisionBuilder.h b/PWGCF/Femto/Core/collisionBuilder.h index d7534f185b9..a3731de9e23 100644 --- a/PWGCF/Femto/Core/collisionBuilder.h +++ b/PWGCF/Femto/Core/collisionBuilder.h @@ -841,6 +841,7 @@ class CollisionBuilder } [[nodiscard]] int64_t collisionIndex() const { return mCurrentCollisionIndex; } + [[nodiscard]] int magneticField() const { return mMagField; } // nominal L3 field of the current run (kG) void reset() { mCollisionAlreadyFilled = false; diff --git a/PWGCF/Femto/Core/kinkBuilder.h b/PWGCF/Femto/Core/kinkBuilder.h index 84d518dbe15..e52fc5747d3 100644 --- a/PWGCF/Femto/Core/kinkBuilder.h +++ b/PWGCF/Femto/Core/kinkBuilder.h @@ -28,18 +28,24 @@ #include #include +#include #include #include #include #include +#include +#include #include #include #include #include +#include #include #include +#include #include +#include #include namespace o2::analysis::femto::kinkbuilder @@ -106,9 +112,9 @@ struct ConfSigmaPlusBits : o2::framework::ConfigurableGroup { struct ConfSigmaPlusPcmBits : o2::framework::ConfigurableGroup { std::string prefix = std::string("SigmaPlusPcmBits"); o2::framework::Configurable passThrough{"passThrough", false, "If true, all SigmaPlusPcm are passed through. Bits for all selections are stored."}; - o2::framework::Configurable> flightDirTiltMax{"flightDirTiltMax", {0.05f}, "Maximum tilt of the flight direction (rad)"}; + o2::framework::Configurable> flightDirTiltMax{"flightDirTiltMax", {0.05f, 0.02f, 0.01f, 0.001f}, "Maximum tilt of the flight direction (rad); the builder tilts in 5 mrad steps, 0.001: measured direction, no tilt"}; o2::framework::Configurable> mothDcaPvMax{"mothDcaPvMax", {1.0f}, "Maximum DCA of mother from primary vertex (cm)"}; - o2::framework::Configurable> chaDauDcaZMax{"chaDauDcaZMax", {0.3f}, "Maximum |DCAz| of charged daughter from primary vertex (cm)"}; + o2::framework::Configurable> chaDauDcaZMax{"chaDauDcaZMax", {10.f, 0.3f}, "Maximum |DCAz| of charged daughter from primary vertex (cm)"}; o2::framework::Configurable> photonDcaZMax{"photonDcaZMax", {2.0f}, "Maximum |DCAz| of the photon from primary vertex (cm)"}; o2::framework::Configurable> chaDauTpcProton{"chaDauTpcProton", {3.f}, "Maximum |nsigma_Proton| TPC for charged daughter tracks"}; o2::framework::Configurable> chaDauTofProton{"chaDauTofProton", {}, "Maximum |nsigma_Proton| TOF for charged daughter tracks"}; @@ -545,15 +551,110 @@ class KinkSelection : public baseselection::BaseSelection kink vertex along the mother helix, v_moth from the measured mother momentum and the mother mass hypothesis. +/// L_dau: daughter track length to TOF (integrated from its point of closest approach to the PV) minus the helix length between +/// that point and the kink vertex. +struct KinkTofChain { + static constexpr float NoTofValue = -999.f; + bool valid = false; + float tofMinusEvTime = NoTofValue; // ps + float evTimeErr = NoTofValue; // ps + float lengthMoth = 0.f; // cm + float pMoth = 0.f; // GeV/c + float lengthDau = 0.f; // cm + float tofExpMom = 0.f; // GeV/c + int16_t deltaBc = 0; // BC(daughter collision) - BC(kink collision) +}; + +/// event time of a collision as strangenesstofpid (reassociateTracks): average tofEvTime and tofEvTimeErr of its tracks with TOF +template +std::pair collisionTofEventTime(T1 const& col, T2 const& tracks) +{ + double sum = 0., sumErr = 0.; + int n = 0; + for (const auto& track : tracks) { // the MC process passes the tracks of all collisions -> keep only this collision + if (track.collisionId() == col.globalIndex() && track.hasTOF()) { + sum += track.tofEvTime(); + sumErr += track.tofEvTimeErr(); + n++; + } + } + if (n == 0) { + return {KinkTofChain::NoTofValue, KinkTofChain::NoTofValue}; + } + return {static_cast(sum / n), static_cast(sumErr / n)}; +} + +/// TOF chain of one kink, following strangenesstofpid: +/// - TOF signal of a daughter assigned to another collision than the kink: shifted to the kink BC (tofSignalInAnotherBC) +/// - event time: average over the TOF tracks of the kink collision (evTime = {time, error}, from collisionTofEventTime) +/// - daughter length: stored length (integrated from the daughter's own collision PV) minus the helix from the kink vertex back +/// to the point of closest approach to that PV +template +KinkTofChain computeKinkTofChain(T1 const& col, T2 const& kink, T3 const& daughter, std::pair const& evTime, float bz) +{ + KinkTofChain chain; + constexpr float MinEvTime = -1e5f; // strangenesstofpid: no valid event time below + constexpr float UndefinedTofSignal = 1e-3f; // strangenesstofpid rejectUndefinedTof: TOF signal 0 + if (!daughter.hasTOF() || !daughter.has_collision() || std::abs(daughter.tofSignal()) < UndefinedTofSignal || + daughter.length() <= 0.f || daughter.tofExpMom() <= 0.f || evTime.first < MinEvTime) { + return chain; + } + // the collisions are bound as the joined table the kink collision comes from (plain collision() would assume aod::Collisions) + const auto dauCol = daughter.template collision_as::parent_t>(); + float tofSignal = daughter.tofSignal(); + if (daughter.collisionId() != col.globalIndex()) { + const int64_t bcDau = dauCol.template bc_as().globalBC(); + const int64_t bcKink = col.template bc_as().globalBC(); + tofSignal = daughter.tofSignalInAnotherBC(bcDau, bcKink); + chain.deltaBc = static_cast(std::clamp(bcDau - bcKink, std::numeric_limits::min(), std::numeric_limits::max())); + } + chain.pMoth = std::sqrt(kink.pxMoth() * kink.pxMoth() + kink.pyMoth() * kink.pyMoth() + kink.pzMoth() * kink.pzMoth()); + // mother: charged -> helix arc PV -> kink vertex, as strangenesstofpid for the charged cascade (2 R asin(chord / 2R) in xy); + { + const float chordXY = std::hypot(kink.xDecVtx(), kink.yDecVtx()); // vertex is relative to the PV + const float ptMoth = std::hypot(kink.pxMoth(), kink.pyMoth()); + const float radius = std::abs(bz) > 0.f && ptMoth > 0.f ? ptMoth / (std::abs(bz) * o2::constants::math::B2C * -1.f) : 0.f; // cm (bz in kG) + const float arcXY = radius > 0.f ? 2.f * radius * std::asin(std::min(1.f, 0.5f * chordXY / radius)) : chordXY; + chain.lengthMoth = std::hypot(arcXY, kink.zDecVtx()); + } + if (chain.pMoth <= 0.f) { + return KinkTofChain{}; + } + // daughter helix from the kink vertex back to its point of closest approach to the PV of its own collision (no material, nominal field) + const std::array vtx{col.posX() + kink.xDecVtx(), col.posY() + kink.yDecVtx(), col.posZ() + kink.zDecVtx()}; + o2::track::TrackPar dauPar(vtx, {kink.pxDaug(), kink.pyDaug(), kink.pzDaug()}, kink.mothSign(), false); + const float curvature = std::abs(dauPar.getCurvature(bz)); // 1/cm + if (!dauPar.propagateParamToDCA(o2::math_utils::Point3D{dauCol.posX(), dauCol.posY(), dauCol.posZ()}, bz)) { + return KinkTofChain{}; + } + const auto dca = dauPar.getXYZGlo(); + const float chordXY = std::hypot(dca.X() - vtx[0], dca.Y() - vtx[1]); + const float arcXY = curvature > 0.f ? 2.f / curvature * std::asin(std::min(1.f, 0.5f * chordXY * curvature)) : chordXY; + chain.lengthDau = daughter.length() - std::hypot(arcXY, dca.Z() - vtx[2]); + if (chain.lengthDau <= 0.f) { + return KinkTofChain{}; + } + chain.tofExpMom = daughter.tofExpMom(); + chain.tofMinusEvTime = tofSignal - evTime.first; + chain.evTimeErr = evTime.second; + chain.valid = true; + return chain; +} + struct KinkBuilderProducts : o2::framework::ProducesGroup { o2::framework::Produces producedSigmas; o2::framework::Produces producedLiteSigmas; o2::framework::Produces producedSigmaMasks; o2::framework::Produces producedSigmaExtras; + o2::framework::Produces producedSigmaTofPids; o2::framework::Produces producedSigmaPlus; o2::framework::Produces producedLiteSigmaPlus; o2::framework::Produces producedSigmaPlusMasks; o2::framework::Produces producedSigmaPlusExtras; + o2::framework::Produces producedSigmaPlusTofPids; o2::framework::Produces producedSigmaPlusPcm; o2::framework::Produces producedLiteSigmaPlusPcm; o2::framework::Produces producedSigmaPlusPcmMasks; @@ -567,10 +668,12 @@ struct ConfKinkTables : o2::framework::ConfigurableGroup { o2::framework::Configurable produceLiteSigmas{"produceLiteSigmas", -1, "Produce LiteSigmas (-1: auto; 0 off; 1 on)"}; o2::framework::Configurable produceSigmaMasks{"produceSigmaMasks", -1, "Produce SigmaMasks (-1: auto; 0 off; 1 on)"}; o2::framework::Configurable produceSigmaExtras{"produceSigmaExtras", -1, "Produce SigmaExtras (-1: auto; 0 off; 1 on)"}; + o2::framework::Configurable produceSigmaTofPids{"produceSigmaTofPids", -1, "Produce SigmaTofPids: TOF time of the full decay chain (-1: auto; 0 off; 1 on)"}; o2::framework::Configurable produceSigmaPlus{"produceSigmaPlus", -1, "Produce SigmaPlus (-1: auto; 0 off; 1 on)"}; o2::framework::Configurable produceLiteSigmaPlus{"produceLiteSigmaPlus", -1, "Produce LiteSigmaPlus (-1: auto; 0 off; 1 on)"}; o2::framework::Configurable produceSigmaPlusMasks{"produceSigmaPlusMasks", -1, "Produce SigmaPlusMasks (-1: auto; 0 off; 1 on)"}; o2::framework::Configurable produceSigmaPlusExtras{"produceSigmaPlusExtras", -1, "Produce SigmaPlusExtras (-1: auto; 0 off; 1 on)"}; + o2::framework::Configurable produceSigmaPlusTofPids{"produceSigmaPlusTofPids", -1, "Produce SigmaPlusTofPids: TOF time of the full decay chain (-1: auto; 0 off; 1 on)"}; o2::framework::Configurable produceSigmaPlusPcm{"produceSigmaPlusPcm", -1, "Produce SigmaPlusPcm (-1: auto; 0 off; 1 on)"}; o2::framework::Configurable produceLiteSigmaPlusPcm{"produceLiteSigmaPlusPcm", -1, "Produce LiteSigmaPlusPcm (-1: auto; 0 off; 1 on)"}; o2::framework::Configurable produceSigmaPlusPcmMasks{"produceSigmaPlusPcmMasks", -1, "Produce SigmaPlusPcmMasks (-1: auto; 0 off; 1 on)"}; @@ -594,6 +697,7 @@ class KinkBuilder mProduceLiteSigmas = utils::enableTable("FLiteSigmas_001", table.produceLiteSigmas.value, initContext); mProduceSigmaMasks = utils::enableTable("FSigmaMasks_001", table.produceSigmaMasks.value, initContext); mProduceSigmaExtras = utils::enableTable("FSigmaExtras_001", table.produceSigmaExtras.value, initContext); + mProduceSigmaTofPids = utils::enableTable("FSigmaTofPids_001", table.produceSigmaTofPids.value, initContext); if (mProduceSigmas && mProduceLiteSigmas) { LOG(fatal) << "FSigmas and FLiteSigmas are mutually exclusive -- enable only one. " @@ -618,6 +722,7 @@ class KinkBuilder mProduceLiteSigmaPlus = utils::enableTable("FLiteSigmaPlus_001", table.produceLiteSigmaPlus.value, initContext); mProduceSigmaPlusMasks = utils::enableTable("FSigmaPlusMasks_001", table.produceSigmaPlusMasks.value, initContext); mProduceSigmaPlusExtras = utils::enableTable("FSigmaPlusExtras_002", table.produceSigmaPlusExtras.value, initContext); + mProduceSigmaPlusTofPids = utils::enableTable("FSigmaPlusTofPids_001", table.produceSigmaPlusTofPids.value, initContext); if (mProduceSigmaPlus && mProduceLiteSigmaPlus) { LOG(fatal) << "FSigmaPlus and FLiteSigmaPlus are mutually exclusive -- enable only one. " @@ -636,8 +741,8 @@ class KinkBuilder } } - if (mProduceSigmas || mProduceLiteSigmas || mProduceSigmaMasks || mProduceSigmaExtras || - mProduceSigmaPlus || mProduceLiteSigmaPlus || mProduceSigmaPlusMasks || mProduceSigmaPlusExtras) { + if (mProduceSigmas || mProduceLiteSigmas || mProduceSigmaMasks || mProduceSigmaExtras || mProduceSigmaTofPids || + mProduceSigmaPlus || mProduceLiteSigmaPlus || mProduceSigmaPlusMasks || mProduceSigmaPlusExtras || mProduceSigmaPlusTofPids) { mFillAnyTable = true; } else { LOG(info) << "No tables configured, Selection object will not be configured..."; @@ -675,11 +780,11 @@ class KinkBuilder auto daughter = kink.template trackDaug_as(); daughterIndex = trackBuilder.template getDaughterIndex(daughter, trackProducts, collisionBuilder); if constexpr (modes::isEqual(kinkType, modes::Kink::kSigma)) { - fillSigma(collisionBuilder, kinkProducts, kink, daughterIndex); + fillSigma(col, collisionBuilder, kinkProducts, kink, daughter, tracks, daughterIndex); } if constexpr (modes::isEqual(kinkType, modes::Kink::kSigmaPlus)) { auto mother = kink.template trackMoth_as(); - fillSigmaPlus(collisionBuilder, kinkProducts, kink, daughter, mother, daughterIndex); + fillSigmaPlus(col, collisionBuilder, kinkProducts, kink, daughter, mother, tracks, daughterIndex); } } } @@ -711,19 +816,19 @@ class KinkBuilder daughterIndex = trackBuilder.template getDaughterIndex(daughter, trackProducts, mcCols, collisionBuilder, mcParticles, mcBuilder, mcProducts); if constexpr (modes::isEqual(kinkType, modes::Kink::kSigma)) { - fillSigma(collisionBuilder, kinkProducts, kink, daughterIndex); + fillSigma(col, collisionBuilder, kinkProducts, kink, daughter, tracks, daughterIndex); mcBuilder.template fillMcSigmaWithLabel(daughter, mcParticles, mcCols, mcProducts); } if constexpr (modes::isEqual(kinkType, modes::Kink::kSigmaPlus)) { auto mother = kink.template trackMoth_as(); - fillSigmaPlus(collisionBuilder, kinkProducts, kink, daughter, mother, daughterIndex); + fillSigmaPlus(col, collisionBuilder, kinkProducts, kink, daughter, mother, tracks, daughterIndex); mcBuilder.template fillMcSigmaPlusWithLabel(daughter, mcParticles, mcCols, mcProducts); } } } - template - void fillSigma(T1& collisionBuilder, T2& kinkProducts, T3 const& kink, int64_t daughterIndex) + template + void fillSigma(T0 const& col, T1& collisionBuilder, T2& kinkProducts, T3 const& kink, T4 const& daughter, T5 const& tracks, int64_t daughterIndex) { // Mass is calculated from original momentum components stored in kink table float mass = kink.mSigmaMinus(); @@ -758,10 +863,15 @@ class KinkBuilder kink.zDecVtx(), mKinkSelection.getKinkTransRadius()); } + if (mProduceSigmaTofPids) { + const auto evTime = daughter.hasTOF() ? collisionTofEventTime(col, tracks) : std::pair{KinkTofChain::NoTofValue, KinkTofChain::NoTofValue}; + const auto chain = computeKinkTofChain(col, kink, daughter, evTime, static_cast(collisionBuilder.magneticField())); + kinkProducts.producedSigmaTofPids(chain.tofMinusEvTime, chain.lengthMoth, chain.pMoth, chain.lengthDau, chain.tofExpMom, chain.evTimeErr, chain.deltaBc); + } } - template - void fillSigmaPlus(T1& collisionBuilder, T2& kinkProducts, T3 const& kink, T4 const& daughter, T5 const& mother, int64_t daughterIndex) + template + void fillSigmaPlus(T0 const& col, T1& collisionBuilder, T2& kinkProducts, T3 const& kink, T4 const& daughter, T5 const& mother, T6 const& tracks, int64_t daughterIndex) { // Mass is calculated from original momentum components stored in kink table float mass = kink.mSigmaPlus(); @@ -801,6 +911,11 @@ class KinkBuilder kink.ptMoth(), mother.itsClusterSizes()); } + if (mProduceSigmaPlusTofPids) { + const auto evTime = daughter.hasTOF() ? collisionTofEventTime(col, tracks) : std::pair{KinkTofChain::NoTofValue, KinkTofChain::NoTofValue}; + const auto chain = computeKinkTofChain(col, kink, daughter, evTime, static_cast(collisionBuilder.magneticField())); + kinkProducts.producedSigmaPlusTofPids(chain.tofMinusEvTime, chain.lengthMoth, chain.pMoth, chain.lengthDau, chain.tofExpMom, chain.evTimeErr, chain.deltaBc); + } } [[nodiscard]] bool fillAnyTable() const { return mFillAnyTable; } @@ -813,10 +928,12 @@ class KinkBuilder bool mProduceLiteSigmas = false; bool mProduceSigmaMasks = false; bool mProduceSigmaExtras = false; + bool mProduceSigmaTofPids = false; bool mProduceSigmaPlus = false; bool mProduceLiteSigmaPlus = false; bool mProduceSigmaPlusMasks = false; bool mProduceSigmaPlusExtras = false; + bool mProduceSigmaPlusTofPids = false; }; /// \class SigmaPlusPcmSelection @@ -1146,9 +1263,12 @@ struct ConfKinkTablesDerivedToDerived : o2::framework::ConfigurableGroup { struct KinkBuilderDerivedToDerivedProducts : o2::framework::ProducesGroup { o2::framework::Produces producedSigmas; o2::framework::Produces producedSigmaMasks; + o2::framework::Produces producedSigmaExtras; + o2::framework::Produces producedSigmaTofPids; o2::framework::Produces producedSigmaPluses; o2::framework::Produces producedSigmaPlusMasks; o2::framework::Produces producedSigmaPlusExtras; + o2::framework::Produces producedSigmaPlusTofPids; o2::framework::Produces producedSigmaPlusPcms; o2::framework::Produces producedSigmaPlusPcmMasks; o2::framework::Produces producedSigmaPlusPcmMlScores; @@ -1224,6 +1344,7 @@ class KinkBuilderDerivedToDerived sigma.mass(), chaDaughterIndex); newSigmaTable.producedSigmaMasks(sigma.mask()); + fillSigmaExtensions(sigma, newSigmaTable); } } @@ -1274,6 +1395,7 @@ class KinkBuilderDerivedToDerived sigma.mass(), chaDaughterIndex); newSigmaTable.producedSigmaMasks(sigma.mask()); + fillSigmaExtensions(sigma, newSigmaTable); mcBuilder.fillSigmaWithLabel(sigma, mcCols, mcParticles, mcMothers, mcPartonicMothers, mcProducts); } } @@ -1376,6 +1498,24 @@ class KinkBuilderDerivedToDerived sigmaPlus.ptOriginal(), sigmaPlus.itsClusterSizes()); } + if constexpr (requires(T1 t) { t.tofLengthDau(); }) { + newSigmaPlusTable.producedSigmaPlusTofPids(sigmaPlus.tofMinusEvTime(), sigmaPlus.tofLengthMoth(), sigmaPlus.tofPMoth(), sigmaPlus.tofLengthDau(), + sigmaPlus.tofExpMomDau(), sigmaPlus.dauTofEvTimeErr(), sigmaPlus.tofDauDeltaBc()); + } + } + + // extras and TOF decay chain (FSigmaExtras / FSigmaTofPids), only when the input sigma table is joined with them + template + void fillSigmaExtensions(T1 const& sigma, T2& newSigmaTable) + { + if constexpr (requires(T1 t) { t.transRadius(); }) { + newSigmaTable.producedSigmaExtras(sigma.kinkAngle(), sigma.dcaDaugToPV(), sigma.dcaMothToPV(), sigma.decayVtxX(), sigma.decayVtxY(), + sigma.decayVtxZ(), sigma.transRadius()); + } + if constexpr (requires(T1 t) { t.tofLengthDau(); }) { + newSigmaTable.producedSigmaTofPids(sigma.tofMinusEvTime(), sigma.tofLengthMoth(), sigma.tofPMoth(), sigma.tofLengthDau(), + sigma.tofExpMomDau(), sigma.dauTofEvTimeErr(), sigma.tofDauDeltaBc()); + } } template diff --git a/PWGCF/Femto/DataModel/FemtoTables.h b/PWGCF/Femto/DataModel/FemtoTables.h index 815fd9d6be6..88cdd121b96 100644 --- a/PWGCF/Femto/DataModel/FemtoTables.h +++ b/PWGCF/Femto/DataModel/FemtoTables.h @@ -26,6 +26,7 @@ #include "Common/DataModel/Multiplicity.h" #include +#include #include #include #include @@ -1115,6 +1116,25 @@ DECLARE_SOA_COLUMN(DauTpcNSigmaPi, dauTpcNSigmaPi, float); DECLARE_SOA_COLUMN(DauTofNSigmaPr, dauTofNSigmaPr, float); DECLARE_SOA_COLUMN(PtOriginal, ptOriginal, float); +// columns for the TOF time of the full kink decay chain, the time difference for any +// mother -> daughter mass hypothesis follows from them (dynamic column tofDeltaT(massMoth, massDau), ps), 0 for the right +// hypothesis. Charged daughter without TOF signal: tofMinusEvTime = -999 and lengths 0. +DECLARE_SOA_COLUMN(TofMinusEvTime, tofMinusEvTime, float); //! measured TOF signal of the charged daughter minus event time (ps) +DECLARE_SOA_COLUMN(TofLengthMoth, tofLengthMoth, float); //! mother flight length PV -> kink vertex (cm) +DECLARE_SOA_COLUMN(TofPMoth, tofPMoth, float); //! measured mother momentum (GeV/c) +DECLARE_SOA_COLUMN(TofLengthDau, tofLengthDau, float); //! daughter flight length kink vertex -> TOF (cm) +DECLARE_SOA_COLUMN(TofExpMomDau, tofExpMomDau, float); //! daughter momentum used for the TOF expected time (GeV/c) +DECLARE_SOA_COLUMN(DauTofEvTimeErr, dauTofEvTimeErr, float); //! event time resolution used for the daughter (ps) +DECLARE_SOA_COLUMN(TofDauDeltaBc, tofDauDeltaBc, int16_t); //! BC of the daughter's collision minus BC of the kink collision (0: same BC, TOF signal shifted to the kink BC) +DECLARE_SOA_DYNAMIC_COLUMN(TofDeltaT, tofDeltaT, //! (t_TOF - t_event) - (t_mother + t_daughter) for the given masses (ps), -999 without TOF + [](float tofMinusEvTime, float lengthMoth, float pMoth, float lengthDau, float expMomDau, float massMoth, float massDau) -> float { + if (lengthDau <= 0.f || pMoth <= 0.f || expMomDau <= 0.f) { + return -999.f; + } + constexpr float C = o2::constants::physics::LightSpeedCm2PS; + return tofMinusEvTime - lengthMoth * std::hypot(pMoth, massMoth) / (C * pMoth) - lengthDau * std::hypot(expMomDau, massDau) / (C * expMomDau); + }); + // columns for sigma plus reconstructed with a PCM photon DECLARE_SOA_COLUMN(MlScore, mlScore, float); //! BDT score of the candidate DECLARE_SOA_COLUMN(FlightDirTilt, flightDirTilt, float); //! Tilt of the flight direction needed for a real solution of the missing photon @@ -1225,6 +1245,20 @@ DECLARE_SOA_TABLE_STAGED_VERSIONED(FSigmaExtras_001, "FSIGMAEXTRAS", 1, femtokinks::TransRadius); using FSigmaExtras = FSigmaExtras_001; +using StoredFSigmaExtras = StoredFSigmaExtras_001; + +// TOF time of the full decay chain for sigma minus kinks +DECLARE_SOA_TABLE_STAGED_VERSIONED(FSigmaTofPids_001, "FSIGMATOFPID", 1, + femtokinks::TofMinusEvTime, + femtokinks::TofLengthMoth, + femtokinks::TofPMoth, + femtokinks::TofLengthDau, + femtokinks::TofExpMomDau, + femtokinks::DauTofEvTimeErr, + femtokinks::TofDauDeltaBc, + femtokinks::TofDeltaT); +using FSigmaTofPids = FSigmaTofPids_001; +using StoredFSigmaTofPids = StoredFSigmaTofPids_001; // table for basic sigma plus information DECLARE_SOA_TABLE_STAGED_VERSIONED(FSigmaPlus_001, "FSIGMAPLUS", 1, @@ -1297,6 +1331,19 @@ DECLARE_SOA_TABLE_STAGED_VERSIONED(FSigmaPlusExtras_002, "FSIGMAPLUSEXTRAS", 2, using FSigmaPlusExtras = FSigmaPlusExtras_002; using StoredFSigmaPlusExtras = StoredFSigmaPlusExtras_002; +// TOF time of the full decay chain for sigma plus kinks +DECLARE_SOA_TABLE_STAGED_VERSIONED(FSigmaPlusTofPids_001, "FSIGPLUSTOFPID", 1, + femtokinks::TofMinusEvTime, + femtokinks::TofLengthMoth, + femtokinks::TofPMoth, + femtokinks::TofLengthDau, + femtokinks::TofExpMomDau, + femtokinks::DauTofEvTimeErr, + femtokinks::TofDauDeltaBc, + femtokinks::TofDeltaT); +using FSigmaPlusTofPids = FSigmaPlusTofPids_001; +using StoredFSigmaPlusTofPids = StoredFSigmaPlusTofPids_001; + // table for basic sigma plus information, sigma plus reconstructed with a PCM photon DECLARE_SOA_TABLE_STAGED_VERSIONED(FSigmaPlusPcm_001, "FSIGMAPLUSPCM", 1, o2::soa::Index<>, diff --git a/PWGCF/Femto/TableProducer/femtoProducer.cxx b/PWGCF/Femto/TableProducer/femtoProducer.cxx index 7ca55f69bed..70cc8f892d0 100644 --- a/PWGCF/Femto/TableProducer/femtoProducer.cxx +++ b/PWGCF/Femto/TableProducer/femtoProducer.cxx @@ -77,7 +77,7 @@ using Run3FullPidTracks = soa::Join; + o2::aod::pidTOFbeta, o2::aod::pidTOFmass, o2::aod::TOFSignal, o2::aod::TOFEvTime>; using Run3McRecoTracks = soa::Join; using Run3Vzeros = o2::soa::Join; @@ -249,14 +249,14 @@ struct FemtoProducer { (!doprocessTracksV0sCascadesRun3pp && !doprocessTracksV0sCascadesRun3PbPb && !doprocessTracksV0sCascadesRun3PbPbWithEventShape && !doprocessTracksV0sCascadesPhotonsRun3PbPbWithEventShape && - !doprocessTracksV0sCascadesKinksRun3pp && !doprocessTracksV0sCascadesKinksPhotonsRun3pp && + !doprocessTracksV0sCascadesKinksRun3pp && !doprocessTracksV0sCascadesKinksPhotonsRun3pp && !doprocessTracksV0sCascadesKinksPhotonsSigmaPlusPcmsRun3pp && !doprocessTracksV0sCascadesRun3ppMc && !doprocessTracksV0sCascadesRun3PbPbMc)) { LOG(fatal) << "At least one cascade table is enabled, but wrong process function is enabled. Breaking..."; } if ((builders.lambdaBuilder.fillAnyTable() || builders.antilambdaBuilder.fillAnyTable() || builders.k0shortBuilder.fillAnyTable()) && (!doprocessTracksV0sCascadesRun3pp && !doprocessTracksV0sCascadesRun3PbPb && - !doprocessTracksV0sRun3pp && !doprocessTracksV0sCascadesKinksRun3pp && !doprocessTracksV0sCascadesKinksPhotonsRun3pp && + !doprocessTracksV0sRun3pp && !doprocessTracksV0sCascadesKinksRun3pp && !doprocessTracksV0sCascadesKinksPhotonsRun3pp && !doprocessTracksV0sCascadesKinksPhotonsSigmaPlusPcmsRun3pp && !doprocessTracksV0sCascadesRun3PbPbWithEventShape && !doprocessTracksV0sCascadesPhotonsRun3PbPbWithEventShape && !doprocessTracksV0sRun3ppMc && !doprocessTracksV0sRun3PbPb && !doprocessTracksV0sRun3PbPbMc && !doprocessTracksV0sCascadesRun3ppMc && !doprocessTracksV0sCascadesRun3PbPbMc && @@ -265,18 +265,19 @@ struct FemtoProducer { } if (builders.photonBuilder.fillAnyTable() && (!doprocessTracksPhotonsRun3pp && !doprocessTracksPhotonsRun3PbPb && - !doprocessTracksV0sCascadesKinksPhotonsRun3pp && !doprocessTracksV0sCascadesPhotonsRun3PbPbWithEventShape)) { + !doprocessTracksV0sCascadesKinksPhotonsRun3pp && !doprocessTracksV0sCascadesKinksPhotonsSigmaPlusPcmsRun3pp && !doprocessTracksV0sCascadesPhotonsRun3PbPbWithEventShape)) { LOG(fatal) << "At least one photon table is enabled, but wrong process function is enabled. Breaking..."; } if ((builders.sigmaBuilder.fillAnyTable() || builders.sigmaPlusBuilder.fillAnyTable()) && - (!doprocessTracksKinksRun3pp && !doprocessTracksV0sCascadesKinksRun3pp && !doprocessTracksV0sCascadesKinksPhotonsRun3pp && + (!doprocessTracksKinksRun3pp && !doprocessTracksV0sCascadesKinksRun3pp && !doprocessTracksV0sCascadesKinksPhotonsRun3pp && !doprocessTracksV0sCascadesKinksPhotonsSigmaPlusPcmsRun3pp && !doprocessTracksKinksRun3ppMc && !doprocessTracksV0sKinksRun3ppMc && !doprocessTracksKinksSigmaPlusPcmsRun3pp && !doprocessTracksKinksSigmaPlusPcmsRun3ppMc)) { LOG(fatal) << "At least one kink table is enabled, but wrong process function is enabled. Breaking..."; } if (builders.sigmaPlusPcmBuilder.fillAnyTable() && (!doprocessTracksSigmaPlusPcmsRun3pp && !doprocessTracksSigmaPlusPcmsRun3ppMc && - !doprocessTracksKinksSigmaPlusPcmsRun3pp && !doprocessTracksKinksSigmaPlusPcmsRun3ppMc)) { + !doprocessTracksKinksSigmaPlusPcmsRun3pp && !doprocessTracksKinksSigmaPlusPcmsRun3ppMc && + !doprocessTracksV0sCascadesKinksPhotonsSigmaPlusPcmsRun3pp)) { LOG(fatal) << "At least one sigma plus (PCM) table is enabled, but wrong process function is enabled. Breaking..."; } if ((builders.d0Builder.fillAnyTable() || builders.d0barBuilder.fillAnyTable()) && @@ -380,6 +381,7 @@ struct FemtoProducer { static_cast(doprocessTracksKinksRun3pp) + static_cast(doprocessTracksV0sCascadesKinksRun3pp) + static_cast(doprocessTracksV0sCascadesKinksPhotonsRun3pp) + + static_cast(doprocessTracksV0sCascadesKinksPhotonsSigmaPlusPcmsRun3pp) + static_cast(doprocessTracksSigmaPlusPcmsRun3pp) + static_cast(doprocessTracksKinksSigmaPlusPcmsRun3pp) + static_cast(doprocessTracksD0sRun3pp) + @@ -918,6 +920,40 @@ struct FemtoProducer { } PROCESS_SWITCH(FemtoProducer, processTracksV0sCascadesKinksPhotonsRun3pp, "Provide tracks, v0s, cascades, kinks and PCM photons", false); + void processTracksV0sCascadesKinksPhotonsSigmaPlusPcmsRun3pp(rawinputs::Run3PpCollisions const& cols, + o2::aod::BCsWithTimestamps const& bcs, + rawinputs::Run3FullPidTracks const& tracks, + rawinputs::Run3Vzeros const& v0s, + rawinputs::Run3Cascades const& cascades, + rawinputs::Run3Kinks const& kinks, + o2::aod::V0PhotonsKF const& photons, + o2::aod::V0Legs const& v0legs, + rawinputs::Run3SigmaPlusPcms const& sigmaPlusPcms) + { + builders.trackBuilder.reset(tracks); + for (auto const& col : cols) { + auto tracksThisCol = tracks.sliceBy(preslices.perColTracks, col.globalIndex()); + if (!processCollisions(col, bcs, tracksThisCol)) { + continue; + } + auto tracksWithItsPid = o2::soa::Attach(tracksThisCol); + processTracks(col, tracksWithItsPid); + auto v0sThisCol = v0s.sliceBy(preslices.perColV0s, col.globalIndex()); + processV0s(col, tracksThisCol, v0sThisCol); + auto cascadesThisCol = cascades.sliceBy(preslices.perColCascades, col.globalIndex()); + processCascades(col, tracksThisCol, cascadesThisCol); + auto kinksThisCol = kinks.sliceBy(preslices.perColRecoKinks, col.globalIndex()); + processKinks(col, tracksThisCol, kinksThisCol); + // V0PhotonsKF/V0Legs carry a plain CollisionId column, so they are sliced manually + auto photonsThisCol = photons.sliceBy(preslices.perColRecoPCMPhotons, col.globalIndex()); + processPhotons(col, photonsThisCol, v0legs); + auto sigmaPlusPcmsThisCol = sigmaPlusPcms.sliceBy(preslices.perColSigmaPlusPcms, col.globalIndex()); + processSigmaPlusPcms(col, tracksThisCol, sigmaPlusPcmsThisCol); + } + } + PROCESS_SWITCH(FemtoProducer, processTracksV0sCascadesKinksPhotonsSigmaPlusPcmsRun3pp, "Provide tracks, v0s, cascades, kinks, PCM photons and sigma plus reconstructed with a PCM photon", false); + void processTracksD0sRun3pp(rawinputs::Run3PpCollisions const& cols, o2::aod::BCsWithTimestamps const& bcs, rawinputs::Run3FullPidTracks const& tracks, diff --git a/PWGCF/Femto/TableProducer/femtoProducerDerivedToDerived.cxx b/PWGCF/Femto/TableProducer/femtoProducerDerivedToDerived.cxx index 9a10acc7538..c3b7272b7a6 100644 --- a/PWGCF/Femto/TableProducer/femtoProducerDerivedToDerived.cxx +++ b/PWGCF/Femto/TableProducer/femtoProducerDerivedToDerived.cxx @@ -70,6 +70,8 @@ using FemtoOmegasWithFitVars = o2::soa::Join; using FemtoSigma = o2::soa::Join; using FemtoSigmaPlus = o2::soa::Join; using FemtoSigmaPlusExtended = o2::soa::Join; +using FemtoSigmaExtendedWithTof = o2::soa::Join; +using FemtoSigmaPlusExtendedWithTof = o2::soa::Join; using FemtoSigmaPlusPcm = o2::soa::Join; using FemtoSigmaPlusPcmExtended = o2::soa::Join; @@ -82,6 +84,8 @@ using FemtoMcXis = o2::soa::Join; using FemtoMcSigma = o2::soa::Join; using FemtoMcSigmaPlus = o2::soa::Join; using FemtoMcSigmaPlusExtended = o2::soa::Join; +using FemtoMcSigmaExtendedWithTof = o2::soa::Join; +using FemtoMcSigmaPlusExtendedWithTof = o2::soa::Join; using FemtoMcSigmaPlusPcm = o2::soa::Join; using FemtoMcSigmaPlusPcmExtended = o2::soa::Join; using FemtoMcParticles = o2::soa::Join; @@ -103,7 +107,6 @@ struct FemtoProducerDerivedToDerived { o2::framework::Preslice perColPhis = o2::aod::femtobase::stored::fColId; o2::framework::Preslice perColSigma = o2::aod::femtobase::stored::fColId; o2::framework::Preslice perColSigmaPlus = o2::aod::femtobase::stored::fColId; - o2::framework::Preslice perColSigmaPlusExtended = o2::aod::femtobase::stored::fColId; o2::framework::Preslice perColSigmaPlusPcm = o2::aod::femtobase::stored::fColId; o2::framework::Preslice perColSigmaPlusPcmExtended = o2::aod::femtobase::stored::fColId; o2::framework::Preslice perColXis = o2::aod::femtobase::stored::fColId; @@ -116,7 +119,6 @@ struct FemtoProducerDerivedToDerived { o2::framework::Preslice perColMcXis = o2::aod::femtobase::stored::fColId; o2::framework::Preslice perColMcSigma = o2::aod::femtobase::stored::fColId; o2::framework::Preslice perColMcSigmaPlus = o2::aod::femtobase::stored::fColId; - o2::framework::Preslice perColMcSigmaPlusExtended = o2::aod::femtobase::stored::fColId; o2::framework::Preslice perColMcSigmaPlusPcm = o2::aod::femtobase::stored::fColId; o2::framework::Preslice perColMcSigmaPlusPcmExtended = o2::aod::femtobase::stored::fColId; } preslices; @@ -181,10 +183,11 @@ struct FemtoProducerDerivedToDerived { kinkbuilder::ConfSigmaSelection1 sigmaSelection1; o2::framework::Partition sigmaPartition = MAKE_SIGMA_PARTITION(sigmaSelection1); + o2::framework::Partition sigmaExtendedWithTofPartition = MAKE_SIGMA_PARTITION(sigmaSelection1); kinkbuilder::ConfSigmaPlusSelection1 sigmaPlusSelection1; o2::framework::Partition sigmaPlusPartition = MAKE_SIGMAPLUS_PARTITION(sigmaPlusSelection1); - o2::framework::Partition sigmaPlusExtendedPartition = MAKE_SIGMAPLUS_PARTITION(sigmaPlusSelection1); + o2::framework::Partition sigmaPlusExtendedWithTofPartition = MAKE_SIGMAPLUS_PARTITION(sigmaPlusSelection1); kinkbuilder::ConfSigmaPlusPcmSelection1 sigmaPlusPcmSelection1; o2::framework::Partition sigmaPlusPcmPartition = MAKE_SIGMAPLUSPCM_PARTITION(sigmaPlusPcmSelection1); @@ -216,9 +219,10 @@ struct FemtoProducerDerivedToDerived { o2::framework::Partition mcXiPartition = MAKE_CASCADE_PARTITION(xiSelection); o2::framework::Partition mcSigmaPartition = MAKE_SIGMA_PARTITION(sigmaSelection1); + o2::framework::Partition mcSigmaExtendedWithTofPartition = MAKE_SIGMA_PARTITION(sigmaSelection1); o2::framework::Partition mcSigmaPlusPartition = MAKE_SIGMAPLUS_PARTITION(sigmaPlusSelection1); - o2::framework::Partition mcSigmaPlusExtendedPartition = MAKE_SIGMAPLUS_PARTITION(sigmaPlusSelection1); + o2::framework::Partition mcSigmaPlusExtendedWithTofPartition = MAKE_SIGMAPLUS_PARTITION(sigmaPlusSelection1); o2::framework::Partition mcSigmaPlusPcmPartition = MAKE_SIGMAPLUSPCM_PARTITION(sigmaPlusPcmSelection1); o2::framework::Partition mcSigmaPlusPcmExtendedPartition = MAKE_SIGMAPLUSPCM_PARTITION(sigmaPlusPcmSelection1); @@ -232,12 +236,14 @@ struct FemtoProducerDerivedToDerived { static_cast(doprocessTracksXis) + static_cast(doprocessTracksXisWithFitVars) + static_cast(doprocessTracksOmegas) + static_cast(doprocessTracksOmegasWithFitVars) + static_cast(doprocessTracksK0shorts) + static_cast(doprocessTracksK0shortsWithFitVars) + static_cast(doprocessTracksSigma) + - static_cast(doprocessTracksSigmaPlus) + static_cast(doprocessTracksSigmaPlusExtended) + + static_cast(doprocessTracksSigmaPlus) + + static_cast(doprocessTracksSigmaExtendedWithTof) + static_cast(doprocessTracksSigmaPlusExtendedWithTof) + static_cast(doprocessTracksSigmaPlusPcm) + static_cast(doprocessTracksSigmaPlusPcmExtended) + static_cast(doprocessTracksRho0) + static_cast(doprocessTracksPhi) + static_cast(doprocessLambdasXis) + static_cast(doprocessLambdasXisWithFitVars) + static_cast(doprocessTracksMcWithFitVars) + static_cast(doprocessTracksSigmaMc) + - static_cast(doprocessTracksSigmaPlusMc) + static_cast(doprocessTracksSigmaPlusExtendedMc) + + static_cast(doprocessTracksSigmaPlusMc) + + static_cast(doprocessTracksSigmaExtendedWithTofMc) + static_cast(doprocessTracksSigmaPlusExtendedWithTofMc) + static_cast(doprocessTracksSigmaPlusPcmMc) + static_cast(doprocessTracksSigmaPlusPcmExtendedMc) + static_cast(doprocessLambdasMcWithFitVars) + static_cast(doprocessTracksLambdasMcWithFitVars) + static_cast(doprocessTracksXisMcWithFitVars) + static_cast(doprocessLambdasXisMcWithFitVars); @@ -254,11 +260,13 @@ struct FemtoProducerDerivedToDerived { doprocessTracksXis || doprocessTracksXisWithFitVars || doprocessTracksOmegas || doprocessTracksOmegasWithFitVars || doprocessTracksK0shorts || doprocessTracksK0shortsWithFitVars || - doprocessTracksSigma || doprocessTracksSigmaPlus || doprocessTracksSigmaPlusExtended || + doprocessTracksSigma || doprocessTracksSigmaPlus || doprocessTracksSigmaPlusPcm || doprocessTracksSigmaPlusPcmExtended || doprocessTracksRho0 || doprocessTracksPhi || doprocessTracksMcWithFitVars || doprocessTracksSigmaMc || doprocessTracksSigmaPlusMc || - doprocessTracksSigmaPlusExtendedMc || doprocessTracksSigmaPlusPcmMc || doprocessTracksSigmaPlusPcmExtendedMc || + doprocessTracksSigmaPlusPcmMc || doprocessTracksSigmaPlusPcmExtendedMc || + doprocessTracksSigmaExtendedWithTof || doprocessTracksSigmaPlusExtendedWithTof || + doprocessTracksSigmaExtendedWithTofMc || doprocessTracksSigmaPlusExtendedWithTofMc || doprocessTracksLambdasMcWithFitVars || doprocessTracksXisMcWithFitVars; const bool needsV0Builder = @@ -275,16 +283,19 @@ struct FemtoProducerDerivedToDerived { doprocessTracksXisMcWithFitVars || doprocessLambdasXisMcWithFitVars; const bool needsKinkBuilder = - doprocessTracksSigma || doprocessTracksSigmaPlus || doprocessTracksSigmaPlusExtended || + doprocessTracksSigma || doprocessTracksSigmaPlus || doprocessTracksSigmaPlusPcm || doprocessTracksSigmaPlusPcmExtended || - doprocessTracksSigmaMc || doprocessTracksSigmaPlusMc || doprocessTracksSigmaPlusExtendedMc || - doprocessTracksSigmaPlusPcmMc || doprocessTracksSigmaPlusPcmExtendedMc; + doprocessTracksSigmaMc || doprocessTracksSigmaPlusMc || + doprocessTracksSigmaPlusPcmMc || doprocessTracksSigmaPlusPcmExtendedMc || + doprocessTracksSigmaExtendedWithTof || doprocessTracksSigmaPlusExtendedWithTof || + doprocessTracksSigmaExtendedWithTofMc || doprocessTracksSigmaPlusExtendedWithTofMc; const bool needsResonanceBuilder = doprocessTracksRho0 || doprocessTracksPhi; const bool needsMcBuilder = doprocessTracksMcWithFitVars || doprocessTracksSigmaMc || doprocessTracksSigmaPlusMc || - doprocessTracksSigmaPlusExtendedMc || doprocessTracksSigmaPlusPcmMc || doprocessTracksSigmaPlusPcmExtendedMc || + doprocessTracksSigmaPlusPcmMc || doprocessTracksSigmaPlusPcmExtendedMc || + doprocessTracksSigmaExtendedWithTofMc || doprocessTracksSigmaPlusExtendedWithTofMc || doprocessLambdasMcWithFitVars || doprocessTracksLambdasMcWithFitVars || doprocessTracksXisMcWithFitVars || doprocessLambdasXisMcWithFitVars; // skip init() entirely for builders the active process doesn't touch: their limit @@ -548,6 +559,23 @@ struct FemtoProducerDerivedToDerived { } PROCESS_SWITCH(FemtoProducerDerivedToDerived, processTracksSigma, "Process sigma and tracks", false); + void processTracksSigmaExtendedWithTof(femtotables::FilteredFemtoCollisions const& cols, femtotables::FemtoTracks const& tracks, femtotables::FemtoSigmaExtendedWithTof const& sigma) + { + builders.trackBuilder.reset(tracks); + for (auto const& col : cols) { + if (builders.trackBuilder.collisionHasTooFewTracks(col, tracks, trackPartition1, trackPartition2, cache) || builders.kinkBuilder.collisionHasTooFewSigma(col, sigma, sigmaExtendedWithTofPartition, cache)) { + continue; + } + if (builders.collisionBuilder.collisionFailsDownsampling()) { + continue; + } + builders.collisionBuilder.processCollision(col, collisionBuilderProducts); + builders.trackBuilder.processTracks(col, tracks, trackPartition1, trackPartition2, cache, trackBuilderProducts, collisionBuilderProducts); + builders.kinkBuilder.processSigma(col, sigma, tracks, sigmaExtendedWithTofPartition, builders.trackBuilder, cache, kinkBuilderProducts, trackBuilderProducts, collisionBuilderProducts); + } + } + PROCESS_SWITCH(FemtoProducerDerivedToDerived, processTracksSigmaExtendedWithTof, "Process sigma (with SigmaExtras and SigmaTofPids) and tracks", false); + void processTracksSigmaPlus(femtotables::FilteredFemtoCollisions const& cols, femtotables::FemtoTracks const& tracks, femtotables::FemtoSigmaPlus const& sigmaplus) { builders.trackBuilder.reset(tracks); @@ -565,11 +593,11 @@ struct FemtoProducerDerivedToDerived { } PROCESS_SWITCH(FemtoProducerDerivedToDerived, processTracksSigmaPlus, "Process sigmaPlus and tracks", false); - void processTracksSigmaPlusExtended(femtotables::FilteredFemtoCollisions const& cols, femtotables::FemtoTracks const& tracks, femtotables::FemtoSigmaPlusExtended const& sigmaplus) + void processTracksSigmaPlusExtendedWithTof(femtotables::FilteredFemtoCollisions const& cols, femtotables::FemtoTracks const& tracks, femtotables::FemtoSigmaPlusExtendedWithTof const& sigmaplus) { builders.trackBuilder.reset(tracks); for (auto const& col : cols) { - if (builders.trackBuilder.collisionHasTooFewTracks(col, tracks, trackPartition1, trackPartition2, cache) || builders.kinkBuilder.collisionHasTooFewSigmaPlus(col, sigmaplus, sigmaPlusExtendedPartition, cache)) { + if (builders.trackBuilder.collisionHasTooFewTracks(col, tracks, trackPartition1, trackPartition2, cache) || builders.kinkBuilder.collisionHasTooFewSigmaPlus(col, sigmaplus, sigmaPlusExtendedWithTofPartition, cache)) { continue; } if (builders.collisionBuilder.collisionFailsDownsampling()) { @@ -577,10 +605,10 @@ struct FemtoProducerDerivedToDerived { } builders.collisionBuilder.processCollision(col, collisionBuilderProducts); builders.trackBuilder.processTracks(col, tracks, trackPartition1, trackPartition2, cache, trackBuilderProducts, collisionBuilderProducts); - builders.kinkBuilder.processSigmaPlus(col, sigmaplus, tracks, sigmaPlusExtendedPartition, builders.trackBuilder, cache, kinkBuilderProducts, trackBuilderProducts, collisionBuilderProducts); + builders.kinkBuilder.processSigmaPlus(col, sigmaplus, tracks, sigmaPlusExtendedWithTofPartition, builders.trackBuilder, cache, kinkBuilderProducts, trackBuilderProducts, collisionBuilderProducts); } } - PROCESS_SWITCH(FemtoProducerDerivedToDerived, processTracksSigmaPlusExtended, "Process sigmaPlus (with SigmaPlusExtras) and tracks", false); + PROCESS_SWITCH(FemtoProducerDerivedToDerived, processTracksSigmaPlusExtendedWithTof, "Process sigmaPlus (with SigmaPlusExtras and SigmaPlusTofPids) and tracks", false); void processTracksSigmaPlusPcm(femtotables::FilteredFemtoCollisions const& cols, femtotables::FemtoTracks const& tracks, femtotables::FemtoSigmaPlusPcm const& sigmapluspcm) { @@ -854,6 +882,36 @@ struct FemtoProducerDerivedToDerived { } PROCESS_SWITCH(FemtoProducerDerivedToDerived, processTracksSigmaMc, "Process sigma and tracks with MC information", false); + void processTracksSigmaExtendedWithTofMc(femtotables::FilteredFemtoMcCollisions const& cols, + femtotables::FemtoMcTracks const& tracks, + femtotables::FemtoMcSigmaExtendedWithTof const& sigma, + o2::aod::FMcCols const& mcCols, + femtotables::FemtoMcParticles const& mcParticles, + o2::aod::FMcMothers const& mcMothers, + o2::aod::FMcPartMoths const& mcPartonicMothers) + { + // once per dataframe + builders.mcBuilder.reset(mcCols, mcParticles); + builders.trackBuilder.reset(tracks); + + for (auto const& col : cols) { + if (builders.trackBuilder.collisionHasTooFewTracks(col, tracks, mcTrackPartition1, mcTrackPartition2, cache) || builders.kinkBuilder.collisionHasTooFewSigma(col, sigma, mcSigmaExtendedWithTofPartition, cache)) { + continue; + } + if (builders.collisionBuilder.collisionFailsDownsampling()) { + continue; + } + builders.collisionBuilder.processCollision(col, collisionBuilderProducts); + builders.mcBuilder.fillCollisionWithLabel(col, mcCols, mcBuilderProducts); + builders.trackBuilder.processTracksWithMc(col, tracks, mcTrackPartition1, mcTrackPartition2, cache, + trackBuilderProducts, collisionBuilderProducts, + builders.mcBuilder, mcCols, mcParticles, mcMothers, mcPartonicMothers, mcBuilderProducts); + builders.kinkBuilder.processSigmaWithMc(col, sigma, tracks, mcSigmaExtendedWithTofPartition, builders.trackBuilder, cache, kinkBuilderProducts, trackBuilderProducts, collisionBuilderProducts, + builders.mcBuilder, mcCols, mcParticles, mcMothers, mcPartonicMothers, mcBuilderProducts); + } + } + PROCESS_SWITCH(FemtoProducerDerivedToDerived, processTracksSigmaExtendedWithTofMc, "Process sigma (with SigmaExtras and SigmaTofPids) and tracks with MC information", false); + void processTracksSigmaPlusMc(femtotables::FilteredFemtoMcCollisions const& cols, femtotables::FemtoMcTracks const& tracks, femtotables::FemtoMcSigmaPlus const& sigmaplus, @@ -884,20 +942,20 @@ struct FemtoProducerDerivedToDerived { } PROCESS_SWITCH(FemtoProducerDerivedToDerived, processTracksSigmaPlusMc, "Process sigmaPlus and tracks with MC information", false); - void processTracksSigmaPlusExtendedMc(femtotables::FilteredFemtoMcCollisions const& cols, - femtotables::FemtoMcTracks const& tracks, - femtotables::FemtoMcSigmaPlusExtended const& sigmaplus, - o2::aod::FMcCols const& mcCols, - femtotables::FemtoMcParticles const& mcParticles, - o2::aod::FMcMothers const& mcMothers, - o2::aod::FMcPartMoths const& mcPartonicMothers) + void processTracksSigmaPlusExtendedWithTofMc(femtotables::FilteredFemtoMcCollisions const& cols, + femtotables::FemtoMcTracks const& tracks, + femtotables::FemtoMcSigmaPlusExtendedWithTof const& sigmaplus, + o2::aod::FMcCols const& mcCols, + femtotables::FemtoMcParticles const& mcParticles, + o2::aod::FMcMothers const& mcMothers, + o2::aod::FMcPartMoths const& mcPartonicMothers) { // once per dataframe builders.mcBuilder.reset(mcCols, mcParticles); builders.trackBuilder.reset(tracks); for (auto const& col : cols) { - if (builders.trackBuilder.collisionHasTooFewTracks(col, tracks, mcTrackPartition1, mcTrackPartition2, cache) || builders.kinkBuilder.collisionHasTooFewSigmaPlus(col, sigmaplus, mcSigmaPlusExtendedPartition, cache)) { + if (builders.trackBuilder.collisionHasTooFewTracks(col, tracks, mcTrackPartition1, mcTrackPartition2, cache) || builders.kinkBuilder.collisionHasTooFewSigmaPlus(col, sigmaplus, mcSigmaPlusExtendedWithTofPartition, cache)) { continue; } if (builders.collisionBuilder.collisionFailsDownsampling()) { @@ -908,11 +966,11 @@ struct FemtoProducerDerivedToDerived { builders.trackBuilder.processTracksWithMc(col, tracks, mcTrackPartition1, mcTrackPartition2, cache, trackBuilderProducts, collisionBuilderProducts, builders.mcBuilder, mcCols, mcParticles, mcMothers, mcPartonicMothers, mcBuilderProducts); - builders.kinkBuilder.processSigmaPlusWithMc(col, sigmaplus, tracks, mcSigmaPlusExtendedPartition, builders.trackBuilder, cache, kinkBuilderProducts, trackBuilderProducts, collisionBuilderProducts, + builders.kinkBuilder.processSigmaPlusWithMc(col, sigmaplus, tracks, mcSigmaPlusExtendedWithTofPartition, builders.trackBuilder, cache, kinkBuilderProducts, trackBuilderProducts, collisionBuilderProducts, builders.mcBuilder, mcCols, mcParticles, mcMothers, mcPartonicMothers, mcBuilderProducts); } } - PROCESS_SWITCH(FemtoProducerDerivedToDerived, processTracksSigmaPlusExtendedMc, "Process sigmaPlus (with SigmaPlusExtras) and tracks with MC information", false); + PROCESS_SWITCH(FemtoProducerDerivedToDerived, processTracksSigmaPlusExtendedWithTofMc, "Process sigmaPlus (with SigmaPlusExtras and SigmaPlusTofPids) and tracks with MC information", false); void processTracksSigmaPlusPcmMc(femtotables::FilteredFemtoMcCollisions const& cols, femtotables::FemtoMcTracks const& tracks,