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
2 changes: 1 addition & 1 deletion PWGCF/Femto/Core/cascadeBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ class CascadeBuilder
}

template <typename T1, typename T2, typename T3, typename T4>
void fillCascade(T1& collisionBuilder, T2& cascadeProducts, T3 const& cascade, T4 const& col, int bachelorIndex, int posDaughterIndex, int negDaughterIndex)
void fillCascade(T1& collisionBuilder, T2& cascadeProducts, T3 const& cascade, T4 const& col, int64_t bachelorIndex, int64_t posDaughterIndex, int64_t negDaughterIndex)
{
float strangeTofBachelor = 0.f;
float strangeTofPosDau = 0.f;
Expand Down
2 changes: 1 addition & 1 deletion PWGCF/Femto/Core/cascadeHistManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ class CascadeHistManager
this->fillAnalysis(cascadeCandidate);
}
if constexpr (modes::isFlagSet(mode, modes::Mode::kQa)) {
this->fillQa(cascadeCandidate, bachelor, negDaughter, posDaughter);
this->fillQa(cascadeCandidate, bachelor, posDaughter, negDaughter);
}
if constexpr (modes::isFlagSet(mode, modes::Mode::kMc)) {
this->template fillMc<mode>(cascadeCandidate, col, mcParticles, mcMothers, mcPartonicMothers);
Expand Down
3 changes: 3 additions & 0 deletions PWGCF/Femto/Core/collisionBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,9 @@ class CollisionBuilder
template <modes::System system, typename T1, typename T2, typename T3, typename T4, typename T5>
void initCollision(T1 const& bc, T2 const& col, T3 const& tracks, T4& ccdb, T5& histRegistry)
{
if (!mFillAnyTable) {
return; // selection object was never configured (no collision table requested), applying selections would use an unset registry
}
if (mRunNumber != bc.runNumber()) {
mRunNumber = bc.runNumber();
if (mMagFieldForced == 0) {
Expand Down
24 changes: 12 additions & 12 deletions PWGCF/Femto/Core/mcBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,18 +149,18 @@ class McBuilder
mProduceMcParticles = utils::enableTable("FMcParticles_001", table.produceMcParticles.value, initContext);
mProduceMcMothers = utils::enableTable("FMcMothers_001", table.produceMcMothers.value, initContext);
mProduceMcPartonicMothers = utils::enableTable("FMcPartMoths_001", table.produceMcPartonicMothers.value, initContext);
mProduceMcMotherLabels = utils::enableTable("FMcMotherLabels", table.producedMcMotherLabels.value, initContext);

mProduceCollisionLabels = utils::enableTable("FColLabels", table.producedCollisionLabels.value, initContext);
mProduceTrackLabels = utils::enableTable("FTrackLabels", table.producedTrackLabels.value, initContext);
mProduceLambdaLabels = utils::enableTable("FLambdaLabels", table.producedLambdaLabels.value, initContext);
mProduceK0shortLabels = utils::enableTable("FK0shortLabels", table.producedK0shortLabels.value, initContext);
mProduceD0Labels = utils::enableTable("FD0Labels", table.producedD0Labels.value, initContext);
mProduceLcLabels = utils::enableTable("FLcLabels", table.producedLcLabels.value, initContext);
mProduceSigmaLabels = utils::enableTable("FSigmaLabels", table.producedSigmaLabels.value, initContext);
mProduceSigmaPlusLabels = utils::enableTable("FSigmaPlusLabels", table.producedSigmaPlusLabels.value, initContext);
mProduceXiLabels = utils::enableTable("FXiLabels", table.producedXiLabels.value, initContext);
mProduceOmegaLabels = utils::enableTable("FOmegaLabels", table.producedOmegaLabels.value, initContext);
mProduceMcMotherLabels = utils::enableTable("FMcMotherLabels_001", table.producedMcMotherLabels.value, initContext);

mProduceCollisionLabels = utils::enableTable("FColLabels_001", table.producedCollisionLabels.value, initContext);
mProduceTrackLabels = utils::enableTable("FTrackLabels_001", table.producedTrackLabels.value, initContext);
mProduceLambdaLabels = utils::enableTable("FLambdaLabels_001", table.producedLambdaLabels.value, initContext);
mProduceK0shortLabels = utils::enableTable("FK0shortLabels_001", table.producedK0shortLabels.value, initContext);
mProduceD0Labels = utils::enableTable("FD0Labels_001", table.producedD0Labels.value, initContext);
mProduceLcLabels = utils::enableTable("FLcLabels_001", table.producedLcLabels.value, initContext);
mProduceSigmaLabels = utils::enableTable("FSigmaLabels_001", table.producedSigmaLabels.value, initContext);
mProduceSigmaPlusLabels = utils::enableTable("FSigmaPlusLabels_001", table.producedSigmaPlusLabels.value, initContext);
mProduceXiLabels = utils::enableTable("FXiLabels_001", table.producedXiLabels.value, initContext);
mProduceOmegaLabels = utils::enableTable("FOmegaLabels_001", table.producedOmegaLabels.value, initContext);

if (mProduceMcCollisions || mProduceCollisionLabels ||
mProduceMcParticles || mProduceMcMotherLabels ||
Expand Down
22 changes: 7 additions & 15 deletions PWGCF/Femto/Core/pairBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -398,14 +398,6 @@ class PairV0V0Builder
<< "). Overriding sameSpecies to false.";
mSameSpecies = false;
}
} else {
// same v0 species: both values are legitimate (e.g. lambda-lambda vs lambda-antilambda),
// but running as different species only makes sense if the two selections are disjoint
if (!mSameSpecies && confV0Selection1.sign.value == confV0Selection2.sign.value) {
LOG(warn) << "sameSpecies=false for identical v0 species with identical sign ("
<< confV0Selection1.sign.value << "). If both selections match the same "
<< "candidates, this produces self-pairs and double counting.";
}
}

mColHistManager.template init<modeSe>(registry, colHistSpec, confCollisionBinning);
Expand Down Expand Up @@ -1910,17 +1902,17 @@ class PairTrackCascadeBuilder
}

template <modes::Mode mode, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8>
void processMixedEvent(T1 const& cols, T2& trackTable, T3& trackPartition, T4& v0Partition, T5& cache, T6& binsVtxMult, T7& binsVtxCent, T8& binsVtxMultCent)
void processMixedEvent(T1 const& cols, T2& trackTable, T3& trackPartition, T4& cascadePartition, T5& cache, T6& binsVtxMult, T7& binsVtxCent, T8& binsVtxMultCent)
{
switch (mMixingPolicy) {
case static_cast<int>(pairhistmanager::kVtxMult):
pairprocesshelpers::processMixedEvent<mode>(cols, trackPartition, v0Partition, trackTable, cache, binsVtxMult, mMixingDepth, mPairHistManagerMe, mCprMe, mPcMe);
pairprocesshelpers::processMixedEvent<mode>(cols, trackPartition, cascadePartition, trackTable, cache, binsVtxMult, mMixingDepth, mPairHistManagerMe, mCprMe, mPcMe);
break;
case static_cast<int>(pairhistmanager::kVtxCent):
pairprocesshelpers::processMixedEvent<mode>(cols, trackPartition, v0Partition, trackTable, cache, binsVtxCent, mMixingDepth, mPairHistManagerMe, mCprMe, mPcMe);
pairprocesshelpers::processMixedEvent<mode>(cols, trackPartition, cascadePartition, trackTable, cache, binsVtxCent, mMixingDepth, mPairHistManagerMe, mCprMe, mPcMe);
break;
case static_cast<int>(pairhistmanager::kVtxMultCent):
pairprocesshelpers::processMixedEvent<mode>(cols, trackPartition, v0Partition, trackTable, cache, binsVtxMultCent, mMixingDepth, mPairHistManagerMe, mCprMe, mPcMe);
pairprocesshelpers::processMixedEvent<mode>(cols, trackPartition, cascadePartition, trackTable, cache, binsVtxMultCent, mMixingDepth, mPairHistManagerMe, mCprMe, mPcMe);
break;
default:
LOG(fatal) << "Invalid binning policiy specifed. Breaking...";
Expand Down Expand Up @@ -2067,7 +2059,7 @@ class PairMcParticleMcParticleBuilder
bool processSameEvent(T1 const& col, T2 const& mcParticles, T3 const& mcMothers, T4 const& mcPartonicMothers, T5& partition1, T6& partition2, T7& cache)
{
if (mSameSpecies) {
auto mcParticleSlice = partition1->sliceByCached(o2::aod::femtomcparticle::fMcColId, col.globalIndex(), cache);
auto mcParticleSlice = partition1->sliceByCachedUnsorted(o2::aod::femtomcparticle::fMcColId, col.globalIndex(), cache);

if (mcParticleSlice.size() < nLimitPartitionIdenticalParticles) {
return false;
Expand All @@ -2080,8 +2072,8 @@ class PairMcParticleMcParticleBuilder
return pairprocesshelpers::processSameEvent<mode>(mcParticleSlice, mcParticles, mcMothers, mcPartonicMothers, col, mMcParticleHistManager1, mPairHistManagerSe, mMcParticleCleaner1, mCprSe, mPcSe, pairOrder);
}

auto mcParticleSlice1 = partition1->sliceByCached(o2::aod::femtomcparticle::fMcColId, col.globalIndex(), cache);
auto mcParticleSlice2 = partition2->sliceByCached(o2::aod::femtomcparticle::fMcColId, col.globalIndex(), cache);
auto mcParticleSlice1 = partition1->sliceByCachedUnsorted(o2::aod::femtomcparticle::fMcColId, col.globalIndex(), cache);
auto mcParticleSlice2 = partition2->sliceByCachedUnsorted(o2::aod::femtomcparticle::fMcColId, col.globalIndex(), cache);
if (mcParticleSlice1.size() < nLimitPartitionParticles || mcParticleSlice2.size() < nLimitPartitionParticles) {
return false;
}
Expand Down
6 changes: 3 additions & 3 deletions PWGCF/Femto/Core/pairProcessHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ void processMixedEvent(T1 const& Collisions,
int windowSizeRaw = 0;
int windowSizeEffective = 0;

std::optional<decltype(Partition1->sliceByCached(o2::aod::femtomcparticle::fMcColId, 0, cache))> sliceParticle1;
std::optional<decltype(Partition1->sliceByCachedUnsorted(o2::aod::femtomcparticle::fMcColId, 0, cache))> sliceParticle1;

for (auto const& [collision1, collision2] : o2::soa::selfCombinations(policy, depth, -1, Collisions, Collisions)) {

Expand All @@ -678,12 +678,12 @@ void processMixedEvent(T1 const& Collisions,
windowSizeRaw = 0;
windowSizeEffective = 0;
lastCollisionIndex = collision1.globalIndex();
sliceParticle1.emplace(Partition1->sliceByCached(o2::aod::femtomcparticle::fMcColId, collision1.globalIndex(), cache));
sliceParticle1.emplace(Partition1->sliceByCachedUnsorted(o2::aod::femtomcparticle::fMcColId, collision1.globalIndex(), cache));
}

++windowSizeRaw;

auto sliceParticle2 = Partition2->sliceByCached(o2::aod::femtomcparticle::fMcColId, collision2.globalIndex(), cache);
auto sliceParticle2 = Partition2->sliceByCachedUnsorted(o2::aod::femtomcparticle::fMcColId, collision2.globalIndex(), cache);

PairHistManager.resetTrackedParticlesPerEvent();

Expand Down
12 changes: 6 additions & 6 deletions PWGCF/Femto/Core/tripletBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -1076,7 +1076,7 @@ class TripletMcParticleMcParticleMcParticleBuilder
tripletprocesshelpers::TripletOrder tripletOrder = tripletprocesshelpers::kOrder123;

if (mParticle1Particle2Particle3AreSameSpecies) {
auto mcParticleSlice1 = partition1->sliceByCached(o2::aod::femtomcparticle::fMcColId, mcCol.globalIndex(), cache);
auto mcParticleSlice1 = partition1->sliceByCachedUnsorted(o2::aod::femtomcparticle::fMcColId, mcCol.globalIndex(), cache);
if (mcParticleSlice1.size() < nLimitPartitionIdenticalParticles123) {
return false;
}
Expand All @@ -1088,8 +1088,8 @@ class TripletMcParticleMcParticleMcParticleBuilder
}

if (mParticle1Particle2AreSameSpecies) {
auto mcParticleSlice1 = partition1->sliceByCached(o2::aod::femtomcparticle::fMcColId, mcCol.globalIndex(), cache);
auto mcParticleSlice3 = partition3->sliceByCached(o2::aod::femtomcparticle::fMcColId, mcCol.globalIndex(), cache);
auto mcParticleSlice1 = partition1->sliceByCachedUnsorted(o2::aod::femtomcparticle::fMcColId, mcCol.globalIndex(), cache);
auto mcParticleSlice3 = partition3->sliceByCachedUnsorted(o2::aod::femtomcparticle::fMcColId, mcCol.globalIndex(), cache);
if (mcParticleSlice1.size() < nLimitPartitionIdenticalParticles12 || mcParticleSlice3.size() < nLimitPartitionParticles) {
return false;
}
Expand All @@ -1100,9 +1100,9 @@ class TripletMcParticleMcParticleMcParticleBuilder
return tripletprocesshelpers::processSameEventMcTruth<mode>(mcParticleSlice1, mcParticleSlice3, mcParticles, mcMothers, mcPartonicMothers, mcCol, mMcParticleHistManager1, mMcParticleHistManager3, mTripletHistManagerSe, mMcParticleCleaner1, mMcParticleCleaner3, mCtrSe, mTcSe, tripletOrder);
}

auto mcParticleSlice1 = partition1->sliceByCached(o2::aod::femtomcparticle::fMcColId, mcCol.globalIndex(), cache);
auto mcParticleSlice2 = partition2->sliceByCached(o2::aod::femtomcparticle::fMcColId, mcCol.globalIndex(), cache);
auto mcParticleSlice3 = partition3->sliceByCached(o2::aod::femtomcparticle::fMcColId, mcCol.globalIndex(), cache);
auto mcParticleSlice1 = partition1->sliceByCachedUnsorted(o2::aod::femtomcparticle::fMcColId, mcCol.globalIndex(), cache);
auto mcParticleSlice2 = partition2->sliceByCachedUnsorted(o2::aod::femtomcparticle::fMcColId, mcCol.globalIndex(), cache);
auto mcParticleSlice3 = partition3->sliceByCachedUnsorted(o2::aod::femtomcparticle::fMcColId, mcCol.globalIndex(), cache);
if (mcParticleSlice1.size() < nLimitPartitionParticles || mcParticleSlice2.size() < nLimitPartitionParticles || mcParticleSlice3.size() < nLimitPartitionParticles) {
return false;
}
Expand Down
47 changes: 29 additions & 18 deletions PWGCF/Femto/Core/tripletProcessHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ 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, // reverse: swap 1&3
kOrder231, // swap 1&2 & 1&3
kOrder312, // swap 2&3 & 1&3
kOrder321, // swap 1&3
};

// process same event for identical 3 particles
Expand Down Expand Up @@ -76,6 +78,12 @@ bool processSameEvent(T1 const& SliceParticle,
case kOrder132:
TripletHistManager.setTriplet(p1, p3, p2, Collision);
break;
case kOrder231:
TripletHistManager.setTriplet(p2, p3, p1, Collision);
break;
case kOrder312:
TripletHistManager.setTriplet(p3, p1, p2, Collision);
break;
case kOrder321:
TripletHistManager.setTriplet(p3, p2, p1, Collision);
break;
Expand Down Expand Up @@ -291,6 +299,12 @@ bool processSameEvent(T1 const& SliceParticle,
case kOrder132:
TripletHistManager.setTripletMc(p1, p3, p2, mcParticles, Collision, mcCollisions);
break;
case kOrder231:
TripletHistManager.setTripletMc(p2, p3, p1, mcParticles, Collision, mcCollisions);
break;
case kOrder312:
TripletHistManager.setTripletMc(p3, p1, p2, mcParticles, Collision, mcCollisions);
break;
case kOrder321:
TripletHistManager.setTripletMc(p3, p2, p1, mcParticles, Collision, mcCollisions);
break;
Expand Down Expand Up @@ -403,7 +417,6 @@ bool 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 Down Expand Up @@ -498,13 +511,6 @@ bool processSameEvent(T1 const& SliceParticle1,
}

// --- mc truth only (kMc without kReco): triplets of generated particles ---------------------------
// These are named processSameEventMcTruth (not processSameEvent) on purpose: several of the reco
// overloads have the same number of arguments and every parameter is a template type, so the call
// would be ambiguous.
// The particles ARE the truth, so there is no track table, no reco counterpart and no charge rescaling.
// The close triplet rejection and the triplet cleaner take the table of mc particles where the reco
// helpers take the track table; both ignore it in the track-track-track case.

// process same event for identical 3 mc particles
template <modes::Mode mode,
typename T1,
Expand Down Expand Up @@ -548,16 +554,24 @@ bool processSameEventMcTruth(T1 const& SliceParticle,

// Randomize triplet order if enabled, then compute the kinematic (Q3) for this triplet
switch (tripletOrder) {
case kOrder123:
TripletHistManager.setTripletMcTruth(p1, p2, p3, Collision);
break;
case kOrder213:
TripletHistManager.setTripletMcTruth(p2, p1, p3, Collision);
break;
case kOrder132:
TripletHistManager.setTripletMcTruth(p1, p3, p2, Collision);
break;
case kOrder231:
TripletHistManager.setTripletMcTruth(p2, p3, p1, Collision);
break;
case kOrder312:
TripletHistManager.setTripletMcTruth(p3, p1, p2, Collision);
break;
case kOrder321:
TripletHistManager.setTripletMcTruth(p3, p2, p1, Collision);
break;
case kOrder123:
default:
TripletHistManager.setTripletMcTruth(p1, p2, p3, Collision);
break;
Expand Down Expand Up @@ -729,7 +743,6 @@ bool processSameEventMcTruth(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 @@ -843,8 +856,6 @@ 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 Down Expand Up @@ -1005,8 +1016,8 @@ void processMixedEventMcTruth(T1 const& McCollisions,
int windowSizeRaw = 0;
int windowSizeEffective = 0;

std::optional<decltype(Partition1->sliceByCached(o2::aod::femtomcparticle::fMcColId, 0, cache))> sliceParticle1;
std::optional<decltype(Partition2->sliceByCached(o2::aod::femtomcparticle::fMcColId, 0, cache))> sliceParticle2;
std::optional<decltype(Partition1->sliceByCachedUnsorted(o2::aod::femtomcparticle::fMcColId, 0, cache))> sliceParticle1;
std::optional<decltype(Partition2->sliceByCachedUnsorted(o2::aod::femtomcparticle::fMcColId, 0, cache))> sliceParticle2;

for (auto const& [collision1, collision2, collision3] : o2::soa::selfCombinations(policy, depth, -1, McCollisions, McCollisions, McCollisions)) {

Expand All @@ -1019,18 +1030,18 @@ void processMixedEventMcTruth(T1 const& McCollisions,
windowSizeEffective = 0;
lastCollisionIndex1 = collision1.globalIndex();
lastCollisionIndex2 = -1; // force sliceParticle2 to refresh below
sliceParticle1.emplace(Partition1->sliceByCached(o2::aod::femtomcparticle::fMcColId, collision1.globalIndex(), cache));
sliceParticle1.emplace(Partition1->sliceByCachedUnsorted(o2::aod::femtomcparticle::fMcColId, collision1.globalIndex(), cache));
}

// inner sub-window
if (collision2.globalIndex() != lastCollisionIndex2) {
lastCollisionIndex2 = collision2.globalIndex();
sliceParticle2.emplace(Partition2->sliceByCached(o2::aod::femtomcparticle::fMcColId, collision2.globalIndex(), cache));
sliceParticle2.emplace(Partition2->sliceByCachedUnsorted(o2::aod::femtomcparticle::fMcColId, collision2.globalIndex(), cache));
}

++windowSizeRaw;

auto sliceParticle3 = Partition3->sliceByCached(o2::aod::femtomcparticle::fMcColId, collision3.globalIndex(), cache);
auto sliceParticle3 = Partition3->sliceByCachedUnsorted(o2::aod::femtomcparticle::fMcColId, collision3.globalIndex(), cache);

TripletHistManager.resetTrackedParticlesPerEvent();

Expand Down
4 changes: 2 additions & 2 deletions PWGCF/Femto/Core/twoTrackResonanceHistManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,8 @@ class TwoTrackResonanceHistManager
negDauPdgCodeAbs = std::abs(PDG_t::kPiMinus);
} else {
mPdgCode = -1 * mPdgCode;
posDauPdgCodeAbs = std::abs(PDG_t::kKMinus);
negDauPdgCodeAbs = std::abs(PDG_t::kPiPlus);
posDauPdgCodeAbs = std::abs(PDG_t::kPiPlus);
negDauPdgCodeAbs = std::abs(PDG_t::kKMinus);
}
} else {
LOG(fatal) << "PDG code for TwoTrackResonance has to be either Rho, Phi or K^0*(892)";
Expand Down
2 changes: 1 addition & 1 deletion PWGCF/Femto/Core/v0HistManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ class V0HistManager
massLambda = v0candidate.massLambda();
massAntiLambda = v0candidate.massAntiLambda();
tofPosDau = posDau.tofNSigmaPi();
tofNegDau = posDau.tofNSigmaPi();
tofNegDau = negDau.tofNSigmaPi();
}

mHistogramRegistry->fill(HIST(v0Prefix) + HIST(QaDir) + HIST(getHistName(kMassLambda, HistTable)), massLambda);
Expand Down
Loading
Loading