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
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",
......
......@@ -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);
......
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