|
14 | 14 | /// \author Laura Serksnyte, TU München, laura.serksnyte@tum.de |
15 | 15 |
|
16 | 16 | #include <CCDB/BasicCCDBManager.h> |
| 17 | +#include <fairlogger/Logger.h> |
17 | 18 | #include "Common/Core/trackUtilities.h" |
18 | 19 | #include "Common/DataModel/EventSelection.h" |
19 | 20 | #include "Common/DataModel/Multiplicity.h" |
@@ -327,27 +328,37 @@ struct femtoDreamProducerTask { |
327 | 328 | auto pdgCode = particleMC.pdgCode(); |
328 | 329 | int particleOrigin = 99; |
329 | 330 | int pdgCodeMother = -1; |
330 | | - // get list of mothers |
331 | | - // could be empty (for example in case of injected light nuclei) |
| 331 | + // get list of mothers, but it could be empty (for example in case of injected light nuclei) |
332 | 332 | auto motherparticlesMC = particleMC.template mothers_as<aod::McParticles>(); |
333 | 333 | // check pdg code |
| 334 | + // if this fails, the particle is a fake |
334 | 335 | if (abs(pdgCode) == abs(ConfTrkPDGCode.value)) { |
| 336 | + // check first if particle is from pile up |
| 337 | + // check if the collision associated with the particle is the same as the analyzed collision by checking their Ids |
335 | 338 | if ((col.has_mcCollision() && (particleMC.mcCollisionId() != col.mcCollisionId())) || !col.has_mcCollision()) { |
336 | 339 | particleOrigin = aod::femtodreamMCparticle::ParticleOriginMCTruth::kWrongCollision; |
| 340 | + // check if particle is primary |
337 | 341 | } else if (particleMC.isPhysicalPrimary()) { |
338 | 342 | particleOrigin = aod::femtodreamMCparticle::ParticleOriginMCTruth::kPrimary; |
339 | | - } else if (particleMC.getGenStatusCode() == -1) { |
340 | | - particleOrigin = aod::femtodreamMCparticle::ParticleOriginMCTruth::kMaterial; |
341 | | - } else if (!motherparticlesMC.empty()) { |
342 | | - // get direct mother of the particle |
| 343 | + // check if particle is secondary |
| 344 | + // particle is from a decay -> getProcess() == 4 |
| 345 | + // particle is generated during transport -> getGenStatusCode() == -1 |
| 346 | + // list of mothers is not empty |
| 347 | + } else if (particleMC.getProcess() == 4 && particleMC.getGenStatusCode() == -1 && !motherparticlesMC.empty()) { |
| 348 | + // get direct mother |
343 | 349 | auto motherparticleMC = motherparticlesMC.front(); |
344 | 350 | pdgCodeMother = motherparticleMC.pdgCode(); |
345 | | - if (motherparticleMC.isPhysicalPrimary() && particleMC.getProcess() == 4) { |
346 | | - particleOrigin = checkDaughterType(fdparttype, motherparticleMC.pdgCode()); |
347 | | - } |
| 351 | + particleOrigin = checkDaughterType(fdparttype, motherparticleMC.pdgCode()); |
| 352 | + // check if particle is material |
| 353 | + // particle is from inelastic hadronic interaction -> getProcess() == 23 |
| 354 | + // particle is generated during transport -> getGenStatusCode() == -1 |
| 355 | + } else if (particleMC.getProcess() == 23 && particleMC.getGenStatusCode() == -1) { |
| 356 | + particleOrigin = aod::femtodreamMCparticle::ParticleOriginMCTruth::kMaterial; |
| 357 | + // cross check to see if we missed a case |
348 | 358 | } else { |
349 | 359 | particleOrigin = aod::femtodreamMCparticle::ParticleOriginMCTruth::kElse; |
350 | 360 | } |
| 361 | + // if pdg code is wrong, particle is fake |
351 | 362 | } else { |
352 | 363 | particleOrigin = aod::femtodreamMCparticle::ParticleOriginMCTruth::kFake; |
353 | 364 | } |
|
0 commit comments