|
51 | 51 | #include "ReconstructionDataFormats/Track.h" |
52 | 52 |
|
53 | 53 | #include "Math/Vector4D.h" |
| 54 | +#include "TMCProcess.h" |
54 | 55 | #include "TRandom3.h" |
55 | 56 |
|
56 | 57 | #include <algorithm> |
@@ -222,27 +223,31 @@ struct nucleiQC { |
222 | 223 | void fillNucleusFlagsPdgsMc(const Tparticle& particle, nuclei::SlimCandidate& candidate) |
223 | 224 | { |
224 | 225 | candidate.pdgCode = particle.pdgCode(); |
| 226 | + candidate.mcProcess = particle.getProcess(); |
225 | 227 |
|
226 | | - if (particle.isPhysicalPrimary()) { |
227 | | - candidate.flags |= nuclei::Flags::kIsPhysicalPrimary; |
228 | | - |
229 | | - // heavy flavour mother |
230 | | - // if (particle.has_mothers()) { |
231 | | - // for (const auto& motherparticle : particle.mothers_as<aod::McParticles>()) { |
232 | | - // if (std::find(nuclei::hfMothCodes.begin(), nuclei::hfMothCodes.end(), std::abs(motherparticle.pdgCode())) != nuclei::hfMothCodes.end()) { |
233 | | - // flags |= kIsSecondaryFromWeakDecay; |
234 | | - // motherPdgCode = motherparticle.pdgCode(); |
235 | | - // break; |
236 | | - // } |
237 | | - // } |
238 | | - //} |
239 | | - |
240 | | - } else if (particle.has_mothers()) { |
241 | | - candidate.flags |= nuclei::Flags::kIsSecondaryFromWeakDecay; |
| 228 | + if (particle.has_mothers()) { |
242 | 229 | for (const auto& motherparticle : particle.template mothers_as<aod::McParticles>()) { |
243 | 230 | candidate.motherPdgCode = motherparticle.pdgCode(); |
244 | 231 | } |
| 232 | + } |
245 | 233 |
|
| 234 | + if (particle.isPhysicalPrimary()) { |
| 235 | + candidate.flags |= nuclei::Flags::kIsPhysicalPrimary; |
| 236 | + |
| 237 | + ///< heavy flavour mother |
| 238 | + /*if (particle.has_mothers()) { |
| 239 | + for (const auto& motherparticle : particle.mothers_as<aod::McParticles>()) { |
| 240 | + if (std::find(nuclei::hfMothCodes.begin(), nuclei::hfMothCodes.end(), std::abs(motherparticle.pdgCode())) != nuclei::hfMothCodes.end()) { |
| 241 | + flags |= kIsSecondaryFromWeakDecay; |
| 242 | + motherPdgCode = motherparticle.pdgCode(); |
| 243 | + break; |
| 244 | + } |
| 245 | + } |
| 246 | + }*/ |
| 247 | + |
| 248 | + } else if (particle.getProcess() == TMCProcess::kPDecay) { |
| 249 | + ///< assuming that strong decays are included in the previous step |
| 250 | + candidate.flags |= nuclei::Flags::kIsSecondaryFromWeakDecay; |
246 | 251 | } else { |
247 | 252 | candidate.flags |= nuclei::Flags::kIsSecondaryFromMaterial; |
248 | 253 | } |
@@ -329,7 +334,8 @@ struct nucleiQC { |
329 | 334 | .ptGenerated = 0.f, // to be filled for mc |
330 | 335 | .etaGenerated = 0.f, |
331 | 336 | .phiGenerated = 0.f, |
332 | | - .centrality = nuclei::getCentrality(collision, cfgCentralityEstimator)}; |
| 337 | + .centrality = nuclei::getCentrality(collision, cfgCentralityEstimator), |
| 338 | + .mcProcess = TMCProcess::kPNoProcess}; |
333 | 339 |
|
334 | 340 | fillDcaInformation(collision, track, candidate); |
335 | 341 | fillNucleusFlagsPdgs(iSpecies, collision, track, candidate); |
@@ -486,6 +492,7 @@ struct nucleiQC { |
486 | 492 | candidate.DCAxy, |
487 | 493 | candidate.DCAz, |
488 | 494 | candidate.flags, |
| 495 | + candidate.mcProcess, |
489 | 496 | candidate.pdgCode, |
490 | 497 | candidate.motherPdgCode); |
491 | 498 | } |
|
0 commit comments