Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 22 additions & 27 deletions PWGHF/HFC/TableProducer/correlatorDplusHadrons.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ struct HfCorrelatorDplusHadrons {
Produces<aod::Dplus> entryDplus;
Produces<aod::Hadron> entryHadron;
static constexpr std::size_t NDaughters{3u};
static constexpr float kEtaDaughtersMax = 0.8f; // Eta cut on daughters of D+ meson as Run2
static constexpr float EtaDaughtersMax = 0.8f; // Eta cut on daughters of D+ meson as Run2

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

// MC reco level
bool isDplusPrompt = false;
bool isDplusNonPrompt = false;
bool isDplusSignal = false;
for (const auto& candidate : candidates) {
// rapidity and pT selections
if (std::abs(HfHelper::yDplus(candidate)) >= yCandMax || candidate.pt() <= ptCandMin || candidate.pt() >= ptCandMax) {
Expand All @@ -437,7 +434,7 @@ struct HfCorrelatorDplusHadrons {
double etaDaugh1 = RecoDecay::eta(std::array{candidate.pxProng0(), candidate.pyProng0(), candidate.pzProng0()});
double etaDaugh2 = RecoDecay::eta(std::array{candidate.pxProng1(), candidate.pyProng1(), candidate.pzProng1()});
double etaDaugh3 = RecoDecay::eta(std::array{candidate.pxProng2(), candidate.pyProng2(), candidate.pzProng2()});
if (std::abs(etaDaugh1) >= kEtaDaughtersMax || std::abs(etaDaugh2) >= kEtaDaughtersMax || std::abs(etaDaugh3) >= kEtaDaughtersMax) {
if (std::abs(etaDaugh1) >= EtaDaughtersMax || std::abs(etaDaugh2) >= EtaDaughtersMax || std::abs(etaDaugh3) >= EtaDaughtersMax) {
continue;
}
// efficiency weight determination
Expand All @@ -447,10 +444,10 @@ struct HfCorrelatorDplusHadrons {
efficiencyWeightD = 1. / efficiencyD->at(effBinD);
}
// Dplus flag
isDplusSignal = std::abs(candidate.flagMcMatchRec()) == hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi;
bool isDplusSignal = std::abs(candidate.flagMcMatchRec()) == hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi;
// prompt and non-prompt division
isDplusPrompt = candidate.originMcRec() == RecoDecay::OriginType::Prompt;
isDplusNonPrompt = candidate.originMcRec() == RecoDecay::OriginType::NonPrompt;
bool isDplusPrompt = candidate.originMcRec() == RecoDecay::OriginType::Prompt;
bool isDplusNonPrompt = candidate.originMcRec() == RecoDecay::OriginType::NonPrompt;

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

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

bool isDplusPrompt = false;
bool isDplusNonPrompt = false;
// MC gen level
for (const auto& particle1 : mcParticles) {
// check if the particle is Dplus (for general plot filling and selection, so both cases are fine) - NOTE: decay channel is not probed!
Expand All @@ -563,22 +558,6 @@ struct HfCorrelatorDplusHadrons {
if (std::abs(yD) >= yCandMax || particle1.pt() <= ptCandMin) {
continue;
}
registry.fill(HIST("hDplusBin"), poolBin);
registry.fill(HIST("hPtCandMCGen"), particle1.pt());
registry.fill(HIST("hEtaMcGen"), particle1.eta());
registry.fill(HIST("hPhiMcGen"), RecoDecay::constrainAngle(particle1.phi(), -PIHalf));
registry.fill(HIST("hYMCGen"), yD);

// prompt and non-prompt division
isDplusPrompt = particle1.originMcGen() == RecoDecay::OriginType::Prompt;
isDplusNonPrompt = particle1.originMcGen() == RecoDecay::OriginType::NonPrompt;
if (isDplusPrompt) {
registry.fill(HIST("hPtCandMcGenPrompt"), particle1.pt());
} else if (isDplusNonPrompt) {
registry.fill(HIST("hPtCandMcGenNonPrompt"), particle1.pt());
}

// prompt and non-prompt division
std::vector<int> listDaughters{};
std::array<int, NDaughters> const arrDaughDplusPDG = {+kPiPlus, -kKPlus, kPiPlus};
std::array<int, NDaughters> prongsId{};
Expand All @@ -590,7 +569,7 @@ struct HfCorrelatorDplusHadrons {
bool isDaughtersOk = true;
for (const auto& dauIdx : listDaughters) {
auto daughI = mcParticles.rawIteratorAt(dauIdx - mcParticles.offset());
if (std::abs(daughI.eta()) >= kEtaDaughtersMax) {
if (std::abs(daughI.eta()) >= EtaDaughtersMax) {
isDaughtersOk = false;
break;
}
Expand All @@ -600,6 +579,22 @@ struct HfCorrelatorDplusHadrons {
if (!isDaughtersOk)
continue; // Skip this D+ candidate if any daughter fails eta cut
counterDplusHadron++;

registry.fill(HIST("hDplusBin"), poolBin);
registry.fill(HIST("hPtCandMCGen"), particle1.pt());
registry.fill(HIST("hEtaMcGen"), particle1.eta());
registry.fill(HIST("hPhiMcGen"), RecoDecay::constrainAngle(particle1.phi(), -PIHalf));
registry.fill(HIST("hYMCGen"), yD);

// prompt and non-prompt division
bool isDplusPrompt = particle1.originMcGen() == RecoDecay::OriginType::Prompt;
bool isDplusNonPrompt = particle1.originMcGen() == RecoDecay::OriginType::NonPrompt;
if (isDplusPrompt) {
registry.fill(HIST("hPtCandMcGenPrompt"), particle1.pt());
} else if (isDplusNonPrompt) {
registry.fill(HIST("hPtCandMcGenNonPrompt"), particle1.pt());
}

// Dplus Hadron correlation dedicated section
// if it's a Dplus particle, search for Hadron and evaluate correlations
registry.fill(HIST("hcountDplustriggersMCGen"), 0, particle1.pt()); // to count trigger Dplus for normalisation)
Expand Down
Loading