Skip to content

Commit ca6f9d9

Browse files
committed
Use check origin method to tag prompt/nonprompt charm hadrons
1 parent 61141d9 commit ca6f9d9

7 files changed

Lines changed: 13 additions & 19 deletions

File tree

Common/Core/RecoDecay.h

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -950,14 +950,8 @@ class RecoDecay
950950

951951
if (!searchUpToQuark) {
952952
if (
953-
(PDGParticleIMother / 100 == 5 || // b mesons
954-
PDGParticleIMother / 1000 == 5 || // b baryons
955-
(PDGParticleIMother - 10000) / 100 == 5 || // bbbar resonances
956-
(PDGParticleIMother - 20000) / 100 == 5 || // bbbar resonances
957-
(PDGParticleIMother - 30000) / 100 == 5 || // bbbar resonances
958-
(PDGParticleIMother - 100000) / 100 == 5 || // bbbar resonances
959-
(PDGParticleIMother - 200000) / 100 == 5 || // bbbar resonances
960-
(PDGParticleIMother - 300000) / 100 == 5) // bbbar resonances
953+
(PDGParticleIMother / 100 == 5 || // b mesons
954+
PDGParticleIMother / 1000 == 5) // b baryons
961955
) {
962956
return 2;
963957
}

EventFiltering/PWGHF/HFFilter.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -982,10 +982,10 @@ struct HfFilter { // Main struct for HF triggers
982982
auto indexRec = RecoDecay::getMatchedMCRec(particlesMC, std::array{trackPos, trackNeg}, pdg::Code::kD0, array{+kPiPlus, -kKPlus}, true, &sign);
983983
if (indexRec > -1) {
984984
auto particle = particlesMC.rawIteratorAt(indexRec);
985-
origin = (RecoDecay::getMother(particlesMC, particle, kBottom, true) > -1 ? OriginType::NonPrompt : OriginType::Prompt);
985+
origin = RecoDecay::checkCharmHadronOrigin(particlesMC, particle, false);
986986
if (origin == OriginType::NonPrompt) {
987987
flag = kNonPrompt;
988-
} else {
988+
} else if (origin == OriginType::Prompt) {
989989
flag = kPrompt;
990990
}
991991
} else {
@@ -1041,7 +1041,7 @@ struct HfFilter { // Main struct for HF triggers
10411041

10421042
if (indexRec > -1) {
10431043
auto particle = particlesMC.rawIteratorAt(indexRec);
1044-
origin = (RecoDecay::getMother(particlesMC, particle, kBottom, true) > -1 ? OriginType::NonPrompt : OriginType::Prompt);
1044+
origin = RecoDecay::checkCharmHadronOrigin(particlesMC, particle, false);
10451045
if (origin == OriginType::NonPrompt) {
10461046
flag = kNonPrompt;
10471047
} else {

PWGHF/TableProducer/HFCandidateCreator2Prong.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ struct HFCandidateCreator2ProngExpressions {
210210
// Check whether the particle is non-prompt (from a b quark).
211211
if (flag != 0) {
212212
auto particle = particlesMC.rawIteratorAt(indexRec);
213-
origin = (RecoDecay::getMother(particlesMC, particle, kBottom, true) > -1 ? OriginType::NonPrompt : OriginType::Prompt);
213+
origin = RecoDecay::checkCharmHadronOrigin(particlesMC, particle, false);
214214
}
215215

216216
rowMCMatchRec(flag, origin);
@@ -246,7 +246,7 @@ struct HFCandidateCreator2ProngExpressions {
246246

247247
// Check whether the particle is non-prompt (from a b quark).
248248
if (flag != 0) {
249-
origin = (RecoDecay::getMother(particlesMC, particle, kBottom, true) > -1 ? OriginType::NonPrompt : OriginType::Prompt);
249+
origin = RecoDecay::checkCharmHadronOrigin(particlesMC, particle, false);
250250
}
251251

252252
rowMCMatchGen(flag, origin);

PWGHF/TableProducer/HFCandidateCreator3Prong.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ struct HFCandidateCreator3ProngExpressions {
251251
// Check whether the particle is non-prompt (from a b quark).
252252
if (flag != 0) {
253253
auto particle = particlesMC.rawIteratorAt(indexRec);
254-
origin = (RecoDecay::getMother(particlesMC, particle, kBottom, true) > -1 ? OriginType::NonPrompt : OriginType::Prompt);
254+
origin = RecoDecay::checkCharmHadronOrigin(particlesMC, particle, false);
255255
}
256256

257257
rowMCMatchRec(flag, origin, swapping, channel);
@@ -305,7 +305,7 @@ struct HFCandidateCreator3ProngExpressions {
305305

306306
// Check whether the particle is non-prompt (from a b quark).
307307
if (flag != 0) {
308-
origin = (RecoDecay::getMother(particlesMC, particle, kBottom, true) > -1 ? OriginType::NonPrompt : OriginType::Prompt);
308+
origin = RecoDecay::checkCharmHadronOrigin(particlesMC, particle, false);
309309
}
310310

311311
rowMCMatchGen(flag, origin, channel);

PWGHF/TableProducer/HFCandidateCreatorChic.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ struct HFCandidateCreatorChicMC {
249249
}
250250
if (flag != 0) {
251251
auto particle = particlesMC.rawIteratorAt(indexRec);
252-
origin = (RecoDecay::getMother(particlesMC, particle, kBottom, true) > -1 ? NonPrompt : Prompt);
252+
origin = RecoDecay::checkCharmHadronOrigin(particlesMC, particle, false);
253253
}
254254
rowMCMatchRec(flag, origin, channel);
255255
}

PWGHF/TableProducer/HFCandidateCreatorX.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ struct HFCandidateCreatorXMC {
305305
// Check whether the particle is non-prompt (from a b quark).
306306
if (flag != 0) {
307307
auto particle = particlesMC.rawIteratorAt(indexRec);
308-
origin = (RecoDecay::getMother(particlesMC, particle, 5, true) > -1 ? NonPrompt : Prompt);
308+
origin = RecoDecay::checkCharmHadronOrigin(particlesMC, particle, false);
309309
}
310310

311311
rowMCMatchRec(flag, origin, channel);
@@ -338,7 +338,7 @@ struct HFCandidateCreatorXMC {
338338

339339
// Check whether the particle is non-prompt (from a b quark).
340340
if (flag != 0) {
341-
origin = (RecoDecay::getMother(particlesMC, particle, 5, true) > -1 ? NonPrompt : Prompt);
341+
origin = RecoDecay::checkCharmHadronOrigin(particlesMC, particle, false);
342342
}
343343

344344
rowMCMatchGen(flag, origin, channel);

PWGHF/Tasks/HFMCValidation.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ struct ValidationGenLevel {
157157
std::size_t arrayPDGsize = arrPDGFinal[iD].size() - std::count(arrPDGFinal[iD].begin(), arrPDGFinal[iD].end(), 0);
158158
int origin = -1;
159159
if (listDaughters.size() == arrayPDGsize) {
160-
origin = (RecoDecay::getMother(particlesMC, particle, kBottom, true) > -1 ? OriginType::NonPrompt : OriginType::Prompt);
160+
origin = RecoDecay::checkCharmHadronOrigin(particlesMC, particle, false);
161161
if (origin == OriginType::Prompt) {
162162
counterPrompt[iD]++;
163163
} else if (origin == OriginType::NonPrompt) {

0 commit comments

Comments
 (0)