Skip to content

Commit ab0e9de

Browse files
[DPG] Update qaEfficiency.cxx (AliceO2Group#8673)
1 parent 1efae33 commit ab0e9de

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

DPG/Tasks/AOTTrack/qaEfficiency.cxx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
///
1818

1919
// O2 includes
20+
#include <memory>
21+
#include <vector>
22+
2023
#include "Framework/AnalysisTask.h"
2124
#include "Framework/runDataProcessing.h"
2225
#include "Framework/HistogramRegistry.h"
@@ -74,6 +77,7 @@ static constexpr int PDGs[nParticles] = {11, 13, 211, 321, 2212, 1000010020, 100
7477
-11, -13, -211, -321, -2212, -1000010020, -1000010030, -1000020030, -1000020040};
7578

7679
// Histograms
80+
std::shared_ptr<TH1> hPtmotherGenerated; // histogram to store pT of Xi and Lambda
7781

7882
// Pt
7983
std::array<std::shared_ptr<TH1>, nParticles> hPtIts;
@@ -332,6 +336,7 @@ struct QaEfficiency {
332336
phiMin, phiMax,
333337
yMin, yMax);
334338
const int histogramIndex = id + pdgSign * nSpecies;
339+
hPtmotherGenerated = histos.add<TH1>("MC/mother/pt/generated", "Generated pT of mother Lambda or Xi", kTH1D, {axisPt});
335340

336341
// Pt
337342
hPtIts[histogramIndex] = histos.add<TH1>(Form("MC/pdg%i/pt/its", PDGs[histogramIndex]), "ITS tracks " + tagPt, kTH1D, {axisPt});
@@ -1242,19 +1247,20 @@ struct QaEfficiency {
12421247
}
12431248
} else {
12441249
if (mcParticle.getProcess() == 4) { // Particle decay
1245-
// Checking mothers
12461250
bool motherIsAccepted = true;
1251+
// Check for mothers if needed
12471252
if (checkForMothers.value && mothersPDGs.value.size() > 0 && mcParticle.has_mothers()) {
12481253
motherIsAccepted = false;
12491254
auto mothers = mcParticle.mothers_as<o2::aod::McParticles>();
1255+
// Loop over mother particles
12501256
for (const auto& mother : mothers) {
12511257
for (const auto& pdgToCheck : mothersPDGs.value) {
12521258
if (mother.pdgCode() == pdgToCheck) {
1253-
motherIsAccepted = true;
1259+
motherIsAccepted = true; // Mother matches the list of specified PDGs
12541260
break;
12551261
}
12561262
if (motherIsAccepted) {
1257-
break;
1263+
hPtmotherGenerated->Fill(mother.pt()); // Fill generated pT for Lambda
12581264
}
12591265
}
12601266
}

0 commit comments

Comments
 (0)