From b0123f9a5cbc3b711b720c01a7c6458f4744d7ce Mon Sep 17 00:00:00 2001 From: Mattia Faggin Date: Wed, 24 Jun 2026 08:11:15 +0000 Subject: [PATCH] Add flag to select events based on subGenId for HF MC. --- DPG/Tasks/AOTTrack/qaImpPar.cxx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/DPG/Tasks/AOTTrack/qaImpPar.cxx b/DPG/Tasks/AOTTrack/qaImpPar.cxx index 7e758dd7ec2..28d1db77bd9 100644 --- a/DPG/Tasks/AOTTrack/qaImpPar.cxx +++ b/DPG/Tasks/AOTTrack/qaImpPar.cxx @@ -116,6 +116,7 @@ struct QaImpactPar { Configurable nCustomMinITShits{"n_customMinITShits", 0, "Minimum number of layers crossed by a track among those in \"customITShitmap\""}; Configurable customForceITSTPCmatching{"custom_forceITSTPCmatching", false, "Consider or not only ITS-TPC macthed tracks when using custom ITS hitmap"}; Configurable downsamplingFraction{"downsamplingFraction", 1.1, "Fraction of tracks to be used to fill the output objects"}; + Configurable eventGeneratorHF{"eventGeneratorHF", -1, "If positive, enable event selection using subGeneratorId information (HF). The value indicates which events to keep (0 = MB, 4 = charm triggered, 5 = beauty triggered)"}; /// Custom cut selection objects TrackSelection selector_ITShitmap; @@ -201,6 +202,12 @@ struct QaImpactPar { const o2::aod::McCollisions&, o2::aod::BCsWithTimestamps const&) { + /// SubgeneratorID check for HF MC + /// Useful to select MB gap events in HF-dedicated MC productions + if (eventGeneratorHF >= 0 && collision.mcCollision().getSubGeneratorId() != eventGeneratorHF) { + return; + } + /// here call the template processReco function auto bc = collision.bc_as(); processReco(collision, tracksUnfiltered, tracks, tracksIU, mcParticles, bc); @@ -216,6 +223,12 @@ struct QaImpactPar { const o2::aod::McCollisions&, o2::aod::BCsWithTimestamps const&) { + /// SubgeneratorID check for HF MC + /// Useful to select MB gap events in HF-dedicated MC productions + if (eventGeneratorHF >= 0 && collision.mcCollision().getSubGeneratorId() != eventGeneratorHF) { + return; + } + /// here call the template processReco function auto bc = collision.bc_as(); processReco(collision, tracksUnfiltered, tracks, tracksIU, mcParticles, bc);