Skip to content

Commit 3cd7c39

Browse files
committed
Allow for corr bkg matching in candidateCreatorMcGen
1 parent f2c4140 commit 3cd7c39

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

PWGHF/TableProducer/candidateCreator2Prong.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -913,7 +913,7 @@ struct HfCandidateCreator2ProngExpressions {
913913
}
914914
continue;
915915
}
916-
hf_mc_gen::fillMcMatchGen2Prong(mcParticles, mcParticlesPerMcColl, rowMcMatchGen, rejectBackground, matchCorrelatedBackgrounds.value);
916+
hf_mc_gen::fillMcMatchGen2Prong(mcParticles, mcParticlesPerMcColl, rowMcMatchGen, rejectBackground, matchCorrelatedBackgrounds);
917917
}
918918
}
919919

PWGHF/TableProducer/candidateCreator3Prong.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1202,7 +1202,7 @@ struct HfCandidateCreator3ProngExpressions {
12021202
}
12031203
continue;
12041204
}
1205-
hf_mc_gen::fillMcMatchGen3Prong(mcParticles, mcParticlesPerMcColl, rowMcMatchGen, rejectBackground, matchCorrelatedBackgrounds ? mothersCorrBkgsPdgs.value : std::vector<int>{});
1205+
hf_mc_gen::fillMcMatchGen3Prong(mcParticles, mcParticlesPerMcColl, rowMcMatchGen, rejectBackground, matchCorrelatedBackgrounds ? mothersCorrBkgsPdgs : std::vector<int>{});
12061206
}
12071207
}
12081208

PWGHF/TableProducer/candidateCreatorMcGen.cxx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232
using namespace o2;
3333
using namespace o2::framework;
34+
using namespace o2::constants::physics;
3435

3536
/// Reconstruction of heavy-flavour 2-prong decay candidates
3637
struct HfCandidateCreatorMcGen {
@@ -41,6 +42,8 @@ struct HfCandidateCreatorMcGen {
4142
Produces<aod::HfCandB0McGen> rowMcMatchGenB0;
4243
Configurable<bool> fill2Prong{"fill2Prong", false, "fill table for 2 prong candidates"};
4344
Configurable<bool> fill3Prong{"fill3Prong", false, "fill table for 3 prong candidates"};
45+
Configurable<bool> matchCorrelatedBackgrounds{"matchCorrelatedBackgrounds", false, "Match correlated background candidates"};
46+
Configurable<std::vector<int>> mothersCorrBkgsPdgs{"mothersCorrBkgsPdgs", {Pdg::kDPlus, Pdg::kDS, Pdg::kDStar, Pdg::kLambdaCPlus, Pdg::kXiCPlus}, "PDG codes of the mother particles of correlated background candidates"};
4447
Configurable<bool> fillBplus{"fillBplus", false, "fill table for for B+ candidates"};
4548
Configurable<bool> fillB0{"fillB0", false, "fill table for B0 candidates"};
4649
Configurable<bool> rejectBackground2Prong{"rejectBackground2Prong", false, "Reject particles from PbPb background for 2 prong candidates"};
@@ -55,10 +58,10 @@ struct HfCandidateCreatorMcGen {
5558
for (const auto& mcCollision : mcCollisions) {
5659
const auto mcParticlesPerMcColl = mcParticles.sliceBy(mcParticlesPerMcCollision, mcCollision.globalIndex());
5760
if (fill2Prong) {
58-
hf_mc_gen::fillMcMatchGen2Prong(mcParticles, mcParticlesPerMcColl, rowMcMatchGen2Prong, rejectBackground2Prong, false);
61+
hf_mc_gen::fillMcMatchGen2Prong(mcParticles, mcParticlesPerMcColl, rowMcMatchGen2Prong, rejectBackground2Prong, matchCorrelatedBackgrounds);
5962
}
6063
if (fill3Prong) {
61-
hf_mc_gen::fillMcMatchGen3Prong(mcParticles, mcParticlesPerMcColl, rowMcMatchGen3Prong, rejectBackground3Prong, std::vector<int>{});
64+
hf_mc_gen::fillMcMatchGen3Prong(mcParticles, mcParticlesPerMcColl, rowMcMatchGen3Prong, rejectBackground3Prong, matchCorrelatedBackgrounds ? mothersCorrBkgsPdgs : std::vector<int>{});
6265
}
6366
}
6467
if (fillBplus) {

0 commit comments

Comments
 (0)