From 4dadc141993f29e26bc2016a07a0c04f64bc7d96 Mon Sep 17 00:00:00 2001 From: Bhagyarathi Sahoo Date: Thu, 15 May 2025 20:30:39 +0530 Subject: [PATCH 1/3] [PWGDQ] Adding 2-prong signal inside new processMCGen --- PWGDQ/Tasks/dqEfficiency_withAssoc.cxx | 36 +++++++++++++++++++------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx b/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx index 4a38eab9952..a879b3b74e3 100644 --- a/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx +++ b/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx @@ -1252,7 +1252,7 @@ struct AnalysisSameEventPairing { Configurable recSignals{"cfgBarrelMCRecSignals", "", "Comma separated list of MC signals (reconstructed)"}; Configurable recSignalsJSON{"cfgMCRecSignalsJSON", "", "Comma separated list of MC signals (reconstructed) via JSON"}; Configurable skimSignalOnly{"cfgSkimSignalOnly", false, "Configurable to select only matched candidates"}; - Configurable runMCGenPair{"cfgRunMCGenPair", false, "Do pairing of true MC particles"}; + //Configurable runMCGenPair{"cfgRunMCGenPair", false, "Do pairing of true MC particles"}; } fConfigMC; struct : ConfigurableGroup { @@ -2050,9 +2050,9 @@ struct AnalysisSameEventPairing { runSameEventPairing(events, trackAssocsPerCollision, barrelAssocs, barrelTracks, mcEvents, mcTracks); runSameEventPairing(events, muonAssocsPerCollision, muonAssocs, muons, mcEvents, mcTracks); // Feature replaced by processMCGen - if (fConfigMC.runMCGenPair) { + /*if (fConfigMC.runMCGenPair) { runMCGen(mcEvents, mcTracks); - } + }*/ // runSameEventPairing(event, tracks, muons); } @@ -2062,9 +2062,9 @@ struct AnalysisSameEventPairing { { runSameEventPairing(events, trackAssocsPerCollision, barrelAssocs, barrelTracks, mcEvents, mcTracks); // Feature replaced by processMCGen - if (fConfigMC.runMCGenPair) { + /*if (fConfigMC.runMCGenPair) { runMCGen(mcEvents, mcTracks); - } + }*/ } void processBarrelOnlyWithCollSkimmed(MyEventsVtxCovSelected const& events, @@ -2073,9 +2073,9 @@ struct AnalysisSameEventPairing { { runSameEventPairing(events, trackAssocsPerCollision, barrelAssocs, barrelTracks, mcEvents, mcTracks); // Feature replaced by processMCGen - if (fConfigMC.runMCGenPair) { + /* if (fConfigMC.runMCGenPair) { runMCGen(mcEvents, mcTracks); - } + }*/ } void processMuonOnlySkimmed(MyEventsVtxCovSelected const& events, @@ -2083,9 +2083,9 @@ struct AnalysisSameEventPairing { { runSameEventPairing(events, muonAssocsPerCollision, muonAssocs, muons, mcEvents, mcTracks); // Feature replaced by processMCGen - if (fConfigMC.runMCGenPair) { + /* if (fConfigMC.runMCGenPair) { runMCGen(mcEvents, mcTracks); - } + }*/ } PresliceUnsorted perReducedMcGenEvent = aod::reducedtrackMC::reducedMCeventId; @@ -2126,6 +2126,24 @@ struct AnalysisSameEventPairing { } } } // end loop over reconstructed events + if (fHasTwoProngGenMCsignals) { + for (auto& [t1, t2] : combinations(mcTracks, mcTracks)) { + 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); + fHistMan->FillHistClass(Form("MCTruthGenPair_%s", sig->GetName()), VarManager::fgValues); + } + } + } + } + } } void processDummy(MyEvents&) From 5cbd1ef7ff3cc25d7d0053023ec042d035942e5e Mon Sep 17 00:00:00 2001 From: Bhagyarathi Sahoo Date: Tue, 20 May 2025 13:36:10 +0530 Subject: [PATCH 2/3] Update dqEfficiency_withAssoc.cxx --- PWGDQ/Tasks/dqEfficiency_withAssoc.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx b/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx index a879b3b74e3..11b25523949 100644 --- a/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx +++ b/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx @@ -2029,7 +2029,7 @@ struct AnalysisSameEventPairing { if (sig->CheckSignal(true, t1_raw, t2_raw)) { mcDecision |= (static_cast(1) << isig); VarManager::FillPairMC(t1, t2); - fHistMan->FillHistClass(Form("MCTruthGenPair_%s", sig->GetName()), VarManager::fgValues); + fHistMan->FillHistClass(Form("MCTruthGenPair_%s", sig->GetName()), VarManager::fgValues); if (useMiniTree.fConfigMiniTree) { // WARNING! To be checked dileptonMiniTreeGen(mcDecision, -999, t1.pt(), t1.eta(), t1.phi(), t2.pt(), t2.eta(), t2.phi()); @@ -2137,7 +2137,7 @@ struct AnalysisSameEventPairing { } if (sig->CheckSignal(true, t1_raw, t2_raw)) { //mcDecision |= (static_cast(1) << isig); - VarManager::FillPairMC(t1, t2); + VarManager::FillPairMC(t1, t2);//NOTE: This feature will only work for muons fHistMan->FillHistClass(Form("MCTruthGenPair_%s", sig->GetName()), VarManager::fgValues); } } From 044e449b3c77b56f95087597b83644cf5d4d46ab Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Tue, 20 May 2025 08:07:21 +0000 Subject: [PATCH 3/3] Please consider the following formatting changes --- PWGDQ/Tasks/dqEfficiency_withAssoc.cxx | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx b/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx index 11b25523949..9630c8275b5 100644 --- a/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx +++ b/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx @@ -1252,7 +1252,7 @@ struct AnalysisSameEventPairing { Configurable recSignals{"cfgBarrelMCRecSignals", "", "Comma separated list of MC signals (reconstructed)"}; Configurable recSignalsJSON{"cfgMCRecSignalsJSON", "", "Comma separated list of MC signals (reconstructed) via JSON"}; Configurable skimSignalOnly{"cfgSkimSignalOnly", false, "Configurable to select only matched candidates"}; - //Configurable runMCGenPair{"cfgRunMCGenPair", false, "Do pairing of true MC particles"}; + // Configurable runMCGenPair{"cfgRunMCGenPair", false, "Do pairing of true MC particles"}; } fConfigMC; struct : ConfigurableGroup { @@ -2029,7 +2029,7 @@ struct AnalysisSameEventPairing { if (sig->CheckSignal(true, t1_raw, t2_raw)) { mcDecision |= (static_cast(1) << isig); VarManager::FillPairMC(t1, t2); - fHistMan->FillHistClass(Form("MCTruthGenPair_%s", sig->GetName()), VarManager::fgValues); + fHistMan->FillHistClass(Form("MCTruthGenPair_%s", sig->GetName()), VarManager::fgValues); if (useMiniTree.fConfigMiniTree) { // WARNING! To be checked dileptonMiniTreeGen(mcDecision, -999, t1.pt(), t1.eta(), t1.phi(), t2.pt(), t2.eta(), t2.phi()); @@ -2073,9 +2073,9 @@ struct AnalysisSameEventPairing { { runSameEventPairing(events, trackAssocsPerCollision, barrelAssocs, barrelTracks, mcEvents, mcTracks); // Feature replaced by processMCGen - /* if (fConfigMC.runMCGenPair) { - runMCGen(mcEvents, mcTracks); - }*/ + /* if (fConfigMC.runMCGenPair) { + runMCGen(mcEvents, mcTracks); + }*/ } void processMuonOnlySkimmed(MyEventsVtxCovSelected const& events, @@ -2083,9 +2083,9 @@ struct AnalysisSameEventPairing { { runSameEventPairing(events, muonAssocsPerCollision, muonAssocs, muons, mcEvents, mcTracks); // Feature replaced by processMCGen - /* if (fConfigMC.runMCGenPair) { - runMCGen(mcEvents, mcTracks); - }*/ + /* if (fConfigMC.runMCGenPair) { + runMCGen(mcEvents, mcTracks); + }*/ } PresliceUnsorted perReducedMcGenEvent = aod::reducedtrackMC::reducedMCeventId; @@ -2136,8 +2136,8 @@ struct AnalysisSameEventPairing { 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 + // mcDecision |= (static_cast(1) << isig); + VarManager::FillPairMC(t1, t2); // NOTE: This feature will only work for muons fHistMan->FillHistClass(Form("MCTruthGenPair_%s", sig->GetName()), VarManager::fgValues); } }