Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions PWGCF/Femto/Core/particleCleaner.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<int> mRequiredPdgCodes;
std::vector<int> mRejectedPdgCodes;
std::vector<int> mRequiredMotherPdgCodes;
Expand Down
207 changes: 124 additions & 83 deletions PWGCF/Femto/Core/tripletBuilder.h

Large diffs are not rendered by default.

14 changes: 8 additions & 6 deletions PWGCF/Femto/Core/tripletHistManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<T1>) {
Expand Down Expand Up @@ -373,9 +375,9 @@ class TripletHistManager
auto mcParticle2 = particle2.template fMcParticle_as<T4>();
auto mcParticle3 = particle3.template fMcParticle_as<T4>();

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);
Expand Down
107 changes: 89 additions & 18 deletions PWGCF/Femto/Core/tripletProcessHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <modes::Mode mode,
typename T1,
typename T2,
Expand Down Expand Up @@ -104,6 +105,7 @@ void processSameEvent(T1 const& SliceParticle,
}

// process same event for identical 2 particles and 1 other particle
// (no cleaner here — ParticleCleaner only operates on MC info, see the mc overload below)
template <modes::Mode mode,
typename T1, typename T2, typename T3, typename T4,
typename T5, typename T6, typename T7, typename T8, typename T9>
Expand Down Expand Up @@ -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 <modes::Mode mode,
typename T1,
typename T2,
Expand Down Expand Up @@ -233,6 +236,7 @@ void processSameEvent(T1 const& SliceParticle1,
}

// process same event for 3 identical particles with mc information
// NOTE: added `Cleaner` (single cleaner, uses the isClean(part, mcParticles, mcMothers, mcPartonicMothers) overload)
template <modes::Mode mode,
typename T1,
typename T2,
Expand All @@ -244,7 +248,8 @@ template <modes::Mode mode,
typename T8,
typename T9,
typename T10,
typename T11>
typename T11,
typename T12>
void processSameEvent(T1 const& SliceParticle,
T2 const& TrackTable,
T3 const& mcParticles,
Expand All @@ -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<mode>(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;
Expand Down Expand Up @@ -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 <modes::Mode mode,
typename T1, typename T2, typename T3, typename T4, typename T5, typename T6,
typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13>
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,
Expand All @@ -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<mode>(part, TrackTable, mcParticles, mcMothers, mcPartonicMothers);
}
for (auto const& part : SliceParticle3) {
if (!Cleaner3.isClean(part, mcParticles, mcMothers, mcPartonicMothers)) {
continue;
}
ParticleHistManager3.template fill<mode>(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;
Expand Down Expand Up @@ -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 <modes::Mode mode,
typename T1,
typename T2,
Expand All @@ -383,7 +414,10 @@ template <modes::Mode mode,
typename T12,
typename T13,
typename T14,
typename T15>
typename T15,
typename T16,
typename T17,
typename T18>
void processSameEvent(T1 const& SliceParticle1,
T2 const& SliceParticle2,
T3 const& SliceParticle3,
Expand All @@ -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<mode>(part, TrackTable, mcParticles, mcMothers, mcPartonicMothers);
}
for (auto const& part : SliceParticle2) {
if (!Cleaner2.isClean(part, mcParticles, mcMothers, mcPartonicMothers)) {
continue;
}
ParticleHistManager2.template fill<mode>(part, TrackTable, mcParticles, mcMothers, mcPartonicMothers);
}
for (auto const& part : SliceParticle3) {
if (!Cleaner3.isClean(part, mcParticles, mcMothers, mcPartonicMothers)) {
continue;
}
ParticleHistManager3.template fill<mode>(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;
Expand All @@ -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 <modes::Mode mode,
typename T1,
typename T2,
Expand Down Expand Up @@ -548,6 +601,8 @@ void processMixedEvent(T1 const& Collisions,
}

// process mixed event in mc
// NOTE: added `mcMothers`, `mcPartonicMothers` (missing in the original — mixed-event mc triplets
// were never mc-cleaned via TcManager) plus `Cleaner1`, `Cleaner2`, `Cleaner3`
template <modes::Mode mode,
typename T1,
typename T2,
Expand All @@ -561,20 +616,30 @@ template <modes::Mode mode,
typename T10,
typename T11,
typename T12,
typename T13>
typename T13,
typename T14,
typename T15,
typename T16,
typename T17,
typename T18>
void processMixedEvent(T1 const& Collisions,
T2 const& mcCollisions,
T3& Partition1,
T4& Partition2,
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;
Expand Down Expand Up @@ -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
Expand Down
Loading
Loading