14 constexpr std::array<u8, 2> SystemVersion = {0x01, 0x10};
18 for (
auto& equip : equipIdsTrd) {
22 for (
size_t crob = 0; crob < numCrobs; crob++) {
26 for (
size_t elink = 0; elink < numElinks; elink++) {
34 par.fCrobParams.push_back(crobPar);
36 auto algo_01 = std::make_unique<UnpackMS<SystemVersion[0]>>(std::move(par));
37 auto algo_10 = std::make_unique<UnpackMS<SystemVersion[1]>>(std::move(par));
38 fAlgos[{equip, SystemVersion[0]}] = std::move(algo_01);
39 fAlgos[{equip, SystemVersion[1]}] = std::move(algo_10);
41 L_(debug) <<
"--- Configured equipment " << equip <<
" with " << numCrobs <<
" crobs";
43 L_(info) <<
"--- Configured " <<
fAlgos.size() <<
" unpacker algorithms for TRD.";
Result_t DoUnpack(const fles::Subsystem subsystem, const fles::Timeslice &ts) const
std::map< UnpackKey, std::unique_ptr< Unpack_t > > fAlgos
Provides the hardware-to-software address mapping for the CBM-TRD.
std::vector< uint16_t > GetEquipmentIds()
Equipment in the configuration.
std::pair< int32_t, std::vector< uint32_t > > Map(uint16_t equipId, uint16_t crob, uint16_t elink)
API: Mapping from component, crob and elink to pair (ASIC address, channel addresses)
int32_t GetElinkTimeOffset(uint32_t criid, uint8_t elinkid)
Get the time offeset to be substracted from the digis which come from a specific CRI.
size_t GetNumCrobs(uint16_t equipmentId)
Number of CROBS of a component.
size_t GetNumElinks(uint16_t equipmentId, uint16_t crobId)
Number of elinks of a component - CROB pair.
int64_t GetSystemTimeOffset()
Get system time offset.
detail::UnpackBase::Result_t Result_t
Unpack(const ReadoutConfig &readout)
Result_t operator()(const fles::Timeslice &) const
TRD Unpacking parameters for one CROB.
std::vector< UnpackElinkPar > fElinkParams
Parameters for each eLink.
TRD Unpacking parameters for one eLink.
std::vector< uint32_t > fChanAddress
CbmTrdAddress for different channels.
uint32_t fAddress
Asic address.
uint64_t fTimeOffset
Time calibration parameter.
Parameters required for the TRD unpacking (specific to one component)