Skip to content

Commit 777fe09

Browse files
authored
PWGMM: dndeta: fix event efficiency histogram (#4473)
1 parent a1c9c0a commit 777fe09

1 file changed

Lines changed: 34 additions & 32 deletions

File tree

PWGMM/Mult/Tasks/dndeta.cxx

Lines changed: 34 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,22 +1121,6 @@ struct MultiplicityCounter {
11211121
c_gen = mcCollision.centrality();
11221122
}
11231123

1124-
auto nCharged = countParticles(particles);
1125-
if constexpr (hasRecoCent<C>()) {
1126-
binnedRegistry.fill(HIST(NtrkZvtxGen_t), nCharged, mcCollision.posZ(), c_gen);
1127-
binnedRegistry.fill(HIST(Efficiency), static_cast<float>(EvEffBins::kGen), c_gen);
1128-
} else {
1129-
inclusiveRegistry.fill(HIST(NtrkZvtxGen_t), nCharged, mcCollision.posZ());
1130-
inclusiveRegistry.fill(HIST(Efficiency), static_cast<float>(EvEffBins::kGen));
1131-
}
1132-
1133-
if (nCharged > 0) {
1134-
if constexpr (hasRecoCent<C>()) {
1135-
binnedRegistry.fill(HIST(Efficiency), static_cast<float>(EvEffBins::kGengt0), c_gen);
1136-
} else {
1137-
inclusiveRegistry.fill(HIST(Efficiency), static_cast<float>(EvEffBins::kGengt0));
1138-
}
1139-
}
11401124
bool atLeastOne = false;
11411125
bool atLeastOne_gt0 = false;
11421126
bool atLeastOne_PVgt0 = false;
@@ -1215,6 +1199,23 @@ struct MultiplicityCounter {
12151199
}
12161200
}
12171201

1202+
auto nCharged = countParticles(particles);
1203+
if constexpr (hasRecoCent<C>()) {
1204+
binnedRegistry.fill(HIST(NtrkZvtxGen_t), nCharged, mcCollision.posZ(), c_gen);
1205+
binnedRegistry.fill(HIST(Efficiency), static_cast<float>(EvEffBins::kGen), c_gen);
1206+
} else {
1207+
inclusiveRegistry.fill(HIST(NtrkZvtxGen_t), nCharged, mcCollision.posZ());
1208+
inclusiveRegistry.fill(HIST(Efficiency), static_cast<float>(EvEffBins::kGen));
1209+
}
1210+
1211+
if (nCharged > 0) {
1212+
if constexpr (hasRecoCent<C>()) {
1213+
binnedRegistry.fill(HIST(Efficiency), static_cast<float>(EvEffBins::kGengt0), c_gen);
1214+
} else {
1215+
inclusiveRegistry.fill(HIST(Efficiency), static_cast<float>(EvEffBins::kGengt0));
1216+
}
1217+
}
1218+
12181219
if (fillResponse) {
12191220
for (auto i = 0U; i < NrecPerCol.size(); ++i) {
12201221
if constexpr (hasRecoCent<C>()) {
@@ -1274,22 +1275,6 @@ struct MultiplicityCounter {
12741275
c_gen = mcCollision.centrality();
12751276
}
12761277

1277-
auto nCharged = countParticles(particles);
1278-
if constexpr (hasRecoCent<C>()) {
1279-
binnedRegistry.fill(HIST(NtrkZvtxGen_t), nCharged, mcCollision.posZ(), c_gen);
1280-
binnedRegistry.fill(HIST(Efficiency), static_cast<float>(EvEffBins::kGen), c_gen);
1281-
} else {
1282-
inclusiveRegistry.fill(HIST(NtrkZvtxGen_t), nCharged, mcCollision.posZ());
1283-
inclusiveRegistry.fill(HIST(Efficiency), static_cast<float>(EvEffBins::kGen));
1284-
}
1285-
1286-
if (nCharged > 0) {
1287-
if constexpr (hasRecoCent<C>()) {
1288-
binnedRegistry.fill(HIST(Efficiency), static_cast<float>(EvEffBins::kGengt0), c_gen);
1289-
} else {
1290-
inclusiveRegistry.fill(HIST(Efficiency), static_cast<float>(EvEffBins::kGengt0));
1291-
}
1292-
}
12931278
bool atLeastOne = false;
12941279
bool atLeastOne_gt0 = false;
12951280
bool atLeastOne_PVgt0 = false;
@@ -1367,6 +1352,23 @@ struct MultiplicityCounter {
13671352
}
13681353
}
13691354

1355+
auto nCharged = countParticles(particles);
1356+
if constexpr (hasRecoCent<C>()) {
1357+
binnedRegistry.fill(HIST(NtrkZvtxGen_t), nCharged, mcCollision.posZ(), c_gen);
1358+
binnedRegistry.fill(HIST(Efficiency), static_cast<float>(EvEffBins::kGen), c_gen);
1359+
} else {
1360+
inclusiveRegistry.fill(HIST(NtrkZvtxGen_t), nCharged, mcCollision.posZ());
1361+
inclusiveRegistry.fill(HIST(Efficiency), static_cast<float>(EvEffBins::kGen));
1362+
}
1363+
1364+
if (nCharged > 0) {
1365+
if constexpr (hasRecoCent<C>()) {
1366+
binnedRegistry.fill(HIST(Efficiency), static_cast<float>(EvEffBins::kGengt0), c_gen);
1367+
} else {
1368+
inclusiveRegistry.fill(HIST(Efficiency), static_cast<float>(EvEffBins::kGengt0));
1369+
}
1370+
}
1371+
13701372
if (fillResponse) {
13711373
for (auto i = 0U; i < NrecPerCol.size(); ++i) {
13721374
if constexpr (hasRecoCent<C>()) {

0 commit comments

Comments
 (0)