Skip to content

Commit 195eb8a

Browse files
committed
Add possibility to account for interactions with material and kink decays
1 parent 657921b commit 195eb8a

1 file changed

Lines changed: 29 additions & 8 deletions

File tree

‎PWGHF/TableProducer/candidateCreatorXic0Omegac0Qa.cxx‎

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,9 +1061,9 @@ struct HfCandidateCreatorXic0Omegac0QaMc {
10611061

10621062
// Configurables
10631063
struct : ConfigurableGroup {
1064-
Configurable<bool> rejectBackground{"rejectBackground", false, "Reject particles from background events"}; // -> Used for only Xic0
1065-
Configurable<bool> acceptTrackInteractionWithMaterial{"acceptTrackInteractionWithMaterial", false, "Accept candidates with final daughters interacting with materials"};
1066-
// Configurable<bool> matchDecayedPions{"matchedDecayedPions", true, "Match also candidates with daughter pion tracks that decay with kinked toploogy"};
1064+
Configurable<bool> rejectBackground{"rejectBackground", true, "Reject particles from background events"};
1065+
Configurable<bool> matchKinkedDecayTopology{"matchKinkedDecayTopology", true, "Match also candidates with tracks that decay with kinked topology"};
1066+
Configurable<bool> matchInteractionsWithMaterial{"matchInteractionsWithMaterial", true, "Match also candidates with tracks that interact with material"};
10671067
} configs;
10681068

10691069
std::array<int, nMcDecayChannels> pdgOfCharmBaryon{+kXiC0, +kXiC0, +kOmegaC0, +kOmegaC0, +kOmegaC0};
@@ -1105,6 +1105,22 @@ struct HfCandidateCreatorXic0Omegac0QaMc {
11051105
}
11061106
}
11071107

1108+
template <typename Track, std::size_t N>
1109+
int matchDecay(aod::McParticles const& mcParticles, std::array<Track, N> const& daughters, int pdgMother, std::array<int, N> const& pdgDaughters,
1110+
int8_t* matchSign, int depth, int8_t* nPiToMu = nullptr, int8_t* nKaToPi = nullptr, int8_t* nMaterial = nullptr)
1111+
{
1112+
if (configs.matchKinkedDecayTopology && configs.matchInteractionsWithMaterial) {
1113+
return RecoDecay::getMatchedMCRec<false, true, false, true, true>(mcParticles, daughters, pdgMother, pdgDaughters, true, matchSign, depth, nPiToMu, nKaToPi, nMaterial);
1114+
}
1115+
if (configs.matchKinkedDecayTopology) {
1116+
return RecoDecay::getMatchedMCRec<false, true, false, true, false>(mcParticles, daughters, pdgMother, pdgDaughters, true, matchSign, depth, nPiToMu, nKaToPi);
1117+
}
1118+
if (configs.matchInteractionsWithMaterial) {
1119+
return RecoDecay::getMatchedMCRec<false, true, false, false, true>(mcParticles, daughters, pdgMother, pdgDaughters, true, matchSign, depth, nullptr, nullptr, nMaterial);
1120+
}
1121+
return RecoDecay::getMatchedMCRec<false, true>(mcParticles, daughters, pdgMother, pdgDaughters, true, matchSign, depth);
1122+
}
1123+
11081124
template <o2::hf_centrality::CentralityEstimator centEstimator, typename Colls, typename McCollisions>
11091125
void runXic0Omegac0Mc(TracksWMcIU const& tracks,
11101126
aod::McParticles const& mcParticles,
@@ -1125,8 +1141,8 @@ struct HfCandidateCreatorXic0Omegac0QaMc {
11251141
int8_t flagChannelMain = 0;
11261142
int8_t flagChannelResonant = 0; // TODO: Implement resonant channel matching
11271143
int8_t origin = 0;
1128-
int8_t nKinkedTracks = 0; // TODO: Implement kinked track matching
1129-
int8_t nInteractionsWithMaterial = 0; // TODO: Implement interaction with material matching
1144+
int8_t nKinkedTracks = 0;
1145+
int8_t nInteractionsWithMaterial = 0;
11301146

11311147
std::vector<int> idxBhadMothers{};
11321148

@@ -1159,19 +1175,24 @@ struct HfCandidateCreatorXic0Omegac0QaMc {
11591175
}
11601176

11611177
for (int decayChannel = 0; decayChannel < nMcDecayChannels; ++decayChannel) {
1178+
int8_t nPiToMu = 0;
1179+
int8_t nKaToPi = 0;
1180+
int8_t nMaterial = 0;
11621181
// CharmBaryon -> Charm bachelor + Cascade
1163-
indexRecCharmBaryon = RecoDecay::getMatchedMCRec<false, true>(mcParticles, arrayDaughters, pdgOfCharmBaryon[decayChannel], std::array{pdgOfCharmBachelor[decayChannel], pdgOfBachelor[decayChannel], +kProton, +kPiMinus}, true, &sign, 3);
1182+
indexRecCharmBaryon = matchDecay(mcParticles, arrayDaughters, pdgOfCharmBaryon[decayChannel], std::array{pdgOfCharmBachelor[decayChannel], pdgOfBachelor[decayChannel], +kProton, +kPiMinus}, &sign, 3, &nPiToMu, &nKaToPi, &nMaterial);
11641183

11651184
if (indexRecCharmBaryon > -1) {
11661185
// Cascade -> Bachelor + V0
1167-
indexRecCascade = RecoDecay::getMatchedMCRec<false, true>(mcParticles, arrayDaughtersCasc, pdgOfCascade[decayChannel], std::array{pdgOfBachelor[decayChannel], +kProton, +kPiMinus}, true, &signCasc, 2);
1186+
indexRecCascade = matchDecay(mcParticles, arrayDaughtersCasc, pdgOfCascade[decayChannel], std::array{pdgOfBachelor[decayChannel], +kProton, +kPiMinus}, &signCasc, 2);
11681187

11691188
if (indexRecCascade > -1) {
11701189
// V0 -> Pos + Neg
1171-
indexRecV0 = RecoDecay::getMatchedMCRec<false, true>(mcParticles, arrayDaughtersV0, +kLambda0, std::array{+kProton, +kPiMinus}, true, &signV0, 1);
1190+
indexRecV0 = matchDecay(mcParticles, arrayDaughtersV0, +kLambda0, std::array{+kProton, +kPiMinus}, &signV0, 1);
11721191

11731192
if (indexRecV0 > -1) {
11741193
flagChannelMain = sign * decayChannelFlags[decayChannel];
1194+
nKinkedTracks = nPiToMu + nKaToPi;
1195+
nInteractionsWithMaterial = nMaterial;
11751196
break;
11761197
}
11771198
}

0 commit comments

Comments
 (0)