Skip to content

Commit 1aa4d97

Browse files
[PWGHF] Fix for D-Meson Trigger Count (#13833)
Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
1 parent cf24f82 commit 1aa4d97

File tree

1 file changed

+22
-27
lines changed

1 file changed

+22
-27
lines changed

PWGHF/HFC/TableProducer/correlatorDplusHadrons.cxx

Lines changed: 22 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ struct HfCorrelatorDplusHadrons {
182182
Produces<aod::Dplus> entryDplus;
183183
Produces<aod::Hadron> entryHadron;
184184
static constexpr std::size_t NDaughters{3u};
185-
static constexpr float kEtaDaughtersMax = 0.8f; // Eta cut on daughters of D+ meson as Run2
185+
static constexpr float EtaDaughtersMax = 0.8f; // Eta cut on daughters of D+ meson as Run2
186186

187187
Configurable<int> selectionFlagDplus{"selectionFlagDplus", 7, "Selection Flag for Dplus"}; // 7 corresponds to topo+PID cuts
188188
Configurable<int> numberEventsMixed{"numberEventsMixed", 5, "Number of events mixed in ME process"};
@@ -425,9 +425,6 @@ struct HfCorrelatorDplusHadrons {
425425
float const multiplicityFT0M = collision.multFT0M();
426426

427427
// MC reco level
428-
bool isDplusPrompt = false;
429-
bool isDplusNonPrompt = false;
430-
bool isDplusSignal = false;
431428
for (const auto& candidate : candidates) {
432429
// rapidity and pT selections
433430
if (std::abs(HfHelper::yDplus(candidate)) >= yCandMax || candidate.pt() <= ptCandMin || candidate.pt() >= ptCandMax) {
@@ -437,7 +434,7 @@ struct HfCorrelatorDplusHadrons {
437434
double etaDaugh1 = RecoDecay::eta(std::array{candidate.pxProng0(), candidate.pyProng0(), candidate.pzProng0()});
438435
double etaDaugh2 = RecoDecay::eta(std::array{candidate.pxProng1(), candidate.pyProng1(), candidate.pzProng1()});
439436
double etaDaugh3 = RecoDecay::eta(std::array{candidate.pxProng2(), candidate.pyProng2(), candidate.pzProng2()});
440-
if (std::abs(etaDaugh1) >= kEtaDaughtersMax || std::abs(etaDaugh2) >= kEtaDaughtersMax || std::abs(etaDaugh3) >= kEtaDaughtersMax) {
437+
if (std::abs(etaDaugh1) >= EtaDaughtersMax || std::abs(etaDaugh2) >= EtaDaughtersMax || std::abs(etaDaugh3) >= EtaDaughtersMax) {
441438
continue;
442439
}
443440
// efficiency weight determination
@@ -447,10 +444,10 @@ struct HfCorrelatorDplusHadrons {
447444
efficiencyWeightD = 1. / efficiencyD->at(effBinD);
448445
}
449446
// Dplus flag
450-
isDplusSignal = std::abs(candidate.flagMcMatchRec()) == hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi;
447+
bool isDplusSignal = std::abs(candidate.flagMcMatchRec()) == hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi;
451448
// prompt and non-prompt division
452-
isDplusPrompt = candidate.originMcRec() == RecoDecay::OriginType::Prompt;
453-
isDplusNonPrompt = candidate.originMcRec() == RecoDecay::OriginType::NonPrompt;
449+
bool isDplusPrompt = candidate.originMcRec() == RecoDecay::OriginType::Prompt;
450+
bool isDplusNonPrompt = candidate.originMcRec() == RecoDecay::OriginType::NonPrompt;
454451

455452
std::vector<float> outputMl = {-1., -1., -1.};
456453

@@ -548,8 +545,6 @@ struct HfCorrelatorDplusHadrons {
548545
int poolBin = corrBinningMcGen.getBin(std::make_tuple(mcCollision.posZ(), mcCollision.multMCFT0A()));
549546
registry.fill(HIST("hMultFT0AMcGen"), mcCollision.multMCFT0A());
550547

551-
bool isDplusPrompt = false;
552-
bool isDplusNonPrompt = false;
553548
// MC gen level
554549
for (const auto& particle1 : mcParticles) {
555550
// check if the particle is Dplus (for general plot filling and selection, so both cases are fine) - NOTE: decay channel is not probed!
@@ -563,22 +558,6 @@ struct HfCorrelatorDplusHadrons {
563558
if (std::abs(yD) >= yCandMax || particle1.pt() <= ptCandMin) {
564559
continue;
565560
}
566-
registry.fill(HIST("hDplusBin"), poolBin);
567-
registry.fill(HIST("hPtCandMCGen"), particle1.pt());
568-
registry.fill(HIST("hEtaMcGen"), particle1.eta());
569-
registry.fill(HIST("hPhiMcGen"), RecoDecay::constrainAngle(particle1.phi(), -PIHalf));
570-
registry.fill(HIST("hYMCGen"), yD);
571-
572-
// prompt and non-prompt division
573-
isDplusPrompt = particle1.originMcGen() == RecoDecay::OriginType::Prompt;
574-
isDplusNonPrompt = particle1.originMcGen() == RecoDecay::OriginType::NonPrompt;
575-
if (isDplusPrompt) {
576-
registry.fill(HIST("hPtCandMcGenPrompt"), particle1.pt());
577-
} else if (isDplusNonPrompt) {
578-
registry.fill(HIST("hPtCandMcGenNonPrompt"), particle1.pt());
579-
}
580-
581-
// prompt and non-prompt division
582561
std::vector<int> listDaughters{};
583562
std::array<int, NDaughters> const arrDaughDplusPDG = {+kPiPlus, -kKPlus, kPiPlus};
584563
std::array<int, NDaughters> prongsId{};
@@ -590,7 +569,7 @@ struct HfCorrelatorDplusHadrons {
590569
bool isDaughtersOk = true;
591570
for (const auto& dauIdx : listDaughters) {
592571
auto daughI = mcParticles.rawIteratorAt(dauIdx - mcParticles.offset());
593-
if (std::abs(daughI.eta()) >= kEtaDaughtersMax) {
572+
if (std::abs(daughI.eta()) >= EtaDaughtersMax) {
594573
isDaughtersOk = false;
595574
break;
596575
}
@@ -600,6 +579,22 @@ struct HfCorrelatorDplusHadrons {
600579
if (!isDaughtersOk)
601580
continue; // Skip this D+ candidate if any daughter fails eta cut
602581
counterDplusHadron++;
582+
583+
registry.fill(HIST("hDplusBin"), poolBin);
584+
registry.fill(HIST("hPtCandMCGen"), particle1.pt());
585+
registry.fill(HIST("hEtaMcGen"), particle1.eta());
586+
registry.fill(HIST("hPhiMcGen"), RecoDecay::constrainAngle(particle1.phi(), -PIHalf));
587+
registry.fill(HIST("hYMCGen"), yD);
588+
589+
// prompt and non-prompt division
590+
bool isDplusPrompt = particle1.originMcGen() == RecoDecay::OriginType::Prompt;
591+
bool isDplusNonPrompt = particle1.originMcGen() == RecoDecay::OriginType::NonPrompt;
592+
if (isDplusPrompt) {
593+
registry.fill(HIST("hPtCandMcGenPrompt"), particle1.pt());
594+
} else if (isDplusNonPrompt) {
595+
registry.fill(HIST("hPtCandMcGenNonPrompt"), particle1.pt());
596+
}
597+
603598
// Dplus Hadron correlation dedicated section
604599
// if it's a Dplus particle, search for Hadron and evaluate correlations
605600
registry.fill(HIST("hcountDplustriggersMCGen"), 0, particle1.pt()); // to count trigger Dplus for normalisation)

0 commit comments

Comments
 (0)