From 304e0ffb610c4f15dd4158b37b4ce3ec3f2899bc Mon Sep 17 00:00:00 2001 From: fmazzasc Date: Sun, 22 Oct 2023 23:35:31 +0200 Subject: [PATCH 1/2] [Common] Uniform tracks extra converter to the coding conventions --- Common/TableProducer/CMakeLists.txt | 4 ++-- ...acksextraConverter.cxx => tracksExtraConverter.cxx} | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) rename Common/TableProducer/{tracksextraConverter.cxx => tracksExtraConverter.cxx} (91%) diff --git a/Common/TableProducer/CMakeLists.txt b/Common/TableProducer/CMakeLists.txt index 67c46c06f32..31f8329609f 100644 --- a/Common/TableProducer/CMakeLists.txt +++ b/Common/TableProducer/CMakeLists.txt @@ -71,8 +71,8 @@ o2physics_add_dpl_workflow(mc-converter PUBLIC_LINK_LIBRARIES COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(tracksextra-converter - SOURCES tracksextraConverter.cxx +o2physics_add_dpl_workflow(tracks-extra-converter + SOURCES tracksExtraConverter.cxx PUBLIC_LINK_LIBRARIES COMPONENT_NAME Analysis) diff --git a/Common/TableProducer/tracksextraConverter.cxx b/Common/TableProducer/tracksExtraConverter.cxx similarity index 91% rename from Common/TableProducer/tracksextraConverter.cxx rename to Common/TableProducer/tracksExtraConverter.cxx index a8ea107b442..21e4a60c84b 100644 --- a/Common/TableProducer/tracksextraConverter.cxx +++ b/Common/TableProducer/tracksExtraConverter.cxx @@ -16,14 +16,14 @@ using namespace o2; using namespace o2::framework; // Converts TracksExtra table from version 000 to 001 -struct tracksextraConverter { +struct tracksExtraConverter { Produces tracksExtra_001; void process(aod::TracksExtra_000 const& tracksExtra_000) { // dummy itsClusterSizes, fill with overflows if a hit in the layer is present - for (auto& track0 : tracksExtra_000) { + for (const auto& track0 : tracksExtra_000) { uint32_t itsClusterSizes = 0; for (int layer = 0; layer < 7; layer++) { @@ -56,7 +56,7 @@ struct tracksextraConverter { } }; -struct trackExtraSpawner { +struct tracksExtraSpawner { // spawn the extended table for TracksExtra001 to avoid the call to the internal spawner and the circular dependency Spawns tracksExtra_001; }; @@ -64,7 +64,7 @@ struct trackExtraSpawner { WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ - adaptAnalysisTask(cfgc), - adaptAnalysisTask(cfgc), + adaptAnalysisTask(cfgc), + adaptAnalysisTask(cfgc), }; } From 1f0a30f8013308817dd601258a7825559444d483 Mon Sep 17 00:00:00 2001 From: fmazzasc Date: Mon, 23 Oct 2023 09:26:46 +0200 Subject: [PATCH 2/2] Add doxygen documentation + capitalize tasks --- Common/TableProducer/tracksExtraConverter.cxx | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/Common/TableProducer/tracksExtraConverter.cxx b/Common/TableProducer/tracksExtraConverter.cxx index 21e4a60c84b..b097cb7c4a3 100644 --- a/Common/TableProducer/tracksExtraConverter.cxx +++ b/Common/TableProducer/tracksExtraConverter.cxx @@ -8,6 +8,17 @@ // In applying this license CERN does not waive the privileges and immunities // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. + +/// \file tracksExtraConverter.cxx +/// \brief Converts TracksExtra table from version 000 to 001 + +/// This task allows for the conversion of the TracksExtra table from version 000 to 001. +/// The conversion is needed because the table has been extended with the ITSClusterSize column +/// and the ITSClusterMap column is evaluated dynamically from it. +/// In the converter a dummy ITSClusterSize column is filled with overflows if a hit in the layer is present + +/// \author F.Mazzaschi + #include "Framework/runDataProcessing.h" #include "Framework/AnalysisTask.h" #include "Framework/AnalysisDataModel.h" @@ -15,14 +26,11 @@ using namespace o2; using namespace o2::framework; -// Converts TracksExtra table from version 000 to 001 -struct tracksExtraConverter { +struct TracksExtraConverter { Produces tracksExtra_001; void process(aod::TracksExtra_000 const& tracksExtra_000) { - // dummy itsClusterSizes, fill with overflows if a hit in the layer is present - for (const auto& track0 : tracksExtra_000) { uint32_t itsClusterSizes = 0; @@ -56,15 +64,15 @@ struct tracksExtraConverter { } }; -struct tracksExtraSpawner { - // spawn the extended table for TracksExtra001 to avoid the call to the internal spawner and the circular dependency +/// Spawn the extended table for TracksExtra001 to avoid the call to the internal spawner and a consequent circular dependency +struct TracksExtraSpawner { Spawns tracksExtra_001; }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ - adaptAnalysisTask(cfgc), - adaptAnalysisTask(cfgc), + adaptAnalysisTask(cfgc), + adaptAnalysisTask(cfgc), }; }