3131
3232using namespace o2 ;
3333using namespace o2 ::framework;
34+ using namespace o2 ::constants::physics;
3435
3536// / Reconstruction of heavy-flavour 2-prong decay candidates
3637struct 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