Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions PWGEM/PhotonMeson/TableProducer/bcWiseClusterSkimmer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
Configurable<bool> cfgRequireGoodRCTQuality{"cfgRequireGoodRCTQuality", false, "Only store BCs with good quality of T0 and EMC in RCT"};
Configurable<bool> cfgStoreMu{"cfgStoreMu", false, "Calculate and store mu (probablity of a TVX collision in the BC) per BC. Otherwise fill with 0"};
Configurable<bool> cfgStoreTime{"cfgStoreTime", false, "Calculate and store time since the start of fill. Otherwise fill with 0"};
Configurable<bool> cfgOnlyCheckFirstTrueContributor{"cfgOnlyCheckFirstTrueContributor", false, "When storing MC cluster info only count as true if the leading contributor is from pi0/eta"};
ConfigurableAxis cfgMultiplicityBinning{"cfgMultiplicityBinning", {1000, 0, 10000}, "Binning used for the binning of the number of particles in the event"};

aod::rctsel::RCTFlagsChecker isFT0EMCGoodRCTChecker{aod::rctsel::kFT0Bad, aod::rctsel::kEMCBad};
Expand Down Expand Up @@ -166,8 +167,8 @@
for (const auto& cluster : clusters) {
float clusterInducerEnergy = 0.;
int32_t mesonMCIndex = -1;
if (cluster.amplitudeA().size() > 0) {
int clusterInducerId = cluster.mcParticleIds()[0];
for (size_t i = 0; i < cluster.amplitudeA().size(); i++) {
int clusterInducerId = cluster.mcParticleIds()[i];
auto clusterInducer = mcParticles.iteratorAt(clusterInducerId);
clusterInducerEnergy = clusterInducer.e();
int daughterId = aod::pwgem::photonmeson::utils::mcutil::FindMotherInChain(clusterInducer, mcParticles, std::vector<int>{111, 221});
Expand All @@ -176,15 +177,19 @@
if (mcParticles.iteratorAt(mesonMCIndex).pt() < cfgMinPtGen)
mesonMCIndex = -1;
}
if (mesonMCIndex != -1)
break;
if (cfgOnlyCheckFirstTrueContributor)
break;
}
bool isEta = false;
if (mesonMCIndex >= 0) {
if (mcParticles.iteratorAt(mesonMCIndex).pdgCode() == 111) {

Check failure on line 187 in PWGEM/PhotonMeson/TableProducer/bcWiseClusterSkimmer.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.

Check failure on line 187 in PWGEM/PhotonMeson/TableProducer/bcWiseClusterSkimmer.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
if (fMapPi0Index.find(mesonMCIndex) != fMapPi0Index.end()) // Some pi0s might not be found (not gg decay or too large y)
mesonMCIndex = fMapPi0Index[mesonMCIndex]; // If pi0 was stored in table, change index from the MC index to the pi0 index from this task
else // If pi0 was not stored, treat photon as if not from pi0
mesonMCIndex = -1;
} else if (mcParticles.iteratorAt(mesonMCIndex).pdgCode() == 221) {

Check failure on line 192 in PWGEM/PhotonMeson/TableProducer/bcWiseClusterSkimmer.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.

Check failure on line 192 in PWGEM/PhotonMeson/TableProducer/bcWiseClusterSkimmer.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
isEta = true;
if (fMapEtaIndex.find(mesonMCIndex) != fMapEtaIndex.end()) // Some etas might not be found (not gg decay or too large y)
mesonMCIndex = fMapEtaIndex[mesonMCIndex]; // If eta was stored in table, change index from the MC index to the eta index from this task
Expand Down Expand Up @@ -297,10 +302,10 @@
bool isGammaGammaDecay(TMCParticle mcParticle, TMCParticles mcParticles)
{
auto daughtersIds = mcParticle.daughtersIds();
if (daughtersIds.size() != 2)

Check failure on line 305 in PWGEM/PhotonMeson/TableProducer/bcWiseClusterSkimmer.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
return false;
for (const auto& daughterId : daughtersIds) {
if (mcParticles.iteratorAt(daughterId).pdgCode() != 22)

Check failure on line 308 in PWGEM/PhotonMeson/TableProducer/bcWiseClusterSkimmer.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.

Check failure on line 308 in PWGEM/PhotonMeson/TableProducer/bcWiseClusterSkimmer.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
return false;
}
return true;
Expand All @@ -313,7 +318,7 @@
if (daughtersIds.size() != 2)
return false;
for (const auto& daughterId : daughtersIds) {
if (mcParticles.iteratorAt(daughterId).pdgCode() != 22)

Check failure on line 321 in PWGEM/PhotonMeson/TableProducer/bcWiseClusterSkimmer.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
return false;
int iCellID = -1;
try {
Expand Down Expand Up @@ -375,10 +380,10 @@
bool isPrimary = mcParticle.isPhysicalPrimary() || mcParticle.producedByGenerator();
bool isFromWD = (aod::pwgem::photonmeson::utils::mcutil::IsFromWD(mcCollision, mcParticle, mcParticles)) > 0;

if (mcParticle.pdgCode() == 111) {

Check failure on line 383 in PWGEM/PhotonMeson/TableProducer/bcWiseClusterSkimmer.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
mcpi0Table(bcTable.lastIndex(), convertForStorage<uint16_t>(mcParticle.pt(), kpT), isAccepted(mcParticle, mcParticles), isPrimary, isFromWD);
fMapPi0Index[mcParticle.globalIndex()] = static_cast<int32_t>(mcpi0Table.lastIndex());
} else if (mcParticle.pdgCode() == 221) {

Check failure on line 386 in PWGEM/PhotonMeson/TableProducer/bcWiseClusterSkimmer.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
mcetaTable(bcTable.lastIndex(), convertForStorage<uint16_t>(mcParticle.pt(), kpT), isAccepted(mcParticle, mcParticles), isPrimary, isFromWD);
fMapEtaIndex[mcParticle.globalIndex()] = static_cast<int32_t>(mcetaTable.lastIndex());
}
Expand Down
Loading