Skip to content

Commit 1900630

Browse files
authored
Update femtoDreamProducer.cxx
1 parent 6a13088 commit 1900630

File tree

1 file changed

+20
-9
lines changed

1 file changed

+20
-9
lines changed

PWGHF/HFC/TableProducer/femtoDreamProducer.cxx

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -612,18 +612,29 @@ struct HfFemtoDreamProducer {
612612
return true;
613613
}
614614

615-
template <typename ParticleType>
615+
template <DecayChannel channel, typename ParticleType>
616616
void fillCharmHadMcGen(ParticleType particles)
617617
{
618618
// Filling particle properties
619619
rowCandCharmHadGen.reserve(particles.size());
620-
for (const auto& particle : particles) {
621-
if (std::abs(particle.flagMcMatchGen()) == hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi) {
622-
rowCandCharmHadGen(
623-
particle.mcCollisionId(),
624-
particle.flagMcMatchGen(),
625-
particle.originMcGen());
620+
if constexpr (channel == DecayChannel::DplusToPiKPi) {
621+
for (const auto& particle : particles) {
622+
if (std::abs(particle.flagMcMatchGen()) == hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi) {
623+
rowCandCharmHadGen(
624+
particle.mcCollisionId(),
625+
particle.flagMcMatchGen(),
626+
particle.originMcGen());
627+
}
626628
}
629+
} else if constexpr (channel == DecayChannel::LcToPKPi) {
630+
for (const auto& particle : particles) {
631+
if (std::abs(particle.flagMcMatchGen()) == hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi) {
632+
rowCandCharmHadGen(
633+
particle.mcCollisionId(),
634+
particle.flagMcMatchGen(),
635+
particle.originMcGen());
636+
}
637+
}
627638
}
628639
}
629640

@@ -686,7 +697,7 @@ struct HfFemtoDreamProducer {
686697
void processMcDplusToPiKPiGen(GeneratedMc const& particles)
687698
{
688699

689-
fillCharmHadMcGen(particles);
700+
fillCharmHadMcGen<DecayChannel::DplusToPiKPi>(particles);
690701
}
691702
PROCESS_SWITCH(HfFemtoDreamProducer, processMcDplusToPiKPiGen, "Provide Mc Generated DplusToPiKPi", false);
692703

@@ -749,7 +760,7 @@ struct HfFemtoDreamProducer {
749760
void processMcLcToPKPiGen(GeneratedMc const& particles)
750761
{
751762

752-
fillCharmHadMcGen(particles);
763+
fillCharmHadMcGen<DecayChannel::LcToPKPi>(particles);
753764
}
754765
PROCESS_SWITCH(HfFemtoDreamProducer, processMcLcToPKPiGen, "Provide Mc Generated lctopkpi", false);
755766
};

0 commit comments

Comments
 (0)