Skip to content

Commit 9ad4f54

Browse files
committed
Feat: implement passthrough mode for MC
1 parent 482a8d6 commit 9ad4f54

10 files changed

Lines changed: 650 additions & 433 deletions

File tree

PWGCF/Femto/Core/baseSelection.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,12 +165,12 @@ class BaseSelection
165165
std::string const& selectionName,
166166
int mode)
167167
{
168+
int selectionMode = mode;
169+
168170
if (mPassThrough) {
169-
mSelectionContainers.at(observableIndex) = selectioncontainer::SelectionContainer<T, BitmaskType>(selectionName, std::vector<T>{1}, limits::LimitType::kEqual, false, false, false);
170-
return;
171+
selectionMode = 2;
171172
}
172-
173-
switch (mode) {
173+
switch (selectionMode) {
174174
case -1: // cut is optional and we store a bit for it
175175
mSelectionContainers.at(observableIndex) = selectioncontainer::SelectionContainer<T, BitmaskType>(selectionName, std::vector<T>{1}, limits::LimitType::kEqual, false, false, true);
176176
break;

PWGCF/Femto/Core/cascadeBuilder.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -636,20 +636,20 @@ class CascadeBuilder
636636
collisionBuilder.template fillMcCollision<system>(collisionProducts, col, mcCols, mcProducts, mcBuilder);
637637

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

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

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

647647
fillCascade(collisionBuilder, cascadeProducts, cascade, col, bachelorIndex, posDaughterIndex, negDaughterIndex);
648648
if constexpr (modes::isEqual(cascadeType, modes::Cascade::kXi)) {
649-
mcBuilder.template fillMcXiWithLabel<system>(col, mcCols, cascade, mcParticles, mcProducts);
649+
mcBuilder.template fillMcXiWithLabel<system>(cascade, mcParticles, mcCols, mcProducts);
650650
}
651651
if constexpr (modes::isEqual(cascadeType, modes::Cascade::kOmega)) {
652-
mcBuilder.template fillMcOmegaWithLabel<system>(col, mcCols, cascade, mcParticles, mcProducts);
652+
mcBuilder.template fillMcOmegaWithLabel<system>(cascade, mcParticles, mcCols, mcProducts);
653653
}
654654
}
655655
}
@@ -733,7 +733,8 @@ class CascadeBuilder
733733
}
734734
}
735735

736-
bool fillAnyTable() { return mFillAnyTable; }
736+
[[nodiscard]] bool fillAnyTable() const { return mFillAnyTable; }
737+
[[nodiscard]] bool isPassThrough() const { return mCascadeSelection.isPassThrough(); }
737738

738739
private:
739740
CascadeSelection<cascadeType, SelectionHistName, FilterHistName> mCascadeSelection;

PWGCF/Femto/Core/charmHadronBuilder.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -442,18 +442,21 @@ class CharmHadronBuilder
442442

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

448448
if constexpr (modes::isEqual(hadronType, modes::CharmHadron::kD0)) {
449449
this->fillD0Tables(collisionProducts, d0Products, candidate, candidate.pt(), mHfHelper.invMassD0ToPiK(candidate), posDauIndex, negDauIndex);
450450
} else {
451451
this->fillD0Tables(collisionProducts, d0Products, candidate, -candidate.pt(), mHfHelper.invMassD0barToKPi(candidate), posDauIndex, negDauIndex);
452452
}
453-
mcBuilder.template fillMcD0WithLabel<system>(col, mcCols, candidate, tracks, mcParticles, mcProducts);
453+
mcBuilder.template fillMcD0WithLabel<system>(candidate, tracks, mcParticles, mcCols, mcProducts);
454454
}
455455
}
456456

457+
[[nodiscard]] bool fillAnyTable() const { return mFillAnyTable; }
458+
[[nodiscard]] bool isPassThrough() const { return mD0Selection.isPassThrough(); }
459+
457460
private:
458461
D0Selection<hadronType, SelectionHistName, FilterHistName> mD0Selection;
459462
HfHelper mHfHelper;

PWGCF/Femto/Core/collisionBuilder.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@ class CollisionBuilder
694694
return;
695695
}
696696
this->template fillCollision<system>(collisionProducts, col);
697-
mcBuilder.template fillMcCollisionWithLabel<system>(mcProducts, col, mcCols);
697+
mcBuilder.template fillMcCollisionWithLabel<system>(col, mcCols, mcProducts);
698698
}
699699

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

707+
[[nodiscard]] bool fillAnyTable() const { return mFillAnyTable; }
708+
[[nodiscard]] bool isPassThrough() const { return mCollisionSelection.isPassThrough(); }
707709
[[nodiscard]] bool producingCollisions() const { return mProducedCollisions; }
708710
[[nodiscard]] bool producingLiteCollisions() const { return mProducedLiteCollisions; }
709711

PWGCF/Femto/Core/kinkBuilder.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -619,15 +619,15 @@ class KinkBuilder
619619
collisionBuilder.template fillMcCollision<system>(collisionProducts, col, mcCols, mcProducts, mcBuilder);
620620

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

624624
if constexpr (modes::isEqual(kinkType, modes::Kink::kSigma)) {
625625
fillSigma(collisionBuilder, kinkProducts, kink, daughterIndex);
626-
mcBuilder.template fillMcSigmaWithLabel<system>(col, mcCols, daughter, mcParticles, mcProducts);
626+
mcBuilder.template fillMcSigmaWithLabel<system>(daughter, mcParticles, mcCols, mcProducts);
627627
}
628628
if constexpr (modes::isEqual(kinkType, modes::Kink::kSigmaPlus)) {
629629
fillSigmaPlus(collisionBuilder, kinkProducts, kink, daughterIndex);
630-
mcBuilder.template fillMcSigmaPlusWithLabel<system>(col, mcCols, daughter, mcParticles, mcProducts);
630+
mcBuilder.template fillMcSigmaPlusWithLabel<system>(daughter, mcParticles, mcCols, mcProducts);
631631
}
632632
}
633633
}
@@ -707,7 +707,8 @@ class KinkBuilder
707707
}
708708
}
709709

710-
bool fillAnyTable() { return mFillAnyTable; }
710+
[[nodiscard]] bool fillAnyTable() const { return mFillAnyTable; }
711+
[[nodiscard]] bool isPassThrough() const { return mKinkSelection.isPassThrough(); }
711712

712713
private:
713714
KinkSelection<kinkType, SelectionHistName, FilterHistName> mKinkSelection;

0 commit comments

Comments
 (0)