CbmRoot
|
Provides the hardware-to-software address mapping for the CBM-TRD. More...
#include <ReadoutConfig.h>
Public Member Functions | |
ReadoutConfig () | |
Constructor. | |
~ReadoutConfig () | |
Destructor. | |
std::vector< uint16_t > | GetEquipmentIds () |
Equipment in the configuration. | |
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. | |
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) | |
void | SetElinkTimeOffset (uint32_t criid, uint8_t elinkid, int32_t offsetNs) |
Register a time offeset to be substracted from the digis which come from a specific CRI. | |
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. | |
std::string | PrintReadoutMap () |
Debug output of readout map. | |
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) |
Initialisation of readout map. | |
void | SetSystemTimeOffset (int64_t offsetNs) |
Get system time offset. | |
int64_t | GetSystemTimeOffset () |
Get system time offset. | |
Private Member Functions | |
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::fChannelMap, "channelMap", "TRD channel map"), yaml::Property(&ReadoutConfig::fElinkTimeOffsetMap, "elinkTimeOffset", "TRD time offset per CRI&Elink combination")) | |
Private Attributes | |
int64_t | fSystemTimeOffset = 0 |
std::map< uint16_t, std::vector< std::vector< uint16_t > > > | fReadoutMap = {} |
std::map< uint16_t, std::vector< std::vector< std::vector< uint32_t > > > > | fChannelMap = {} |
std::map< uint32_t, std::vector< int32_t > > | fElinkTimeOffsetMap |
Map to store time offsets for each CRI&Elink combination. | |
Provides the hardware-to-software address mapping for the CBM-TRD.
The hardware address as provided in the raw data stream is specified in terms of the equipment identifier (specific to one FLES component) and the elink number with in component. This is to be translated into the module address and the ASIC number within the module. The mapping of the two address spaces is hard-coded in this class.
Definition at line 31 of file trd/ReadoutConfig.h.
cbm::algo::trd::ReadoutConfig::ReadoutConfig | ( | ) |
Constructor.
Definition at line 23 of file trd/ReadoutConfig.cxx.
cbm::algo::trd::ReadoutConfig::~ReadoutConfig | ( | ) |
Destructor.
Definition at line 29 of file trd/ReadoutConfig.cxx.
|
private |
int32_t cbm::algo::trd::ReadoutConfig::GetElinkTimeOffset | ( | uint32_t | criid, |
uint8_t | elinkid ) |
Get the time offeset to be substracted from the digis which come from a specific CRI.
Definition at line 145 of file trd/ReadoutConfig.cxx.
References fElinkTimeOffsetMap.
Referenced by cbm::algo::trd::Unpack::Unpack().
std::vector< uint16_t > cbm::algo::trd::ReadoutConfig::GetEquipmentIds | ( | ) |
Equipment in the configuration.
Definition at line 34 of file trd/ReadoutConfig.cxx.
References fReadoutMap.
Referenced by cbm::algo::trd::Unpack::Unpack().
size_t cbm::algo::trd::ReadoutConfig::GetNumCrobs | ( | uint16_t | equipmentId | ) |
Number of CROBS of a component.
Equipment | ID |
Definition at line 45 of file trd/ReadoutConfig.cxx.
References fReadoutMap.
Referenced by GetNumElinks(), and cbm::algo::trd::Unpack::Unpack().
size_t cbm::algo::trd::ReadoutConfig::GetNumElinks | ( | uint16_t | equipmentId, |
uint16_t | crobId ) |
Number of elinks of a component - CROB pair.
Equipment | ID |
CROB | ID |
Definition at line 56 of file trd/ReadoutConfig.cxx.
References fReadoutMap, and GetNumCrobs().
Referenced by cbm::algo::trd::Unpack::Unpack().
|
inline |
Get system time offset.
Definition at line 94 of file trd/ReadoutConfig.h.
References fSystemTimeOffset.
Referenced by cbm::algo::trd::Unpack::Unpack().
void cbm::algo::trd::ReadoutConfig::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 ) |
Initialisation of readout map.
Definition at line 66 of file trd/ReadoutConfig.cxx.
References fChannelMap, and fReadoutMap.
Referenced by CbmTaskTrdUnpackParWrite::Init().
std::pair< int32_t, std::vector< uint32_t > > cbm::algo::trd::ReadoutConfig::Map | ( | uint16_t | equipId, |
uint16_t | crob, | ||
uint16_t | elink ) |
API: Mapping from component, crob and elink to pair (ASIC address, channel addresses)
equipId | Equipment identifier (component) |
crob | CROB number within component |
elink | Elink number within CROB |
Definition at line 117 of file trd/ReadoutConfig.cxx.
References fChannelMap, fReadoutMap, and size().
Referenced by cbm::algo::trd::Unpack::Unpack().
std::string cbm::algo::trd::ReadoutConfig::PrintReadoutMap | ( | ) |
Debug output of readout map.
Definition at line 158 of file trd/ReadoutConfig.cxx.
References fChannelMap, and fReadoutMap.
void cbm::algo::trd::ReadoutConfig::SetElinkTimeOffset | ( | uint32_t | criid, |
uint8_t | elinkid, | ||
int32_t | offsetNs ) |
Register a time offeset to be substracted from the digis which come from a specific CRI.
Definition at line 134 of file trd/ReadoutConfig.cxx.
References fElinkTimeOffsetMap.
Referenced by CbmTaskTrdUnpackParWrite::Init().
|
inline |
Get system time offset.
Definition at line 91 of file trd/ReadoutConfig.h.
References fSystemTimeOffset.
Referenced by CbmTaskTrdUnpackParWrite::Init().
|
private |
Definition at line 106 of file trd/ReadoutConfig.h.
Referenced by Init(), Map(), and PrintReadoutMap().
|
private |
Map to store time offsets for each CRI&Elink combination.
Definition at line 109 of file trd/ReadoutConfig.h.
Referenced by GetElinkTimeOffset(), and SetElinkTimeOffset().
|
private |
Definition at line 102 of file trd/ReadoutConfig.h.
Referenced by GetEquipmentIds(), GetNumCrobs(), GetNumElinks(), Init(), Map(), and PrintReadoutMap().
|
private |
Definition at line 98 of file trd/ReadoutConfig.h.
Referenced by GetSystemTimeOffset(), and SetSystemTimeOffset().