Skip to content

Commit b6dd892

Browse files
[PWGLF] now checking mcprocess to flag primaries and secondaries (#13878)
1 parent a070377 commit b6dd892

File tree

3 files changed

+29
-17
lines changed

3 files changed

+29
-17
lines changed

PWGLF/DataModel/LFSlimNucleiTables.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ DECLARE_SOA_COLUMN(PDGcode, pdgCode, int);
5454
DECLARE_SOA_COLUMN(MotherPDGcode, MotherpdgCode, int);
5555
DECLARE_SOA_COLUMN(MotherDecRad, motherDecRad, float);
5656
DECLARE_SOA_COLUMN(AbsoDecL, absoDecL, float);
57+
DECLARE_SOA_COLUMN(McProcess, mcProcess, uint64_t);
5758

5859
} // namespace NucleiTableNS
5960

@@ -197,6 +198,7 @@ DECLARE_SOA_TABLE(NucleiTableRed, "AOD", "NUCLEITABLERED",
197198
NucleiTableNS::DCAxy,
198199
NucleiTableNS::DCAz,
199200
NucleiTableNS::Flags,
201+
NucleiTableNS::McProcess,
200202
NucleiTableNS::PDGcode,
201203
NucleiTableNS::MotherPDGcode);
202204

PWGLF/TableProducer/QC/nucleiQC.cxx

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
#include "ReconstructionDataFormats/Track.h"
5252

5353
#include "Math/Vector4D.h"
54+
#include "TMCProcess.h"
5455
#include "TRandom3.h"
5556

5657
#include <algorithm>
@@ -222,27 +223,31 @@ struct nucleiQC {
222223
void fillNucleusFlagsPdgsMc(const Tparticle& particle, nuclei::SlimCandidate& candidate)
223224
{
224225
candidate.pdgCode = particle.pdgCode();
226+
candidate.mcProcess = particle.getProcess();
225227

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()) {
242229
for (const auto& motherparticle : particle.template mothers_as<aod::McParticles>()) {
243230
candidate.motherPdgCode = motherparticle.pdgCode();
244231
}
232+
}
245233

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;
246251
} else {
247252
candidate.flags |= nuclei::Flags::kIsSecondaryFromMaterial;
248253
}
@@ -329,7 +334,8 @@ struct nucleiQC {
329334
.ptGenerated = 0.f, // to be filled for mc
330335
.etaGenerated = 0.f,
331336
.phiGenerated = 0.f,
332-
.centrality = nuclei::getCentrality(collision, cfgCentralityEstimator)};
337+
.centrality = nuclei::getCentrality(collision, cfgCentralityEstimator),
338+
.mcProcess = TMCProcess::kPNoProcess};
333339

334340
fillDcaInformation(collision, track, candidate);
335341
fillNucleusFlagsPdgs(iSpecies, collision, track, candidate);
@@ -486,6 +492,7 @@ struct nucleiQC {
486492
candidate.DCAxy,
487493
candidate.DCAz,
488494
candidate.flags,
495+
candidate.mcProcess,
489496
candidate.pdgCode,
490497
candidate.motherPdgCode);
491498
}

PWGLF/Utils/nucleiUtils.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
#include "Framework/HistogramRegistry.h"
2525
#include "Framework/HistogramSpec.h"
2626

27+
#include "TMCProcess.h"
28+
2729
#include <algorithm>
2830
#include <string>
2931
#include <vector>
@@ -103,6 +105,7 @@ struct SlimCandidate {
103105
float etaGenerated = -999.f;
104106
float phiGenerated = -999.f;
105107
float centrality = -1.f;
108+
uint64_t mcProcess = TMCProcess::kPNoProcess;
106109
};
107110

108111
enum Species {

0 commit comments

Comments
 (0)