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
18 changes: 0 additions & 18 deletions PWGCF/Femto/Core/baseSelection.h
Original file line number Diff line number Diff line change
Expand Up @@ -259,25 +259,7 @@ class BaseSelection
template <typename R>
void setBitmask(int observableIndex, R bitmask)
{
// if there are no selections configured, bail out
if (mSelectionContainers.at(observableIndex).isEmpty()) {
return;
}
// if any previous observable did not pass minimal selections, there is no point in setting bitmask for other observables
// minimal selection for each observable is computed after adding it
if (mPassesMinimalSelections == false) {
return;
}
// set bitmask for given observable
mSelectionContainers.at(observableIndex).setBitmask(bitmask);
// check if minimal selction for this observable holds
if (mSelectionContainers.at(observableIndex).passesAsMinimalCut() == false) {
mPassesMinimalSelections = false;
}
// check if any optional selection holds
if (mSelectionContainers.at(observableIndex).passesAsOptionalCut() == true) {
mPassesOptionalSelections = true;
}
}

/// \brief Print detailed information about all configured selections.
Expand Down
12 changes: 8 additions & 4 deletions PWGCF/Femto/Core/cascadeHistManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -216,13 +216,17 @@ class CascadeHistManager
template <typename T1, typename T2>
void fill(T1 const& cascadeCandidate, T2 const& tracks)
{
// this used to work, still under investigation
// auto bachelor = cascadeCandidate.template bachelor_as<T2>();
// auto posDaughter = cascadeCandidate.template posDau_as<T2>();
// auto negDaughter = cascadeCandidate.template negDau_as<T2>();

auto bachelor = cascadeCandidate.template bachelor_as<T2>();
mBachelorManager.fill(bachelor, tracks);
auto posDaughter = cascadeCandidate.template posDau_as<T2>();
auto posDaughter = tracks.rawIteratorAt(cascadeCandidate.posDauId() - tracks.offset());
mPosDauManager.fill(posDaughter, tracks);
auto negDaughter = cascadeCandidate.template negDau_as<T2>();
auto negDaughter = tracks.rawIteratorAt(cascadeCandidate.negDauId() - tracks.offset());
mNegDauManager.fill(negDaughter, tracks);
auto bachelor = tracks.rawIteratorAt(cascadeCandidate.bachelorId() - tracks.offset());
mBachelorManager.fill(bachelor, tracks);

if constexpr (modes::isFlagSet(mode, modes::Mode::kAnalysis)) {
mHistogramRegistry->fill(HIST(cascadePrefix) + HIST(AnalysisDir) + HIST(getHistName(kPt, HistTable)), cascadeCandidate.pt());
Expand Down
32 changes: 20 additions & 12 deletions PWGCF/Femto/Core/closePairRejection.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,13 +243,17 @@ class ClosePairRejectionV0V0
mCtrNeg.setMagField(magField);
}
template <typename T1, typename T2, typename T3>
void setPair(T1 const& v01, T2 const& v02, T3 const& /*tracks*/)
void setPair(T1 const& v01, T2 const& v02, T3 const& tracks)
{
auto posDau1 = v01.template posDau_as<T3>();
auto negDau1 = v01.template posDau_as<T3>();
// auto posDau1 = v01.template posDau_as<T3>();
// auto negDau1 = v01.template posDau_as<T3>();
auto posDau1 = tracks.rawIteratorAt(v01.posDauId() - tracks.offset());
auto negDau1 = tracks.rawIteratorAt(v01.negDauId() - tracks.offset());

auto posDau2 = v02.template posDau_as<T3>();
auto negDau2 = v02.template posDau_as<T3>();
// auto posDau2 = v02.template posDau_as<T3>();
// auto negDau2 = v02.template posDau_as<T3>();
auto posDau2 = tracks.rawIteratorAt(v02.posDauId() - tracks.offset());
auto negDau2 = tracks.rawIteratorAt(v02.negDauId() - tracks.offset());

mCtrPos.compute(posDau1, posDau2);
mCtrNeg.compute(negDau1, negDau2);
Expand Down Expand Up @@ -287,13 +291,15 @@ class ClosePairRejectionTrackV0 // can also be used for any particle type that h
mCtr.setMagField(magField);
}
template <typename T1, typename T2, typename T3>
void setPair(const T1& track, const T2& v0, const T3 /*trackTable*/)
void setPair(const T1& track, const T2& v0, const T3 trackTable)
{
if (track.signedPt() > 0) {
auto daughter = v0.template posDau_as<T3>();
// auto daughter = v0.template posDau_as<T3>();
auto daughter = trackTable.rawIteratorAt(v0.posDauId() - trackTable.offset());
mCtr.compute(track, daughter);
} else {
auto daughter = v0.template negDau_as<T3>();
// auto daughter = v0.template negDau_as<T3>();
auto daughter = trackTable.rawIteratorAt(v0.negDauId() - trackTable.offset());
mCtr.compute(track, daughter);
}
}
Expand Down Expand Up @@ -328,9 +334,10 @@ class ClosePairRejectionTrackCascade
mCtr.setMagField(magField);
}
template <typename T1, typename T2, typename T3>
void setPair(const T1& track, const T2& cascade, const T3 /*trackTable*/)
void setPair(const T1& track, const T2& cascade, const T3 trackTable)
{
auto bachelor = cascade.template posDau_as<T3>();
// auto bachelor = cascade.template posDau_as<T3>();
auto bachelor = trackTable.rawIteratorAt(cascade.bachelorId() - trackTable.offset());
mCtr.compute(track, bachelor);
}

Expand Down Expand Up @@ -365,9 +372,10 @@ class ClosePairRejectionTrackKink
}

template <typename T1, typename T2, typename T3>
void setPair(const T1& track, const T2& kink, const T3 /*trackTable*/)
void setPair(const T1& track, const T2& kink, const T3 trackTable)
{
auto daughter = kink.template chaDau_as<T3>();
// auto daughter = kink.template chaDau_as<T3>();
auto daughter = trackTable.rawIteratorAt(kink.chaDauId() - trackTable.offset());
mCtr.compute(track, daughter);
}

Expand Down
2 changes: 1 addition & 1 deletion PWGCF/Femto/Core/collisionBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ class CollisionBuilderDerivedToDerived
col.mult(),
col.cent(),
col.magField());
newCollisionTable.producedCollisionMask(col.collisionMask());
newCollisionTable.producedCollisionMask(col.mask());
}
};

Expand Down
4 changes: 3 additions & 1 deletion PWGCF/Femto/Core/kinkHistManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,9 @@ class KinkHistManager
template <typename T1, typename T2>
void fill(T1 const& kinkcandidate, T2 const& tracks)
{
auto chaDaughter = kinkcandidate.template chaDau_as<T2>();
// this used to work, still under investigation
// auto chaDaughter = kinkcandidate.template chaDau_as<T2>();
auto chaDaughter = tracks.rawIteratorAt(kinkcandidate.chaDauId() - tracks.offset());
mChaDauManager.fill(chaDaughter, tracks);
fill(kinkcandidate);
}
Expand Down
36 changes: 18 additions & 18 deletions PWGCF/Femto/Core/pairBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,16 +131,16 @@ class PairTrackTrackBuilder
void processSameEvent(T1 const& col, T2& trackTable, T3& partition1, T4& partition2, T5& cache)
{
if (mSameSpecies) {
auto trackSlice1 = partition1->sliceByCached(o2::aod::femtobase::stored::collisionId, col.globalIndex(), cache);
auto trackSlice1 = partition1->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache);
if (trackSlice1.size() == 0) {
return;
}
mColHistManager.fill(col);
mCprSe.setMagField(col.magField());
pairprocesshelpers::processSameEvent(trackSlice1, trackTable, mTrackHistManager1, mPairHistManagerSe, mCprSe, mRng, mMixIdenticalParticles);
} else {
auto trackSlice1 = partition1->sliceByCached(o2::aod::femtobase::stored::collisionId, col.globalIndex(), cache);
auto trackSlice2 = partition2->sliceByCached(o2::aod::femtobase::stored::collisionId, col.globalIndex(), cache);
auto trackSlice1 = partition1->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache);
auto trackSlice2 = partition2->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache);
if (trackSlice1.size() == 0 || trackSlice2.size() == 0) {
return;
}
Expand Down Expand Up @@ -299,16 +299,16 @@ class PairV0V0Builder
void processSameEvent(T1 const& col, T2& trackTable, T3& /*lambdaTable*/, T4& partition1, T5& partition2, T6& cache)
{
if (mSameSpecies) {
auto v0Slice1 = partition1->sliceByCached(o2::aod::femtobase::stored::collisionId, col.globalIndex(), cache);
auto v0Slice1 = partition1->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache);
if (v0Slice1.size() == 0) {
return;
}
mColHistManager.fill(col);
mCprSe.setMagField(col.magField());
pairprocesshelpers::processSameEvent(v0Slice1, trackTable, mV0HistManager1, mPairHistManagerSe, mCprSe, mRng, mMixIdenticalParticles);
} else {
auto v0Slice1 = partition1->sliceByCached(o2::aod::femtobase::stored::collisionId, col.globalIndex(), cache);
auto v0Slice2 = partition2->sliceByCached(o2::aod::femtobase::stored::collisionId, col.globalIndex(), cache);
auto v0Slice1 = partition1->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache);
auto v0Slice2 = partition2->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache);
if (v0Slice1.size() == 0 || v0Slice2.size() == 0) {
return;
}
Expand Down Expand Up @@ -433,8 +433,8 @@ class PairTrackV0Builder
template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
void processSameEvent(T1 const& col, T2& trackTable, T3& trackPartition, T4& /*v0table*/, T5& v0Partition, T6& cache)
{
auto trackSlice = trackPartition->sliceByCached(o2::aod::femtobase::stored::collisionId, col.globalIndex(), cache);
auto v0Slice = v0Partition->sliceByCached(o2::aod::femtobase::stored::collisionId, col.globalIndex(), cache);
auto trackSlice = trackPartition->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache);
auto v0Slice = v0Partition->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache);
if (trackSlice.size() == 0 || v0Slice.size() == 0) {
return;
}
Expand Down Expand Up @@ -538,8 +538,8 @@ class PairTrackTwoTrackResonanceBuilder
template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
void processSameEvent(T1 const& col, T2& trackTable, T3& trackPartition, T4& /*resonanceTable*/, T5& resonancePartition, T6& cache)
{
auto trackSlice = trackPartition->sliceByCached(o2::aod::femtobase::stored::collisionId, col.globalIndex(), cache);
auto v0Slice = resonancePartition->sliceByCached(o2::aod::femtobase::stored::collisionId, col.globalIndex(), cache);
auto trackSlice = trackPartition->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache);
auto v0Slice = resonancePartition->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache);
if (trackSlice.size() == 0 || v0Slice.size() == 0) {
return;
}
Expand Down Expand Up @@ -624,12 +624,12 @@ class PairTrackKinkBuilder

mPairHistManagerSe.init(registry, pairHistSpec);
mPairHistManagerSe.setMass(confTrackSelection.pdgCode.value, confKinkSelection.pdgCode.value);
mPairHistManagerSe.setCharge(confTrackSelection.chargeAbs.value, confKinkSelection.sign.value);
mPairHistManagerSe.setCharge(confTrackSelection.chargeAbs.value, 1); // abs charge of kink daughter is always 1
mCprSe.init(registry, cprHistSpec, confCpr.detaMax.value, confCpr.dphistarMax.value, confTrackSelection.chargeAbs.value, confCpr.on.value);

mPairHistManagerMe.init(registry, pairHistSpec);
mPairHistManagerMe.setMass(confTrackSelection.pdgCode.value, confKinkSelection.pdgCode.value);
mPairHistManagerMe.setCharge(confTrackSelection.chargeAbs.value, confKinkSelection.sign.value);
mPairHistManagerMe.setCharge(confTrackSelection.chargeAbs.value, 1); // abs charge of kink daughter is always 1
mCprMe.init(registry, cprHistSpec, confCpr.detaMax.value, confCpr.dphistarMax.value, confTrackSelection.chargeAbs.value, confCpr.on.value);

// setup mixing
Expand All @@ -640,8 +640,8 @@ class PairTrackKinkBuilder
template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
void processSameEvent(T1 const& col, T2& trackTable, T3& trackPartition, T4& /*kinktable*/, T5& kinkPartition, T6& cache)
{
auto trackSlice = trackPartition->sliceByCached(o2::aod::femtobase::stored::collisionId, col.globalIndex(), cache);
auto kinkSlice = kinkPartition->sliceByCached(o2::aod::femtobase::stored::collisionId, col.globalIndex(), cache);
auto trackSlice = trackPartition->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache);
auto kinkSlice = kinkPartition->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache);
if (trackSlice.size() == 0 || kinkSlice.size() == 0) {
return;
}
Expand Down Expand Up @@ -732,12 +732,12 @@ class PairTrackCascadeBuilder

mPairHistManagerSe.init(registry, pairHistSpec);
mPairHistManagerSe.setMass(confTrackSelection.pdgCode.value, confCascadeSelection.pdgCode.value);
mPairHistManagerSe.setCharge(confTrackSelection.chargeAbs.value, confCascadeSelection.sign.value);
mPairHistManagerSe.setCharge(confTrackSelection.chargeAbs.value, 1);
mCprSe.init(registry, cprHistSpec, confCpr.detaMax.value, confCpr.dphistarMax.value, confTrackSelection.chargeAbs.value, confCpr.on.value);

mPairHistManagerMe.init(registry, pairHistSpec);
mPairHistManagerMe.setMass(confTrackSelection.pdgCode.value, confCascadeSelection.pdgCode.value);
mPairHistManagerMe.setCharge(confTrackSelection.chargeAbs.value, confCascadeSelection.sign.value);
mPairHistManagerMe.setCharge(confTrackSelection.chargeAbs.value, 1);
mCprMe.init(registry, cprHistSpec, confCpr.detaMax.value, confCpr.dphistarMax.value, confTrackSelection.chargeAbs.value, confCpr.on.value);

// setup mixing
Expand All @@ -748,8 +748,8 @@ class PairTrackCascadeBuilder
template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
void processSameEvent(T1 const& col, T2& trackTable, T3& trackPartition, T4& /*cascadeTable*/, T5& v0Partition, T6& cache)
{
auto trackSlice = trackPartition->sliceByCached(o2::aod::femtobase::stored::collisionId, col.globalIndex(), cache);
auto v0Slice = v0Partition->sliceByCached(o2::aod::femtobase::stored::collisionId, col.globalIndex(), cache);
auto trackSlice = trackPartition->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache);
auto v0Slice = v0Partition->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache);
if (trackSlice.size() == 0 || v0Slice.size() == 0) {
return;
}
Expand Down
6 changes: 3 additions & 3 deletions PWGCF/Femto/Core/pairHistManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,10 @@ class PairHistManager
}
void setCharge(int chargeAbsParticle1, int chargeAbsParticle2)
{
// the pt stored is actually pt/z, so in case of particles with z > 1, we have to rescale the pt (this is so far only for He3 the case)
// the pt stored is actually as pt/z for tracks, so in case of particles with z > 1, we have to rescale the pt (this is so far only for He3 the case)
// similarly, for neutral particles, no reason to rescale so we just set absolute charge to 1
mAbsCharge1 = chargeAbsParticle1;
mAbsCharge2 = chargeAbsParticle2;
mAbsCharge1 = std::abs(chargeAbsParticle1);
mAbsCharge2 = std::abs(chargeAbsParticle2);
}

template <typename T1, typename T2>
Expand Down
104 changes: 4 additions & 100 deletions PWGCF/Femto/Core/pairProcessHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,51 +112,6 @@ void processSameEvent(T1 const& SliceParticle1,
}
}

// process same event for tracks and particles decaying into tracks
// template <typename T1,
// typename T2,
// typename T3,
// typename T4,
// typename T5,
// typename T6,
// typename T7,
// typename T8>
// void processSameEvent(T1& SliceParticle1,
// T2& SliceParticle2,
// T3& TrackTable,
// T4& ParticleHistManager1,
// T5& ParticleHistManager2,
// T6& PairHistManager,
// T7& CprManager,
// T8& PcManager)
// {
// // Fill single particle histograms
// for (auto const& part : SliceParticle1) {
// ParticleHistManager1.fill(part);
// }
//
// for (auto const& part : SliceParticle2) {
// ParticleHistManager2.fill(part, TrackTable);
// }
//
// for (auto const& [p1, p2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(SliceParticle1, SliceParticle2))) {
// // pair cleaning
// if (!PcManager.isCleanPair(p1, p2, TrackTable)) {
// continue;
// }
// // Close pair rejection
// if (CprManager.isActivated()) {
// CprManager.setPair(p1, p2, TrackTable);
// if (CprManager.isClosePair()) {
// continue;
// }
// }
// CprManager.fill();
// PairHistManager.setPair(p1, p2);
// PairHistManager.fill();
// }
// }

// process mixed event for identical particles
template <typename T1,
typename T2,
Expand All @@ -182,8 +137,8 @@ void processMixedEvent(T1& Collisions,
continue;
}
CprManager.setMagField(collision1.magField());
auto sliceParticle1 = Partition->sliceByCached(o2::aod::femtobase::stored::collisionId, collision1.globalIndex(), cache);
auto sliceParticle2 = Partition->sliceByCached(o2::aod::femtobase::stored::collisionId, collision2.globalIndex(), cache);
auto sliceParticle1 = Partition->sliceByCached(o2::aod::femtobase::stored::fColId, collision1.globalIndex(), cache);
auto sliceParticle2 = Partition->sliceByCached(o2::aod::femtobase::stored::fColId, collision2.globalIndex(), cache);
if (sliceParticle1.size() == 0 || sliceParticle2.size() == 0) {
continue;
}
Expand Down Expand Up @@ -233,8 +188,8 @@ void processMixedEvent(T1& Collisions,
continue;
}
CprManager.setMagField(collision1.magField());
auto sliceParticle1 = Partition1->sliceByCached(o2::aod::femtobase::stored::collisionId, collision1.globalIndex(), cache);
auto sliceParticle2 = Partition2->sliceByCached(o2::aod::femtobase::stored::collisionId, collision2.globalIndex(), cache);
auto sliceParticle1 = Partition1->sliceByCached(o2::aod::femtobase::stored::fColId, collision1.globalIndex(), cache);
auto sliceParticle2 = Partition2->sliceByCached(o2::aod::femtobase::stored::fColId, collision2.globalIndex(), cache);
if (sliceParticle1.size() == 0 || sliceParticle2.size() == 0) {
continue;
}
Expand All @@ -256,57 +211,6 @@ void processMixedEvent(T1& Collisions,
}
}
}

// // process mixed event for track and particles decaying into tracks
// template <typename T1,
// typename T2,
// typename T3,
// typename T4,
// typename T5,
// typename T6,
// typename T7,
// typename T8,
// typename T9,
// typename T10>
// void processMixedEvent(T1& Collisions,
// T2& Partition1,
// T3& Partition2,
// T4& TrackTable,
// T5& cache,
// T6& policy,
// T7& depth,
// T8& PairHistManager,
// T9& CprManager,
// T10& PcManager)
// {
// for (auto const& [collision1, collision2] : o2::soa::selfCombinations(policy, depth, -1, Collisions, Collisions)) {
// if (!(std::fabs(collision1.magField() - collision2.magField()) < o2::constants::math::Epsilon)) {
// continue;
// }
// CprManager.setMagField(collision1.magField());
// auto sliceParticle1 = Partition1->sliceByCached(o2::aod::femtobase::stored::collisionId, collision1.globalIndex(), cache);
// auto sliceParticle2 = Partition2->sliceByCached(o2::aod::femtobase::stored::collisionId, collision2.globalIndex(), cache);
// if (sliceParticle1.size() == 0 || sliceParticle2.size() == 0) {
// continue;
// }
// for (auto const& [p1, p2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(sliceParticle1, sliceParticle2))) {
// // pair cleaning
// if (!PcManager.isCleanPair(p1, p2, TrackTable)) {
// continue;
// }
// // Close pair rejection
// if (CprManager.isActivated()) {
// CprManager.setPair(p1, p2, TrackTable);
// if (CprManager.isClosePair()) {
// continue;
// }
// }
// CprManager.fill();
// PairHistManager.setPair(p1, p2);
// PairHistManager.fill();
// }
// }
// }
} // namespace pairprocesshelpers
} // namespace o2::analysis::femto

Expand Down
Loading
Loading