Skip to content
Merged
Show file tree
Hide file tree
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
8 changes: 8 additions & 0 deletions PWGHF/DataModel/HFCandidateSelectionTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@

namespace o2::aod
{
// selection steps
enum SelectionStep {
RecoSkims = 0,
RecoTopol,
RecoPID,
NSelectionSteps
};

namespace hf_selcandidate_d0
{
DECLARE_SOA_COLUMN(IsSelD0, isSelD0, int); //!
Expand Down
6 changes: 4 additions & 2 deletions PWGHF/TableProducer/HFDplusToPiKPiCandidateSelector.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,14 @@ struct HFDplusToPiKPiCandidateSelector {
// looping over 3-prong candidates
for (auto& candidate : candidates) {

// final selection flag: 0 - rejected, 1 - accepted
// final selection flag:
auto statusDplusToPiKPi = 0;

if (!(candidate.hfflag() & 1 << DecayType::DPlusToPiKPi)) {
hfSelDplusToPiKPiCandidate(statusDplusToPiKPi);
continue;
}
SETBIT(statusDplusToPiKPi, aod::SelectionStep::RecoSkims);

auto trackPos1 = candidate.index0_as<aod::BigTracksPID>(); // positive daughter (negative for the antiparticles)
auto trackNeg = candidate.index1_as<aod::BigTracksPID>(); // negative daughter (positive for the antiparticles)
Expand All @@ -146,6 +147,7 @@ struct HFDplusToPiKPiCandidateSelector {
hfSelDplusToPiKPiCandidate(statusDplusToPiKPi);
continue;
}
SETBIT(statusDplusToPiKPi, aod::SelectionStep::RecoTopol);

// track-level PID selection
int pidTrackPos1Pion = selectorPion.getStatusTrackPIDAll(trackPos1);
Expand All @@ -158,8 +160,8 @@ struct HFDplusToPiKPiCandidateSelector {
hfSelDplusToPiKPiCandidate(statusDplusToPiKPi);
continue;
}
SETBIT(statusDplusToPiKPi, aod::SelectionStep::RecoPID);

statusDplusToPiKPi = 1;
hfSelDplusToPiKPiCandidate(statusDplusToPiKPi);
}
}
Expand Down
88 changes: 77 additions & 11 deletions PWGHF/Tasks/taskDPlus.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
using namespace o2;
using namespace o2::framework;
using namespace o2::framework::expressions;
using namespace o2::aod::hf_cand;
using namespace o2::aod::hf_cand_prong3;

void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
Expand All @@ -43,7 +44,7 @@ struct TaskDPlus {
{"hPtProng1", "3-prong candidates;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0., 10.}}}},
{"hPtProng2", "3-prong candidates;prong 2 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0., 10.}}}}}};

Configurable<int> d_selectionFlagDPlus{"d_selectionFlagDPlus", 1, "Selection Flag for DPlus"};
Configurable<int> d_selectionFlagDPlus{"d_selectionFlagDPlus", 7, "Selection Flag for DPlus"}; // 7 corresponds to topo+PID cuts
Configurable<double> cutYCandMax{"cutYCandMax", -1., "max. cand. rapidity"};
Configurable<std::vector<double>> bins{"pTBins", std::vector<double>{hf_cuts_dplus_topikpi::pTBins_v}, "pT bin limits"};

Expand Down Expand Up @@ -112,20 +113,41 @@ struct TaskDPlus {
struct TaskDPlusMC {
HistogramRegistry registry{
"registry",
{{"hPtRecSig", "3-prong candidates (matched);#it{p}_{T}^{rec.} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0., 10.}}}},
{"hPtRecBg", "3-prong candidates (unmatched);#it{p}_{T}^{rec.} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0., 10.}}}},
{"hPtGen", "MC particles (matched);#it{p}_{T}^{gen.} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0., 10.}}}},
{"hPtGenSig", "3-prong candidates (matched);#it{p}_{T}^{gen.} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0., 10.}}}},
{"hCPARecSig", "3-prong candidates (matched);cosine of pointing angle;entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}},
{{"hCPARecSig", "3-prong candidates (matched);cosine of pointing angle;entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}},
{"hCPARecBg", "3-prong candidates (unmatched);cosine of pointing angle;entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}},
{"hEtaRecSig", "3-prong candidates (matched);#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}},
{"hEtaRecBg", "3-prong candidates (unmatched);#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}},
{"hEtaGen", "MC particles (matched);#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}}}};

Configurable<int> d_selectionFlagDPlus{"d_selectionFlagDPlus", 1, "Selection Flag for DPlus"};
Configurable<double> cutYCandMax{"cutYCandMax", -1., "max. cand. rapidity"};
Configurable<std::vector<double>> bins{"pTBins", std::vector<double>{hf_cuts_dplus_topikpi::pTBins_v}, "pT bin limits"};
Configurable<int> d_selectionFlagDPlus{"d_selectionFlagDPlus", 7, "Selection Flag for DPlus"}; // 7 corresponds to topo+PID cuts

Filter filterSelectCandidates = (aod::hf_selcandidate_dplus::isSelDplusToPiKPi >= d_selectionFlagDPlus);
void init(o2::framework::InitContext&)
{
auto vbins = (std::vector<double>)bins;

registry.add("hPtRecSig", "3-prong candidates (matched);#it{p}_{T}^{rec.} (GeV/#it{c});entries", {HistType::kTH1F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}}});
registry.add("hPtRecSigNonPrompt", "3-prong candidates (matched, non-prompt);#it{p}_{T}^{rec.} (GeV/#it{c});entries", {HistType::kTH1F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}}});
registry.add("hPtRecBg", "3-prong candidates (unmatched);#it{p}_{T}^{rec.} (GeV/#it{c});entries", {HistType::kTH1F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}}});
registry.add("hPtGen", "MC particles (matched);#it{p}_{T}^{gen.} (GeV/#it{c});entries", {HistType::kTH1F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}}});
registry.add("hPtGenSig", "3-prong candidates (matched);#it{p}_{T}^{gen.} (GeV/#it{c});entries", {HistType::kTH1F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}}});
registry.add("hPtGenSigPrompt", "3-prong candidates (matched, prompt);#it{p}_{T}^{gen.} (GeV/#it{c});entries", {HistType::kTH1F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}}});
registry.add("hPtGenSigNonPrompt", "3-prong candidates (matched, non-prompt);#it{p}_{T}^{gen.} (GeV/#it{c});entries", {HistType::kTH1F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}}});
registry.add("hPtvsYRecSig_RecoPID", "3-prong candidates (RecoPID - matched);#it{p}_{T}^{rec.}; #it{y}", {HistType::kTH2F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}, {100, -5., 5.}}});
registry.add("hPtvsYRecSigPrompt_RecoPID", "3-prong candidates (RecoPID - matched, prompt);#it{p}_{T}^{rec.}; #it{y}", {HistType::kTH2F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}, {100, -5., 5.}}});
registry.add("hPtvsYRecSigNonPrompt_RecoPID", "3-prong candidates (RecoPID - matched, non-prompt);#it{p}_{T}^{rec.}; #it{y}", {HistType::kTH2F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}, {100, -5., 5.}}});
registry.add("hPtvsYRecSig_RecoTopol", "3-prong candidates (RecoTopol - matched);#it{p}_{T}^{rec.}; #it{y}", {HistType::kTH2F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}, {100, -5., 5.}}});
registry.add("hPtvsYRecSigPrompt_RecoTopol", "3-prong candidates (RecoTopol - matched, prompt);#it{p}_{T}^{rec.}; #it{y}", {HistType::kTH2F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}, {100, -5., 5.}}});
registry.add("hPtvsYRecSigNonPrompt_RecoTopol", "3-prong candidates (RecoTopol - matched, non-prompt);#it{p}_{T}^{rec.}; #it{y}", {HistType::kTH2F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}, {100, -5., 5.}}});
registry.add("hPtvsYRecSig_RecoSkim", "3-prong candidates (RecoSkim - matched);#it{p}_{T}^{rec.}; #it{y}", {HistType::kTH2F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}, {100, -5., 5.}}});
registry.add("hPtvsYRecSigPrompt_RecoSkim", "3-prong candidates (RecoSkim - matched, prompt);#it{p}_{T}^{rec.}; #it{y}", {HistType::kTH2F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}, {100, -5., 5.}}});
registry.add("hPtvsYRecSigNonPrompt_RecoSkim", "3-prong candidates (RecoSkim - matched, non-prompt);#it{p}_{T}^{rec.}; #it{y}", {HistType::kTH2F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}, {100, -5., 5.}}});
registry.add("hPtvsYGenPrompt", "3-prong candidates (matched, prompt);#it{p}_{T}^{gen.}; #it{y}", {HistType::kTH2F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}, {100, -5., 5.}}});
registry.add("hPtvsYGenNonPrompt", "3-prong candidates (matched, non-prompt);#it{p}_{T}^{gen.}; #it{y}", {HistType::kTH2F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}, {100, -5., 5.}}});
}

Filter filterSelectCandidates = (aod::hf_selcandidate_dplus::isSelDplusToPiKPi > 0);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to me that this line prevents calculation of efficiency without applying selector decision as it used to be before when >= d_selectionFlagDPlus was used.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed it does not allow for the selection of all the 3-prong candidates, however what is the interest in selecting all the candidates that are not reconstructed as D+ in the HFTrackIndexSkimsCreator? Filtering the candidates that have at least BIT(0) instead should improve a bit the execution time


void process(soa::Filtered<soa::Join<aod::HfCandProng3, aod::HFSelDplusToPiKPiCandidate, aod::HfCandProng3MCRec>> const& candidates,
soa::Join<aod::McParticles, aod::HfCandProng3MCGen> const& particlesMC, aod::BigTracksMC const& tracks)
Expand All @@ -145,7 +167,41 @@ struct TaskDPlusMC {
auto indexMother = RecoDecay::getMother(particlesMC, candidate.index0_as<aod::BigTracksMC>().mcParticle_as<soa::Join<aod::McParticles, aod::HfCandProng3MCGen>>(), pdg::Code::kDPlus, true);
auto particleMother = particlesMC.iteratorAt(indexMother);
registry.fill(HIST("hPtGenSig"), particleMother.pt()); // gen. level pT
registry.fill(HIST("hPtRecSig"), candidate.pt()); // rec. level pT
auto ptRec = candidate.pt();
auto yRec = YDPlus(candidate);
registry.fill(HIST("hPtvsYRecSig_RecoSkim"), ptRec, yRec);
if (TESTBIT(candidate.isSelDplusToPiKPi(), aod::SelectionStep::RecoTopol)) {
registry.fill(HIST("hPtvsYRecSig_RecoTopol"), ptRec, yRec);
}
if (TESTBIT(candidate.isSelDplusToPiKPi(), aod::SelectionStep::RecoPID)) {
registry.fill(HIST("hPtvsYRecSig_RecoPID"), ptRec, yRec);
}
if (candidate.isSelDplusToPiKPi() >= d_selectionFlagDPlus) {
registry.fill(HIST("hPtRecSig"), ptRec); // rec. level pT
}
if (candidate.originMCRec() == OriginType::Prompt) {
registry.fill(HIST("hPtvsYRecSigPrompt_RecoSkim"), ptRec, yRec);
if (TESTBIT(candidate.isSelDplusToPiKPi(), aod::SelectionStep::RecoTopol)) {
registry.fill(HIST("hPtvsYRecSigPrompt_RecoTopol"), ptRec, yRec);
}
if (TESTBIT(candidate.isSelDplusToPiKPi(), aod::SelectionStep::RecoPID)) {
registry.fill(HIST("hPtvsYRecSigPrompt_RecoPID"), ptRec, yRec);
}
if (candidate.isSelDplusToPiKPi() >= d_selectionFlagDPlus) {
registry.fill(HIST("hPtRecSigPrompt"), ptRec); // rec. level pT, prompt
}
} else {
registry.fill(HIST("hPtvsYRecSigNonPrompt_RecoSkim"), ptRec, yRec);
if (TESTBIT(candidate.isSelDplusToPiKPi(), aod::SelectionStep::RecoTopol)) {
registry.fill(HIST("hPtvsYRecSigNonPrompt_RecoTopol"), ptRec, yRec);
}
if (TESTBIT(candidate.isSelDplusToPiKPi(), aod::SelectionStep::RecoPID)) {
registry.fill(HIST("hPtvsYRecSigNonPrompt_RecoPID"), ptRec, yRec);
}
if (candidate.isSelDplusToPiKPi() >= d_selectionFlagDPlus) {
registry.fill(HIST("hPtRecSigNonPrompt"), ptRec); // rec. level pT, non-prompt
}
}
registry.fill(HIST("hCPARecSig"), candidate.cpa());
registry.fill(HIST("hEtaRecSig"), candidate.eta());
} else {
Expand All @@ -158,10 +214,20 @@ struct TaskDPlusMC {
//Printf("MC Particles: %d", particlesMC.size());
for (auto& particle : particlesMC) {
if (std::abs(particle.flagMCMatchGen()) == 1 << DecayType::DPlusToPiKPi) {
if (cutYCandMax >= 0. && std::abs(RecoDecay::Y(array{particle.px(), particle.py(), particle.pz()}, RecoDecay::getMassPDG(particle.pdgCode()))) > cutYCandMax) {
auto ptGen = particle.pt();
auto yGen = RecoDecay::Y(array{particle.px(), particle.py(), particle.pz()}, RecoDecay::getMassPDG(particle.pdgCode()));
if (cutYCandMax >= 0. && std::abs(yGen) > cutYCandMax) {
continue;
}
registry.fill(HIST("hPtGen"), particle.pt());
registry.fill(HIST("hPtGen"), ptGen);
registry.fill(HIST("hPtvsYGen"), ptGen, yGen);
if (particle.originMCGen() == OriginType::Prompt) {
registry.fill(HIST("hPtGenPrompt"), ptGen);
registry.fill(HIST("hPtvsYGenPrompt"), ptGen, yGen);
} else {
registry.fill(HIST("hPtGenNonPrompt"), ptGen);
registry.fill(HIST("hPtvsYGenNonPrompt"), ptGen, yGen);
}
registry.fill(HIST("hEtaGen"), particle.eta());
}
}
Expand Down