Skip to content

Commit fe3347d

Browse files
authored
[PWGLF] Fix histo filling for secondaries (#13452)
1 parent 04c3e08 commit fe3347d

File tree

1 file changed

+49
-2
lines changed

1 file changed

+49
-2
lines changed

PWGMM/Mult/Tasks/dndetaMFTPbPb.cxx

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -932,6 +932,12 @@ struct DndetaMFTPbPb {
932932
hNevt->GetXaxis()->SetBinLabel(1, "Reconstructed collisions");
933933
hNevt->GetXaxis()->SetBinLabel(2, "Generated collisions");
934934
if (doprocessSecondariesMCInlcusive) {
935+
registry.add({"Events/EvtGenRec", ";status", {HistType::kTH1F, {{3, 0.5, 3.5}}}});
936+
auto heff = registry.get<TH1>(HIST("Events/EvtGenRec"));
937+
auto* h = heff->GetXaxis();
938+
h->SetBinLabel(1, "All generated");
939+
h->SetBinLabel(2, "All reconstructed");
940+
h->SetBinLabel(3, "Selected reconstructed");
935941
registry.add({"Tracks/THnRecAmb", "; p_{T} (GeV/c); #eta; Z_{vtx} (cm)", {HistType::kTHnSparseF, {ptAxis, etaAxis, zAxis}}});
936942
registry.add({"Tracks/THnRec", "; p_{T} (GeV/c); #eta; Z_{vtx} (cm)", {HistType::kTHnSparseF, {ptAxis, etaAxis, zAxis}}});
937943
registry.add({"Tracks/THnRecNonAmb", "; p_{T} (GeV/c); #eta; Z_{vtx} (cm)", {HistType::kTHnSparseF, {ptAxis, etaAxis, zAxis}}});
@@ -944,6 +950,12 @@ struct DndetaMFTPbPb {
944950
registry.add({"Tracks/THnGenSecMatAmb", "; p_{T} (GeV/c); #eta; Z_{vtx} (cm)", {HistType::kTHnSparseF, {ptAxis, etaAxis, zAxis}}});
945951
}
946952
if (doprocessSecondariesMCCentFT0C) {
953+
registry.add({"Events/Centrality/EvtGenRec", ";status;centrality", {HistType::kTH2F, {{3, 0.5, 3.5}, centralityAxis}}});
954+
auto heff = registry.get<TH2>(HIST("Events/Centrality/EvtGenRec"));
955+
auto* h = heff->GetXaxis();
956+
h->SetBinLabel(1, "All generated");
957+
h->SetBinLabel(2, "All reconstructed");
958+
h->SetBinLabel(3, "Selected reconstructed");
947959
registry.add({"Tracks/Centrality/THnRecAmb", "; p_{T} (GeV/c); #eta; Z_{vtx} (cm); centrality", {HistType::kTHnSparseF, {ptAxis, etaAxis, zAxis, centralityAxis}}});
948960
registry.add({"Tracks/Centrality/THnRec", "; p_{T} (GeV/c); #eta; Z_{vtx} (cm); centrality", {HistType::kTHnSparseF, {ptAxis, etaAxis, zAxis, centralityAxis}}});
949961
registry.add({"Tracks/Centrality/THnRecNonAmb", "; p_{T} (GeV/c); #eta; Z_{vtx} (cm); centrality", {HistType::kTHnSparseF, {ptAxis, etaAxis, zAxis, centralityAxis}}});
@@ -2883,11 +2895,46 @@ struct DndetaMFTPbPb {
28832895
registry.fill(HIST("Events/hNGenRecColls"), 1.f, collisions.size());
28842896
registry.fill(HIST("Events/hNGenRecColls"), 2.f, mcCollisions.size());
28852897

2898+
float cGen = -1;
2899+
if constexpr (has_reco_cent<C>) {
2900+
float crecMin = 105.f;
2901+
for (const auto& collision : collisions) {
2902+
if (isGoodEvent<false>(collision)) {
2903+
float c = getRecoCent(collision);
2904+
if (c < crecMin) {
2905+
crecMin = c;
2906+
}
2907+
}
2908+
}
2909+
if (cGen < 0)
2910+
cGen = crecMin;
2911+
}
2912+
2913+
if constexpr (has_reco_cent<C>) {
2914+
registry.fill(HIST("Events/Centrality/EvtGenRec"), 1., cGen);
2915+
} else {
2916+
registry.fill(HIST("Events/EvtGenRec"), 1.);
2917+
}
2918+
28862919
for (const auto& collision : collisions) {
28872920
float crec = getRecoCent(collision);
2921+
2922+
if constexpr (has_reco_cent<C>) {
2923+
registry.fill(HIST("Events/Centrality/EvtGenRec"), 2., crec);
2924+
} else {
2925+
registry.fill(HIST("Events/EvtGenRec"), 2.);
2926+
}
2927+
28882928
if (!isGoodEvent<false>(collision)) {
28892929
continue;
28902930
}
2931+
2932+
if constexpr (has_reco_cent<C>) {
2933+
registry.fill(HIST("Events/Centrality/EvtGenRec"), 3., crec);
2934+
} else {
2935+
registry.fill(HIST("Events/EvtGenRec"), 3.);
2936+
}
2937+
28912938
if (!collision.has_mcCollision()) {
28922939
continue;
28932940
}
@@ -3111,9 +3158,9 @@ struct DndetaMFTPbPb {
31113158
if (!particle.isPhysicalPrimary()) { // Secondaries (weak decays and material)
31123159
if (particle.getProcess() == kNumDecay) { // Particles from decay
31133160
if constexpr (has_reco_cent<C>) {
3114-
registry.fill(HIST("Tracks/Centrality/THnDCAxyBestGenPrim"), itrack.pt(), itrack.eta(), mcCollision.posZ(), atrack.bestDCAXY(), atrack.bestDCAZ(), crec);
3161+
registry.fill(HIST("Tracks/Centrality/THnDCAxyBestGenSecWeak"), itrack.pt(), itrack.eta(), mcCollision.posZ(), atrack.bestDCAXY(), atrack.bestDCAZ(), crec);
31153162
} else {
3116-
registry.fill(HIST("Tracks/THnDCAxyBestGenPrim"), itrack.pt(), itrack.eta(), mcCollision.posZ(), atrack.bestDCAXY(), atrack.bestDCAZ());
3163+
registry.fill(HIST("Tracks/THnDCAxyBestGenSecWeak"), itrack.pt(), itrack.eta(), mcCollision.posZ(), atrack.bestDCAXY(), atrack.bestDCAZ());
31173164
}
31183165
} else { // Particles from the material
31193166
if constexpr (has_reco_cent<C>) {

0 commit comments

Comments
 (0)