diff --git a/algo/detectors/sts/ReadoutConfig.cxx b/algo/detectors/sts/ReadoutConfig.cxx index f2e187ee6962e7c18ca2908fcc3cc68953aa1cf8..14fd5c59b075c1faf86fb68b2ae5fb24d4057d28 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 f78931eebf336434e9ffa9e22c7802e70fbed35c..48d7daa3c45b0d6b5fdae9f8ff0b5e2fc1afe546 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 70c800df5794cb9c7e635e9bce5bc3061d553e90..2fdcd40c2d096e11a5a04a0efb4279ebe67ee60c 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 7cf95a1fb3515def8520e086d14b98dd93ef0319..c153322e42866fc4945c004e0097a8d74ef2cacb 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 2e88928501d3fcf62615c1efe1757f6390a51218..85af4342209c316bf3ddd0d1a9b1230aa14be905 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")