From 2b7bf713aac3143dd8c5b9fe5c09394fd91fe22f Mon Sep 17 00:00:00 2001 From: Kshitish Kumar Pradhan Date: Sun, 31 Aug 2025 17:27:57 +0530 Subject: [PATCH] Added a loop in processMCGen to fill generated pair histograms taking into account selected collisions This histogram MCTruthGenPairSel_%s fill at generation level similar to MCTruthGenSel_%s but now for pairs. This is done to fill correct number in generation level for histograms that stores angualr distribution for polarization. --- PWGDQ/Tasks/dqEfficiency_withAssoc.cxx | 34 ++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx b/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx index f0b7965ccc4..0d5c7906f87 100644 --- a/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx +++ b/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx @@ -2232,6 +2232,40 @@ struct AnalysisSameEventPairing { } } } + // Fill Generated PAIR histograms taking into account selected collisions + for (auto& event : events) { + if (!event.isEventSelected_bit(0)) { + continue; + } + if (!event.has_reducedMCevent()) { + continue; + } + + if (fHasTwoProngGenMCsignals) { + for (auto& [t1, t2] : combinations(mcTracks, mcTracks)) { + if (t1.reducedMCeventId() != event.reducedMCeventId()) { + continue; + } + if (t2.reducedMCeventId() != event.reducedMCeventId()) { + continue; + } + auto t1_raw = mcTracks.rawIteratorAt(t1.globalIndex()); + auto t2_raw = mcTracks.rawIteratorAt(t2.globalIndex()); + if (t1_raw.reducedMCeventId() == t2_raw.reducedMCeventId()) { + for (auto& sig : fGenMCSignals) { + if (sig->GetNProngs() != 2) { // NOTE: 2-prong signals required here + continue; + } + if (sig->CheckSignal(true, t1_raw, t2_raw)) { + // mcDecision |= (static_cast(1) << isig); + VarManager::FillPairMC(t1, t2); // NOTE: This feature will only work for muons + fHistMan->FillHistClass(Form("MCTruthGenPairSel_%s", sig->GetName()), VarManager::fgValues); + } + } + } + } + } + } // end loop over reconstructed events } void processDummy(MyEvents&)