Skip to content

Commit f4e630a

Browse files
committed
Feat: implement passthrough mode for MC
1 parent 58ae096 commit f4e630a

10 files changed

Lines changed: 654 additions & 436 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
@@ -619,20 +619,20 @@ class CascadeBuilder
619619
collisionBuilder.template fillMcCollision<system>(collisionProducts, col, mcCols, mcProducts, mcBuilder);
620620

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

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

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

630630
fillCascade(collisionBuilder, cascadeProducts, cascade, col, bachelorIndex, posDaughterIndex, negDaughterIndex);
631631
if constexpr (modes::isEqual(cascadeType, modes::Cascade::kXi)) {
632-
mcBuilder.template fillMcXiWithLabel<system>(col, mcCols, cascade, mcParticles, mcProducts);
632+
mcBuilder.template fillMcXiWithLabel<system>(cascade, mcParticles, mcCols, mcProducts);
633633
}
634634
if constexpr (modes::isEqual(cascadeType, modes::Cascade::kOmega)) {
635-
mcBuilder.template fillMcOmegaWithLabel<system>(col, mcCols, cascade, mcParticles, mcProducts);
635+
mcBuilder.template fillMcOmegaWithLabel<system>(cascade, mcParticles, mcCols, mcProducts);
636636
}
637637
}
638638
}
@@ -716,7 +716,8 @@ class CascadeBuilder
716716
}
717717
}
718718

719-
bool fillAnyTable() { return mFillAnyTable; }
719+
[[nodiscard]] bool fillAnyTable() const { return mFillAnyTable; }
720+
[[nodiscard]] bool isPassThrough() const { return mCascadeSelection.isPassThrough(); }
720721

721722
private:
722723
CascadeSelection<cascadeType, SelectionHistName, FilterHistName> mCascadeSelection;

PWGCF/Femto/Core/charmHadronBuilder.h

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

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

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

459+
[[nodiscard]] bool fillAnyTable() const { return mFillAnyTable; }
460+
[[nodiscard]] bool isPassThrough() const { return mD0Selection.isPassThrough(); }
461+
459462
private:
460463
D0Selection<hadronType, SelectionHistName, FilterHistName> mD0Selection;
461464
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)