|
17 | 17 | /// |
18 | 18 |
|
19 | 19 | // O2 includes |
| 20 | +#include <memory> |
| 21 | +#include <vector> |
| 22 | + |
20 | 23 | #include "Framework/AnalysisTask.h" |
21 | 24 | #include "Framework/runDataProcessing.h" |
22 | 25 | #include "Framework/HistogramRegistry.h" |
@@ -74,6 +77,7 @@ static constexpr int PDGs[nParticles] = {11, 13, 211, 321, 2212, 1000010020, 100 |
74 | 77 | -11, -13, -211, -321, -2212, -1000010020, -1000010030, -1000020030, -1000020040}; |
75 | 78 |
|
76 | 79 | // Histograms |
| 80 | +std::shared_ptr<TH1> hPtmotherGenerated; // histogram to store pT of Xi and Lambda |
77 | 81 |
|
78 | 82 | // Pt |
79 | 83 | std::array<std::shared_ptr<TH1>, nParticles> hPtIts; |
@@ -332,6 +336,7 @@ struct QaEfficiency { |
332 | 336 | phiMin, phiMax, |
333 | 337 | yMin, yMax); |
334 | 338 | const int histogramIndex = id + pdgSign * nSpecies; |
| 339 | + hPtmotherGenerated = histos.add<TH1>("MC/mother/pt/generated", "Generated pT of mother Lambda or Xi", kTH1D, {axisPt}); |
335 | 340 |
|
336 | 341 | // Pt |
337 | 342 | hPtIts[histogramIndex] = histos.add<TH1>(Form("MC/pdg%i/pt/its", PDGs[histogramIndex]), "ITS tracks " + tagPt, kTH1D, {axisPt}); |
@@ -1242,19 +1247,20 @@ struct QaEfficiency { |
1242 | 1247 | } |
1243 | 1248 | } else { |
1244 | 1249 | if (mcParticle.getProcess() == 4) { // Particle decay |
1245 | | - // Checking mothers |
1246 | 1250 | bool motherIsAccepted = true; |
| 1251 | + // Check for mothers if needed |
1247 | 1252 | if (checkForMothers.value && mothersPDGs.value.size() > 0 && mcParticle.has_mothers()) { |
1248 | 1253 | motherIsAccepted = false; |
1249 | 1254 | auto mothers = mcParticle.mothers_as<o2::aod::McParticles>(); |
| 1255 | + // Loop over mother particles |
1250 | 1256 | for (const auto& mother : mothers) { |
1251 | 1257 | for (const auto& pdgToCheck : mothersPDGs.value) { |
1252 | 1258 | if (mother.pdgCode() == pdgToCheck) { |
1253 | | - motherIsAccepted = true; |
| 1259 | + motherIsAccepted = true; // Mother matches the list of specified PDGs |
1254 | 1260 | break; |
1255 | 1261 | } |
1256 | 1262 | if (motherIsAccepted) { |
1257 | | - break; |
| 1263 | + hPtmotherGenerated->Fill(mother.pt()); // Fill generated pT for Lambda |
1258 | 1264 | } |
1259 | 1265 | } |
1260 | 1266 | } |
|
0 commit comments