Skip to content

Commit f2c4140

Browse files
committed
Remove unnecessary templetization
1 parent b585e19 commit f2c4140

File tree

4 files changed

+8
-16
lines changed

4 files changed

+8
-16
lines changed

PWGHF/TableProducer/candidateCreator2Prong.cxx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -913,11 +913,7 @@ struct HfCandidateCreator2ProngExpressions {
913913
}
914914
continue;
915915
}
916-
if (matchCorrBkgs) {
917-
hf_mc_gen::fillMcMatchGen2Prong<true>(mcParticles, mcParticlesPerMcColl, rowMcMatchGen, rejectBackground);
918-
} else {
919-
hf_mc_gen::fillMcMatchGen2Prong<false>(mcParticles, mcParticlesPerMcColl, rowMcMatchGen, rejectBackground);
920-
}
916+
hf_mc_gen::fillMcMatchGen2Prong(mcParticles, mcParticlesPerMcColl, rowMcMatchGen, rejectBackground, matchCorrelatedBackgrounds.value);
921917
}
922918
}
923919

PWGHF/TableProducer/candidateCreator3Prong.cxx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1202,11 +1202,7 @@ struct HfCandidateCreator3ProngExpressions {
12021202
}
12031203
continue;
12041204
}
1205-
if (matchCorrBkgs) {
1206-
hf_mc_gen::fillMcMatchGen3Prong<true>(mcParticles, mcParticlesPerMcColl, rowMcMatchGen, rejectBackground, mothersCorrBkgsPdgs.value);
1207-
} else {
1208-
hf_mc_gen::fillMcMatchGen3Prong<false>(mcParticles, mcParticlesPerMcColl, rowMcMatchGen, rejectBackground);
1209-
}
1205+
hf_mc_gen::fillMcMatchGen3Prong(mcParticles, mcParticlesPerMcColl, rowMcMatchGen, rejectBackground, matchCorrelatedBackgrounds ? mothersCorrBkgsPdgs.value : std::vector<int>{});
12101206
}
12111207
}
12121208

PWGHF/TableProducer/candidateCreatorMcGen.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ struct HfCandidateCreatorMcGen {
5555
for (const auto& mcCollision : mcCollisions) {
5656
const auto mcParticlesPerMcColl = mcParticles.sliceBy(mcParticlesPerMcCollision, mcCollision.globalIndex());
5757
if (fill2Prong) {
58-
hf_mc_gen::fillMcMatchGen2Prong<false>(mcParticles, mcParticlesPerMcColl, rowMcMatchGen2Prong, rejectBackground2Prong);
58+
hf_mc_gen::fillMcMatchGen2Prong(mcParticles, mcParticlesPerMcColl, rowMcMatchGen2Prong, rejectBackground2Prong, false);
5959
}
6060
if (fill3Prong) {
61-
hf_mc_gen::fillMcMatchGen3Prong<false>(mcParticles, mcParticlesPerMcColl, rowMcMatchGen3Prong, rejectBackground3Prong);
61+
hf_mc_gen::fillMcMatchGen3Prong(mcParticles, mcParticlesPerMcColl, rowMcMatchGen3Prong, rejectBackground3Prong, std::vector<int>{});
6262
}
6363
}
6464
if (fillBplus) {

PWGHF/Utils/utilsMcGen.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
namespace hf_mc_gen
3737
{
3838

39-
template <bool matchCorrBkgs, typename T, typename U, typename V>
40-
void fillMcMatchGen2Prong(T const& mcParticles, U const& mcParticlesPerMcColl, V& rowMcMatchGen, bool rejectBackground)
39+
template <typename T, typename U, typename V>
40+
void fillMcMatchGen2Prong(T const& mcParticles, U const& mcParticlesPerMcColl, V& rowMcMatchGen, bool rejectBackground, bool matchCorrelatedBackgrounds)
4141
{
4242
using namespace o2::constants::physics;
4343
constexpr std::size_t NDaughtersResonant{2u};
@@ -121,7 +121,7 @@ void fillMcMatchGen2Prong(T const& mcParticles, U const& mcParticlesPerMcColl, V
121121
}
122122
}
123123

124-
template <bool matchCorrBkgs, typename T, typename U, typename V>
124+
template <typename T, typename U, typename V>
125125
void fillMcMatchGen3Prong(T const& mcParticles, U const& mcParticlesPerMcColl, V& rowMcMatchGen, bool rejectBackground, std::vector<int> const& corrBkgMothersPdgs = {})
126126
{
127127
using namespace o2::constants::physics;
@@ -147,7 +147,7 @@ void fillMcMatchGen3Prong(T const& mcParticles, U const& mcParticlesPerMcColl, V
147147
continue;
148148
}
149149

150-
if (matchCorrBkgs) {
150+
if (corrBkgMothersPdgs.size() > 0) {
151151
for (const auto& motherPdgCode : corrBkgMothersPdgs) {
152152
if (std::abs(particle.pdgCode()) != motherPdgCode) {
153153
continue; // Skip if the particle PDG code does not match the mother PDG code

0 commit comments

Comments
 (0)