Skip to content

Commit

Permalink
PWGHF, DO NOT MERGE: Change the eta cut with the Y cut in the tasks (A…
Browse files Browse the repository at this point in the history
…liceO2Group#5393)

Co-authored-by: Luigi <ldellost@aliceml.cern.ch>
  • Loading branch information
2 people authored and jgrosseo committed Aug 18, 2021
1 parent 850fc91 commit 60443be
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 22 deletions.
20 changes: 10 additions & 10 deletions Tasks/PWGHF/taskD0.cxx
Expand Up @@ -56,7 +56,7 @@ struct TaskD0 {

Configurable<int> d_selectionFlagD0{"d_selectionFlagD0", 1, "Selection Flag for D0"};
Configurable<int> d_selectionFlagD0bar{"d_selectionFlagD0bar", 1, "Selection Flag for D0bar"};
Configurable<double> cutEtaCandMax{"cutEtaCandMax", -1., "max. cand. pseudorapidity"};
Configurable<double> cutYCandMax{"cutYCandMax", -1., "max. cand. rapidity"};

Filter filterSelectCandidates = (aod::hf_selcandidate_d0::isSelD0 >= d_selectionFlagD0 || aod::hf_selcandidate_d0::isSelD0bar >= d_selectionFlagD0bar);

Expand All @@ -67,8 +67,8 @@ struct TaskD0 {
if (!(candidate.hfflag() & 1 << D0ToPiK)) {
continue;
}
if (cutEtaCandMax >= 0. && std::abs(candidate.eta()) > cutEtaCandMax) {
//Printf("Candidate: eta rejection: %g", candidate.eta());
if (cutYCandMax >= 0. && std::abs(YD0(candidate)) > cutYCandMax) {
//Printf("Candidate: Y rejection: %g", YD0(candidate));
continue;
}
if (candidate.isSelD0() >= d_selectionFlagD0) {
Expand Down Expand Up @@ -114,7 +114,7 @@ struct TaskD0MC {

Configurable<int> d_selectionFlagD0{"d_selectionFlagD0", 1, "Selection Flag for D0"};
Configurable<int> d_selectionFlagD0bar{"d_selectionFlagD0bar", 1, "Selection Flag for D0bar"};
Configurable<double> cutEtaCandMax{"cutEtaCandMax", -1., "max. cand. pseudorapidity"};
Configurable<double> cutYCandMax{"cutYCandMax", -1., "max. cand. rapidity"};

Filter filterSelectCandidates = (aod::hf_selcandidate_d0::isSelD0 >= d_selectionFlagD0 || aod::hf_selcandidate_d0::isSelD0bar >= d_selectionFlagD0bar);

Expand All @@ -127,8 +127,8 @@ struct TaskD0MC {
if (!(candidate.hfflag() & 1 << D0ToPiK)) {
continue;
}
if (cutEtaCandMax >= 0. && std::abs(candidate.eta()) > cutEtaCandMax) {
//Printf("MC Rec.: eta rejection: %g", candidate.eta());
if (cutYCandMax >= 0. && std::abs(YD0(candidate)) > cutYCandMax) {
//Printf("MC Rec.: Y rejection: %g", YD0(candidate));
continue;
}
if (std::abs(candidate.flagMCMatchRec()) == 1 << D0ToPiK) {
Expand All @@ -148,11 +148,11 @@ struct TaskD0MC {
// MC gen.
//Printf("MC Particles: %d", particlesMC.size());
for (auto& particle : particlesMC) {
if (cutEtaCandMax >= 0. && std::abs(particle.eta()) > cutEtaCandMax) {
//Printf("MC Gen.: eta rejection: %g", particle.eta());
continue;
}
if (std::abs(particle.flagMCMatchGen()) == 1 << D0ToPiK) {
if (cutYCandMax >= 0. && std::abs(RecoDecay::Y(array{particle.px(), particle.py(), particle.pz()}, RecoDecay::getMassPDG(particle.pdgCode()))) > cutYCandMax) {
//Printf("MC Gen.: Y rejection: %g", RecoDecay::Y(array{particle.px(), particle.py(), particle.pz()}, RecoDecay::getMassPDG(particle.pdgCode())));
continue;
}
registry.fill(HIST("hPtGen"), particle.pt());
registry.fill(HIST("hEtaGen"), particle.eta());
}
Expand Down
31 changes: 19 additions & 12 deletions Tasks/PWGHF/taskLc.cxx
Expand Up @@ -55,7 +55,7 @@ struct TaskLc {
{"hdca2", "3-prong candidates;prong DCA to sec. vertex (cm);entries", {HistType::kTH1F, {{100, 0., 1.}}}}}};

Configurable<int> d_selectionFlagLc{"d_selectionFlagLc", 1, "Selection Flag for Lc"};
Configurable<double> cutEtaCandMax{"cutEtaCandMax", -1., "max. cand. pseudorapidity"};
Configurable<double> cutYCandMax{"cutYCandMax", -1., "max. cand. rapidity"};

Filter filterSelectCandidates = (aod::hf_selcandidate_lc::isSelLcpKpi >= d_selectionFlagLc || aod::hf_selcandidate_lc::isSelLcpiKp >= d_selectionFlagLc);

Expand All @@ -66,8 +66,8 @@ struct TaskLc {
if (!(candidate.hfflag() & 1 << LcToPKPi)) {
continue;
}
if (cutEtaCandMax >= 0. && std::abs(candidate.eta()) > cutEtaCandMax) {
//Printf("Candidate: eta rejection: %g", candidate.eta());
if (cutYCandMax >= 0. && std::abs(YLc(candidate)) > cutYCandMax) {
//Printf("Candidate: Y rejection: %g", YLc(candidate));
continue;
}
if (candidate.isSelLcpKpi() >= d_selectionFlagLc) {
Expand Down Expand Up @@ -105,6 +105,7 @@ struct TaskLcMC {
{{"hPtRecSig", "3-prong candidates (rec. matched);#it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0., 10.}}}},
{"hPtRecBg", "3-prong candidates (rec. unmatched);#it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0., 10.}}}},
{"hPtGen", "3-prong candidates (gen. matched);#it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0., 10.}}}},
{"hPtGenSig", "3-prong candidates (rec. matched);#it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0., 10.}}}},
{"hCPARecSig", "3-prong candidates (rec. matched);cosine of pointing angle;entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}},
{"hCPARecBg", "3-prong candidates (rec. unmatched);cosine of pointing angle;entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}},
{"hEtaRecSig", "3-prong candidates (rec. matched);#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}},
Expand All @@ -113,25 +114,31 @@ struct TaskLcMC {

Configurable<int> d_selectionFlagLc{"d_selectionFlagLc", 1, "Selection Flag for Lc"};
Configurable<int> d_selectionFlagLcbar{"d_selectionFlagLcbar", 1, "Selection Flag for Lcbar"};
Configurable<double> cutEtaCandMax{"cutEtaCandMax", -1., "max. cand. pseudorapidity"};
Configurable<double> cutYCandMax{"cutYCandMax", -1., "max. cand. rapidity"};

Filter filterSelectCandidates = (aod::hf_selcandidate_lc::isSelLcpKpi >= d_selectionFlagLc || aod::hf_selcandidate_lc::isSelLcpiKp >= d_selectionFlagLc);

void process(soa::Filtered<soa::Join<aod::HfCandProng3, aod::HFSelLcCandidate, aod::HfCandProng3MCRec>> const& candidates,
soa::Join<aod::McParticles, aod::HfCandProng3MCGen> const& particlesMC)
soa::Join<aod::McParticles, aod::HfCandProng3MCGen> const& particlesMC, aod::BigTracksMC const& tracks)
{
// MC rec.
//Printf("MC Candidates: %d", candidates.size());

for (auto& candidate : candidates) {
if (!(candidate.hfflag() & 1 << LcToPKPi)) {
continue;
}
if (cutEtaCandMax >= 0. && std::abs(candidate.eta()) > cutEtaCandMax) {
//Printf("MC Rec.: eta rejection: %g", candidate.eta());
if (cutYCandMax >= 0. && std::abs(YLc(candidate)) > cutYCandMax) {
//Printf("MC Rec.: Y rejection: %g", YLc(candidate));
continue;
}

if (std::abs(candidate.flagMCMatchRec()) == 1 << LcToPKPi) {
registry.fill(HIST("hPtRecSig"), candidate.pt());
// Get the corresponding MC particle.
auto indexMother = RecoDecay::getMother(particlesMC, candidate.index0_as<aod::BigTracksMC>().label_as<soa::Join<aod::McParticles, aod::HfCandProng3MCGen>>(), 4122, true);
auto particleMother = particlesMC.iteratorAt(indexMother);
registry.fill(HIST("hPtGenSig"), particleMother.pt()); //gen. level pT
registry.fill(HIST("hPtRecSig"), candidate.pt()); //rec. level pT
registry.fill(HIST("hCPARecSig"), candidate.cpa());
registry.fill(HIST("hEtaRecSig"), candidate.eta());
} else {
Expand All @@ -143,11 +150,11 @@ struct TaskLcMC {
// MC gen.
//Printf("MC Particles: %d", particlesMC.size());
for (auto& particle : particlesMC) {
if (cutEtaCandMax >= 0. && std::abs(particle.eta()) > cutEtaCandMax) {
//Printf("MC Gen.: eta rejection: %g", particle.eta());
continue;
}
if (std::abs(particle.flagMCMatchGen()) == 1 << LcToPKPi) {
if (cutYCandMax >= 0. && std::abs(RecoDecay::Y(array{particle.px(), particle.py(), particle.pz()}, RecoDecay::getMassPDG(particle.pdgCode()))) > cutYCandMax) {
//Printf("MC Gen.: Y rejection: %g", RecoDecay::Y(array{particle.px(), particle.py(), particle.pz()}, RecoDecay::getMassPDG(particle.pdgCode())));
continue;
}
registry.fill(HIST("hPtGen"), particle.pt());
registry.fill(HIST("hEtaGen"), particle.eta());
}
Expand Down

0 comments on commit 60443be

Please sign in to comment.