Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions DPG/Tasks/AOTTrack/qaEfficiency.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ struct QaEfficiency {
Configurable<bool> numSameCollision{"numSameCollision", false, "Flag to ask that the numerator is in the same collision as the denominator"};
Configurable<bool> noFakesHits{"noFakesHits", false, "Flag to reject tracks that have fake hits"};
Configurable<bool> skipEventsWithoutTPCTracks{"skipEventsWithoutTPCTracks", false, "Flag to reject events that have no tracks reconstructed in the TPC"};
Configurable<bool> skipParticlesFromBackgroundEvents{"skipParticlesFromBackgroundEvents", false, "Flag to reject particles from background events (for embedded MC)"};
Configurable<float> maxProdRadius{"maxProdRadius", 9999.f, "Maximum production radius of the particle under study"};
Configurable<float> nsigmaTPCDe{"nsigmaTPCDe", 3.f, "Value of the Nsigma TPC cut for deuterons PID"};
// Charge selection
Expand Down Expand Up @@ -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<true, doFillHisto>(mcParticle, countingHisto, trkCutIdxHasMcPart)) {
// 3: pt cut 4: eta cut 5: phi cut 6: y cut
return false;
Expand Down Expand Up @@ -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<true, false>(particle, nullptr)) {
Expand Down Expand Up @@ -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;
}
Expand Down
Loading