Skip to content

Commit

Permalink
PWGCF: CF filter process function for MCGen (AliceO2Group#7118)
Browse files Browse the repository at this point in the history
* process function for the MCGen
  • Loading branch information
jaelpark authored Aug 2, 2024
1 parent 1a2c6e7 commit 54cb25d
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions PWGCF/TableProducer/filterCorrelations.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,25 @@ struct FilterCF {
delete[] mcParticleLabels;
}
PROCESS_SWITCH(FilterCF, processMC, "Process MC", false);

void processMCGen(aod::McCollisions::iterator const& mcCollision, aod::McParticles const& particles, aod::BCsWithTimestamps const&)
{
float multiplicity = 0.0f;
for (auto& particle : particles) {
if (!particle.isPhysicalPrimary() || std::abs(particle.eta()) > cfgCutMCEta || particle.pt() < cfgCutMCPt)
continue;
int8_t sign = 0;
if (TParticlePDG* pdgparticle = pdg->GetParticle(particle.pdgCode()))
if ((sign = pdgparticle->Charge()) != 0)
multiplicity += 1.0f;
outputMcParticles(outputMcCollisions.lastIndex() + 1, truncateFloatFraction(particle.pt(), FLOAT_PRECISION),
truncateFloatFraction(particle.eta(), FLOAT_PRECISION),
truncateFloatFraction(particle.phi(), FLOAT_PRECISION),
sign, particle.pdgCode(), particle.flags());
}
outputMcCollisions(mcCollision.posZ(), multiplicity);
}
PROCESS_SWITCH(FilterCF, processMCGen, "Process MCGen", false);
};

struct MultiplicitySelector {
Expand Down

0 comments on commit 54cb25d

Please sign in to comment.