diff --git a/algo/detectors/trd2d/ReadoutConfig.h b/algo/detectors/trd2d/ReadoutConfig.h index 44df9ad7981cd546dd98c1ac82ab826a9e764fa0..0c2bdc7b1b04086963433a2093699d895c47b4da 100644 --- a/algo/detectors/trd2d/ReadoutConfig.h +++ b/algo/detectors/trd2d/ReadoutConfig.h @@ -108,7 +108,13 @@ namespace cbm::algo::trd2d void InitChannelMap( const std::map<size_t, std::map<size_t, std::map<size_t, std::tuple<int32_t, bool, uint64_t>>>>& channelMap); + /** @brief Get system time offset **/ + int64_t GetSystemTimeOffset() { return fSystemTimeOffset; }; + private: + // --- System time offset + int64_t fSystemTimeOffset = 0; + // --- TRD2D readout map // --- Map index: (equipment), map value: (module id, crob id) std::map<uint16_t, CompMapping> fReadoutMap = {}; //! @@ -117,7 +123,8 @@ namespace cbm::algo::trd2d // --- Map index: (equipment, asic, chan), map value: (pad address, mask flag, daq offset) std::map<uint16_t, std::vector<std::vector<ChanMapping>>> fChannelMap = {}; //! - CBM_YAML_PROPERTIES(yaml::Property(&ReadoutConfig::fReadoutMap, "readoutMap", "Maps equipment to module and CROB ID", + CBM_YAML_PROPERTIES(yaml::Property(&ReadoutConfig::fSystemTimeOffset, "timeOffset", "System time offset for TRD2D"), + yaml::Property(&ReadoutConfig::fReadoutMap, "readoutMap", "Maps equipment to module and CROB ID", YAML::Hex), yaml::Property(&ReadoutConfig::fChannelMap, "channelMap", "Maps equipment, ASIC and channel to pad address, R pairing flag and DAQ offset", diff --git a/algo/detectors/trd2d/Unpack.cxx b/algo/detectors/trd2d/Unpack.cxx index e12ef68aee899ad3b398f78947ff8a9da5c13ff1..cc6b25977dc79ad4b7802d666921d6316b9af47f 100644 --- a/algo/detectors/trd2d/Unpack.cxx +++ b/algo/detectors/trd2d/Unpack.cxx @@ -11,8 +11,7 @@ using fles::Subsystem; Unpack::Unpack(const ReadoutConfig& readout) : fReadout(readout) { - constexpr i64 SystemTimeOffset = -510; - constexpr u8 SystemVersion = 0x02; + constexpr u8 SystemVersion = 0x02; // Create one algorithm per component for TRD and configure it with parameters auto equipIdsTrd2d = fReadout.GetEquipmentIds(); @@ -33,10 +32,10 @@ Unpack::Unpack(const ReadoutConfig& readout) : fReadout(readout) chanPar.fDaqOffset = pars.daqOffset; // Time calibration parameter asicPar.fChanParams.push_back(chanPar); } - auto comppars = fReadout.CompMap(equip); - par.fSystemTimeOffset = SystemTimeOffset; - par.fModId = comppars.moduleId; - par.fCrobId = comppars.crobId; + auto comppars = fReadout.CompMap(equip); + par.fSystemTimeOffset = fReadout.GetSystemTimeOffset(); + par.fModId = comppars.moduleId; + par.fCrobId = comppars.crobId; par.fAsicParams.push_back(asicPar); } auto algo = std::make_unique<UnpackMS>(par);