Skip to content

Commit e8094e7

Browse files
committed
Add possibility to reject particles from background event
1 parent f5edd90 commit e8094e7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

PWGHF/Tasks/taskMcGenPtRapShapes.cxx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ struct HfTaskMcGenPtRapShapes {
5656
ConfigurableAxis axisPtBeauty{"axisPtBeauty", {3000, 0.f, 300.f}, "Binning for the pT axis of beauty hadrons"};
5757
ConfigurableAxis axisRapCharm{"axisRapCharm", {100, -1.f, 1.f}, "Binning for the y axis of charm hadrons"};
5858
ConfigurableAxis axisRapBeauty{"axisRapBeauty", {100, -1.f, 1.f}, "Binning for the y axis of beauty hadrons"};
59+
Configurable<bool> rejectBackground{"rejectBackground", false, "Reject particles from background events"};
5960

6061
std::array<std::shared_ptr<TH2>, nCharmHadrons> histRapVsPtCharmPrompt{};
6162
std::array<std::shared_ptr<TH2>, nCharmHadrons> histRapVsPtCharmNonPrompt{};
@@ -81,6 +82,9 @@ struct HfTaskMcGenPtRapShapes {
8182
void process(aod::McParticles const& mcParticles)
8283
{
8384
for (auto const& mcParticle : mcParticles) {
85+
if (rejectBackground and mcParticle.fromBackgroundEvent()) {
86+
continue;
87+
}
8488
int const absPdgCode = std::abs(mcParticle.pdgCode());
8589
float const pt = mcParticle.pt();
8690
float const rap = mcParticle.y();

0 commit comments

Comments
 (0)