Skip to content
Snippets Groups Projects
Commit 40dc7ac4 authored by Dominik Smith's avatar Dominik Smith Committed by Pierre-Alain Loizeau
Browse files

Added YAML-configurable system offset TRD2D unpacker in cbm::algo.

parent 71ad1331
No related branches found
No related tags found
1 merge request!1851Added YAML-configurable system offset TRD2D unpacker in cbm::algo.
...@@ -108,7 +108,13 @@ namespace cbm::algo::trd2d ...@@ -108,7 +108,13 @@ namespace cbm::algo::trd2d
void InitChannelMap( void InitChannelMap(
const std::map<size_t, std::map<size_t, std::map<size_t, std::tuple<int32_t, bool, uint64_t>>>>& channelMap); 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: private:
// --- System time offset
int64_t fSystemTimeOffset = 0;
// --- TRD2D readout map // --- TRD2D readout map
// --- Map index: (equipment), map value: (module id, crob id) // --- Map index: (equipment), map value: (module id, crob id)
std::map<uint16_t, CompMapping> fReadoutMap = {}; //! std::map<uint16_t, CompMapping> fReadoutMap = {}; //!
...@@ -117,7 +123,8 @@ namespace cbm::algo::trd2d ...@@ -117,7 +123,8 @@ namespace cbm::algo::trd2d
// --- Map index: (equipment, asic, chan), map value: (pad address, mask flag, daq offset) // --- Map index: (equipment, asic, chan), map value: (pad address, mask flag, daq offset)
std::map<uint16_t, std::vector<std::vector<ChanMapping>>> fChannelMap = {}; //! 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::Hex),
yaml::Property(&ReadoutConfig::fChannelMap, "channelMap", yaml::Property(&ReadoutConfig::fChannelMap, "channelMap",
"Maps equipment, ASIC and channel to pad address, R pairing flag and DAQ offset", "Maps equipment, ASIC and channel to pad address, R pairing flag and DAQ offset",
......
...@@ -11,8 +11,7 @@ using fles::Subsystem; ...@@ -11,8 +11,7 @@ using fles::Subsystem;
Unpack::Unpack(const ReadoutConfig& readout) : fReadout(readout) 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 // Create one algorithm per component for TRD and configure it with parameters
auto equipIdsTrd2d = fReadout.GetEquipmentIds(); auto equipIdsTrd2d = fReadout.GetEquipmentIds();
...@@ -33,10 +32,10 @@ Unpack::Unpack(const ReadoutConfig& readout) : fReadout(readout) ...@@ -33,10 +32,10 @@ Unpack::Unpack(const ReadoutConfig& readout) : fReadout(readout)
chanPar.fDaqOffset = pars.daqOffset; // Time calibration parameter chanPar.fDaqOffset = pars.daqOffset; // Time calibration parameter
asicPar.fChanParams.push_back(chanPar); asicPar.fChanParams.push_back(chanPar);
} }
auto comppars = fReadout.CompMap(equip); auto comppars = fReadout.CompMap(equip);
par.fSystemTimeOffset = SystemTimeOffset; par.fSystemTimeOffset = fReadout.GetSystemTimeOffset();
par.fModId = comppars.moduleId; par.fModId = comppars.moduleId;
par.fCrobId = comppars.crobId; par.fCrobId = comppars.crobId;
par.fAsicParams.push_back(asicPar); par.fAsicParams.push_back(asicPar);
} }
auto algo = std::make_unique<UnpackMS>(par); auto algo = std::make_unique<UnpackMS>(par);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment