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

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

parent 94fb376c
No related branches found
No related tags found
1 merge request!1852Added YAML-configurable system offset TRD unpacker in cbm::algo.
...@@ -87,7 +87,13 @@ namespace cbm::algo::trd ...@@ -87,7 +87,13 @@ namespace cbm::algo::trd
void Init(const std::map<size_t, std::map<size_t, std::map<size_t, size_t>>>& addressMap, void Init(const std::map<size_t, std::map<size_t, std::map<size_t, size_t>>>& addressMap,
std::map<size_t, std::map<size_t, std::map<size_t, std::map<size_t, size_t>>>>& channelMap); std::map<size_t, std::map<size_t, std::map<size_t, std::map<size_t, size_t>>>>& channelMap);
/** @brief Get system time offset **/
int64_t GetSystemTimeOffset() { return fSystemTimeOffset; };
private: private:
// --- System time offset
int64_t fSystemTimeOffset = 0;
// --- TRD readout map // --- TRD readout map
// --- Map index: (equipment, crob, elink), map value: (ASIC address) // --- Map index: (equipment, crob, elink), map value: (ASIC address)
std::map<uint16_t, std::vector<std::vector<uint16_t>>> fReadoutMap = {}; //! std::map<uint16_t, std::vector<std::vector<uint16_t>>> fReadoutMap = {}; //!
...@@ -100,6 +106,7 @@ namespace cbm::algo::trd ...@@ -100,6 +106,7 @@ namespace cbm::algo::trd
std::map<uint32_t, std::vector<int32_t>> fElinkTimeOffsetMap; std::map<uint32_t, std::vector<int32_t>> fElinkTimeOffsetMap;
CBM_YAML_PROPERTIES( CBM_YAML_PROPERTIES(
yaml::Property(&ReadoutConfig::fSystemTimeOffset, "timeOffset", "System time offset for TRD1D"),
yaml::Property(&ReadoutConfig::fReadoutMap, "readoutMap", "TRD readout map", {}, YAML::Hex), yaml::Property(&ReadoutConfig::fReadoutMap, "readoutMap", "TRD readout map", {}, YAML::Hex),
yaml::Property(&ReadoutConfig::fChannelMap, "channelMap", "TRD channel map"), yaml::Property(&ReadoutConfig::fChannelMap, "channelMap", "TRD channel map"),
yaml::Property(&ReadoutConfig::fElinkTimeOffsetMap, "elinkTimeOffset", "TRD time offset per CRI&Elink combination") yaml::Property(&ReadoutConfig::fElinkTimeOffsetMap, "elinkTimeOffset", "TRD time offset per CRI&Elink combination")
......
...@@ -11,7 +11,6 @@ using fles::Subsystem; ...@@ -11,7 +11,6 @@ using fles::Subsystem;
Unpack::Unpack(const ReadoutConfig& readout) : fReadout(readout) Unpack::Unpack(const ReadoutConfig& readout) : fReadout(readout)
{ {
constexpr i64 SystemTimeOffset = 1300;
constexpr std::array<u8, 2> SystemVersion = {0x01, 0x10}; constexpr std::array<u8, 2> SystemVersion = {0x01, 0x10};
// Create one algorithm per component for TRD and configure it with parameters // Create one algorithm per component for TRD and configure it with parameters
...@@ -29,7 +28,7 @@ Unpack::Unpack(const ReadoutConfig& readout) : fReadout(readout) ...@@ -29,7 +28,7 @@ Unpack::Unpack(const ReadoutConfig& readout) : fReadout(readout)
auto addresses = fReadout.Map(equip, crob, elink); auto addresses = fReadout.Map(equip, crob, elink);
elinkPar.fAddress = addresses.first; // Asic address for this elink elinkPar.fAddress = addresses.first; // Asic address for this elink
elinkPar.fChanAddress = addresses.second; // Channel addresses for this elink elinkPar.fChanAddress = addresses.second; // Channel addresses for this elink
elinkPar.fTimeOffset = SystemTimeOffset + fReadout.GetElinkTimeOffset(crob, elink); elinkPar.fTimeOffset = fReadout.GetSystemTimeOffset() + fReadout.GetElinkTimeOffset(crob, elink);
crobPar.fElinkParams.push_back(elinkPar); crobPar.fElinkParams.push_back(elinkPar);
} }
par.fCrobParams.push_back(crobPar); par.fCrobParams.push_back(crobPar);
......
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