Skip to content

Commit 7445991

Browse files
authored
[PWGHF] Add possibility to reject particles from background event (#13583)
1 parent 15210ce commit 7445991

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

PWGHF/Tasks/taskMcGenPtRapShapes.cxx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ constexpr std::array<int, nBeautyHadrons> PdgCodesBeauty = {Pdg::kB0, Pdg::kBPlu
5252

5353
struct HfTaskMcGenPtRapShapes {
5454

55+
Configurable<bool> rejectBackground{"rejectBackground", false, "Reject particles from background events"};
56+
Configurable<float> absRapidityMax{"absRapidityMax", 0.5, "Absolute maximum rapidity"};
5557
ConfigurableAxis axisPtCharm{"axisPtCharm", {1000, 0.f, 100.f}, "Binning for the pT axis of charm hadrons"};
5658
ConfigurableAxis axisPtBeauty{"axisPtBeauty", {3000, 0.f, 300.f}, "Binning for the pT axis of beauty hadrons"};
5759
ConfigurableAxis axisRapCharm{"axisRapCharm", {100, -1.f, 1.f}, "Binning for the y axis of charm hadrons"};
@@ -81,6 +83,9 @@ struct HfTaskMcGenPtRapShapes {
8183
void process(aod::McParticles const& mcParticles)
8284
{
8385
for (auto const& mcParticle : mcParticles) {
86+
if (rejectBackground && mcParticle.fromBackgroundEvent()) {
87+
continue;
88+
}
8489
int const absPdgCode = std::abs(mcParticle.pdgCode());
8590
float const pt = mcParticle.pt();
8691
float const rap = mcParticle.y();
@@ -94,7 +99,7 @@ struct HfTaskMcGenPtRapShapes {
9499
histRapVsPtCharmPrompt[idxCharm]->Fill(pt, rap);
95100
} else if (origin == RecoDecay::OriginType::NonPrompt) {
96101
histRapVsPtCharmNonPrompt[idxCharm]->Fill(pt, rap);
97-
if (std::abs(rap) < 0.5) {
102+
if (std::abs(rap) < absRapidityMax) {
98103
auto bMother = mcParticles.rawIteratorAt(idxBhadMothers[0]);
99104
histPtCharmVsPtBeautyNonPrompt[idxCharm]->Fill(bMother.pt(), pt);
100105
}

0 commit comments

Comments
 (0)