From ee3a863c5523b8f389304de13c9641cc4291d5c9 Mon Sep 17 00:00:00 2001 From: Sahil Upadhyaya Date: Fri, 11 Apr 2025 11:36:39 +0200 Subject: [PATCH 1/4] Adding MCSignal for POWHEG Drell-Yan muon selection --- PWGDQ/Core/MCProng.cxx | 3 ++- PWGDQ/Core/MCProng.h | 1 + PWGDQ/Core/MCSignal.h | 6 ++++++ PWGDQ/Core/MCSignalLibrary.cxx | 12 ++++++++++++ 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/PWGDQ/Core/MCProng.cxx b/PWGDQ/Core/MCProng.cxx index cc3d3ee8b36..8eb0dc6d2e9 100644 --- a/PWGDQ/Core/MCProng.cxx +++ b/PWGDQ/Core/MCProng.cxx @@ -22,7 +22,8 @@ std::map MCProng::fgSourceNames = { {"kProducedInTransport", MCProng::kProducedInTransport}, {"kProducedByGenerator", MCProng::kProducedByGenerator}, {"kFromBackgroundEvent", MCProng::kFromBackgroundEvent}, - {"kHEPMCFinalState", MCProng::kHEPMCFinalState}}; + {"kHEPMCFinalState", MCProng::kHEPMCFinalState}, + {"kIsPowhegDYMuon", MCProng::kIsPowhegDYMuon}}; //________________________________________________________________________________________________________________ MCProng::MCProng() : fNGenerations(0), diff --git a/PWGDQ/Core/MCProng.h b/PWGDQ/Core/MCProng.h index b1935260433..dcb9b4ae7ee 100644 --- a/PWGDQ/Core/MCProng.h +++ b/PWGDQ/Core/MCProng.h @@ -73,6 +73,7 @@ class MCProng kProducedByGenerator, // Produced by generator (if not, then produced by GEANT) kFromBackgroundEvent, // Produced in the underlying event kHEPMCFinalState, // HEPMC code 11 + kIsPowhegDYMuon, // POWHEG muons based on Pythia Status Code (=23) -> Drell-Yan signal kNSources }; diff --git a/PWGDQ/Core/MCSignal.h b/PWGDQ/Core/MCSignal.h index 06404e88ed5..9852d8ccfd9 100644 --- a/PWGDQ/Core/MCSignal.h +++ b/PWGDQ/Core/MCSignal.h @@ -253,6 +253,12 @@ bool MCSignal::CheckProng(int i, bool checkSources, const T& track) sourcesDecision |= (static_cast(1) << MCProng::kHEPMCFinalState); } } + // Check kIsPowhegDYMuon + if (fProngs[i].fSourceBits[j] & (static_cast(1) << MCProng::kIsPowhegDYMuon)) { + if ((fProngs[i].fExcludeSource[j] & (static_cast(1) << MCProng::kIsPowhegDYMuon)) != (currentMCParticle.getGenStatusCode()==23)) { + sourcesDecision |= (static_cast(1) << MCProng::kIsPowhegDYMuon); + } + } } // end if(hasSources) // no source bit is fulfilled if (hasSources && !sourcesDecision) { diff --git a/PWGDQ/Core/MCSignalLibrary.cxx b/PWGDQ/Core/MCSignalLibrary.cxx index 4cf7100d86d..0eccf362d6f 100644 --- a/PWGDQ/Core/MCSignalLibrary.cxx +++ b/PWGDQ/Core/MCSignalLibrary.cxx @@ -348,6 +348,12 @@ MCSignal* o2::aod::dqmcsignals::GetMCSignal(const char* name) signal = new MCSignal(name, "electron from a photon conversion", {prong}, {-1}); return signal; } + if (!nameStr.compare("PowhegDYMuon1")) { + MCProng prong(1, {13}, {true}, {false}, {0}, {0}, {false}); // selecting muons + prong.SetSourceBit(0, MCProng::kIsPowhegDYMuon); // set source to be Muon from POWHEG + signal = new MCSignal(name, "POWHEG Muon singles", {prong}, {-1});// define a signal with 1-prong + return signal; + } // 2-prong signals if (!nameStr.compare("dielectron")) { @@ -381,6 +387,12 @@ MCSignal* o2::aod::dqmcsignals::GetMCSignal(const char* name) signal = new MCSignal(name, "dielectron from a photon conversion from a pi0", {prong, prong}, {1, 1}); return signal; } + if (!nameStr.compare("PowhegDYMuon2")) { + MCProng prong(1, {13}, {true}, {false}, {0}, {0}, {false}); // selecting muons + prong.SetSourceBit(0, MCProng::kIsPowhegDYMuon); // set source to be Muon from POWHEG + signal = new MCSignal(name, "POWHEG Muon pair", {prong,prong}, {-1,-1});// define a signal with 2-prong + return signal; + } // LMEE single signals // electron signals with mother X: e from mother X From e0289580347ffeecd8858ca9a7245a1e3d9fd3d9 Mon Sep 17 00:00:00 2001 From: Sahil Upadhyaya Date: Fri, 11 Apr 2025 14:17:36 +0200 Subject: [PATCH 2/4] Clang fix --- PWGDQ/Core/MCProng.h | 2 +- PWGDQ/Core/MCSignal.h | 4 ++-- PWGDQ/Core/MCSignalLibrary.cxx | 12 ++++++------ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/PWGDQ/Core/MCProng.h b/PWGDQ/Core/MCProng.h index dcb9b4ae7ee..cdcbe0d114b 100644 --- a/PWGDQ/Core/MCProng.h +++ b/PWGDQ/Core/MCProng.h @@ -73,7 +73,7 @@ class MCProng kProducedByGenerator, // Produced by generator (if not, then produced by GEANT) kFromBackgroundEvent, // Produced in the underlying event kHEPMCFinalState, // HEPMC code 11 - kIsPowhegDYMuon, // POWHEG muons based on Pythia Status Code (=23) -> Drell-Yan signal + kIsPowhegDYMuon, // POWHEG muons based on Pythia Status Code (=23) -> Drell-Yan signal kNSources }; diff --git a/PWGDQ/Core/MCSignal.h b/PWGDQ/Core/MCSignal.h index 9852d8ccfd9..42fe0a0a050 100644 --- a/PWGDQ/Core/MCSignal.h +++ b/PWGDQ/Core/MCSignal.h @@ -255,10 +255,10 @@ bool MCSignal::CheckProng(int i, bool checkSources, const T& track) } // Check kIsPowhegDYMuon if (fProngs[i].fSourceBits[j] & (static_cast(1) << MCProng::kIsPowhegDYMuon)) { - if ((fProngs[i].fExcludeSource[j] & (static_cast(1) << MCProng::kIsPowhegDYMuon)) != (currentMCParticle.getGenStatusCode()==23)) { + if ((fProngs[i].fExcludeSource[j] & (static_cast(1) << MCProng::kIsPowhegDYMuon)) != (currentMCParticle.getGenStatusCode() == 23)) { sourcesDecision |= (static_cast(1) << MCProng::kIsPowhegDYMuon); } - } + } } // end if(hasSources) // no source bit is fulfilled if (hasSources && !sourcesDecision) { diff --git a/PWGDQ/Core/MCSignalLibrary.cxx b/PWGDQ/Core/MCSignalLibrary.cxx index 0eccf362d6f..bff19c83df4 100644 --- a/PWGDQ/Core/MCSignalLibrary.cxx +++ b/PWGDQ/Core/MCSignalLibrary.cxx @@ -349,9 +349,9 @@ MCSignal* o2::aod::dqmcsignals::GetMCSignal(const char* name) return signal; } if (!nameStr.compare("PowhegDYMuon1")) { - MCProng prong(1, {13}, {true}, {false}, {0}, {0}, {false}); // selecting muons - prong.SetSourceBit(0, MCProng::kIsPowhegDYMuon); // set source to be Muon from POWHEG - signal = new MCSignal(name, "POWHEG Muon singles", {prong}, {-1});// define a signal with 1-prong + MCProng prong(1, {13}, {true}, {false}, {0}, {0}, {false}); // selecting muons + prong.SetSourceBit(0, MCProng::kIsPowhegDYMuon); // set source to be Muon from POWHEG + signal = new MCSignal(name, "POWHEG Muon singles", {prong}, {-1}); // define a signal with 1-prong return signal; } @@ -388,9 +388,9 @@ MCSignal* o2::aod::dqmcsignals::GetMCSignal(const char* name) return signal; } if (!nameStr.compare("PowhegDYMuon2")) { - MCProng prong(1, {13}, {true}, {false}, {0}, {0}, {false}); // selecting muons - prong.SetSourceBit(0, MCProng::kIsPowhegDYMuon); // set source to be Muon from POWHEG - signal = new MCSignal(name, "POWHEG Muon pair", {prong,prong}, {-1,-1});// define a signal with 2-prong + MCProng prong(1, {13}, {true}, {false}, {0}, {0}, {false}); // selecting muons + prong.SetSourceBit(0, MCProng::kIsPowhegDYMuon); // set source to be Muon from POWHEG + signal = new MCSignal(name, "POWHEG Muon pair", {prong, prong}, {-1, -1}); // define a signal with 2-prong return signal; } From 27d2bae1fe453018e671fa990891c824a1d6d395 Mon Sep 17 00:00:00 2001 From: Sahil Upadhyaya Date: Tue, 22 Jul 2025 17:38:39 +0200 Subject: [PATCH 3/4] Adding histograms for Drell-Yan studies --- PWGDQ/Core/HistogramsLibrary.cxx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/PWGDQ/Core/HistogramsLibrary.cxx b/PWGDQ/Core/HistogramsLibrary.cxx index 11c87e700de..3aef32e9ef7 100644 --- a/PWGDQ/Core/HistogramsLibrary.cxx +++ b/PWGDQ/Core/HistogramsLibrary.cxx @@ -1966,6 +1966,13 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "Mass_Pt", "", false, 500, 0.0, 5.0, VarManager::kMassDau, 200, 0.0, 20.0, VarManager::kPt); hm->AddHistogram(histClass, "Rapidity", "", false, 400, -4.0, 4.0, VarManager::kRap); } + + if (subGroupStr.Contains("DY-dimuon")) { + hm->AddHistogram(histClass, "DY_mass", "", false, 5000, 0.0, 50.0, VarManager::kMass); // 10 MeV mass res + hm->AddHistogram(histClass, "DY_pT", "", false, 2000, 0.0, 100.0, VarManager::kPt); // 50 MeV pT res + hm->AddHistogram(histClass, "DY_y", "", false, 20, 2.0, 4.0, VarManager::kRap); + hm->AddHistogram(histClass, "DY_phi", "", false, 180, constants::math::PI, 2 * constants::math::PI, VarManager::kPhi); + } } //__________________________________________________________________ From 8af4d448bec52c860858ec2bd668f39643c47e0b Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Tue, 22 Jul 2025 15:48:31 +0000 Subject: [PATCH 4/4] Please consider the following formatting changes --- PWGDQ/Core/HistogramsLibrary.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGDQ/Core/HistogramsLibrary.cxx b/PWGDQ/Core/HistogramsLibrary.cxx index 3aef32e9ef7..5df619f15e1 100644 --- a/PWGDQ/Core/HistogramsLibrary.cxx +++ b/PWGDQ/Core/HistogramsLibrary.cxx @@ -1969,7 +1969,7 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h if (subGroupStr.Contains("DY-dimuon")) { hm->AddHistogram(histClass, "DY_mass", "", false, 5000, 0.0, 50.0, VarManager::kMass); // 10 MeV mass res - hm->AddHistogram(histClass, "DY_pT", "", false, 2000, 0.0, 100.0, VarManager::kPt); // 50 MeV pT res + hm->AddHistogram(histClass, "DY_pT", "", false, 2000, 0.0, 100.0, VarManager::kPt); // 50 MeV pT res hm->AddHistogram(histClass, "DY_y", "", false, 20, 2.0, 4.0, VarManager::kRap); hm->AddHistogram(histClass, "DY_phi", "", false, 180, constants::math::PI, 2 * constants::math::PI, VarManager::kPhi); }