From 2096708165bcc2dceeb3d7ec4c6aa499be09d8fe Mon Sep 17 00:00:00 2001 From: Victor Date: Sun, 10 Aug 2025 20:41:47 +0200 Subject: [PATCH] [PWGCF] DptDpt - Using metadata for auto autoconfiguration --- PWGCF/TableProducer/dptDptFilter.h | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/PWGCF/TableProducer/dptDptFilter.h b/PWGCF/TableProducer/dptDptFilter.h index b107156d5f3..3e44818103c 100644 --- a/PWGCF/TableProducer/dptDptFilter.h +++ b/PWGCF/TableProducer/dptDptFilter.h @@ -18,6 +18,7 @@ #include "PWGCF/Core/AnalysisConfigurableCuts.h" +#include "Common/Core/MetadataHelper.h" #include "Common/Core/RecoDecay.h" #include "Common/Core/TrackSelection.h" #include "Common/Core/TrackSelectionDefaults.h" @@ -74,6 +75,9 @@ enum SystemType { kXeXe, ///< **Xe-Xe** system kppRun3, ///< **p-p Run 3** system kPbPbRun3, ///< **Pb-Pb Run 3** system + kNeNeRun3, ///< **Ne-Ne Run 3** system + kOORun3, ///< **O-O Run 3** system + kpORun3, ///< **p-O Run 3** system knSystems ///< number of handled systems }; @@ -194,6 +198,11 @@ float overallminp = 0.0f; //============================================================================================ std::bitset<32> collisionFlags; +//============================================================================================ +// The input data metadata access helper +//============================================================================================ +o2::common::core::MetadataHelper metadataInfo; + //============================================================================================ // The DptDptFilter configuration objects //============================================================================================ @@ -561,6 +570,22 @@ inline TriggerSelectionType getTriggerSelection(std::string const& triggstr) } } +inline SystemType getSytemTypeFromMetaData() +{ + auto period = metadataInfo.get("LPMProductionTag"); + + if (period == "LHC25ad" || period == "LHC25g5") { + return kpORun3; + } else if (period == "LHC25ae" || period == "LHC25g6") { + return kOORun3; + } else if (period == "LHC25af" || period == "LHC25g7") { + return kNeNeRun3; + } else { + LOGF(fatal, "DptDptCorrelations::getSystemTypeFromMetadata(). No automatic system type configuration for %s period", period.c_str()); + } + return kPbp; +} + inline SystemType getSystemType(std::string const& sysstr) { /* we have to figure out how extract the system type */ @@ -572,14 +597,14 @@ inline SystemType getSystemType(std::string const& sysstr) return kpPb; } else if (sysstr == "Pbp") { return kPbp; - } else if (sysstr == "pPb") { - return kpPb; } else if (sysstr == "XeXe") { return kXeXe; } else if (sysstr == "ppRun3") { return kppRun3; } else if (sysstr == "PbPbRun3") { return kPbPbRun3; + } else if (sysstr == "Auto") { + return getSytemTypeFromMetaData(); } else { LOGF(fatal, "DptDptCorrelations::getSystemType(). Wrong system type: %s", sysstr.c_str()); }