From 10145c8e1b6547aba3fae1ae1b0b6940560e2601 Mon Sep 17 00:00:00 2001 From: Anton Riedel Date: Wed, 15 Jul 2026 16:26:32 +0200 Subject: [PATCH] Fix: fixes in triplet tasks --- PWGCF/Femto/Core/particleCleaner.h | 6 +- PWGCF/Femto/Core/tripletBuilder.h | 207 +++++++++++------- PWGCF/Femto/Core/tripletHistManager.h | 14 +- PWGCF/Femto/Core/tripletProcessHelpers.h | 107 +++++++-- .../Tasks/femtoTripletTrackTrackCascade.cxx | 20 +- .../Tasks/femtoTripletTrackTrackTrack.cxx | 14 +- .../Femto/Tasks/femtoTripletTrackTrackV0.cxx | 14 +- 7 files changed, 254 insertions(+), 128 deletions(-) diff --git a/PWGCF/Femto/Core/particleCleaner.h b/PWGCF/Femto/Core/particleCleaner.h index 9974c20cb47..54e1aa0a36a 100644 --- a/PWGCF/Femto/Core/particleCleaner.h +++ b/PWGCF/Femto/Core/particleCleaner.h @@ -232,9 +232,9 @@ class ParticleCleaner private: bool mActivate = false; - bool mRejectParticleWithoutMcParticle = true; - bool mRejectParticleWithoutMcMother = true; - bool mRejectParticleWithoutMcPartonicMother = true; + bool mRejectParticleWithoutMcParticle = false; + bool mRejectParticleWithoutMcMother = false; + bool mRejectParticleWithoutMcPartonicMother = false; std::vector mRequiredPdgCodes; std::vector mRejectedPdgCodes; std::vector mRequiredMotherPdgCodes; diff --git a/PWGCF/Femto/Core/tripletBuilder.h b/PWGCF/Femto/Core/tripletBuilder.h index 0184d442ea7..7ebda0d0802 100644 --- a/PWGCF/Femto/Core/tripletBuilder.h +++ b/PWGCF/Femto/Core/tripletBuilder.h @@ -10,7 +10,7 @@ // or submit itself to any jurisdiction. /// \file tripletBuilder.h -/// \brief histogram manager for pair tasks +/// \brief histogram manager for triplet tasks /// \author anton.riedel@tum.de, TU München, anton.riedel@tum.de #ifndef PWGCF_FEMTO_CORE_TRIPLETBUILDER_H_ @@ -77,22 +77,28 @@ class TripletTrackTrackTrackBuilder typename T11, typename T12, typename T13, - typename T14> + typename T14, + typename T15, + typename T16, + typename T17> void init(o2::framework::HistogramRegistry* registry, T1 const& confCollisionBinning, T2 const& confTrackSelection1, T3 const& confTrackSelection2, T4 const& confTrackSelection3, - T5 const& confCtr, - T6 const& confMixing, - T7 const& confTripletBinning, - T8 const& confTripletCuts, - std::map> const& colHistSpec, - std::map> const& trackHistSpec1, - std::map> const& trackHistSpec2, - std::map> const& trackHistSpec3, - std::map> const& pairHistSpec, - std::map> const& cprHistSpec) + T5 const& confCleaner1, + T6 const& confCleaner2, + T7 const& confCleaner3, + T8 const& confCtr, + T9 const& confMixing, + T10 const& confTripletBinning, + T11 const& confTripletCuts, + std::map> const& colHistSpec, + std::map> const& trackHistSpec1, + std::map> const& trackHistSpec2, + std::map> const& trackHistSpec3, + std::map> const& pairHistSpec, + std::map> const& cprHistSpec) { // check if correlate the same tracks or not mTrack1Track2Track3AreSameSpecies = confMixing.particle123AreSameSpecies.value; @@ -110,6 +116,7 @@ class TripletTrackTrackTrackBuilder if (mTrack1Track2Track3AreSameSpecies) { // Track1 & Track2 & Track3 are the same particle species + mCleaner1.init(confCleaner1); mTrackHistManager1.template init(registry, trackHistSpec1, confTrackSelection1); mTripletHistManagerSe.setMass(confTrackSelection1.pdgCodeAbs.value, confTrackSelection1.pdgCodeAbs.value, confTrackSelection1.pdgCodeAbs.value); @@ -121,6 +128,8 @@ class TripletTrackTrackTrackBuilder mCtrMe.init(registry, cprHistSpec, confCtr, confTrackSelection1.chargeAbs.value, confTrackSelection1.chargeAbs.value, confTrackSelection1.chargeAbs.value); } else if (mTrack1Track2AreSameSpecies) { // Track1 & Track2 & are the same particle species and track 3 is something else + mCleaner1.init(confCleaner1); + mCleaner3.init(confCleaner3); mTrackHistManager1.template init(registry, trackHistSpec1, confTrackSelection1); mTrackHistManager3.template init(registry, trackHistSpec3, confTrackSelection3); @@ -133,6 +142,9 @@ class TripletTrackTrackTrackBuilder mCtrMe.init(registry, cprHistSpec, confCtr, confTrackSelection1.chargeAbs.value, confTrackSelection1.chargeAbs.value, confTrackSelection3.chargeAbs.value); } else { // all three tracks are different + mCleaner1.init(confCleaner1); + mCleaner2.init(confCleaner2); + mCleaner3.init(confCleaner3); mTrackHistManager1.template init(registry, trackHistSpec1, confTrackSelection1); mTrackHistManager2.template init(registry, trackHistSpec2, confTrackSelection2); mTrackHistManager3.template init(registry, trackHistSpec3, confTrackSelection3); @@ -225,7 +237,7 @@ class TripletTrackTrackTrackBuilder if (mMixIdenticalParticles) { tripletOrder = static_cast(mDist(mRng)); } - tripletprocesshelpers::processSameEvent(trackSlice1, trackTable, mcParticles, mcMothers, mcPartonicMothers, col, mcCols, mTrackHistManager1, mTripletHistManagerSe, mCtrSe, mTc, tripletOrder); + tripletprocesshelpers::processSameEvent(trackSlice1, trackTable, mcParticles, mcMothers, mcPartonicMothers, col, mcCols, mTrackHistManager1, mTripletHistManagerSe, mCleaner1, mCtrSe, mTc, tripletOrder); } else if (mTrack1Track2AreSameSpecies) { auto trackSlice1 = partition1->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache); auto trackSlice3 = partition3->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache); @@ -237,7 +249,7 @@ class TripletTrackTrackTrackBuilder if (mMixIdenticalParticles) { tripletOrder = static_cast(mDist(mRng)); } - tripletprocesshelpers::processSameEvent(trackSlice1, trackSlice3, trackTable, mcParticles, mcMothers, mcPartonicMothers, col, mcCols, mTrackHistManager1, mTrackHistManager3, mTripletHistManagerSe, mCtrSe, mTc, tripletOrder); + tripletprocesshelpers::processSameEvent(trackSlice1, trackSlice3, trackTable, mcParticles, mcMothers, mcPartonicMothers, col, mcCols, mTrackHistManager1, mTrackHistManager3, mTripletHistManagerSe, mCleaner1, mCleaner3, mCtrSe, mTc, tripletOrder); } else { auto trackSlice1 = partition1->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache); auto trackSlice2 = partition2->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache); @@ -247,10 +259,11 @@ class TripletTrackTrackTrackBuilder } mColHistManager.template fill(col, mcCols); mCtrSe.setMagField(col.magField()); - tripletprocesshelpers::processSameEvent(trackSlice1, trackSlice2, trackSlice3, trackTable, mcParticles, mcMothers, mcPartonicMothers, col, mcCols, mTrackHistManager1, mTrackHistManager2, mTrackHistManager3, mTripletHistManagerSe, mCtrSe, mTc); + tripletprocesshelpers::processSameEvent(trackSlice1, trackSlice2, trackSlice3, trackTable, mcParticles, mcMothers, mcPartonicMothers, col, mcCols, mTrackHistManager1, mTrackHistManager2, mTrackHistManager3, mTripletHistManagerSe, mCleaner1, mCleaner2, mCleaner3, mCtrSe, mTc); } } + // data template void processMixedEvent(T1 const& cols, T2& trackTable, T3& partition1, T4& partition2, T5& partition3, T6& cache, T7& binsVtxMult, T8& binsVtxCent, T9& binsVtxMultCent) { @@ -299,19 +312,20 @@ class TripletTrackTrackTrackBuilder } } - template - void processMixedEvent(T1 const& cols, T2 const& mcCols, T3& trackTable, T4& partition1, T5& partition2, T6& partition3, T7 const& mcParticles, T8& cache, T9& binsVtxMult, T10& binsVtxCent, T11& binsVtxMultCent) + // mc — NOTE: now takes mcMothers, mcPartonicMothers (required by the fixed tripletprocesshelpers mc overload) + template + void processMixedEvent(T1 const& cols, T2 const& mcCols, T3& trackTable, T4& partition1, T5& partition2, T6& partition3, T7 const& mcParticles, T8 const& mcMothers, T9 const& mcPartonicMothers, T10& cache, T11& binsVtxMult, T12& binsVtxCent, T13& binsVtxMultCent) { if (mTrack1Track2Track3AreSameSpecies) { switch (mMixingPolicy) { case static_cast(pairhistmanager::kVtxMult): - tripletprocesshelpers::processMixedEvent(cols, mcCols, partition1, partition1, partition1, trackTable, mcParticles, cache, binsVtxMult, mMixingDepth, mTripletHistManagerMe, mCtrMe, mTc); + tripletprocesshelpers::processMixedEvent(cols, mcCols, partition1, partition1, partition1, trackTable, mcParticles, mcMothers, mcPartonicMothers, cache, binsVtxMult, mMixingDepth, mTripletHistManagerMe, mCleaner1, mCleaner1, mCleaner1, mCtrMe, mTc); break; case static_cast(pairhistmanager::kVtxCent): - tripletprocesshelpers::processMixedEvent(cols, mcCols, partition1, partition1, partition1, trackTable, mcParticles, cache, binsVtxCent, mMixingDepth, mTripletHistManagerMe, mCtrMe, mTc); + tripletprocesshelpers::processMixedEvent(cols, mcCols, partition1, partition1, partition1, trackTable, mcParticles, mcMothers, mcPartonicMothers, cache, binsVtxCent, mMixingDepth, mTripletHistManagerMe, mCleaner1, mCleaner1, mCleaner1, mCtrMe, mTc); break; case static_cast(pairhistmanager::kVtxMultCent): - tripletprocesshelpers::processMixedEvent(cols, mcCols, partition1, partition1, partition1, trackTable, mcParticles, cache, binsVtxMultCent, mMixingDepth, mTripletHistManagerMe, mCtrMe, mTc); + tripletprocesshelpers::processMixedEvent(cols, mcCols, partition1, partition1, partition1, trackTable, mcParticles, mcMothers, mcPartonicMothers, cache, binsVtxMultCent, mMixingDepth, mTripletHistManagerMe, mCleaner1, mCleaner1, mCleaner1, mCtrMe, mTc); break; default: LOG(fatal) << "Invalid binning policy specifed. Breaking..."; @@ -319,13 +333,13 @@ class TripletTrackTrackTrackBuilder } else if (mTrack1Track2AreSameSpecies) { switch (mMixingPolicy) { case static_cast(pairhistmanager::kVtxMult): - tripletprocesshelpers::processMixedEvent(cols, mcCols, partition1, partition1, partition3, trackTable, mcParticles, cache, binsVtxMult, mMixingDepth, mTripletHistManagerMe, mCtrMe, mTc); + tripletprocesshelpers::processMixedEvent(cols, mcCols, partition1, partition1, partition3, trackTable, mcParticles, mcMothers, mcPartonicMothers, cache, binsVtxMult, mMixingDepth, mTripletHistManagerMe, mCleaner1, mCleaner1, mCleaner3, mCtrMe, mTc); break; case static_cast(pairhistmanager::kVtxCent): - tripletprocesshelpers::processMixedEvent(cols, mcCols, partition1, partition1, partition3, trackTable, mcParticles, cache, binsVtxCent, mMixingDepth, mTripletHistManagerMe, mCtrMe, mTc); + tripletprocesshelpers::processMixedEvent(cols, mcCols, partition1, partition1, partition3, trackTable, mcParticles, mcMothers, mcPartonicMothers, cache, binsVtxCent, mMixingDepth, mTripletHistManagerMe, mCleaner1, mCleaner1, mCleaner3, mCtrMe, mTc); break; case static_cast(pairhistmanager::kVtxMultCent): - tripletprocesshelpers::processMixedEvent(cols, mcCols, partition1, partition1, partition3, trackTable, mcParticles, cache, binsVtxMultCent, mMixingDepth, mTripletHistManagerMe, mCtrMe, mTc); + tripletprocesshelpers::processMixedEvent(cols, mcCols, partition1, partition1, partition3, trackTable, mcParticles, mcMothers, mcPartonicMothers, cache, binsVtxMultCent, mMixingDepth, mTripletHistManagerMe, mCleaner1, mCleaner1, mCleaner3, mCtrMe, mTc); break; default: LOG(fatal) << "Invalid binning policy specifed. Breaking..."; @@ -333,13 +347,13 @@ class TripletTrackTrackTrackBuilder } else { switch (mMixingPolicy) { case static_cast(pairhistmanager::kVtxMult): - tripletprocesshelpers::processMixedEvent(cols, mcCols, partition1, partition2, partition3, trackTable, mcParticles, cache, binsVtxMult, mMixingDepth, mTripletHistManagerMe, mCtrMe, mTc); + tripletprocesshelpers::processMixedEvent(cols, mcCols, partition1, partition2, partition3, trackTable, mcParticles, mcMothers, mcPartonicMothers, cache, binsVtxMult, mMixingDepth, mTripletHistManagerMe, mCleaner1, mCleaner2, mCleaner3, mCtrMe, mTc); break; case static_cast(pairhistmanager::kVtxCent): - tripletprocesshelpers::processMixedEvent(cols, mcCols, partition1, partition2, partition3, trackTable, mcParticles, cache, binsVtxCent, mMixingDepth, mTripletHistManagerMe, mCtrMe, mTc); + tripletprocesshelpers::processMixedEvent(cols, mcCols, partition1, partition2, partition3, trackTable, mcParticles, mcMothers, mcPartonicMothers, cache, binsVtxCent, mMixingDepth, mTripletHistManagerMe, mCleaner1, mCleaner2, mCleaner3, mCtrMe, mTc); break; case static_cast(pairhistmanager::kVtxMultCent): - tripletprocesshelpers::processMixedEvent(cols, mcCols, partition1, partition2, partition3, trackTable, mcParticles, cache, binsVtxMultCent, mMixingDepth, mTripletHistManagerMe, mCtrMe, mTc); + tripletprocesshelpers::processMixedEvent(cols, mcCols, partition1, partition2, partition3, trackTable, mcParticles, mcMothers, mcPartonicMothers, cache, binsVtxMultCent, mMixingDepth, mTripletHistManagerMe, mCleaner1, mCleaner2, mCleaner3, mCtrMe, mTc); break; default: LOG(fatal) << "Invalid binning policy specifed. Breaking..."; @@ -352,6 +366,9 @@ class TripletTrackTrackTrackBuilder trackhistmanager::TrackHistManager mTrackHistManager1; trackhistmanager::TrackHistManager mTrackHistManager2; trackhistmanager::TrackHistManager mTrackHistManager3; + particlecleaner::ParticleCleaner mCleaner1; + particlecleaner::ParticleCleaner mCleaner2; + particlecleaner::ParticleCleaner mCleaner3; triplethistmanager::TripletHistManager mTripletHistManagerSe; triplethistmanager::TripletHistManager mTripletHistManagerMe; @@ -404,24 +421,30 @@ class TripletTrackTrackV0Builder typename T13, typename T14, typename T15, - typename T16> + typename T16, + typename T17, + typename T18, + typename T19> void init(o2::framework::HistogramRegistry* registry, T1 const& confCollisionBinning, T2 const& confTrackSelection1, T3 const& confTrackSelection2, T4 const& confV0Selection, - T5 const& confCtr, - T6 const& confMixing, - T7 const& confTripletBinning, - T8 const& confTripletCuts, - std::map> const& colHistSpec, - std::map> const& trackHistSpec1, - std::map> const& trackHistSpec2, - std::map> const& v0histSpec, - std::map> const& posDauhistSpec, - std::map> const& negDauhistSpec, - std::map> const& tripletHistSpec, - std::map> const& ctrHistSpec) + T5 const& confCleaner1, + T6 const& confCleaner2, + T7 const& confV0Cleaner, + T8 const& confCtr, + T9 const& confMixing, + T10 const& confTripletBinning, + T11 const& confTripletCuts, + std::map> const& colHistSpec, + std::map> const& trackHistSpec1, + std::map> const& trackHistSpec2, + std::map> const& v0histSpec, + std::map> const& posDauhistSpec, + std::map> const& negDauhistSpec, + std::map> const& tripletHistSpec, + std::map> const& ctrHistSpec) { // check if correlate the same tracks or not mTrack1Track2AreSameSpecies = confMixing.particle12AreSameSpecies.value; @@ -432,8 +455,11 @@ class TripletTrackTrackV0Builder mTc.template init(confTripletCuts); + mV0Cleaner.init(confV0Cleaner); + if (mTrack1Track2AreSameSpecies) { // Track1 & Track2 & are the same particle species and track 3 is something else + mCleaner1.init(confCleaner1); mTrackHistManager1.template init(registry, trackHistSpec1, confTrackSelection1); mV0HistManager.template init(registry, v0histSpec, confV0Selection, posDauhistSpec, negDauhistSpec); @@ -446,6 +472,8 @@ class TripletTrackTrackV0Builder mCtrMe.init(registry, ctrHistSpec, confCtr, confTrackSelection1.chargeAbs.value, confTrackSelection1.chargeAbs.value); } else { // all three tracks are different + mCleaner1.init(confCleaner1); + mCleaner2.init(confCleaner2); mTrackHistManager1.template init(registry, trackHistSpec1, confTrackSelection1); mTrackHistManager2.template init(registry, trackHistSpec2, confTrackSelection2); mV0HistManager.template init(registry, v0histSpec, confV0Selection, posDauhistSpec, negDauhistSpec); @@ -523,7 +551,7 @@ class TripletTrackTrackV0Builder if (mMixIdenticalParticles) { tripletOrder = static_cast(mDist(mRng)); } - tripletprocesshelpers::processSameEvent(trackSlice1, v0Slice, trackTable, mcParticles, mcMothers, mcPartonicMothers, col, mcCols, mTrackHistManager1, mV0HistManager, mTripletHistManagerSe, mCtrSe, mTc, tripletOrder); + tripletprocesshelpers::processSameEvent(trackSlice1, v0Slice, trackTable, mcParticles, mcMothers, mcPartonicMothers, col, mcCols, mTrackHistManager1, mV0HistManager, mTripletHistManagerSe, mCleaner1, mV0Cleaner, mCtrSe, mTc, tripletOrder); } else { auto trackSlice1 = partition1->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache); auto trackSlice2 = partition2->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache); @@ -533,10 +561,11 @@ class TripletTrackTrackV0Builder } mColHistManager.template fill(col, mcCols); mCtrSe.setMagField(col.magField()); - tripletprocesshelpers::processSameEvent(trackSlice1, trackSlice2, v0Slice, trackTable, mcParticles, mcMothers, mcPartonicMothers, col, mcCols, mTrackHistManager1, mTrackHistManager2, mV0HistManager, mTripletHistManagerSe, mCtrSe, mTc); + tripletprocesshelpers::processSameEvent(trackSlice1, trackSlice2, v0Slice, trackTable, mcParticles, mcMothers, mcPartonicMothers, col, mcCols, mTrackHistManager1, mTrackHistManager2, mV0HistManager, mTripletHistManagerSe, mCleaner1, mCleaner2, mV0Cleaner, mCtrSe, mTc); } } + // data template void processMixedEvent(T1 const& cols, T2& trackTable, T3& partition1, T4& partition2, T5& partition3, T6& cache, T7& binsVtxMult, T8& binsVtxCent, T9& binsVtxMultCent) { @@ -571,19 +600,20 @@ class TripletTrackTrackV0Builder } } - template - void processMixedEvent(T1 const& cols, T2 const& mcCols, T3& trackTable, T4& partition1, T5& partition2, T6& partition3, T7 const& mcParticles, T8& cache, T9& binsVtxMult, T10& binsVtxCent, T11& binsVtxMultCent) + // mc — NOTE: now takes mcMothers, mcPartonicMothers (required by the fixed tripletprocesshelpers mc overload) + template + void processMixedEvent(T1 const& cols, T2 const& mcCols, T3& trackTable, T4& partition1, T5& partition2, T6& partition3, T7 const& mcParticles, T8 const& mcMothers, T9 const& mcPartonicMothers, T10& cache, T11& binsVtxMult, T12& binsVtxCent, T13& binsVtxMultCent) { if (mTrack1Track2AreSameSpecies) { switch (mMixingPolicy) { case static_cast(pairhistmanager::kVtxMult): - tripletprocesshelpers::processMixedEvent(cols, mcCols, partition1, partition1, partition3, trackTable, mcParticles, cache, binsVtxMult, mMixingDepth, mTripletHistManagerMe, mCtrMe, mTc); + tripletprocesshelpers::processMixedEvent(cols, mcCols, partition1, partition1, partition3, trackTable, mcParticles, mcMothers, mcPartonicMothers, cache, binsVtxMult, mMixingDepth, mTripletHistManagerMe, mCleaner1, mCleaner1, mV0Cleaner, mCtrMe, mTc); break; case static_cast(pairhistmanager::kVtxCent): - tripletprocesshelpers::processMixedEvent(cols, mcCols, partition1, partition1, partition3, trackTable, mcParticles, cache, binsVtxCent, mMixingDepth, mTripletHistManagerMe, mCtrMe, mTc); + tripletprocesshelpers::processMixedEvent(cols, mcCols, partition1, partition1, partition3, trackTable, mcParticles, mcMothers, mcPartonicMothers, cache, binsVtxCent, mMixingDepth, mTripletHistManagerMe, mCleaner1, mCleaner1, mV0Cleaner, mCtrMe, mTc); break; case static_cast(pairhistmanager::kVtxMultCent): - tripletprocesshelpers::processMixedEvent(cols, mcCols, partition1, partition1, partition3, trackTable, mcParticles, cache, binsVtxMultCent, mMixingDepth, mTripletHistManagerMe, mCtrMe, mTc); + tripletprocesshelpers::processMixedEvent(cols, mcCols, partition1, partition1, partition3, trackTable, mcParticles, mcMothers, mcPartonicMothers, cache, binsVtxMultCent, mMixingDepth, mTripletHistManagerMe, mCleaner1, mCleaner1, mV0Cleaner, mCtrMe, mTc); break; default: LOG(fatal) << "Invalid binning policy specifed. Breaking..."; @@ -591,13 +621,13 @@ class TripletTrackTrackV0Builder } else { switch (mMixingPolicy) { case static_cast(pairhistmanager::kVtxMult): - tripletprocesshelpers::processMixedEvent(cols, mcCols, partition1, partition2, partition3, trackTable, mcParticles, cache, binsVtxMult, mMixingDepth, mTripletHistManagerMe, mCtrMe, mTc); + tripletprocesshelpers::processMixedEvent(cols, mcCols, partition1, partition2, partition3, trackTable, mcParticles, mcMothers, mcPartonicMothers, cache, binsVtxMult, mMixingDepth, mTripletHistManagerMe, mCleaner1, mCleaner2, mV0Cleaner, mCtrMe, mTc); break; case static_cast(pairhistmanager::kVtxCent): - tripletprocesshelpers::processMixedEvent(cols, mcCols, partition1, partition2, partition3, trackTable, mcParticles, cache, binsVtxCent, mMixingDepth, mTripletHistManagerMe, mCtrMe, mTc); + tripletprocesshelpers::processMixedEvent(cols, mcCols, partition1, partition2, partition3, trackTable, mcParticles, mcMothers, mcPartonicMothers, cache, binsVtxCent, mMixingDepth, mTripletHistManagerMe, mCleaner1, mCleaner2, mV0Cleaner, mCtrMe, mTc); break; case static_cast(pairhistmanager::kVtxMultCent): - tripletprocesshelpers::processMixedEvent(cols, mcCols, partition1, partition2, partition3, trackTable, mcParticles, cache, binsVtxMultCent, mMixingDepth, mTripletHistManagerMe, mCtrMe, mTc); + tripletprocesshelpers::processMixedEvent(cols, mcCols, partition1, partition2, partition3, trackTable, mcParticles, mcMothers, mcPartonicMothers, cache, binsVtxMultCent, mMixingDepth, mTripletHistManagerMe, mCleaner1, mCleaner2, mV0Cleaner, mCtrMe, mTc); break; default: LOG(fatal) << "Invalid binning policy specifed. Breaking..."; @@ -610,6 +640,9 @@ class TripletTrackTrackV0Builder trackhistmanager::TrackHistManager mTrackHistManager1; trackhistmanager::TrackHistManager mTrackHistManager2; v0histmanager::V0HistManager mV0HistManager; + particlecleaner::ParticleCleaner mCleaner1; + particlecleaner::ParticleCleaner mCleaner2; + particlecleaner::ParticleCleaner mV0Cleaner; triplethistmanager::TripletHistManager mTripletHistManagerSe; triplethistmanager::TripletHistManager mTripletHistManagerMe; @@ -673,32 +706,34 @@ class TripletTrackTrackCascadeBuilder typename T20, typename T21, typename T22, - typename T23> + typename T23, + typename T24> void init(o2::framework::HistogramRegistry* registry, T1 const& confCollisionBinning, T2 const& confTrackSelection1, T3 const& confTrackSelection2, - T4 const& confTrackCleaner, - T5 const& confCtr, - T6 const& confCascadeSelection, - T7 const& confCascadeCleaner, - T8 const& confCprBachelor, - T9 const& confCprV0Daughter, - T10 const& confMixing, - T11 const& confTripletBinning, - T12 const& confTripletCuts, - std::map> const& colHistSpec, - std::map> const& trackHistSpec1, - std::map> const& trackHistSpec2, - std::map> const& cascadeHistSpec, - std::map> const& bachelorHistSpec, - std::map> const& posDauHistSpec, - std::map> const& negDauHistSpec, - std::map> const& tripletHistSpec, - std::map> const& cprHistSpecBachelor, - std::map> const& cprHistSpecV0Daughter, - std::map> const& ctrHistSpec) + T4 const& confTrackCleaner1, + T5 const& confTrackCleaner2, + T6 const& confCtr, + T7 const& confCascadeSelection, + T8 const& confCascadeCleaner, + T9 const& confCprBachelor, + T10 const& confCprV0Daughter, + T11 const& confMixing, + T12 const& confTripletBinning, + T13 const& confTripletCuts, + std::map> const& colHistSpec, + std::map> const& trackHistSpec1, + std::map> const& trackHistSpec2, + std::map> const& cascadeHistSpec, + std::map> const& bachelorHistSpec, + std::map> const& posDauHistSpec, + std::map> const& negDauHistSpec, + std::map> const& tripletHistSpec, + std::map> const& cprHistSpecBachelor, + std::map> const& cprHistSpecV0Daughter, + std::map> const& ctrHistSpec) { // check if correlate the same tracks or not mTrack1Track2AreSameSpecies = confMixing.particle12AreSameSpecies.value; @@ -707,12 +742,13 @@ class TripletTrackTrackCascadeBuilder mTripletHistManagerMe.template init(registry, tripletHistSpec, confTripletBinning, confTripletCuts, confMixing); mTc.template init(confTripletCuts); + + mCascadeCleaner.init(confCascadeCleaner); if (mTrack1Track2AreSameSpecies) { // Track1 & Track2 & are the same particle species and track 3 is something else + mTrackCleaner1.init(confTrackCleaner1); mTrackHistManager1.template init(registry, trackHistSpec1, confTrackSelection1); mCascadeHistManager.template init(registry, cascadeHistSpec, confCascadeSelection, bachelorHistSpec, posDauHistSpec, negDauHistSpec); - mTrackCleaner.init(confTrackCleaner); - mCascadeCleaner.init(confCascadeCleaner); mTripletHistManagerSe.setMass(confTrackSelection1.pdgCodeAbs.value, confTrackSelection1.pdgCodeAbs.value, confCascadeSelection.pdgCodeAbs.value); mTripletHistManagerSe.setCharge(confTrackSelection1.chargeAbs.value, confTrackSelection1.chargeAbs.value, 1); mCtrSe.init(registry, ctrHistSpec, cprHistSpecBachelor, cprHistSpecV0Daughter, confCtr, confCprBachelor, confCprV0Daughter, confTrackSelection1.chargeAbs.value, confTrackSelection1.chargeAbs.value); @@ -721,6 +757,8 @@ class TripletTrackTrackCascadeBuilder mCtrMe.init(registry, ctrHistSpec, cprHistSpecBachelor, cprHistSpecV0Daughter, confCtr, confCprBachelor, confCprV0Daughter, confTrackSelection1.chargeAbs.value, confTrackSelection1.chargeAbs.value); } else { // all three tracks are different + mTrackCleaner1.init(confTrackCleaner1); + mTrackCleaner2.init(confTrackCleaner2); mTrackHistManager1.template init(registry, trackHistSpec1, confTrackSelection1); mTrackHistManager2.template init(registry, trackHistSpec2, confTrackSelection2); mCascadeHistManager.template init(registry, cascadeHistSpec, confCascadeSelection, bachelorHistSpec, posDauHistSpec, negDauHistSpec); @@ -797,7 +835,7 @@ class TripletTrackTrackCascadeBuilder if (mMixIdenticalParticles) { tripletOrder = static_cast(mDist(mRng)); } - tripletprocesshelpers::processSameEvent(trackSlice1, cascadeSlice, trackTable, mcParticles, mcMothers, mcPartonicMothers, col, mcCols, mTrackHistManager1, mCascadeHistManager, mTripletHistManagerSe, mCtrSe, mTc, tripletOrder); + tripletprocesshelpers::processSameEvent(trackSlice1, cascadeSlice, trackTable, mcParticles, mcMothers, mcPartonicMothers, col, mcCols, mTrackHistManager1, mCascadeHistManager, mTripletHistManagerSe, mTrackCleaner1, mCascadeCleaner, mCtrSe, mTc, tripletOrder); } else { auto trackSlice1 = partition1->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache); auto trackSlice2 = partition2->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache); @@ -807,10 +845,11 @@ class TripletTrackTrackCascadeBuilder } mColHistManager.template fill(col, mcCols); mCtrSe.setMagField(col.magField()); - tripletprocesshelpers::processSameEvent(trackSlice1, trackSlice2, cascadeSlice, trackTable, mcParticles, mcMothers, mcPartonicMothers, col, mcCols, mTrackHistManager1, mTrackHistManager2, mCascadeHistManager, mTripletHistManagerSe, mCtrSe, mTc); + tripletprocesshelpers::processSameEvent(trackSlice1, trackSlice2, cascadeSlice, trackTable, mcParticles, mcMothers, mcPartonicMothers, col, mcCols, mTrackHistManager1, mTrackHistManager2, mCascadeHistManager, mTripletHistManagerSe, mTrackCleaner1, mTrackCleaner2, mCascadeCleaner, mCtrSe, mTc); } } + // data template void processMixedEvent(T1 const& cols, T2& trackTable, T3& partition1, T4& partition2, T5& partition3, T6& cache, T7& binsVtxMult, T8& binsVtxCent, T9& binsVtxMultCent) { @@ -846,19 +885,20 @@ class TripletTrackTrackCascadeBuilder } } - template - void processMixedEvent(T1 const& cols, T2 const& mcCols, T3& trackTable, T4& partition1, T5& partition2, T6& partition3, T7 const& mcParticles, T8& cache, T9& binsVtxMult, T10& binsVtxCent, T11& binsVtxMultCent) + // mc — NOTE: now takes mcMothers, mcPartonicMothers (required by the fixed tripletprocesshelpers mc overload) + template + void processMixedEvent(T1 const& cols, T2 const& mcCols, T3& trackTable, T4& partition1, T5& partition2, T6& partition3, T7 const& mcParticles, T8 const& mcMothers, T9 const& mcPartonicMothers, T10& cache, T11& binsVtxMult, T12& binsVtxCent, T13& binsVtxMultCent) { if (mTrack1Track2AreSameSpecies) { switch (mMixingPolicy) { case static_cast(pairhistmanager::kVtxMult): - tripletprocesshelpers::processMixedEvent(cols, mcCols, partition1, partition1, partition3, trackTable, mcParticles, cache, binsVtxMult, mMixingDepth, mTripletHistManagerMe, mCtrMe, mTc); + tripletprocesshelpers::processMixedEvent(cols, mcCols, partition1, partition1, partition3, trackTable, mcParticles, mcMothers, mcPartonicMothers, cache, binsVtxMult, mMixingDepth, mTripletHistManagerMe, mTrackCleaner1, mTrackCleaner1, mCascadeCleaner, mCtrMe, mTc); break; case static_cast(pairhistmanager::kVtxCent): - tripletprocesshelpers::processMixedEvent(cols, mcCols, partition1, partition1, partition3, trackTable, mcParticles, cache, binsVtxCent, mMixingDepth, mTripletHistManagerMe, mCtrMe, mTc); + tripletprocesshelpers::processMixedEvent(cols, mcCols, partition1, partition1, partition3, trackTable, mcParticles, mcMothers, mcPartonicMothers, cache, binsVtxCent, mMixingDepth, mTripletHistManagerMe, mTrackCleaner1, mTrackCleaner1, mCascadeCleaner, mCtrMe, mTc); break; case static_cast(pairhistmanager::kVtxMultCent): - tripletprocesshelpers::processMixedEvent(cols, mcCols, partition1, partition1, partition3, trackTable, mcParticles, cache, binsVtxMultCent, mMixingDepth, mTripletHistManagerMe, mCtrMe, mTc); + tripletprocesshelpers::processMixedEvent(cols, mcCols, partition1, partition1, partition3, trackTable, mcParticles, mcMothers, mcPartonicMothers, cache, binsVtxMultCent, mMixingDepth, mTripletHistManagerMe, mTrackCleaner1, mTrackCleaner1, mCascadeCleaner, mCtrMe, mTc); break; default: LOG(fatal) << "Invalid binning policy specifed. Breaking..."; @@ -866,13 +906,13 @@ class TripletTrackTrackCascadeBuilder } else { switch (mMixingPolicy) { case static_cast(pairhistmanager::kVtxMult): - tripletprocesshelpers::processMixedEvent(cols, mcCols, partition1, partition2, partition3, trackTable, mcParticles, cache, binsVtxMult, mMixingDepth, mTripletHistManagerMe, mCtrMe, mTc); + tripletprocesshelpers::processMixedEvent(cols, mcCols, partition1, partition2, partition3, trackTable, mcParticles, mcMothers, mcPartonicMothers, cache, binsVtxMult, mMixingDepth, mTripletHistManagerMe, mTrackCleaner1, mTrackCleaner2, mCascadeCleaner, mCtrMe, mTc); break; case static_cast(pairhistmanager::kVtxCent): - tripletprocesshelpers::processMixedEvent(cols, mcCols, partition1, partition2, partition3, trackTable, mcParticles, cache, binsVtxCent, mMixingDepth, mTripletHistManagerMe, mCtrMe, mTc); + tripletprocesshelpers::processMixedEvent(cols, mcCols, partition1, partition2, partition3, trackTable, mcParticles, mcMothers, mcPartonicMothers, cache, binsVtxCent, mMixingDepth, mTripletHistManagerMe, mTrackCleaner1, mTrackCleaner2, mCascadeCleaner, mCtrMe, mTc); break; case static_cast(pairhistmanager::kVtxMultCent): - tripletprocesshelpers::processMixedEvent(cols, mcCols, partition1, partition2, partition3, trackTable, mcParticles, cache, binsVtxMultCent, mMixingDepth, mTripletHistManagerMe, mCtrMe, mTc); + tripletprocesshelpers::processMixedEvent(cols, mcCols, partition1, partition2, partition3, trackTable, mcParticles, mcMothers, mcPartonicMothers, cache, binsVtxMultCent, mMixingDepth, mTripletHistManagerMe, mTrackCleaner1, mTrackCleaner2, mCascadeCleaner, mCtrMe, mTc); break; default: LOG(fatal) << "Invalid binning policy specifed. Breaking..."; @@ -885,7 +925,8 @@ class TripletTrackTrackCascadeBuilder trackhistmanager::TrackHistManager mTrackHistManager1; trackhistmanager::TrackHistManager mTrackHistManager2; cascadehistmanager::CascadeHistManager mCascadeHistManager; - particlecleaner::ParticleCleaner mTrackCleaner; + particlecleaner::ParticleCleaner mTrackCleaner1; + particlecleaner::ParticleCleaner mTrackCleaner2; particlecleaner::ParticleCleaner mCascadeCleaner; triplethistmanager::TripletHistManager mTripletHistManagerSe; triplethistmanager::TripletHistManager mTripletHistManagerMe; diff --git a/PWGCF/Femto/Core/tripletHistManager.h b/PWGCF/Femto/Core/tripletHistManager.h index 8d5600c3331..b336170d838 100644 --- a/PWGCF/Femto/Core/tripletHistManager.h +++ b/PWGCF/Femto/Core/tripletHistManager.h @@ -328,9 +328,11 @@ class TripletHistManager // set Q3 mQ3 = getQ3(mParticle1, mParticle2, mParticle3); - mKstar12 = getKstar(mParticle1, mParticle2); - mKstar13 = getKstar(mParticle1, mParticle3); - mKstar23 = getKstar(mParticle2, mParticle3); + if (mPlotKstar) { + mKstar12 = getKstar(mParticle1, mParticle2); + mKstar13 = getKstar(mParticle1, mParticle3); + mKstar23 = getKstar(mParticle2, mParticle3); + } // if one of the particles has a mass getter, we cache the value for the filling later if constexpr (utils::HasMass) { @@ -373,9 +375,9 @@ class TripletHistManager auto mcParticle2 = particle2.template fMcParticle_as(); auto mcParticle3 = particle3.template fMcParticle_as(); - mTrueParticle1 = ROOT::Math::PtEtaPhiMVector(mAbsCharge1 * mcParticle1.pt(), mcParticle1.eta(), mcParticle1.phi(), mPdgMass1); - mTrueParticle2 = ROOT::Math::PtEtaPhiMVector(mAbsCharge2 * mcParticle2.pt(), mcParticle2.eta(), mcParticle2.phi(), mPdgMass2); - mTrueParticle3 = ROOT::Math::PtEtaPhiMVector(mAbsCharge3 * mcParticle3.pt(), mcParticle3.eta(), mcParticle3.phi(), mPdgMass3); + mTrueParticle1 = ROOT::Math::PtEtaPhiMVector(mcParticle1.pt(), mcParticle1.eta(), mcParticle1.phi(), mPdgMass1); + mTrueParticle2 = ROOT::Math::PtEtaPhiMVector(mcParticle2.pt(), mcParticle2.eta(), mcParticle2.phi(), mPdgMass2); + mTrueParticle3 = ROOT::Math::PtEtaPhiMVector(mcParticle3.pt(), mcParticle3.eta(), mcParticle3.phi(), mPdgMass3); // set true mT mTrueMt = getMt(mTrueParticle1, mTrueParticle2, mTrueParticle3); diff --git a/PWGCF/Femto/Core/tripletProcessHelpers.h b/PWGCF/Femto/Core/tripletProcessHelpers.h index 92a674e12fd..1bfbfad796b 100644 --- a/PWGCF/Femto/Core/tripletProcessHelpers.h +++ b/PWGCF/Femto/Core/tripletProcessHelpers.h @@ -31,10 +31,11 @@ enum TripletOrder : uint8_t { kOrder123, // no swap kOrder213, // swap 1&2: for the case that particle 1 & 2 are the same species, particle 3 is something else kOrder132, // swap 2&3 - kOrder321, // swap 1&2&3 + kOrder321, // reverse: swap 1&3 }; // process same event for identical 3 particles +// (no cleaner here — ParticleCleaner only operates on MC info, see the mc overload below) template @@ -168,6 +170,7 @@ void processSameEvent(T1 const& SliceParticle1, // 1&2 have same species } // process same event for 3 different particles +// (no cleaner here — ParticleCleaner only operates on MC info, see the mc overload below) template + typename T11, + typename T12> void processSameEvent(T1 const& SliceParticle, T2 const& TrackTable, T3 const& mcParticles, @@ -254,17 +259,27 @@ void processSameEvent(T1 const& SliceParticle, T7 const& mcCollisions, T8& ParticleHistManager, T9& TripletHistManager, - T10& CtrManager, - T11& TcManager, + T10& Cleaner, + T11& CtrManager, + T12& TcManager, TripletOrder tripletOrder) { TripletHistManager.resetTrackedParticlesPerEvent(); for (auto const& part : SliceParticle) { + if (!Cleaner.isClean(part, mcParticles, mcMothers, mcPartonicMothers)) { + continue; + } ParticleHistManager.template fill(part, TrackTable, mcParticles, mcMothers, mcPartonicMothers); } for (auto const& [p1, p2, p3] : o2::soa::combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy(SliceParticle, SliceParticle, SliceParticle))) { + // check if all three particles are clean + if (!Cleaner.isClean(p1, mcParticles, mcMothers, mcPartonicMothers) || + !Cleaner.isClean(p2, mcParticles, mcMothers, mcPartonicMothers) || + !Cleaner.isClean(p3, mcParticles, mcMothers, mcPartonicMothers)) { + continue; + } // check if triplet is clean if (!TcManager.isCleanTriplet(p1, p2, p3, TrackTable, mcParticles, mcPartonicMothers)) { continue; @@ -305,9 +320,10 @@ void processSameEvent(T1 const& SliceParticle, } // process same event for 2 identical particles and one other with mc information +// NOTE: added `Cleaner1` (for particle 1&2) and `Cleaner3` (for particle 3, a different species) template + typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15> void processSameEvent(T1 const& SliceParticle1, T2 const& SliceParticle3, T3 const& TrackTable, @@ -319,21 +335,35 @@ void processSameEvent(T1 const& SliceParticle1, T9& ParticleHistManager1, T10& ParticleHistManager3, T11& TripletHistManager, - T12& CtrManager, - T13& TcManager, + T12& Cleaner1, + T13& Cleaner3, + T14& CtrManager, + T15& TcManager, TripletOrder tripletOrder) { TripletHistManager.resetTrackedParticlesPerEvent(); for (auto const& part : SliceParticle1) { + if (!Cleaner1.isClean(part, mcParticles, mcMothers, mcPartonicMothers)) { + continue; + } ParticleHistManager1.template fill(part, TrackTable, mcParticles, mcMothers, mcPartonicMothers); } for (auto const& part : SliceParticle3) { + if (!Cleaner3.isClean(part, mcParticles, mcMothers, mcPartonicMothers)) { + continue; + } ParticleHistManager3.template fill(part, TrackTable, mcParticles, mcMothers, mcPartonicMothers); } for (auto const& p3 : SliceParticle3) { for (auto const& [p1, p2] : o2::soa::combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy(SliceParticle1, SliceParticle1))) { + // check if all three particles are clean + if (!Cleaner1.isClean(p1, mcParticles, mcMothers, mcPartonicMothers) || + !Cleaner1.isClean(p2, mcParticles, mcMothers, mcPartonicMothers) || + !Cleaner3.isClean(p3, mcParticles, mcMothers, mcPartonicMothers)) { + continue; + } // check if triplet is clean if (!TcManager.isCleanTriplet(p1, p2, p3, TrackTable, mcParticles, mcPartonicMothers)) { continue; @@ -368,6 +398,7 @@ void processSameEvent(T1 const& SliceParticle1, } // process same event for 3 different particles with mc information +// NOTE: added `Cleaner1`, `Cleaner2`, `Cleaner3` (one per species) template + typename T15, + typename T16, + typename T17, + typename T18> void processSameEvent(T1 const& SliceParticle1, T2 const& SliceParticle2, T3 const& SliceParticle3, @@ -397,22 +431,40 @@ void processSameEvent(T1 const& SliceParticle1, T11& ParticleHistManager2, T12& ParticleHistManager3, T13& TripletHistManager, - T14& CtrManager, - T15& TcManager) + T14& Cleaner1, + T15& Cleaner2, + T16& Cleaner3, + T17& CtrManager, + T18& TcManager) { TripletHistManager.resetTrackedParticlesPerEvent(); for (auto const& part : SliceParticle1) { + if (!Cleaner1.isClean(part, mcParticles, mcMothers, mcPartonicMothers)) { + continue; + } ParticleHistManager1.template fill(part, TrackTable, mcParticles, mcMothers, mcPartonicMothers); } for (auto const& part : SliceParticle2) { + if (!Cleaner2.isClean(part, mcParticles, mcMothers, mcPartonicMothers)) { + continue; + } ParticleHistManager2.template fill(part, TrackTable, mcParticles, mcMothers, mcPartonicMothers); } for (auto const& part : SliceParticle3) { + if (!Cleaner3.isClean(part, mcParticles, mcMothers, mcPartonicMothers)) { + continue; + } ParticleHistManager3.template fill(part, TrackTable, mcParticles, mcMothers, mcPartonicMothers); } for (auto const& [p1, p2, p3] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(SliceParticle1, SliceParticle2, SliceParticle3))) { + // check if all three particles are clean + if (!Cleaner1.isClean(p1, mcParticles, mcMothers, mcPartonicMothers) || + !Cleaner2.isClean(p2, mcParticles, mcMothers, mcPartonicMothers) || + !Cleaner3.isClean(p3, mcParticles, mcMothers, mcPartonicMothers)) { + continue; + } // check if triplet is clean if (!TcManager.isCleanTriplet(p1, p2, p3, TrackTable, mcParticles, mcPartonicMothers)) { continue; @@ -436,6 +488,7 @@ void processSameEvent(T1 const& SliceParticle1, } // process mixed event +// (no cleaner here — ParticleCleaner only operates on MC info, see the mc overload below) template + typename T13, + typename T14, + typename T15, + typename T16, + typename T17, + typename T18> void processMixedEvent(T1 const& Collisions, T2 const& mcCollisions, T3& Partition1, @@ -569,12 +629,17 @@ void processMixedEvent(T1 const& Collisions, T5& Partition3, T6 const& TrackTable, T7 const& mcParticles, - T8& cache, - T9 const& policy, - T10 const& depth, - T11& TripletHistManager, - T12& CtrManager, - T13& TcManager) + T8 const& mcMothers, + T9 const& mcPartonicMothers, + T10& cache, + T11 const& policy, + T12 const& depth, + T13& TripletHistManager, + T14& Cleaner1, + T15& Cleaner2, + T16& Cleaner3, + T17& CtrManager, + T18& TcManager) { int64_t lastCollisionIndex1 = -1; int64_t lastCollisionIndex2 = -1; @@ -630,8 +695,14 @@ void processMixedEvent(T1 const& Collisions, TripletHistManager.fillMixingQaMe(collision1, collision2, collision3); for (auto const& [p1, p2, p3] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(*sliceParticle1, *sliceParticle2, sliceParticle3))) { + // particle cleaning + if (!Cleaner1.isClean(p1, mcParticles, mcMothers, mcPartonicMothers) || + !Cleaner2.isClean(p2, mcParticles, mcMothers, mcPartonicMothers) || + !Cleaner3.isClean(p3, mcParticles, mcMothers, mcPartonicMothers)) { + continue; + } // pair cleaning - if (!TcManager.isCleanTriplet(p1, p2, p3, TrackTable)) { + if (!TcManager.isCleanTriplet(p1, p2, p3, TrackTable, mcParticles, mcPartonicMothers)) { continue; } // Close pair rejection diff --git a/PWGCF/Femto/Tasks/femtoTripletTrackTrackCascade.cxx b/PWGCF/Femto/Tasks/femtoTripletTrackTrackCascade.cxx index 013d9a3eb6c..6bddc62672e 100644 --- a/PWGCF/Femto/Tasks/femtoTripletTrackTrackCascade.cxx +++ b/PWGCF/Femto/Tasks/femtoTripletTrackTrackCascade.cxx @@ -60,8 +60,8 @@ struct FemtoTripletTrackTrackCascade { using FemtoOmegas = o2::soa::Join; using FemtoTracksWithLabel = o2::soa::Join; - using FemtoXisWithLabel = o2::soa::Join; - using FemtoOmegasWithLabel = o2::soa::Join; + using FemtoXisWithLabel = o2::soa::Join; + using FemtoOmegasWithLabel = o2::soa::Join; using FemtoMcParticlesWithLabel = o2::soa::Join; @@ -229,10 +229,10 @@ struct FemtoTripletTrackTrackCascade { if (processXi) { xiHistSpec = cascadehistmanager::makeCascadeHistSpecMap(confXiBinning); - tripletTrackTrackXiBuilder.init(&hRegistry, confCollisionBinning, confTrackSelections1, confTrackSelections2, confTrackCleaner1, confCtr, confXiSelection, confXiCleaner, confCprBachelor, confCprV0Daughter, confMixing, confTripletBinning, confTripletCuts, colHistSpec, trackHistSpec1, trackHistSpec2, xiHistSpec, bachelorHistSpec, posDauSpec, negDauSpec, tripletTrackTrackCascadeHistSpec, cprHistSpecBachelor, cprHistSpecV0Daughter, ctrHistSpec); + tripletTrackTrackXiBuilder.init(&hRegistry, confCollisionBinning, confTrackSelections1, confTrackSelections2, confTrackCleaner1, confTrackCleaner2, confCtr, confXiSelection, confXiCleaner, confCprBachelor, confCprV0Daughter, confMixing, confTripletBinning, confTripletCuts, colHistSpec, trackHistSpec1, trackHistSpec2, xiHistSpec, bachelorHistSpec, posDauSpec, negDauSpec, tripletTrackTrackCascadeHistSpec, cprHistSpecBachelor, cprHistSpecV0Daughter, ctrHistSpec); } else { omegaHistSpec = cascadehistmanager::makeCascadeHistSpecMap(confOmegaBinning); - tripletTrackTrackOmegaBuilder.init(&hRegistry, confCollisionBinning, confTrackSelections1, confTrackSelections2, confTrackCleaner1, confCtr, confOmegaSelection, confOmegaCleaner, confCprBachelor, confCprV0Daughter, confMixing, confTripletBinning, confTripletCuts, colHistSpec, trackHistSpec1, trackHistSpec2, omegaHistSpec, bachelorHistSpec, posDauSpec, negDauSpec, tripletTrackTrackCascadeHistSpec, cprHistSpecBachelor, cprHistSpecV0Daughter, ctrHistSpec); + tripletTrackTrackOmegaBuilder.init(&hRegistry, confCollisionBinning, confTrackSelections1, confTrackSelections2, confTrackCleaner1, confTrackCleaner2, confCtr, confOmegaSelection, confOmegaCleaner, confCprBachelor, confCprV0Daughter, confMixing, confTripletBinning, confTripletCuts, colHistSpec, trackHistSpec1, trackHistSpec2, omegaHistSpec, bachelorHistSpec, posDauSpec, negDauSpec, tripletTrackTrackCascadeHistSpec, cprHistSpecBachelor, cprHistSpecV0Daughter, ctrHistSpec); } } else { colHistSpec = colhistmanager::makeColMcHistSpecMap(confCollisionBinning); @@ -244,10 +244,10 @@ struct FemtoTripletTrackTrackCascade { tripletTrackTrackCascadeHistSpec = triplethistmanager::makeTripletMcHistSpecMap(confTripletBinning, confMixing); if (processXi) { xiHistSpec = cascadehistmanager::makeCascadeMcHistSpecMap(confXiBinning); - tripletTrackTrackXiBuilder.init(&hRegistry, confCollisionBinning, confTrackSelections1, confTrackSelections2, confTrackCleaner1, confCtr, confXiSelection, confXiCleaner, confCprBachelor, confCprV0Daughter, confMixing, confTripletBinning, confTripletCuts, colHistSpec, trackHistSpec1, trackHistSpec2, xiHistSpec, bachelorHistSpec, posDauSpec, negDauSpec, tripletTrackTrackCascadeHistSpec, cprHistSpecBachelor, cprHistSpecV0Daughter, ctrHistSpec); + tripletTrackTrackXiBuilder.init(&hRegistry, confCollisionBinning, confTrackSelections1, confTrackSelections2, confTrackCleaner1, confTrackCleaner2, confCtr, confXiSelection, confXiCleaner, confCprBachelor, confCprV0Daughter, confMixing, confTripletBinning, confTripletCuts, colHistSpec, trackHistSpec1, trackHistSpec2, xiHistSpec, bachelorHistSpec, posDauSpec, negDauSpec, tripletTrackTrackCascadeHistSpec, cprHistSpecBachelor, cprHistSpecV0Daughter, ctrHistSpec); } else { omegaHistSpec = cascadehistmanager::makeCascadeMcHistSpecMap(confOmegaBinning); - tripletTrackTrackOmegaBuilder.init(&hRegistry, confCollisionBinning, confTrackSelections1, confTrackSelections2, confTrackCleaner1, confCtr, confOmegaSelection, confOmegaCleaner, confCprBachelor, confCprV0Daughter, confMixing, confTripletBinning, confTripletCuts, colHistSpec, trackHistSpec1, trackHistSpec2, omegaHistSpec, bachelorHistSpec, posDauSpec, negDauSpec, tripletTrackTrackCascadeHistSpec, cprHistSpecBachelor, cprHistSpecV0Daughter, ctrHistSpec); + tripletTrackTrackOmegaBuilder.init(&hRegistry, confCollisionBinning, confTrackSelections1, confTrackSelections2, confTrackCleaner1, confTrackCleaner2, confCtr, confOmegaSelection, confOmegaCleaner, confCprBachelor, confCprV0Daughter, confMixing, confTripletBinning, confTripletCuts, colHistSpec, trackHistSpec1, trackHistSpec2, omegaHistSpec, bachelorHistSpec, posDauSpec, negDauSpec, tripletTrackTrackCascadeHistSpec, cprHistSpecBachelor, cprHistSpecV0Daughter, ctrHistSpec); } } hRegistry.print(); @@ -271,9 +271,9 @@ struct FemtoTripletTrackTrackCascade { } PROCESS_SWITCH(FemtoTripletTrackTrackCascade, processXiMixedEvent, "Enable processing mixed event processing for tracks and xis", true); - void processXiMixedEventMc(FilteredFemtoCollisionsWithLabel const& cols, o2::aod::FMcCols const& mcCols, FemtoTracksWithLabel const& tracks, FemtoXisWithLabel const& /*xis*/, FemtoMcParticlesWithLabel const& mcParticles, o2::aod::FMcMothers const& /*mcMothers*/, o2::aod::FMcPartMoths const& /*mcPartonicMothers*/) + void processXiMixedEventMc(FilteredFemtoCollisionsWithLabel const& cols, o2::aod::FMcCols const& mcCols, FemtoTracksWithLabel const& tracks, FemtoXisWithLabel const& /*xis*/, FemtoMcParticlesWithLabel const& mcParticles, o2::aod::FMcMothers const& mcMothers, o2::aod::FMcPartMoths const& mcPartonicMothers) { - tripletTrackTrackXiBuilder.processMixedEvent(cols, mcCols, tracks, trackWithLabelPartition1, trackWithLabelPartition2, xiWithLabelPartition, mcParticles, cache, mixBinsVtxMult, mixBinsVtxCent, mixBinsVtxMultCent); + tripletTrackTrackXiBuilder.processMixedEvent(cols, mcCols, tracks, trackWithLabelPartition1, trackWithLabelPartition2, xiWithLabelPartition, mcParticles, mcMothers, mcPartonicMothers, cache, mixBinsVtxMult, mixBinsVtxCent, mixBinsVtxMultCent); } PROCESS_SWITCH(FemtoTripletTrackTrackCascade, processXiMixedEventMc, "Enable processing mixed event processing for tracks and xis with mc information", false); @@ -295,9 +295,9 @@ struct FemtoTripletTrackTrackCascade { } PROCESS_SWITCH(FemtoTripletTrackTrackCascade, processOmegaMixedEvent, "Enable processing mixed event processing for tracks and omegas", false); - void processOmegaMixedEventMc(FilteredFemtoCollisionsWithLabel const& cols, o2::aod::FMcCols const& mcCols, FemtoTracksWithLabel const& tracks, FemtoXisWithLabel const& /*xis*/, FemtoMcParticlesWithLabel const& mcParticles, o2::aod::FMcMothers const& /*mcMothers*/, o2::aod::FMcPartMoths const& /*mcPartonicMothers*/) + void processOmegaMixedEventMc(FilteredFemtoCollisionsWithLabel const& cols, o2::aod::FMcCols const& mcCols, FemtoTracksWithLabel const& tracks, FemtoOmegasWithLabel const& /*omegas*/, FemtoMcParticlesWithLabel const& mcParticles, o2::aod::FMcMothers const& mcMothers, o2::aod::FMcPartMoths const& mcPartonicMothers) { - tripletTrackTrackOmegaBuilder.processMixedEvent(cols, mcCols, tracks, trackWithLabelPartition1, trackWithLabelPartition2, omegaWithLabelPartition, mcParticles, cache, mixBinsVtxMult, mixBinsVtxCent, mixBinsVtxMultCent); + tripletTrackTrackOmegaBuilder.processMixedEvent(cols, mcCols, tracks, trackWithLabelPartition1, trackWithLabelPartition2, omegaWithLabelPartition, mcParticles, mcMothers, mcPartonicMothers, cache, mixBinsVtxMult, mixBinsVtxCent, mixBinsVtxMultCent); } PROCESS_SWITCH(FemtoTripletTrackTrackCascade, processOmegaMixedEventMc, "Enable processing mixed event processing for tracks and omegas with mc information", false); }; diff --git a/PWGCF/Femto/Tasks/femtoTripletTrackTrackTrack.cxx b/PWGCF/Femto/Tasks/femtoTripletTrackTrackTrack.cxx index 16e780089d7..8b9db111c69 100644 --- a/PWGCF/Femto/Tasks/femtoTripletTrackTrackTrack.cxx +++ b/PWGCF/Femto/Tasks/femtoTripletTrackTrackTrack.cxx @@ -18,6 +18,7 @@ #include "PWGCF/Femto/Core/collisionBuilder.h" #include "PWGCF/Femto/Core/collisionHistManager.h" #include "PWGCF/Femto/Core/modes.h" +#include "PWGCF/Femto/Core/particleCleaner.h" #include "PWGCF/Femto/Core/partitions.h" #include "PWGCF/Femto/Core/trackBuilder.h" #include "PWGCF/Femto/Core/trackHistManager.h" @@ -74,6 +75,11 @@ struct FemtoTripletTrackTrackTrack { trackbuilder::ConfTrackSelection3 confTrackSelections3; trackhistmanager::ConfTrackBinning3 confTrackBinning3; + // particle cleaners (mc only; one per track species) + particlecleaner::ConfTrackCleaner1 confTrackCleaner1; + particlecleaner::ConfTrackCleaner2 confTrackCleaner2; + particlecleaner::ConfTrackCleaner3 confTrackCleaner3; + o2::framework::Partition trackPartition1 = MAKE_TRACK_PARTITION(confTrackSelections1); o2::framework::Partition trackPartition2 = MAKE_TRACK_PARTITION(confTrackSelections2); o2::framework::Partition trackPartition3 = MAKE_TRACK_PARTITION(confTrackSelections3); @@ -147,14 +153,14 @@ struct FemtoTripletTrackTrackTrack { trackHistSpec2 = trackhistmanager::makeTrackHistSpecMap(confTrackBinning2); trackHistSpec3 = trackhistmanager::makeTrackHistSpecMap(confTrackBinning3); tripletHistSpec = triplethistmanager::makeTripletHistSpecMap(confTripletBinning, confMixing); - tripletTrackTrackTrackBuilder.init(&hRegistry, confCollisionBinning, confTrackSelections1, confTrackSelections2, confTrackSelections3, confCtr, confMixing, confTripletBinning, confTripletCuts, colHistSpec, trackHistSpec1, trackHistSpec2, trackHistSpec3, tripletHistSpec, ctrHistSpec); + tripletTrackTrackTrackBuilder.init(&hRegistry, confCollisionBinning, confTrackSelections1, confTrackSelections2, confTrackSelections3, confTrackCleaner1, confTrackCleaner2, confTrackCleaner3, confCtr, confMixing, confTripletBinning, confTripletCuts, colHistSpec, trackHistSpec1, trackHistSpec2, trackHistSpec3, tripletHistSpec, ctrHistSpec); } else { colHistSpec = colhistmanager::makeColMcHistSpecMap(confCollisionBinning); trackHistSpec1 = trackhistmanager::makeTrackMcHistSpecMap(confTrackBinning1); trackHistSpec2 = trackhistmanager::makeTrackMcHistSpecMap(confTrackBinning2); trackHistSpec3 = trackhistmanager::makeTrackMcHistSpecMap(confTrackBinning3); tripletHistSpec = triplethistmanager::makeTripletMcHistSpecMap(confTripletBinning, confMixing); - tripletTrackTrackTrackBuilder.init(&hRegistry, confCollisionBinning, confTrackSelections1, confTrackSelections2, confTrackSelections3, confCtr, confMixing, confTripletBinning, confTripletCuts, colHistSpec, trackHistSpec1, trackHistSpec2, trackHistSpec3, tripletHistSpec, ctrHistSpec); + tripletTrackTrackTrackBuilder.init(&hRegistry, confCollisionBinning, confTrackSelections1, confTrackSelections2, confTrackSelections3, confTrackCleaner1, confTrackCleaner2, confTrackCleaner3, confCtr, confMixing, confTripletBinning, confTripletCuts, colHistSpec, trackHistSpec1, trackHistSpec2, trackHistSpec3, tripletHistSpec, ctrHistSpec); } hRegistry.print(); }; @@ -177,9 +183,9 @@ struct FemtoTripletTrackTrackTrack { } PROCESS_SWITCH(FemtoTripletTrackTrackTrack, processMixedEvent, "Enable processing mixed event processing", true); - void processMixedEventMc(FilteredFemtoCollisionsWithLabel const& cols, o2::aod::FMcCols const& mcCols, FemtoTracksWithLabel const& tracks, FemtoMcParticlesWithLabel const& mcParticles) + void processMixedEventMc(FilteredFemtoCollisionsWithLabel const& cols, o2::aod::FMcCols const& mcCols, FemtoTracksWithLabel const& tracks, FemtoMcParticlesWithLabel const& mcParticles, o2::aod::FMcMothers const& mcMothers, o2::aod::FMcPartMoths const& mcPartonicMothers) { - tripletTrackTrackTrackBuilder.processMixedEvent(cols, mcCols, tracks, trackWithLabelPartition1, trackWithLabelPartition2, trackWithLabelPartition3, mcParticles, cache, mixBinsVtxMult, mixBinsVtxCent, mixBinsVtxMultCent); + tripletTrackTrackTrackBuilder.processMixedEvent(cols, mcCols, tracks, trackWithLabelPartition1, trackWithLabelPartition2, trackWithLabelPartition3, mcParticles, mcMothers, mcPartonicMothers, cache, mixBinsVtxMult, mixBinsVtxCent, mixBinsVtxMultCent); } PROCESS_SWITCH(FemtoTripletTrackTrackTrack, processMixedEventMc, "Enable processing mixed event processing", false); }; diff --git a/PWGCF/Femto/Tasks/femtoTripletTrackTrackV0.cxx b/PWGCF/Femto/Tasks/femtoTripletTrackTrackV0.cxx index a6c74f1c4c1..5be5c5d372a 100644 --- a/PWGCF/Femto/Tasks/femtoTripletTrackTrackV0.cxx +++ b/PWGCF/Femto/Tasks/femtoTripletTrackTrackV0.cxx @@ -18,6 +18,7 @@ #include "PWGCF/Femto/Core/collisionBuilder.h" #include "PWGCF/Femto/Core/collisionHistManager.h" #include "PWGCF/Femto/Core/modes.h" +#include "PWGCF/Femto/Core/particleCleaner.h" #include "PWGCF/Femto/Core/partitions.h" #include "PWGCF/Femto/Core/trackBuilder.h" #include "PWGCF/Femto/Core/trackHistManager.h" @@ -79,6 +80,11 @@ struct FemtoTripletTrackTrackV0 { trackbuilder::ConfTrackSelection2 confTrackSelections2; trackhistmanager::ConfTrackBinning2 confTrackBinning2; + // particle cleaners (mc only) + particlecleaner::ConfTrackCleaner1 confTrackCleaner1; + particlecleaner::ConfTrackCleaner2 confTrackCleaner2; + particlecleaner::ConfLambdaCleaner1 confLambdaCleaner; + o2::framework::Partition trackPartition1 = MAKE_TRACK_PARTITION(confTrackSelections1); o2::framework::Partition trackPartition2 = MAKE_TRACK_PARTITION(confTrackSelections2); o2::framework::Preslice perColtracks = o2::aod::femtobase::stored::fColId; @@ -171,7 +177,7 @@ struct FemtoTripletTrackTrackV0 { posDauSpec = trackhistmanager::makeTrackHistSpecMap(confPosDauBinning); negDauSpec = trackhistmanager::makeTrackHistSpecMap(confNegDauBinning); tripletHistSpec = triplethistmanager::makeTripletHistSpecMap(confTripletBinning, confMixing); - tripletTrackTrackLambdaBuilder.init(&hRegistry, confCollisionBinning, confTrackSelections1, confTrackSelections2, confLambdaSelection, confCtr, confMixing, confTripletBinning, confTripletCuts, colHistSpec, trackHistSpec1, trackHistSpec2, lambdaHistSpec, posDauSpec, negDauSpec, tripletHistSpec, ctrHistSpec); + tripletTrackTrackLambdaBuilder.init(&hRegistry, confCollisionBinning, confTrackSelections1, confTrackSelections2, confLambdaSelection, confTrackCleaner1, confTrackCleaner2, confLambdaCleaner, confCtr, confMixing, confTripletBinning, confTripletCuts, colHistSpec, trackHistSpec1, trackHistSpec2, lambdaHistSpec, posDauSpec, negDauSpec, tripletHistSpec, ctrHistSpec); } else { colHistSpec = colhistmanager::makeColMcHistSpecMap(confCollisionBinning); trackHistSpec1 = trackhistmanager::makeTrackMcHistSpecMap(confTrackBinning1); @@ -180,7 +186,7 @@ struct FemtoTripletTrackTrackV0 { posDauSpec = trackhistmanager::makeTrackMcHistSpecMap(confPosDauBinning); negDauSpec = trackhistmanager::makeTrackMcHistSpecMap(confNegDauBinning); tripletHistSpec = triplethistmanager::makeTripletMcHistSpecMap(confTripletBinning, confMixing); - tripletTrackTrackLambdaBuilder.init(&hRegistry, confCollisionBinning, confTrackSelections1, confTrackSelections2, confLambdaSelection, confCtr, confMixing, confTripletBinning, confTripletCuts, colHistSpec, trackHistSpec1, trackHistSpec2, lambdaHistSpec, posDauSpec, negDauSpec, tripletHistSpec, ctrHistSpec); + tripletTrackTrackLambdaBuilder.init(&hRegistry, confCollisionBinning, confTrackSelections1, confTrackSelections2, confLambdaSelection, confTrackCleaner1, confTrackCleaner2, confLambdaCleaner, confCtr, confMixing, confTripletBinning, confTripletCuts, colHistSpec, trackHistSpec1, trackHistSpec2, lambdaHistSpec, posDauSpec, negDauSpec, tripletHistSpec, ctrHistSpec); } hRegistry.print(); }; @@ -203,9 +209,9 @@ struct FemtoTripletTrackTrackV0 { } PROCESS_SWITCH(FemtoTripletTrackTrackV0, processMixedEvent, "Enable processing mixed event processing", true); - void processMixedEventMc(FilteredFemtoCollisionsWithLabel const& cols, o2::aod::FMcCols const& mcCols, FemtoTracksWithLabel const& tracks, FemtoLambdasWithLabel const& /*lambdas*/, FemtoMcParticlesWithLabel const& mcParticles, o2::aod::FMcMothers const& /*mcMothers*/, o2::aod::FMcPartMoths const& /*mcPartonicMothers*/) + void processMixedEventMc(FilteredFemtoCollisionsWithLabel const& cols, o2::aod::FMcCols const& mcCols, FemtoTracksWithLabel const& tracks, FemtoLambdasWithLabel const& /*lambdas*/, FemtoMcParticlesWithLabel const& mcParticles, o2::aod::FMcMothers const& mcMothers, o2::aod::FMcPartMoths const& mcPartonicMothers) { - tripletTrackTrackLambdaBuilder.processMixedEvent(cols, mcCols, tracks, trackWithLabelPartition1, trackWithLabelPartition2, lambdaWithLabelPartition, mcParticles, cache, mixBinsVtxMult, mixBinsVtxCent, mixBinsVtxMultCent); + tripletTrackTrackLambdaBuilder.processMixedEvent(cols, mcCols, tracks, trackWithLabelPartition1, trackWithLabelPartition2, lambdaWithLabelPartition, mcParticles, mcMothers, mcPartonicMothers, cache, mixBinsVtxMult, mixBinsVtxCent, mixBinsVtxMultCent); } PROCESS_SWITCH(FemtoTripletTrackTrackV0, processMixedEventMc, "Enable processing mixed event processing", false); };