From e48ef69dbac6b1604563545e180258f925fc9e30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Thu, 18 Sep 2025 11:16:53 +0200 Subject: [PATCH] Add run info option and reorganize includes Added option to include run info in histograms and updated includes. --- DPG/Tasks/AOTTrack/qaEventTrack.cxx | 35 ++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/DPG/Tasks/AOTTrack/qaEventTrack.cxx b/DPG/Tasks/AOTTrack/qaEventTrack.cxx index 144e41af1a0..50c1fea9909 100644 --- a/DPG/Tasks/AOTTrack/qaEventTrack.cxx +++ b/DPG/Tasks/AOTTrack/qaEventTrack.cxx @@ -23,19 +23,23 @@ #include "qaEventTrack.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "ReconstructionDataFormats/DCA.h" +#include "Common/Core/MetadataHelper.h" +#include "Common/Core/TrackSelection.h" +#include "Common/Core/TrackSelectionDefaults.h" #include "Common/Core/trackUtilities.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/TrackSelectionDefaults.h" #include "Common/TableProducer/PID/pidTOFBase.h" +#include +#include +#include +#include +#include +#include + +#include + #include #include @@ -44,6 +48,8 @@ using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::dataformats; +o2::common::core::MetadataHelper metadataInfo; + // TODO: add PID wagons as dependency + include impact parameter studies (same or separate task in workflow??) //-------------------------------------------------------------------------------------------------- @@ -68,6 +74,9 @@ struct qaEventTrack { // option to apply a timeframe cut Configurable tfCut{"tfCut", false, "applies timeframe cut"}; + // option to add run info to the histograms + Configurable addRunInfo{"addRunInfo", true, "add run info (pass, data) to the histograms"}; + // options to select only specific tracks Configurable trackSelection{"trackSelection", 1, "Track selection: 0 -> No Cut, 1 -> kGlobalTrack, 2 -> kGlobalTrackWoPtEta, 3 -> kGlobalTrackWoDCA, 4 -> kQualityTracks, 5 -> kInAcceptanceTracks"}; Configurable selectCharge{"selectCharge", 0, "select charge +1 or -1 (0 means no selection)"}; @@ -166,6 +175,14 @@ struct qaEventTrack { } } + if (addRunInfo) { + auto hRunInfo = histos.add("hRunInfo", "Run info", kTH1D, {{1, 0.5, 1.5, "Run info"}}); + // hRunInfo->SetBit(TH1::kCanRebin); // allow dynamic bin creation based on label + if (metadataInfo.isFullyDefined()) { + hRunInfo->Fill(metadataInfo.makeMetadataLabel().c_str(), 1.0); + } + } + // // Next section setups overwrite of configurableAxis if overwriteAxisRangeForPbPb is used. // @@ -1153,6 +1170,8 @@ struct qaEventTrack { WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { + // Parse the metadata + metadataInfo.initMetadata(cfgc); return WorkflowSpec{adaptAnalysisTask(cfgc)}; }