Skip to content
Open
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
8 changes: 4 additions & 4 deletions PWGCF/Femto/Core/baseSelection.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,12 @@ class BaseSelection
std::string const& selectionName,
int mode)
{
int selectionMode = mode;

if (mPassThrough) {
mSelectionContainers.at(observableIndex) = selectioncontainer::SelectionContainer<T, BitmaskType>(selectionName, std::vector<T>{1}, limits::LimitType::kEqual, false, false, false);
return;
selectionMode = 2;
}

switch (mode) {
switch (selectionMode) {
case -1: // cut is optional and we store a bit for it
mSelectionContainers.at(observableIndex) = selectioncontainer::SelectionContainer<T, BitmaskType>(selectionName, std::vector<T>{1}, limits::LimitType::kEqual, false, false, true);
break;
Expand Down
13 changes: 7 additions & 6 deletions PWGCF/Femto/Core/cascadeBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -619,20 +619,20 @@ class CascadeBuilder
collisionBuilder.template fillMcCollision<system>(collisionProducts, col, mcCols, mcProducts, mcBuilder);

auto bachelor = cascade.template bachelor_as<T8>();
bachelorIndex = trackBuilder.template getDaughterIndex<system, modes::Track::kCascadeBachelor>(col, collisionBuilder, mcCols, bachelor, trackProducts, mcParticles, mcBuilder, mcProducts);
bachelorIndex = trackBuilder.template getDaughterIndex<system, modes::Track::kCascadeBachelor>(bachelor, trackProducts, mcCols, collisionBuilder, mcParticles, mcBuilder, mcProducts);

auto posDaughter = cascade.template posTrack_as<T8>();
posDaughterIndex = trackBuilder.template getDaughterIndex<system, modes::Track::kV0Daughter>(col, collisionBuilder, mcCols, posDaughter, trackProducts, mcParticles, mcBuilder, mcProducts);
posDaughterIndex = trackBuilder.template getDaughterIndex<system, modes::Track::kV0Daughter>(posDaughter, trackProducts, mcCols, collisionBuilder, mcParticles, mcBuilder, mcProducts);

auto negDaughter = cascade.template negTrack_as<T8>();
negDaughterIndex = trackBuilder.template getDaughterIndex<system, modes::Track::kV0Daughter>(col, collisionBuilder, mcCols, negDaughter, trackProducts, mcParticles, mcBuilder, mcProducts);
negDaughterIndex = trackBuilder.template getDaughterIndex<system, modes::Track::kV0Daughter>(negDaughter, trackProducts, mcCols, collisionBuilder, mcParticles, mcBuilder, mcProducts);

fillCascade(collisionBuilder, cascadeProducts, cascade, col, bachelorIndex, posDaughterIndex, negDaughterIndex);
if constexpr (modes::isEqual(cascadeType, modes::Cascade::kXi)) {
mcBuilder.template fillMcXiWithLabel<system>(col, mcCols, cascade, mcParticles, mcProducts);
mcBuilder.template fillMcXiWithLabel<system>(cascade, mcParticles, mcCols, mcProducts);
}
if constexpr (modes::isEqual(cascadeType, modes::Cascade::kOmega)) {
mcBuilder.template fillMcOmegaWithLabel<system>(col, mcCols, cascade, mcParticles, mcProducts);
mcBuilder.template fillMcOmegaWithLabel<system>(cascade, mcParticles, mcCols, mcProducts);
}
}
}
Expand Down Expand Up @@ -716,7 +716,8 @@ class CascadeBuilder
}
}

bool fillAnyTable() { return mFillAnyTable; }
[[nodiscard]] bool fillAnyTable() const { return mFillAnyTable; }
[[nodiscard]] bool isPassThrough() const { return mCascadeSelection.isPassThrough(); }

private:
CascadeSelection<cascadeType, SelectionHistName, FilterHistName> mCascadeSelection;
Expand Down
39 changes: 22 additions & 17 deletions PWGCF/Femto/Core/cascadeHistManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -435,15 +435,15 @@ class CascadeHistManager
}
}

template <modes::Mode mode, typename T1, typename T2, typename T3, typename T4, typename T5>
void fill(T1 const& cascadeCandidate, T2 const& tracks, T3 const& mcParticles, T4 const& mcMothers, T5 const& mcPartonicMothers)
template <modes::Mode mode, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
void fill(T1 const& cascadeCandidate, T2 const& tracks, T3 const& col, T4 const& mcParticles, T5 const& mcMothers, T6 const& mcPartonicMothers)
{
auto posDaughter = tracks.rawIteratorAt(cascadeCandidate.posDauId() - tracks.offset());
mPosDauManager.template fill<mode>(posDaughter, tracks, mcParticles, mcMothers, mcPartonicMothers);
mPosDauManager.template fill<mode>(posDaughter, tracks, col, mcParticles, mcMothers, mcPartonicMothers);
auto negDaughter = tracks.rawIteratorAt(cascadeCandidate.negDauId() - tracks.offset());
mNegDauManager.template fill<mode>(negDaughter, tracks, mcParticles, mcMothers, mcPartonicMothers);
mNegDauManager.template fill<mode>(negDaughter, tracks, col, mcParticles, mcMothers, mcPartonicMothers);
auto bachelor = tracks.rawIteratorAt(cascadeCandidate.bachelorId() - tracks.offset());
mBachelorManager.template fill<mode>(bachelor, tracks, mcParticles, mcMothers, mcPartonicMothers);
mBachelorManager.template fill<mode>(bachelor, tracks, col, mcParticles, mcMothers, mcPartonicMothers);

if constexpr (modes::isFlagSet(mode, modes::Mode::kReco)) {
this->fillAnalysis(cascadeCandidate);
Expand All @@ -452,7 +452,7 @@ class CascadeHistManager
this->fillQa(cascadeCandidate);
}
if constexpr (modes::isFlagSet(mode, modes::Mode::kMc)) {
this->template fillMc<mode>(cascadeCandidate, mcParticles, mcMothers, mcPartonicMothers);
this->template fillMc<mode>(cascadeCandidate, col, mcParticles, mcMothers, mcPartonicMothers);
}
}

Expand Down Expand Up @@ -598,8 +598,8 @@ class CascadeHistManager
}
}

template <modes::Mode mode, typename T1, typename T2, typename T3, typename T4>
void fillMc(T1 const& cascadeCandidate, T2 const& /*mcParticles*/, T3 const& /*mcMothers*/, T4 const& /*mcPartonicMothers*/)
template <modes::Mode mode, typename T1, typename T2, typename T3, typename T4, typename T5>
void fillMc(T1 const& cascadeCandidate, T2 const& col, T3 const& /*mcParticles*/, T4 const& /*mcMothers*/, T5 const& /*mcPartonicMothers*/)
{
// No MC Particle
if (!cascadeCandidate.has_fMcParticle()) {
Expand All @@ -614,42 +614,47 @@ class CascadeHistManager
}

// Retrieve MC particle
auto mcParticle = cascadeCandidate.template fMcParticle_as<T2>();
auto mcParticle = cascadeCandidate.template fMcParticle_as<T3>();

// whether a particle is associated to a wrong collision or not cannot be known by the producer so we check it here
bool fromWrongCollision = mcParticle.fMcColId() != col.fMcColId();

// missidentifed particles are special case
// whether a particle is missidentfied or not cannot be known by the producer so we check it here
bool isMissidentified = mcParticle.pdgCode() != mPdgCode;

mHistogramRegistry->fill(HIST(cascadePrefix) + HIST(McDir) + HIST(getHistName(kTruePtVsPt, HistTable)), mcParticle.pt(), cascadeCandidate.pt());
mHistogramRegistry->fill(HIST(cascadePrefix) + HIST(McDir) + HIST(getHistName(kTrueEtaVsEta, HistTable)), mcParticle.eta(), cascadeCandidate.eta());
mHistogramRegistry->fill(HIST(cascadePrefix) + HIST(McDir) + HIST(getHistName(kTruePhiVsPhi, HistTable)), mcParticle.phi(), cascadeCandidate.phi());
if (isMissidentified) {
mHistogramRegistry->fill(HIST(cascadePrefix) + HIST(McDir) + HIST(getHistName(kOrigin, HistTable)), static_cast<int>(modes::McOrigin::kMissidentified));
if (fromWrongCollision) {
mHistogramRegistry->fill(HIST(cascadePrefix) + HIST(McDir) + HIST(getHistName(kOrigin, HistTable)), static_cast<float>(modes::McOrigin::kFromWrongCollision));
} else if (isMissidentified) {
mHistogramRegistry->fill(HIST(cascadePrefix) + HIST(McDir) + HIST(getHistName(kOrigin, HistTable)), static_cast<float>(modes::McOrigin::kMissidentified));
} else {
mHistogramRegistry->fill(HIST(cascadePrefix) + HIST(McDir) + HIST(getHistName(kOrigin, HistTable)), mcParticle.origin());
}
mHistogramRegistry->fill(HIST(cascadePrefix) + HIST(McDir) + HIST(getHistName(kPdg, HistTable)), mcParticle.pdgCode());

// get mother
if (mcParticle.has_fMcMother()) {
auto mother = mcParticle.template fMcMother_as<T3>();
auto mother = mcParticle.template fMcMother_as<T4>();
mHistogramRegistry->fill(HIST(cascadePrefix) + HIST(McDir) + HIST(getHistName(kPdgMother, HistTable)), mother.pdgCode());
} else {
mHistogramRegistry->fill(HIST(cascadePrefix) + HIST(McDir) + HIST(getHistName(kPdgMother, HistTable)), 0);
}

// get partonic mother
if (mcParticle.has_fMcPartMoth()) {
auto partonicMother = mcParticle.template fMcPartMoth_as<T4>();
auto partonicMother = mcParticle.template fMcPartMoth_as<T5>();
mHistogramRegistry->fill(HIST(cascadePrefix) + HIST(McDir) + HIST(getHistName(kPdgPartonicMother, HistTable)), partonicMother.pdgCode());
} else {
mHistogramRegistry->fill(HIST(cascadePrefix) + HIST(McDir) + HIST(getHistName(kPdgPartonicMother, HistTable)), 0);
}

if constexpr (modes::isFlagSet(mode, modes::Mode::kQa)) {
if (mPlotOrigins) {
// check first if particle is missidentified
if (isMissidentified) {
if (fromWrongCollision) {
mHistogramRegistry->fill(HIST(cascadePrefix) + HIST(McDir) + HIST(getHistName(kFromWrongCollision, HistTable)), cascadeCandidate.pt(), cascadeCandidate.cascadeCosPa());
} else if (isMissidentified) {
// if it is, we fill it as such
mHistogramRegistry->fill(HIST(cascadePrefix) + HIST(McDir) + HIST(getHistName(kMissidentified, HistTable)), cascadeCandidate.pt(), cascadeCandidate.cascadeCosPa());
} else {
Expand All @@ -666,7 +671,7 @@ class CascadeHistManager
break;
case modes::McOrigin::kFromSecondaryDecay:
if (mcParticle.has_fMcMother()) {
auto mother = mcParticle.template fMcMother_as<T3>();
auto mother = mcParticle.template fMcMother_as<T4>();
int motherPdgCode = std::abs(mother.pdgCode());
// Switch on PDG of the mother
if (mPlotNSecondaries >= histmanager::kSecondaryPlotLevel1 && motherPdgCode == mPdgCodesSecondaryMother[0]) {
Expand Down
9 changes: 6 additions & 3 deletions PWGCF/Femto/Core/charmHadronBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -444,18 +444,21 @@ class CharmHadronBuilder

auto prong0 = candidate.template prong0_as<T8>();
auto prong1 = candidate.template prong1_as<T8>();
posDauIndex = trackBuilder.template getDaughterIndex<system, modes::Track::kCharmDaughter>(col, collisionBuilder, mcCols, prong0, trackProducts, mcParticles, mcBuilder, mcProducts);
negDauIndex = trackBuilder.template getDaughterIndex<system, modes::Track::kCharmDaughter>(col, collisionBuilder, mcCols, prong1, trackProducts, mcParticles, mcBuilder, mcProducts);
posDauIndex = trackBuilder.template getDaughterIndex<system, modes::Track::kCharmDaughter>(prong0, trackProducts, mcCols, collisionBuilder, mcParticles, mcBuilder, mcProducts);
negDauIndex = trackBuilder.template getDaughterIndex<system, modes::Track::kCharmDaughter>(prong1, trackProducts, mcCols, collisionBuilder, mcParticles, mcBuilder, mcProducts);

if constexpr (modes::isEqual(hadronType, modes::CharmHadron::kD0)) {
this->fillD0Tables(collisionProducts, d0Products, candidate, candidate.pt(), mHfHelper.invMassD0ToPiK(candidate), posDauIndex, negDauIndex);
} else {
this->fillD0Tables(collisionProducts, d0Products, candidate, -candidate.pt(), mHfHelper.invMassD0barToKPi(candidate), posDauIndex, negDauIndex);
}
mcBuilder.template fillMcD0WithLabel<system>(col, mcCols, candidate, tracks, mcParticles, mcProducts);
mcBuilder.template fillMcD0WithLabel<system>(candidate, tracks, mcParticles, mcCols, mcProducts);
}
}

[[nodiscard]] bool fillAnyTable() const { return mFillAnyTable; }
[[nodiscard]] bool isPassThrough() const { return mD0Selection.isPassThrough(); }

private:
D0Selection<hadronType, SelectionHistName, FilterHistName> mD0Selection;
HfHelper mHfHelper;
Expand Down
8 changes: 4 additions & 4 deletions PWGCF/Femto/Core/charmHadronHistManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -308,13 +308,13 @@ class CharmHadronHistManager
}
}

template <modes::Mode mode, typename T1, typename T2, typename T3, typename T4, typename T5>
void fill(T1 const& charmHadronCandidate, T2 const& tracks, T3 const& mcParticles, T4 const& mcMothers, T5 const& mcPartonicMothers)
template <modes::Mode mode, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
void fill(T1 const& charmHadronCandidate, T2 const& tracks, T3 const& col, T4 const& mcParticles, T5 const& mcMothers, T6 const& mcPartonicMothers)
{
auto prong0 = tracks.rawIteratorAt(charmHadronCandidate.posDauId() - tracks.offset());
mProng0Manager.template fill<mode>(prong0, tracks, mcParticles, mcMothers, mcPartonicMothers);
mProng0Manager.template fill<mode>(prong0, tracks, col, mcParticles, mcMothers, mcPartonicMothers);
auto prong1 = tracks.rawIteratorAt(charmHadronCandidate.negDauId() - tracks.offset());
mProng1Manager.template fill<mode>(prong1, tracks, mcParticles, mcMothers, mcPartonicMothers);
mProng1Manager.template fill<mode>(prong1, tracks, col, mcParticles, mcMothers, mcPartonicMothers);

if constexpr (modes::isFlagSet(mode, modes::Mode::kReco)) {
this->fillAnalysis(charmHadronCandidate);
Expand Down
4 changes: 3 additions & 1 deletion PWGCF/Femto/Core/collisionBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ class CollisionBuilder
return;
}
this->template fillCollision<system>(collisionProducts, col);
mcBuilder.template fillMcCollisionWithLabel<system>(mcProducts, col, mcCols);
mcBuilder.template fillMcCollisionWithLabel<system>(col, mcCols, mcProducts);
}

[[nodiscard]] int64_t collisionIndex() const { return mCurrentCollisionIndex; }
Expand All @@ -704,6 +704,8 @@ class CollisionBuilder
mCurrentCollisionIndex = -1;
}

[[nodiscard]] bool fillAnyTable() const { return mFillAnyTable; }
[[nodiscard]] bool isPassThrough() const { return mCollisionSelection.isPassThrough(); }
[[nodiscard]] bool producingCollisions() const { return mProducedCollisions; }
[[nodiscard]] bool producingLiteCollisions() const { return mProducedLiteCollisions; }

Expand Down
9 changes: 5 additions & 4 deletions PWGCF/Femto/Core/kinkBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -619,15 +619,15 @@ class KinkBuilder
collisionBuilder.template fillMcCollision<system>(collisionProducts, col, mcCols, mcProducts, mcBuilder);

auto daughter = kink.template trackDaug_as<T8>();
daughterIndex = trackBuilder.template getDaughterIndex<system, modes::Track::kKinkDaughter>(col, collisionBuilder, mcCols, daughter, trackProducts, mcParticles, mcBuilder, mcProducts);
daughterIndex = trackBuilder.template getDaughterIndex<system, modes::Track::kKinkDaughter>(daughter, trackProducts, mcCols, collisionBuilder, mcParticles, mcBuilder, mcProducts);

if constexpr (modes::isEqual(kinkType, modes::Kink::kSigma)) {
fillSigma(collisionBuilder, kinkProducts, kink, daughterIndex);
mcBuilder.template fillMcSigmaWithLabel<system>(col, mcCols, daughter, mcParticles, mcProducts);
mcBuilder.template fillMcSigmaWithLabel<system>(daughter, mcParticles, mcCols, mcProducts);
}
if constexpr (modes::isEqual(kinkType, modes::Kink::kSigmaPlus)) {
fillSigmaPlus(collisionBuilder, kinkProducts, kink, daughterIndex);
mcBuilder.template fillMcSigmaPlusWithLabel<system>(col, mcCols, daughter, mcParticles, mcProducts);
mcBuilder.template fillMcSigmaPlusWithLabel<system>(daughter, mcParticles, mcCols, mcProducts);
}
}
}
Expand Down Expand Up @@ -707,7 +707,8 @@ class KinkBuilder
}
}

bool fillAnyTable() { return mFillAnyTable; }
[[nodiscard]] bool fillAnyTable() const { return mFillAnyTable; }
[[nodiscard]] bool isPassThrough() const { return mKinkSelection.isPassThrough(); }

private:
KinkSelection<kinkType, SelectionHistName, FilterHistName> mKinkSelection;
Expand Down
Loading
Loading