Skip to content

Commit d4e9dae

Browse files
author
Nicolas Strangmann
committed
[PWGEM/PhotonMeson] Expand true definition in BCWisePi0
1 parent 398c722 commit d4e9dae

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

PWGEM/PhotonMeson/TableProducer/bcWiseClusterSkimmer.cxx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ struct bcWiseClusterSkimmer {
7777
Configurable<bool> cfgRequireGoodRCTQuality{"cfgRequireGoodRCTQuality", false, "Only store BCs with good quality of T0 and EMC in RCT"};
7878
Configurable<bool> cfgStoreMu{"cfgStoreMu", false, "Calculate and store mu (probablity of a TVX collision in the BC) per BC. Otherwise fill with 0"};
7979
Configurable<bool> cfgStoreTime{"cfgStoreTime", false, "Calculate and store time since the start of fill. Otherwise fill with 0"};
80+
Configurable<bool> cfgOnlyCheckFirstTrueContributor{"cfgOnlyCheckFirstTrueContributor", false, "When storing MC cluster info only count as true if the leading contributor is from pi0/eta"};
8081
ConfigurableAxis cfgMultiplicityBinning{"cfgMultiplicityBinning", {1000, 0, 10000}, "Binning used for the binning of the number of particles in the event"};
8182

8283
aod::rctsel::RCTFlagsChecker isFT0EMCGoodRCTChecker{aod::rctsel::kFT0Bad, aod::rctsel::kEMCBad};
@@ -166,8 +167,8 @@ struct bcWiseClusterSkimmer {
166167
for (const auto& cluster : clusters) {
167168
float clusterInducerEnergy = 0.;
168169
int32_t mesonMCIndex = -1;
169-
if (cluster.amplitudeA().size() > 0) {
170-
int clusterInducerId = cluster.mcParticleIds()[0];
170+
for (size_t i = 0; i < cluster.amplitudeA().size(); i++) {
171+
int clusterInducerId = cluster.mcParticleIds()[i];
171172
auto clusterInducer = mcParticles.iteratorAt(clusterInducerId);
172173
clusterInducerEnergy = clusterInducer.e();
173174
int daughterId = aod::pwgem::photonmeson::utils::mcutil::FindMotherInChain(clusterInducer, mcParticles, std::vector<int>{111, 221});
@@ -176,6 +177,10 @@ struct bcWiseClusterSkimmer {
176177
if (mcParticles.iteratorAt(mesonMCIndex).pt() < cfgMinPtGen)
177178
mesonMCIndex = -1;
178179
}
180+
if (mesonMCIndex != -1)
181+
break;
182+
if (cfgOnlyCheckFirstTrueContributor)
183+
break;
179184
}
180185
bool isEta = false;
181186
if (mesonMCIndex >= 0) {

0 commit comments

Comments
 (0)