Skip to content

Commit c36df4d

Browse files
committed
[PWGCF] Femto: fix Lc process guard and pass-through mode
1 parent ddab34c commit c36df4d

2 files changed

Lines changed: 19 additions & 18 deletions

File tree

PWGCF/Femto/Core/charmHadronBuilder.h

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -542,21 +542,24 @@ class CharmHadronBuilder
542542
}
543543
}
544544

545-
/// Write one row for the given mass hypothesis, if PWGHF accepted it.
546-
/// A candidate passing both hypotheses is stored twice, once per hypothesis.
545+
/// pass-through accepts every candidate once, under the pKPi prong mapping
546+
template <bool isPKPi, typename T>
547+
bool acceptsHypothesis(T const& candidate) const
548+
{
549+
if (mCharmHadronSelection.isPassThrough()) {
550+
return isPKPi;
551+
}
552+
return isPKPi ? candidate.isSelLcToPKPi() : candidate.isSelLcToPiKP();
553+
}
554+
555+
/// a candidate passing both hypotheses is stored twice, once per hypothesis
547556
template <bool isPKPi, modes::System system, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8>
548557
void fillLcHypothesis(T1 const& col, T2& collisionBuilder, T3& collisionProducts, T4& trackProducts,
549558
T5& charmHadronProducts, T6 const& candidate, T7& trackBuilder,
550559
T8 const& prong0, T8 const& prong1, T8 const& prong2)
551560
{
552-
if constexpr (isPKPi) {
553-
if (!candidate.isSelLcToPKPi()) {
554-
return;
555-
}
556-
} else {
557-
if (!candidate.isSelLcToPiKP()) {
558-
return;
559-
}
561+
if (!this->acceptsHypothesis<isPKPi>(candidate)) {
562+
return;
560563
}
561564

562565
// remap the prongs onto the accepted hypothesis so that the proton is always first
@@ -582,14 +585,8 @@ class CharmHadronBuilder
582585
T10 const& mcParticles, T11& mcBuilder, T12& mcProducts,
583586
T13 const& prong0, T13 const& prong1, T13 const& prong2)
584587
{
585-
if constexpr (isPKPi) {
586-
if (!candidate.isSelLcToPKPi()) {
587-
return;
588-
}
589-
} else {
590-
if (!candidate.isSelLcToPiKP()) {
591-
return;
592-
}
588+
if (!this->acceptsHypothesis<isPKPi>(candidate)) {
589+
return;
593590
}
594591

595592
// remap the prongs onto the accepted hypothesis so that the proton is always first

PWGCF/Femto/TableProducer/femtoProducer.cxx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,10 @@ struct FemtoProducer {
313313
static_cast<int>(doprocessTracksV0sKinksRun3ppMc) +
314314
static_cast<int>(doprocessTracksD0sRun3ppMc) +
315315
static_cast<int>(doprocessTracksD0sRun3PbPbMc) +
316+
static_cast<int>(doprocessTracksLcsRun3pp) +
317+
static_cast<int>(doprocessTracksLcsRun3PbPb) +
318+
static_cast<int>(doprocessTracksLcsRun3ppMc) +
319+
static_cast<int>(doprocessTracksLcsRun3PbPbMc) +
316320
static_cast<int>(doprocessMcOnly);
317321

318322
if (nProcesses != 1) {

0 commit comments

Comments
 (0)