From 62939388997e812b5abd1c181d2be05b3342a070 Mon Sep 17 00:00:00 2001 From: Roman Lietava Date: Wed, 18 Feb 2026 18:26:43 +0100 Subject: [PATCH 1/2] dev:CTpCfg list of used inputs --- .../include/DataFormatsCTP/Configuration.h | 3 ++- .../Detectors/CTP/src/Configuration.cxx | 19 +++++++++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/DataFormats/Detectors/CTP/include/DataFormatsCTP/Configuration.h b/DataFormats/Detectors/CTP/include/DataFormatsCTP/Configuration.h index e9464089d71fc..ff1462084d53d 100644 --- a/DataFormats/Detectors/CTP/include/DataFormatsCTP/Configuration.h +++ b/DataFormats/Detectors/CTP/include/DataFormatsCTP/Configuration.h @@ -214,7 +214,8 @@ struct CtpCfg { uint32_t orbitShift = 0; uint32_t irInputs_1_24 = 0; uint32_t irInputs_25_48 = 0; - ClassDefNV(CtpCfg, 1) + std::vector listOfUsedInputs(); + ClassDefNV(CtpCfg, 2) }; } // namespace ctp } // namespace o2 diff --git a/DataFormats/Detectors/CTP/src/Configuration.cxx b/DataFormats/Detectors/CTP/src/Configuration.cxx index 61e51bcb20d91..611545e6a5759 100644 --- a/DataFormats/Detectors/CTP/src/Configuration.cxx +++ b/DataFormats/Detectors/CTP/src/Configuration.cxx @@ -1227,9 +1227,24 @@ int CtpCfg::readAndSave(std::string& path) } return 0; } - +std::vector CtpCfg::listOfUsedInputs() +{ + std::cout << std::hex << "0x" << irInputs_1_24 << " " << irInputs_25_48 << std::dec << std::endl; + std::vector inputList; + for(int i = 0; i < 24; i++) { + if ((1ul << i) & irInputs_1_24) { + inputList.push_back(i); + } + } + for(int i = 0; i < 24; i++) { + if ((1ul << i) & irInputs_25_48) { + inputList.push_back(i + 24); + } + } + return inputList; +} std::ostream& o2::ctp::operator<<(std::ostream& in, const o2::ctp::CTPConfiguration& conf) { conf.printStream(in); return in; -} +} \ No newline at end of file From c1569eb3646238f9993ddf8aa410eb6bf59f680b Mon Sep 17 00:00:00 2001 From: Roman Lietava Date: Wed, 18 Feb 2026 18:37:26 +0100 Subject: [PATCH 2/2] clang --- DataFormats/Detectors/CTP/src/Configuration.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DataFormats/Detectors/CTP/src/Configuration.cxx b/DataFormats/Detectors/CTP/src/Configuration.cxx index 611545e6a5759..98458ef06d1d3 100644 --- a/DataFormats/Detectors/CTP/src/Configuration.cxx +++ b/DataFormats/Detectors/CTP/src/Configuration.cxx @@ -1231,12 +1231,12 @@ std::vector CtpCfg::listOfUsedInputs() { std::cout << std::hex << "0x" << irInputs_1_24 << " " << irInputs_25_48 << std::dec << std::endl; std::vector inputList; - for(int i = 0; i < 24; i++) { + for (int i = 0; i < 24; i++) { if ((1ul << i) & irInputs_1_24) { inputList.push_back(i); } } - for(int i = 0; i < 24; i++) { + for (int i = 0; i < 24; i++) { if ((1ul << i) & irInputs_25_48) { inputList.push_back(i + 24); }