Skip to content

Commit f2ca7de

Browse files
committed
Implement Mattia and Vit comments
1 parent c2a9666 commit f2ca7de

File tree

5 files changed

+117
-119
lines changed

5 files changed

+117
-119
lines changed

PWGHF/TableProducer/candidateCreator2Prong.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,7 @@ struct HfCandidateCreator2ProngExpressions {
779779
if (matchCorrBkgs) {
780780
indexRec = -1; // Index of the matched reconstructed candidate
781781
int depth = 2;
782-
for (const auto& [chn, finalState] : finalStates2Prongs) {
782+
for (const auto& [chn, finalState] : hf_chns_2prong::finalStates2Prongs) {
783783
std::array<int, 2> finalStateParts2Prong = std::array{finalState[0], finalState[1]};
784784
if (finalState.size() == 3) { // Partly Reco 2-prong decays
785785
if (matchKinkedDecayTopology && matchInteractionsWithMaterial) {

PWGHF/TableProducer/candidateCreator3Prong.cxx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,14 @@ using namespace o2;
5959
using namespace o2::hf_evsel;
6060
using namespace o2::hf_trkcandsel;
6161
using namespace o2::aod::hf_cand_3prong;
62-
using namespace o2::hf_decay;
62+
using namespace o2::hf_decay::hf_cand_3prong;
63+
using namespace o2::hf_corrbkg;
6364
using namespace o2::hf_centrality;
6465
using namespace o2::hf_occupancy;
6566
using namespace o2::constants::physics;
6667
using namespace o2::framework;
6768
using namespace o2::framework::expressions;
6869
using namespace o2::aod::pid_tpc_tof_utils;
69-
using namespace o2::hf_corrbkg;
7070

7171
/// Reconstruction of heavy-flavour 3-prong decay candidates
7272
struct HfCandidateCreator3Prong {
@@ -853,6 +853,7 @@ struct HfCandidateCreator3ProngExpressions {
853853
Configurable<bool> matchKinkedDecayTopology{"matchKinkedDecayTopology", false, "Match also candidates with tracks that decay with kinked topology"};
854854
Configurable<bool> matchInteractionsWithMaterial{"matchInteractionsWithMaterial", false, "Match also candidates with tracks that interact with material"};
855855
Configurable<bool> matchCorrBkgs{"matchCorrBkgs", false, "Match correlated background candidates"};
856+
Configurable<std::vector<int>> mothersCorrBkgsPdgs{"mothersCorrBkgsPdgs", {411, 413, 431, 4122, 4232}, "PDG codes of the mother particles of correlated background candidates"};
856857

857858
constexpr static std::size_t NDaughtersResonant{2u};
858859

@@ -947,10 +948,9 @@ struct HfCandidateCreator3ProngExpressions {
947948
}
948949

949950
if (matchCorrBkgs) {
950-
std::array<int, 5> mothersPdgCodes = {Pdg::kDPlus, Pdg::kDS, Pdg::kDStar, Pdg::kLambdaCPlus, Pdg::kXiCPlus};
951951
indexRec = -1; // Index of the matched reconstructed candidate
952952

953-
for (const auto& pdg : mothersPdgCodes) {
953+
for (const auto& pdg : mothersCorrBkgsPdgs.value) {
954954
int depth = 2;
955955
if (pdg == Pdg::kDStar) {
956956
depth = 3; // D0 resonant decays are active
@@ -1206,7 +1206,7 @@ struct HfCandidateCreator3ProngExpressions {
12061206
continue;
12071207
}
12081208
if (matchCorrBkgs) {
1209-
hf_mc_gen::fillMcMatchGen3Prong<true>(mcParticles, mcParticlesPerMcColl, rowMcMatchGen, rejectBackground);
1209+
hf_mc_gen::fillMcMatchGen3Prong<true>(mcParticles, mcParticlesPerMcColl, rowMcMatchGen, rejectBackground, mothersCorrBkgsPdgs.value);
12101210
} else {
12111211
hf_mc_gen::fillMcMatchGen3Prong(mcParticles, mcParticlesPerMcColl, rowMcMatchGen, rejectBackground);
12121212
}

PWGHF/TableProducer/treeCreatorDplusToPiKPi.cxx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ using namespace o2;
3131
using namespace o2::framework;
3232
using namespace o2::framework::expressions;
3333
using namespace o2::hf_centrality;
34-
using namespace o2::hf_corrbkg;
3534

3635
namespace o2::aod
3736
{

PWGHF/Utils/utilsMcGen.h

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,11 @@
3232
#include "PWGHF/DataModel/CandidateReconstructionTables.h"
3333
#include "PWGHF/Utils/utilsMcMatching.h"
3434

35-
using namespace o2::hf_decay::hf_cand_2prong;
36-
using namespace o2::hf_decay::hf_cand_3prong;
37-
using namespace o2::hf_corrbkg;
38-
3935
namespace hf_mc_gen
4036
{
4137

38+
using namespace o2::hf_corrbkg;
39+
4240
template <bool matchCorrBkgs = false, typename T, typename U, typename V>
4341
void fillMcMatchGen2Prong(T const& mcParticles, U const& mcParticlesPerMcColl, V& rowMcMatchGen, bool rejectBackground)
4442
{
@@ -61,7 +59,7 @@ void fillMcMatchGen2Prong(T const& mcParticles, U const& mcParticlesPerMcColl, V
6159
if (matchCorrBkgs) {
6260
bool matched = false;
6361

64-
for (const auto& [chn, finalState] : finalStates2Prongs) {
62+
for (const auto& [chn, finalState] : o2::hf_corrbkg::hf_chns_2prong::finalStates2Prongs) {
6563
if (finalState.size() == 3) { // Partly Reco 3-prong decays
6664
std::array<int, 3> finalStateParts = std::array{finalState[0], finalState[1], finalState[2]};
6765
if (particle.pdgCode() < 0) {
@@ -131,7 +129,7 @@ void fillMcMatchGen2Prong(T const& mcParticles, U const& mcParticlesPerMcColl, V
131129
}
132130

133131
template <bool matchCorrBkgs = false, typename T, typename U, typename V>
134-
void fillMcMatchGen3Prong(T const& mcParticles, U const& mcParticlesPerMcColl, V& rowMcMatchGen, bool rejectBackground)
132+
void fillMcMatchGen3Prong(T const& mcParticles, U const& mcParticlesPerMcColl, V& rowMcMatchGen, bool rejectBackground, std::vector<int> const& corrBkgMothersPdgs = {})
135133
{
136134
using namespace o2::constants::physics;
137135
constexpr std::size_t NDaughtersResonant{2u};
@@ -157,8 +155,7 @@ void fillMcMatchGen3Prong(T const& mcParticles, U const& mcParticlesPerMcColl, V
157155
}
158156

159157
if (matchCorrBkgs) {
160-
std::array<int, 5> mothersPdgCodes = {Pdg::kDPlus, Pdg::kDS, Pdg::kDStar, Pdg::kLambdaCPlus, Pdg::kXiCPlus};
161-
for (const auto& motherPdgCode : mothersPdgCodes) {
158+
for (const auto& motherPdgCode : corrBkgMothersPdgs) {
162159
if (std::abs(particle.pdgCode()) != motherPdgCode) {
163160
continue; // Skip if the particle PDG code does not match the mother PDG code
164161
}

0 commit comments

Comments
 (0)