diff --git a/DPG/Tasks/AOTTrack/qaEfficiency.cxx b/DPG/Tasks/AOTTrack/qaEfficiency.cxx index 850f8e38e4a..20abc845190 100644 --- a/DPG/Tasks/AOTTrack/qaEfficiency.cxx +++ b/DPG/Tasks/AOTTrack/qaEfficiency.cxx @@ -201,6 +201,7 @@ struct QaEfficiency { Configurable numSameCollision{"numSameCollision", false, "Flag to ask that the numerator is in the same collision as the denominator"}; Configurable noFakesHits{"noFakesHits", false, "Flag to reject tracks that have fake hits"}; Configurable skipEventsWithoutTPCTracks{"skipEventsWithoutTPCTracks", false, "Flag to reject events that have no tracks reconstructed in the TPC"}; + Configurable skipParticlesFromBackgroundEvents{"skipParticlesFromBackgroundEvents", false, "Flag to reject particles from background events (for embedded MC)"}; Configurable maxProdRadius{"maxProdRadius", 9999.f, "Maximum production radius of the particle under study"}; Configurable nsigmaTPCDe{"nsigmaTPCDe", 3.f, "Value of the Nsigma TPC cut for deuterons PID"}; // Charge selection @@ -1548,6 +1549,9 @@ struct QaEfficiency { histos.fill(countingHisto, trkCutIdxHasMcPart); // Tracks with particles (i.e. no fakes) } const auto mcParticle = track.mcParticle(); + if (skipParticlesFromBackgroundEvents && mcParticle.fromBackgroundEvent()) { + return false; + } if (!isInAcceptance(mcParticle, countingHisto, trkCutIdxHasMcPart)) { // 3: pt cut 4: eta cut 5: phi cut 6: y cut return false; @@ -1913,6 +1917,9 @@ struct QaEfficiency { /// only to fill denominator of ITS-TPC matched primary tracks only in MC events with at least 1 reco. vtx for (const auto& particle : groupedMcParticles) { // Particle loop + if (skipParticlesFromBackgroundEvents && particle.fromBackgroundEvent()) { + continue; + } /// require generated particle in acceptance if (!isInAcceptance(particle, nullptr)) { @@ -1968,6 +1975,9 @@ struct QaEfficiency { // Loop on particles to fill the denominator float dNdEta = 0; // Multiplicity for (const auto& mcParticle : groupedMcParticles) { + if (skipParticlesFromBackgroundEvents && mcParticle.fromBackgroundEvent()) { + continue; + } if (TMath::Abs(mcParticle.eta()) <= 2.f && !mcParticle.has_daughters()) { dNdEta += 1.f; }