From 33e0b19f16c63571d448f22ffd0f7509abfeb015 Mon Sep 17 00:00:00 2001 From: Felix Weiglhofer <weiglhofer@fias.uni-frankfurt.de> Date: Fri, 22 Mar 2024 09:53:18 +0000 Subject: [PATCH] online: Move STS time offset into config file. --- algo/detectors/sts/ReadoutConfig.cxx | 1 + algo/detectors/sts/ReadoutConfig.h | 16 +++++++++++----- algo/detectors/sts/ReadoutConfig_mCBM2022.cxx | 2 ++ algo/detectors/sts/Unpack.cxx | 3 +-- external/InstallParameter.cmake | 2 +- 5 files changed, 16 insertions(+), 8 deletions(-) diff --git a/algo/detectors/sts/ReadoutConfig.cxx b/algo/detectors/sts/ReadoutConfig.cxx index f2e187ee69..14fd5c59b0 100644 --- a/algo/detectors/sts/ReadoutConfig.cxx +++ b/algo/detectors/sts/ReadoutConfig.cxx @@ -86,6 +86,7 @@ void sts::ReadoutConfig::Init(const ReadoutSetup& config, const ChannelMaskSet& const uint16_t numChanPerAsic = 128; ///< Number of channels per ASIC const uint16_t numElinksPerComp = numCrobPerComp * numElinksPerCrob; + fTimeOffset = config.timeOffset; // map from feb ID to adc cut // TODO: Don't hardcode this. Read from configuration file. diff --git a/algo/detectors/sts/ReadoutConfig.h b/algo/detectors/sts/ReadoutConfig.h index f78931eebf..48d7daa3c4 100644 --- a/algo/detectors/sts/ReadoutConfig.h +++ b/algo/detectors/sts/ReadoutConfig.h @@ -70,6 +70,7 @@ namespace cbm::algo::sts yaml::Property(&Elink::toAsicFebB, "toAsicFebB", "Mapping of eLink to ASIC for FEB Type B", YAML::Hex)); }; + i32 timeOffset; u16 numAsicsPerFeb; std::vector<Module> modules; std::vector<Component> components; @@ -78,12 +79,13 @@ namespace cbm::algo::sts const std::vector<Elink>& GetElinks(FEBType type) const; - CBM_YAML_PROPERTIES(yaml::Property(&ReadoutSetup::numAsicsPerFeb, "numAsicsPerFeb", "Number of ASICs per FEB"), - yaml::Property(&ReadoutSetup::modules, "modules", "Modules", {}, YAML::Flow), - yaml::Property(&ReadoutSetup::components, "components", "Components", {}, YAML::Flow), - yaml::Property(&ReadoutSetup::elinksFeb8_1, "elinksFeb8_1", + CBM_YAML_PROPERTIES(yaml::Property(&ReadoutSetup::timeOffset, "timeOffset", "Time offset for STS", YAML::Hex), + yaml::Property(&ReadoutSetup::numAsicsPerFeb, "numAsicsPerFeb", "Number of ASICs per FEB"), + yaml::Property(&ReadoutSetup::modules, "modules", "Modules", {}, YAML::Flow), + yaml::Property(&ReadoutSetup::components, "components", "Components", {}, YAML::Flow), + yaml::Property(&ReadoutSetup::elinksFeb8_1, "elinksFeb8_1", "Elinks for FEB8_1 (1:1 elink:ASIC, 5 FEB / ROB)", {}, YAML::Flow), - yaml::Property(&ReadoutSetup::elinksFeb8_5, "elinksFeb8_5", + yaml::Property(&ReadoutSetup::elinksFeb8_5, "elinksFeb8_5", "Elinks for FEB8_5 (5:1 elink:ASIC, 1 FEB / ROB)", {}, YAML::Flow)); }; @@ -115,6 +117,8 @@ namespace cbm::algo::sts /** @brief Constructor **/ ReadoutConfig(const ReadoutSetup&, const ChannelMaskSet&); + i64 TimeOffset() const { return fTimeOffset; } + /** @brief Equipment in the configuration ** @return Vector of equipment IDs **/ @@ -157,6 +161,8 @@ namespace cbm::algo::sts std::string PrintReadoutMap(); private: + i32 fTimeOffset = 0; // Time offset for STS + // --- STS readout map // --- Map index: (equipment, elink) std::map<u16, std::vector<Entry>> fReadoutConfig = {}; //! diff --git a/algo/detectors/sts/ReadoutConfig_mCBM2022.cxx b/algo/detectors/sts/ReadoutConfig_mCBM2022.cxx index 70c800df57..2fdcd40c2d 100644 --- a/algo/detectors/sts/ReadoutConfig_mCBM2022.cxx +++ b/algo/detectors/sts/ReadoutConfig_mCBM2022.cxx @@ -10,6 +10,8 @@ ReadoutConfig ReadoutConfig::MakeMCBM2022() { ReadoutSetup setup; + setup.timeOffset = -970; + // clang-format off setup.numAsicsPerFeb = 8; diff --git a/algo/detectors/sts/Unpack.cxx b/algo/detectors/sts/Unpack.cxx index 7cf95a1fb3..c153322e42 100644 --- a/algo/detectors/sts/Unpack.cxx +++ b/algo/detectors/sts/Unpack.cxx @@ -14,7 +14,6 @@ Unpack::Unpack(const Config& config) : fConfig(config) uint32_t numChansPerAsicSts = 128; // R/O channels per ASIC for STS uint32_t numAsicsPerModuleSts = 16; // Number of ASICs per module for STS - constexpr i64 SystemTimeOffset = -970; // ns? constexpr u8 SystemVersion = 0x20; auto equipIdsSts = fConfig.readout.GetEquipmentIds(); @@ -28,7 +27,7 @@ Unpack::Unpack(const Config& config) : fConfig(config) auto mapEntry = fConfig.readout.Map(equip, elink); elinkPar.fAddress = mapEntry.moduleAddress; // Module address for this elink elinkPar.fAsicNr = mapEntry.asicNumber; // ASIC number within module - elinkPar.fTimeOffset = SystemTimeOffset; + elinkPar.fTimeOffset = fConfig.readout.TimeOffset(); elinkPar.fAdcMinCut = fConfig.readout.AdcCutMap(equip, elink); elinkPar.fAdcOffset = 1.; elinkPar.fAdcGain = 1.; diff --git a/external/InstallParameter.cmake b/external/InstallParameter.cmake index 2e88928501..85af434220 100644 --- a/external/InstallParameter.cmake +++ b/external/InstallParameter.cmake @@ -1,4 +1,4 @@ -set(PARAMETER_VERSION 961cdcd9f50561aaa7a305d78cf1d6157cd5ac68) # 2024-03-19 +set(PARAMETER_VERSION 4eb5a8fb28d265bd0ff235f696fceaf53db11702) # 2024-03-22 set(PARAMETER_SRC_URL "https://git.cbm.gsi.de/CbmSoft/cbmroot_parameter.git") -- GitLab