From a8d5ca287b8a608bb2947e1bf24b774fb3b7161d Mon Sep 17 00:00:00 2001 From: Marian Ivanov Date: Thu, 12 Dec 2024 10:25:08 +0100 Subject: [PATCH] [Common] TrackQAConverter002- for TOF modification (#8901) Signed-off-by: Felix Schlepper Co-authored-by: Felix Schlepper --- .../TableProducer/Converters/CMakeLists.txt | 5 + .../Converters/trackQA002Converter.cxx | 97 +++++++++++++++++++ 2 files changed, 102 insertions(+) create mode 100644 Common/TableProducer/Converters/trackQA002Converter.cxx diff --git a/Common/TableProducer/Converters/CMakeLists.txt b/Common/TableProducer/Converters/CMakeLists.txt index 0bf0ff823d4..eda31568123 100644 --- a/Common/TableProducer/Converters/CMakeLists.txt +++ b/Common/TableProducer/Converters/CMakeLists.txt @@ -88,3 +88,8 @@ o2physics_add_dpl_workflow(trackqa-converter SOURCES trackQAConverter.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(trackqa-converter-002 + SOURCES trackQA002Converter.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) diff --git a/Common/TableProducer/Converters/trackQA002Converter.cxx b/Common/TableProducer/Converters/trackQA002Converter.cxx new file mode 100644 index 00000000000..3e1bc82dbaf --- /dev/null +++ b/Common/TableProducer/Converters/trackQA002Converter.cxx @@ -0,0 +1,97 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// 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. +#include + +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" + +using namespace o2; +using namespace o2::framework; + +struct TrackQAConverter002 { + Produces tracksQA_002; + + void process000(aod::TracksQA_000 const& tracksQA_002) + { + for (const auto& trackQA : tracksQA_000) { + tracksQA_002( + trackQA.trackId(), + trackQA.tpcTime0(), + trackQA.tpcdcaR(), + trackQA.tpcdcaZ(), + trackQA.tpcClusterByteMask(), + trackQA.tpcdEdxMax0R(), + trackQA.tpcdEdxMax1R(), + trackQA.tpcdEdxMax2R(), + trackQA.tpcdEdxMax3R(), + trackQA.tpcdEdxTot0R(), + trackQA.tpcdEdxTot1R(), + trackQA.tpcdEdxTot2R(), + trackQA.tpcdEdxTot3R(), + // dummy values, not available in _000 + std::numeric_limits::min(), // deltaRefContParamY + std::numeric_limits::min(), // deltaRefContParamZ + std::numeric_limits::min(), // deltaRefContParamSnp + std::numeric_limits::min(), // deltaRefContParamTgl + std::numeric_limits::min(), // deltaRefContParamQ2Pt + std::numeric_limits::min(), // deltaRefGloParamY + std::numeric_limits::min(), // deltaRefGloParamZ + std::numeric_limits::min(), // deltaRefGloParamSnp + std::numeric_limits::min(), // deltaRefGloParamTgl + std::numeric_limits::min(), // deltaRefGloParamQ2Pt + std::numeric_limits::min(), // dTofdX + std::numeric_limits::min()); // dTofdY + } + } + PROCESS_SWITCH(TrackQAConverter002, process000, "process v000-to-v002 conversion", false); + + void process001(aod::TracksQA_001 const& tracksQA_002) + { + for (const auto& trackQA : tracksQA_001) { + tracksQA_002( + trackQA.trackId(), + trackQA.tpcTime0(), + trackQA.tpcdcaR(), + trackQA.tpcdcaZ(), + trackQA.tpcClusterByteMask(), + trackQA.tpcdEdxMax0R(), + trackQA.tpcdEdxMax1R(), + trackQA.tpcdEdxMax2R(), + trackQA.tpcdEdxMax3R(), + trackQA.tpcdEdxTot0R(), + trackQA.tpcdEdxTot1R(), + trackQA.tpcdEdxTot2R(), + trackQA.tpcdEdxTot3R(), + trackQA.deltaRefContParamY(), + trackQA.deltaRefITSParamZ(), + trackQA.deltaRefContParamSnp(), + trackQA.deltaRefContParamTgl(), + trackQA.deltaRefContParamQ2Pt(), + trackQA.deltaRefGloParamY(), + trackQA.deltaRefGloParamZ(), + trackQA.deltaRefGloParamSnp(), + trackQA.deltaRefGloParamTgl(), + trackQA.deltaRefGloParamQ2Pt(), + // dummy values, not available in _001 + std::numeric_limits::min(), // dTofdX + std::numeric_limits::min()); // dTofdY + } + } + PROCESS_SWITCH(TrackQAConverter002, process001, "process v001-to-v002 conversion", false); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc), + }; +}