diff --git a/PWGCF/Femto/Core/collisionBuilder.h b/PWGCF/Femto/Core/collisionBuilder.h index d7534f185b9..b22c23e8ee3 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]] float 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..f67a6bb62e7 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 @@ -61,6 +67,7 @@ struct ConfKinkFilters : o2::framework::ConfigurableGroup { o2::framework::Configurable massMinSigmaPlusPcm{"massMinSigmaPlusPcm", 1.1f, "Minimum mass for SigmaPlus (PCM) hypothesis"}; o2::framework::Configurable massMaxSigmaPlusPcm{"massMaxSigmaPlusPcm", 1.3f, "Maximum mass for SigmaPlus (PCM) hypothesis"}; o2::framework::Configurable mlScoreMinSigmaPlusPcm{"mlScoreMinSigmaPlusPcm", -1.f, "Minimum BDT score for SigmaPlus (PCM) (-1: no cut)"}; + o2::framework::Configurable sigmaPlusPcmMomCorr{"sigmaPlusPcmMomCorr", true, "PCM SigmaPlus: pT, eta, phi from the corrected momentum of the sigmaplusbuilder (PxSigmaPlusCorr...) where available; the mass stays the one with only the pi0 constraint"}; }; // selections bits for all kinks @@ -106,10 +113,7 @@ 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> 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> photonDcaZMax{"photonDcaZMax", {2.0f}, "Maximum |DCAz| of the photon from primary vertex (cm)"}; + 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> 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"}; o2::framework::Configurable requireTof{"requireTof", false, "If true, TOF PID is a minimal selection. If false, TOF PID is optional"}; @@ -194,8 +198,6 @@ enum KinkSeles { kPtOriginalMax, kFlightDirTiltMax, - kChaDauDcaZMax, - kPhotonDcaZMax, kKinkSelsMax }; @@ -221,9 +223,7 @@ const std::unordered_map kinkSelectionNames = { {kCosPointingAngleMin, "cosPointingAngleMin"}, {kPtOriginalMin, "ptOriginalMin"}, {kPtOriginalMax, "ptOriginalMax"}, - {kFlightDirTiltMax, "flightDirTiltMax"}, - {kChaDauDcaZMax, "chaDauDcaZMax"}, - {kPhotonDcaZMax, "photonDcaZMax"}}; + {kFlightDirTiltMax, "flightDirTiltMax"}}; /// enum for all kink pre-filters (evaluated in checkFilters, before the selection bitmask) enum KinkFilters { @@ -237,6 +237,7 @@ enum KinkFilters { kMassMax, kPhiAtPv, kMlScoreMin, + kMomCorr, kKinkFiltersMax }; @@ -253,7 +254,8 @@ const std::unordered_map kinkFilterNames = { {kMassMin, "massMin"}, {kMassMax, "massMax"}, {kPhiAtPv, "kinkPhiAtPv"}, - {kMlScoreMin, "mlScoreMin"}}; + {kMlScoreMin, "mlScoreMin"}, + {kMomCorr, "sigmaPlusPcmMomCorr"}}; /// \class KinkCuts /// \brief Cut class to contain and execute all cuts applied to kinks @@ -545,15 +547,112 @@ 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 +/// (tracks sliced to the collision in the process function) +template +std::pair collisionTofEventTime(T const& tracksThisCol) +{ + double sum = 0., sumErr = 0.; + int n = 0; + for (const auto& track : tracksThisCol) { + if (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 + // evTime.second <= 0: no event time (kink collision without TOF tracks, NoTofValue from collisionTofEventTime) + if (!daughter.hasTOF() || !daughter.has_collision() || std::abs(daughter.tofSignal()) < UndefinedTofSignal || + daughter.length() <= 0.f || daughter.tofExpMom() <= 0.f || evTime.first < MinEvTime || evTime.second <= 0.f) { + 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()}, daughter.sign(), 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 +666,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 +695,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 +720,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 +739,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..."; @@ -649,6 +752,15 @@ class KinkBuilder LOG(info) << "Initialization done..."; } + /// TOF event time of the current collision for the kink TOF tables, from the tracks sliced to the collision + template + void setCollisionTofEventTime(T const& tracksThisCol) + { + if (mProduceSigmaTofPids || mProduceSigmaPlusTofPids) { + mCollisionTofEventTime = collisionTofEventTime(tracksThisCol); + } + } + template void fillKinks(T1 const& col, T2& collisionBuilder, T3& collisionProducts, T4& trackProducts, T5& kinkProducts, T6 const& kinks, T7 const& tracks, T8& trackBuilder) { @@ -675,11 +787,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, 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, daughterIndex); } } } @@ -711,19 +823,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, 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, 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, int64_t daughterIndex) { // Mass is calculated from original momentum components stored in kink table float mass = kink.mSigmaMinus(); @@ -758,10 +870,15 @@ class KinkBuilder kink.zDecVtx(), mKinkSelection.getKinkTransRadius()); } + if (mProduceSigmaTofPids) { + const auto evTime = daughter.hasTOF() ? mCollisionTofEventTime : std::pair{KinkTofChain::NoTofValue, KinkTofChain::NoTofValue}; + const auto chain = computeKinkTofChain(col, kink, daughter, evTime, 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, int64_t daughterIndex) { // Mass is calculated from original momentum components stored in kink table float mass = kink.mSigmaPlus(); @@ -801,6 +918,11 @@ class KinkBuilder kink.ptMoth(), mother.itsClusterSizes()); } + if (mProduceSigmaPlusTofPids) { + const auto evTime = daughter.hasTOF() ? mCollisionTofEventTime : std::pair{KinkTofChain::NoTofValue, KinkTofChain::NoTofValue}; + const auto chain = computeKinkTofChain(col, kink, daughter, evTime, collisionBuilder.magneticField()); + kinkProducts.producedSigmaPlusTofPids(chain.tofMinusEvTime, chain.lengthMoth, chain.pMoth, chain.lengthDau, chain.tofExpMom, chain.evTimeErr, chain.deltaBc); + } } [[nodiscard]] bool fillAnyTable() const { return mFillAnyTable; } @@ -809,14 +931,17 @@ class KinkBuilder private: KinkSelection mKinkSelection; bool mFillAnyTable = false; + std::pair mCollisionTofEventTime{KinkTofChain::NoTofValue, KinkTofChain::NoTofValue}; // of the current collision bool mProduceSigmas = false; 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 @@ -843,12 +968,10 @@ class SigmaPlusPcmSelection : public baseselection::BaseSelectionaddSelection(kFlightDirTiltMax, kinkSelectionNames.at(kFlightDirTiltMax), config.flightDirTiltMax.value, limits::kUpperLimit, true, true, false); - this->addSelection(kMothDcaPvMax, kinkSelectionNames.at(kMothDcaPvMax), config.mothDcaPvMax.value, limits::kUpperLimit, true, true, false); - this->addSelection(kChaDauDcaZMax, kinkSelectionNames.at(kChaDauDcaZMax), config.chaDauDcaZMax.value, limits::kAbsUpperLimit, true, true, false); - this->addSelection(kPhotonDcaZMax, kinkSelectionNames.at(kPhotonDcaZMax), config.photonDcaZMax.value, limits::kAbsUpperLimit, true, true, false); this->addSelection(kChaDaughTpcProton, kinkSelectionNames.at(kChaDaughTpcProton), config.chaDauTpcProton.value, limits::kAbsUpperLimit, true, true, false); this->addSelection(kChaDaughTofProton, kinkSelectionNames.at(kChaDaughTofProton), config.chaDauTofProton.value, limits::kAbsUpperLimit, true, config.requireTof.value, false); this->addComments(kChaDaughTofProton, "requireTof = " + std::to_string(config.requireTof.value) + "; keepTracksWithoutTof = " + std::to_string(mKeepTracksWithoutTof)); @@ -867,6 +990,7 @@ class SigmaPlusPcmSelection : public baseselection::BaseSelection(mPhiAtPv)}, {kinkFilterNames.at(kMlScoreMin), mMlScoreMin}, + {kinkFilterNames.at(kMomCorr), static_cast(mUseMomCorr)}, }); }; @@ -874,6 +998,10 @@ class SigmaPlusPcmSelection : public baseselection::BaseSelection momMother = {sigmaPlusPcmCand.pxSigmaPlus(), sigmaPlusPcmCand.pySigmaPlus(), sigmaPlusPcmCand.pzSigmaPlus()}; + constexpr float NoCorrection = -900.f; // -999 in the builder if the correction was not computed + if (mUseMomCorr && sigmaPlusPcmCand.pxSigmaPlusCorr() > NoCorrection) { + momMother = {sigmaPlusPcmCand.pxSigmaPlusCorr(), sigmaPlusPcmCand.pySigmaPlusCorr(), sigmaPlusPcmCand.pzSigmaPlusCorr()}; + } mPt = RecoDecay::pt(momMother); mEta = RecoDecay::eta(momMother); mPhi = RecoDecay::phi(momMother); @@ -915,6 +1043,7 @@ class SigmaPlusPcmSelection : public baseselection::BaseSelectiontemplate fillFilter(kPhiAtPv, mPhiAtPv); + this->template fillFilter(kMomCorr, mUseMomCorr); p = mMass > mMassLowerLimit; this->template fillFilter(kMassMin, p); @@ -938,9 +1067,6 @@ class SigmaPlusPcmSelection : public baseselection::BaseSelectionreset(); this->evaluateObservable(kFlightDirTiltMax, sigmaPlusPcmCand.flightDirTilt()); - this->evaluateObservable(kMothDcaPvMax, sigmaPlusPcmCand.candDcaToPV()); - this->evaluateObservable(kChaDauDcaZMax, sigmaPlusPcmCand.protonDcaZ()); - this->evaluateObservable(kPhotonDcaZMax, sigmaPlusPcmCand.photonDcaZToPV()); auto chaDaughter = sigmaPlusPcmCand.template protonTrack_as(); this->evaluateObservable(kChaDaughTpcProton, chaDaughter.tpcNSigmaPr()); @@ -971,6 +1097,7 @@ class SigmaPlusPcmSelection : public baseselection::BaseSelection 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 +1380,7 @@ class KinkBuilderDerivedToDerived sigma.mass(), chaDaughterIndex); newSigmaTable.producedSigmaMasks(sigma.mask()); + fillSigmaExtensions(sigma, newSigmaTable); } } @@ -1274,6 +1431,7 @@ class KinkBuilderDerivedToDerived sigma.mass(), chaDaughterIndex); newSigmaTable.producedSigmaMasks(sigma.mask()); + fillSigmaExtensions(sigma, newSigmaTable); mcBuilder.fillSigmaWithLabel(sigma, mcCols, mcParticles, mcMothers, mcPartonicMothers, mcProducts); } } @@ -1376,6 +1534,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 @@ -1384,20 +1560,46 @@ class KinkBuilderDerivedToDerived if constexpr (requires(T1 t) { t.mlScore(); }) { newSigmaPlusPcmTable.producedSigmaPlusPcmMlScores(sigmaPlusPcm.mlScore()); } - if constexpr (requires(T1 t) { t.photonConvRadius(); }) { + if constexpr (requires(T1 t) { t.pxMissPhoton(); }) { newSigmaPlusPcmTable.producedSigmaPlusPcmExtras(sigmaPlusPcm.flightDirTilt(), sigmaPlusPcm.dcaMothToPV(), sigmaPlusPcm.dauDcaXY(), sigmaPlusPcm.dauDcaZ(), sigmaPlusPcm.dauTpcNSigmaPr(), sigmaPlusPcm.dauTofNSigmaPr(), - sigmaPlusPcm.photonDcaXYToPV(), + sigmaPlusPcm.dauItsNCls(), + sigmaPlusPcm.dauItsChi2NCl(), + sigmaPlusPcm.kfDevDauPhoton(), + sigmaPlusPcm.kfDcaDauPhoton(), + sigmaPlusPcm.kfSigmaXYDecVtx(), + sigmaPlusPcm.kfSigmaZDecVtx(), sigmaPlusPcm.photonDcaZToPV(), - sigmaPlusPcm.photonCosPAToPV(), - sigmaPlusPcm.photonConvRadius(), + sigmaPlusPcm.photonDcaToPV(), + sigmaPlusPcm.photonLegMinDcaXY(), + sigmaPlusPcm.photonLegMinDcaZ(), + sigmaPlusPcm.photonMinItsNCls(), sigmaPlusPcm.antiSigmaPointingAngle(), - sigmaPlusPcm.dcaDauPhoton(), - sigmaPlusPcm.transRadius()); + sigmaPlusPcm.pxDau(), + sigmaPlusPcm.pyDau(), + sigmaPlusPcm.pzDau(), + sigmaPlusPcm.pxPhoton(), + sigmaPlusPcm.pyPhoton(), + sigmaPlusPcm.pzPhoton(), + sigmaPlusPcm.pxMissPhoton(), + sigmaPlusPcm.pyMissPhoton(), + sigmaPlusPcm.pzMissPhoton(), + sigmaPlusPcm.decayVtxX(), + sigmaPlusPcm.decayVtxY(), + sigmaPlusPcm.decayVtxZ(), + sigmaPlusPcm.pvX(), + sigmaPlusPcm.pvY(), + sigmaPlusPcm.photonConvX(), + sigmaPlusPcm.photonConvY(), + sigmaPlusPcm.photonConvZ(), + sigmaPlusPcm.flightDirTheta(), + sigmaPlusPcm.flightDirPhi(), + sigmaPlusPcm.flightDirCorrAngle(), + sigmaPlusPcm.massCorr()); } } diff --git a/PWGCF/Femto/DataModel/FemtoTables.h b/PWGCF/Femto/DataModel/FemtoTables.h index 815fd9d6be6..706c67f5b55 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,17 +1116,70 @@ 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 -DECLARE_SOA_COLUMN(DauDcaXY, dauDcaXY, float); //! DCAxy of the charged daughter to the primary vertex -DECLARE_SOA_COLUMN(DauDcaZ, dauDcaZ, float); //! DCAz of the charged daughter to the primary vertex -DECLARE_SOA_COLUMN(PhotonDcaXYToPV, photonDcaXYToPV, float); //! Transverse DCA of the photon flight line to the primary vertex -DECLARE_SOA_COLUMN(PhotonDcaZToPV, photonDcaZToPV, float); //! Longitudinal DCA of the photon flight line to the primary vertex -DECLARE_SOA_COLUMN(PhotonCosPAToPV, photonCosPAToPV, float); //! Cosine of the photon pointing angle to the primary vertex -DECLARE_SOA_COLUMN(PhotonConvRadius, photonConvRadius, float); //! Conversion radius of the photon -DECLARE_SOA_COLUMN(AntiSigmaPointingAngle, antiSigmaPointingAngle, float); //! Angle between the unbent proton momentum and the flight direction -DECLARE_SOA_COLUMN(DcaDauPhoton, dcaDauPhoton, float); //! DCA between charged daughter and photon at the decay vertex +DECLARE_SOA_COLUMN(MlScore, mlScore, float); //! BDT score of the candidate +// BDT inputs of the sigmaplusbuilder (sigmaPt and flightDistance follow from the momenta and the decay vertex below) +DECLARE_SOA_COLUMN(FlightDirTilt, flightDirTilt, float); //! Tilt of the flight direction needed for a real solution of the missing photon (rad) +DECLARE_SOA_COLUMN(DauDcaXY, dauDcaXY, float); //! DCAxy of the charged daughter to the primary vertex (cm) +DECLARE_SOA_COLUMN(DauDcaZ, dauDcaZ, float); //! DCAz of the charged daughter to the primary vertex (cm) +DECLARE_SOA_COLUMN(DauItsNCls, dauItsNCls, uint8_t); //! Number of ITS clusters of the charged daughter +DECLARE_SOA_COLUMN(DauItsChi2NCl, dauItsChi2NCl, float); //! ITS chi2 per cluster of the charged daughter +DECLARE_SOA_COLUMN(KfDevDauPhoton, kfDevDauPhoton, float); //! Charged daughter-photon distance in units of its uncertainty (KFParticle) +DECLARE_SOA_COLUMN(KfDcaDauPhoton, kfDcaDauPhoton, float); //! Charged daughter-photon distance (KFParticle, cm) +DECLARE_SOA_COLUMN(KfSigmaXYDecVtx, kfSigmaXYDecVtx, float); //! Transverse uncertainty of the KFParticle decay vertex (cm) +DECLARE_SOA_COLUMN(KfSigmaZDecVtx, kfSigmaZDecVtx, float); //! Longitudinal uncertainty of the KFParticle decay vertex (cm) +DECLARE_SOA_COLUMN(PhotonDcaZToPV, photonDcaZToPV, float); //! Longitudinal DCA of the photon flight line to the primary vertex (cm) +DECLARE_SOA_COLUMN(PhotonDcaToPV, photonDcaToPV, float); //! 3D DCA of the photon flight line to the primary vertex (cm) +DECLARE_SOA_COLUMN(PhotonLegMinDcaXY, photonLegMinDcaXY, float); //! Smaller |DCAxy| of the two photon legs (cm) +DECLARE_SOA_COLUMN(PhotonLegMinDcaZ, photonLegMinDcaZ, float); //! Smaller |DCAz| of the two photon legs (cm) +DECLARE_SOA_COLUMN(PhotonMinItsNCls, photonMinItsNCls, uint8_t); //! Smaller number of ITS clusters of the two photon legs +DECLARE_SOA_COLUMN(AntiSigmaPointingAngle, antiSigmaPointingAngle, float); //! Angle between the unbent proton momentum and the flight direction (rad) +// momentum and mass resolution studies +DECLARE_SOA_COLUMN(PxDau, pxDau, float); //! Px of the charged daughter at the decay vertex (GeV/c) +DECLARE_SOA_COLUMN(PyDau, pyDau, float); //! Py of the charged daughter at the decay vertex (GeV/c) +DECLARE_SOA_COLUMN(PzDau, pzDau, float); //! Pz of the charged daughter at the decay vertex (GeV/c) +DECLARE_SOA_COLUMN(PxPhoton, pxPhoton, float); //! Px of the measured (PCM) photon (GeV/c) +DECLARE_SOA_COLUMN(PyPhoton, pyPhoton, float); //! Py of the measured (PCM) photon (GeV/c) +DECLARE_SOA_COLUMN(PzPhoton, pzPhoton, float); //! Pz of the measured (PCM) photon (GeV/c) +DECLARE_SOA_COLUMN(PxMissPhoton, pxMissPhoton, float); //! Px of the reconstructed (missing) photon (GeV/c) +DECLARE_SOA_COLUMN(PyMissPhoton, pyMissPhoton, float); //! Py of the reconstructed (missing) photon (GeV/c) +DECLARE_SOA_COLUMN(PzMissPhoton, pzMissPhoton, float); //! Pz of the reconstructed (missing) photon (GeV/c) +DECLARE_SOA_COLUMN(PvX, pvX, float); //! Primary vertex used by the builder (x direction, cm) +DECLARE_SOA_COLUMN(PvY, pvY, float); //! Primary vertex used by the builder (y direction, cm) +DECLARE_SOA_COLUMN(PhotonConvX, photonConvX, float); //! Photon conversion point (x direction, relative to PV, cm) +DECLARE_SOA_COLUMN(PhotonConvY, photonConvY, float); //! Photon conversion point (y direction, relative to PV, cm) +DECLARE_SOA_COLUMN(PhotonConvZ, photonConvZ, float); //! Photon conversion point (z direction, relative to PV, cm) +DECLARE_SOA_COLUMN(FlightDirTheta, flightDirTheta, float); //! Polar angle of the used flight direction (rad) +DECLARE_SOA_COLUMN(FlightDirPhi, flightDirPhi, float); //! Azimuth of the used flight direction (rad) +DECLARE_SOA_COLUMN(FlightDirCorrAngle, flightDirCorrAngle, float); //! Angle between the corrected and the used flight direction (rad) +DECLARE_SOA_COLUMN(MassCorr, massCorr, float); //! Mass with the corrected flight direction (GeV/c^2, -999 if not computed) +DECLARE_SOA_DYNAMIC_COLUMN(PtUncorr, ptUncorr, //! pT from the daughter momenta (uncorrected; BDT input sigmaPt) + [](float pxDau, float pyDau, float pxPhoton, float pyPhoton, float pxMissPhoton, float pyMissPhoton) -> float { + return std::hypot(pxDau + pxPhoton + pxMissPhoton, pyDau + pyPhoton + pyMissPhoton); + }); +DECLARE_SOA_DYNAMIC_COLUMN(FlightDistance, flightDistance, //! 3D distance from the PV to the decay vertex (BDT input flightDistance, cm) + [](float decayVtxX, float decayVtxY, float decayVtxZ) -> float { + return std::sqrt(decayVtxX * decayVtxX + decayVtxY * decayVtxY + decayVtxZ * decayVtxZ); + }); // id column for charged daughter track DECLARE_SOA_INDEX_COLUMN_FULL(ChaDau, chaDau, int32_t, FTracks, "_ChaDau"); //! @@ -1225,6 +1279,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 +1365,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<>, @@ -1346,6 +1427,7 @@ DECLARE_SOA_TABLE_STAGED_VERSIONED(FSigmaPlusPcmMlScores_001, "FSIGMAPCMML", 1, using FSigmaPlusPcmMlScores = FSigmaPlusPcmMlScores_001; using StoredFSigmaPlusPcmMlScores = StoredFSigmaPlusPcmMlScores_001; +// BDT inputs of the sigmaplusbuilder and the variables for momentum and mass resolution studies DECLARE_SOA_TABLE_STAGED_VERSIONED(FSigmaPlusPcmExtras_001, "FSIGMAPCMEXTRA", 1, femtokinks::FlightDirTilt, femtokinks::DcaMothToPV, @@ -1353,13 +1435,41 @@ DECLARE_SOA_TABLE_STAGED_VERSIONED(FSigmaPlusPcmExtras_001, "FSIGMAPCMEXTRA", 1, femtokinks::DauDcaZ, femtokinks::DauTpcNSigmaPr, femtokinks::DauTofNSigmaPr, - femtokinks::PhotonDcaXYToPV, + femtokinks::DauItsNCls, + femtokinks::DauItsChi2NCl, + femtokinks::KfDevDauPhoton, + femtokinks::KfDcaDauPhoton, + femtokinks::KfSigmaXYDecVtx, + femtokinks::KfSigmaZDecVtx, femtokinks::PhotonDcaZToPV, - femtokinks::PhotonCosPAToPV, - femtokinks::PhotonConvRadius, + femtokinks::PhotonDcaToPV, + femtokinks::PhotonLegMinDcaXY, + femtokinks::PhotonLegMinDcaZ, + femtokinks::PhotonMinItsNCls, femtokinks::AntiSigmaPointingAngle, - femtokinks::DcaDauPhoton, - femtokinks::TransRadius); + femtokinks::PxDau, + femtokinks::PyDau, + femtokinks::PzDau, + femtokinks::PxPhoton, + femtokinks::PyPhoton, + femtokinks::PzPhoton, + femtokinks::PxMissPhoton, + femtokinks::PyMissPhoton, + femtokinks::PzMissPhoton, + femtokinks::DecayVtxX, + femtokinks::DecayVtxY, + femtokinks::DecayVtxZ, + femtokinks::PvX, + femtokinks::PvY, + femtokinks::PhotonConvX, + femtokinks::PhotonConvY, + femtokinks::PhotonConvZ, + femtokinks::FlightDirTheta, + femtokinks::FlightDirPhi, + femtokinks::FlightDirCorrAngle, + femtokinks::MassCorr, + femtokinks::PtUncorr, + femtokinks::FlightDistance); using FSigmaPlusPcmExtras = FSigmaPlusPcmExtras_001; using StoredFSigmaPlusPcmExtras = StoredFSigmaPlusPcmExtras_001; diff --git a/PWGCF/Femto/TableProducer/femtoProducer.cxx b/PWGCF/Femto/TableProducer/femtoProducer.cxx index 7ca55f69bed..0d8a5f98613 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) + @@ -494,12 +496,17 @@ struct FemtoProducer { template void processKinks(T1 const& col, T2 const& tracks, T3 const& kinks) { + builders.sigmaBuilder.setCollisionTofEventTime(tracks); + builders.sigmaPlusBuilder.setCollisionTofEventTime(tracks); builders.sigmaBuilder.fillKinks(col, builders.collisionBuilder, collisionBuilderProducts, trackBuilderProducts, kinkBuilderProducts, kinks, tracks, builders.trackBuilder); builders.sigmaPlusBuilder.fillKinks(col, builders.collisionBuilder, collisionBuilderProducts, trackBuilderProducts, kinkBuilderProducts, kinks, tracks, builders.trackBuilder); } - template - void processMcKinks(T1 const& col, T2 const& mcCols, T3 const& tracks, T4 const& kinks, T5 const& mcParticles) + // tracks: all tracks (kink daughters looked up by index), tracksThisCol: tracks of this collision (TOF event time) + template + void processMcKinks(T1 const& col, T2 const& mcCols, T3 const& tracks, T4 const& tracksThisCol, T5 const& kinks, T6 const& mcParticles) { + builders.sigmaBuilder.setCollisionTofEventTime(tracksThisCol); + builders.sigmaPlusBuilder.setCollisionTofEventTime(tracksThisCol); builders.sigmaBuilder.fillMcKinks(col, builders.collisionBuilder, collisionBuilderProducts, mcCols, trackBuilderProducts, kinkBuilderProducts, kinks, tracks, builders.trackBuilder, mcParticles, builders.mcBuilder, mcProducts); builders.sigmaPlusBuilder.fillMcKinks(col, builders.collisionBuilder, collisionBuilderProducts, mcCols, trackBuilderProducts, kinkBuilderProducts, kinks, tracks, builders.trackBuilder, mcParticles, builders.mcBuilder, mcProducts); } @@ -918,6 +925,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, @@ -1162,7 +1203,7 @@ struct FemtoProducer { processMcTracks(col, mcCols, tracksThisCol, tracksWithItsPid, mcParticles); auto kinksThisCol = kinks.sliceBy(preslices.perColRecoKinks, col.globalIndex()); - processMcKinks(col, mcCols, tracks, kinksThisCol, mcParticles); + processMcKinks(col, mcCols, tracks, tracksThisCol, kinksThisCol, mcParticles); } } PROCESS_SWITCH(FemtoProducer, processTracksKinksRun3ppMc, "Provide reconstructed and generated tracks and kinks", false); @@ -1219,7 +1260,7 @@ struct FemtoProducer { processMcTracks(col, mcCols, tracksThisCol, tracksWithItsPid, mcParticles); auto kinksThisCol = kinks.sliceBy(preslices.perColRecoKinks, col.globalIndex()); - processMcKinks(col, mcCols, tracks, kinksThisCol, mcParticles); + processMcKinks(col, mcCols, tracks, tracksThisCol, kinksThisCol, mcParticles); auto sigmaPlusPcmsThisCol = sigmaPlusPcms.sliceBy(preslices.perColRecoSigmaPlusPcms, col.globalIndex()); processMcSigmaPlusPcms(col, mcCols, tracks, sigmaPlusPcmsThisCol, mcParticles); } @@ -1253,7 +1294,7 @@ struct FemtoProducer { processMcV0s(col, mcCols, tracks, v0sThisCol, mcParticles); auto kinksThisCol = kinks.sliceBy(preslices.perColRecoKinks, col.globalIndex()); - processMcKinks(col, mcCols, tracks, kinksThisCol, mcParticles); + processMcKinks(col, mcCols, tracks, tracksThisCol, kinksThisCol, mcParticles); } } PROCESS_SWITCH(FemtoProducer, processTracksV0sKinksRun3ppMc, "Provide reconstructed and generated tracks, v0s and kinks", false); 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,