Skip to content

Commit aa20839

Browse files
committed
Add flag to reject particles from background events
1 parent 0a9a63b commit aa20839

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

DPG/Tasks/AOTTrack/qaEfficiency.cxx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ struct QaEfficiency {
201201
Configurable<bool> numSameCollision{"numSameCollision", false, "Flag to ask that the numerator is in the same collision as the denominator"};
202202
Configurable<bool> noFakesHits{"noFakesHits", false, "Flag to reject tracks that have fake hits"};
203203
Configurable<bool> skipEventsWithoutTPCTracks{"skipEventsWithoutTPCTracks", false, "Flag to reject events that have no tracks reconstructed in the TPC"};
204+
Configurable<bool> skipParticlesFromBackgroundEvents{"skipParticlesFromBackgroundEvents", false, "Flag to reject particles from background events (for embedded MC)"};
204205
Configurable<float> maxProdRadius{"maxProdRadius", 9999.f, "Maximum production radius of the particle under study"};
205206
Configurable<float> nsigmaTPCDe{"nsigmaTPCDe", 3.f, "Value of the Nsigma TPC cut for deuterons PID"};
206207
// Charge selection
@@ -1548,6 +1549,9 @@ struct QaEfficiency {
15481549
histos.fill(countingHisto, trkCutIdxHasMcPart); // Tracks with particles (i.e. no fakes)
15491550
}
15501551
const auto mcParticle = track.mcParticle();
1552+
if (skipParticlesFromBackgroundEvents && mcParticle.fromBackgroundEvent()) {
1553+
return false;
1554+
}
15511555
if (!isInAcceptance<true, doFillHisto>(mcParticle, countingHisto, trkCutIdxHasMcPart)) {
15521556
// 3: pt cut 4: eta cut 5: phi cut 6: y cut
15531557
return false;
@@ -1913,6 +1917,9 @@ struct QaEfficiency {
19131917

19141918
/// only to fill denominator of ITS-TPC matched primary tracks only in MC events with at least 1 reco. vtx
19151919
for (const auto& particle : groupedMcParticles) { // Particle loop
1920+
if (skipParticlesFromBackgroundEvents && particle.fromBackgroundEvent()) {
1921+
continue;
1922+
}
19161923

19171924
/// require generated particle in acceptance
19181925
if (!isInAcceptance<true, false>(particle, nullptr)) {
@@ -1968,6 +1975,9 @@ struct QaEfficiency {
19681975
// Loop on particles to fill the denominator
19691976
float dNdEta = 0; // Multiplicity
19701977
for (const auto& mcParticle : groupedMcParticles) {
1978+
if (skipParticlesFromBackgroundEvents && mcParticle.fromBackgroundEvent()) {
1979+
continue;
1980+
}
19711981
if (TMath::Abs(mcParticle.eta()) <= 2.f && !mcParticle.has_daughters()) {
19721982
dNdEta += 1.f;
19731983
}

0 commit comments

Comments
 (0)