From bd5b81780ed8e6d5411e32d820c55e2e839e4cdc Mon Sep 17 00:00:00 2001 From: feisenhu Date: Wed, 28 Aug 2024 15:56:47 +0200 Subject: [PATCH] [PWGEM]: adding histograms and cuts to check subGenerators --- PWGDQ/Core/CutsLibrary.cxx | 4 ++++ PWGDQ/Core/HistogramsLibrary.cxx | 3 +++ PWGDQ/Core/VarManager.cxx | 2 ++ PWGDQ/Core/VarManager.h | 3 +++ 4 files changed, 12 insertions(+) diff --git a/PWGDQ/Core/CutsLibrary.cxx b/PWGDQ/Core/CutsLibrary.cxx index 4cafd358cdb..b973184d89d 100644 --- a/PWGDQ/Core/CutsLibrary.cxx +++ b/PWGDQ/Core/CutsLibrary.cxx @@ -3202,6 +3202,10 @@ AnalysisCut* o2::aod::dqcuts::GetAnalysisCut(const char* cutName) std::string nameStr = cutName; // --------------------------------------------------------------- // Event cuts + if (!nameStr.compare("noEventCut")) { + return cut; + } + if (!nameStr.compare("eventNoTFBorder")) { cut->AddCut(VarManager::kIsNoTFBorder, 0.5, 1.5); return cut; diff --git a/PWGDQ/Core/HistogramsLibrary.cxx b/PWGDQ/Core/HistogramsLibrary.cxx index 6343a5772f0..f43abb2b700 100644 --- a/PWGDQ/Core/HistogramsLibrary.cxx +++ b/PWGDQ/Core/HistogramsLibrary.cxx @@ -148,6 +148,9 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "MCVtxX_VtxY", "Vtx X vs Vtx Y", false, 200, 15.0, 15.0, VarManager::kMCVtxZ, 200, -0.2, 0.2, VarManager::kMCVtxY); hm->AddHistogram(histClass, "MCImpPar", "MC impact param", false, 20, 0.0, 20.0, VarManager::kMCEventImpParam); } + if (subGroupStr.Contains("subgen")) { + hm->AddHistogram(histClass, "SubGenID", "SubGenerator ID", false, 11, -0.5, 10.5, VarManager::kMCEventSubGeneratorId); + } if (subGroupStr.Contains("qvector")) { int varZNA[3] = {VarManager::kQ1ZNAX, VarManager::kQ1ZNAY, VarManager::kCentFT0C}; int varZNC[3] = {VarManager::kQ1ZNCX, VarManager::kQ1ZNCY, VarManager::kCentFT0C}; diff --git a/PWGDQ/Core/VarManager.cxx b/PWGDQ/Core/VarManager.cxx index 49259cf7ed2..3026f9408a2 100644 --- a/PWGDQ/Core/VarManager.cxx +++ b/PWGDQ/Core/VarManager.cxx @@ -293,6 +293,7 @@ void VarManager::SetDefaultVarNames() fgVariableNames[kCentFT0C] = "Centrality FT0C"; fgVariableUnits[kCentFT0C] = "%"; fgVariableNames[kMCEventGeneratorId] = "MC Generator ID"; + fgVariableNames[kMCEventSubGeneratorId] = "MC SubGenerator ID"; fgVariableNames[kMCVtxX] = "MC Vtx X"; fgVariableNames[kMCVtxY] = "MC Vtx Y"; fgVariableNames[kMCVtxZ] = "MC Vtx Z"; @@ -300,6 +301,7 @@ void VarManager::SetDefaultVarNames() fgVariableNames[kMCEventWeight] = "MC event weight"; fgVariableNames[kMCEventImpParam] = "MC impact parameter"; fgVariableUnits[kMCEventGeneratorId] = ""; + fgVariableUnits[kMCEventSubGeneratorId] = ""; fgVariableUnits[kMCVtxX] = "cm"; fgVariableUnits[kMCVtxY] = "cm"; fgVariableUnits[kMCVtxZ] = "cm"; diff --git a/PWGDQ/Core/VarManager.h b/PWGDQ/Core/VarManager.h index 44419b6a881..d7cde9afe50 100644 --- a/PWGDQ/Core/VarManager.h +++ b/PWGDQ/Core/VarManager.h @@ -242,6 +242,7 @@ class VarManager : public TObject kNTPCtracksInPast, kNTPCtracksInFuture, kMCEventGeneratorId, + kMCEventSubGeneratorId, kMCVtxX, kMCVtxY, kMCVtxZ, @@ -1626,6 +1627,7 @@ void VarManager::FillEvent(T const& event, float* values) if constexpr ((fillMap & CollisionMC) > 0) { values[kMCEventGeneratorId] = event.generatorsID(); + values[kMCEventSubGeneratorId] = event.getSubGeneratorId(); values[kMCVtxX] = event.posX(); values[kMCVtxY] = event.posY(); values[kMCVtxZ] = event.posZ(); @@ -1636,6 +1638,7 @@ void VarManager::FillEvent(T const& event, float* values) if constexpr ((fillMap & ReducedEventMC) > 0) { values[kMCEventGeneratorId] = event.generatorsID(); + values[kMCEventGeneratorId] = -999; // to be added in reduced events values[kMCVtxX] = event.mcPosX(); values[kMCVtxY] = event.mcPosY(); values[kMCVtxZ] = event.mcPosZ();