CbmRoot
Loading...
Searching...
No Matches
cbm::algo::trd::ReadoutConfig Class Reference

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.
 

Detailed Description

Provides the hardware-to-software address mapping for the CBM-TRD.

Author
Volker Friese v.fri.nosp@m.ese@.nosp@m.gsi.d.nosp@m.e
Since
3 March 2022

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.

Constructor & Destructor Documentation

◆ ReadoutConfig()

cbm::algo::trd::ReadoutConfig::ReadoutConfig ( )

Constructor.

Definition at line 23 of file trd/ReadoutConfig.cxx.

◆ ~ReadoutConfig()

cbm::algo::trd::ReadoutConfig::~ReadoutConfig ( )

Destructor.

Definition at line 29 of file trd/ReadoutConfig.cxx.

Member Function Documentation

◆ CBM_YAML_PROPERTIES()

cbm::algo::trd::ReadoutConfig::CBM_YAML_PROPERTIES ( yaml::Property &::, "", " " TRD1D,
yaml::Property &::, "", " ", {}, ::Hex ,
yaml::Property &::, "", " " map,
yaml::Property &::, "", " & " combination )
private

◆ GetElinkTimeOffset()

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().

◆ GetEquipmentIds()

std::vector< uint16_t > cbm::algo::trd::ReadoutConfig::GetEquipmentIds ( )

Equipment in the configuration.

Returns
Vector of equipment IDs

Definition at line 34 of file trd/ReadoutConfig.cxx.

References fReadoutMap.

Referenced by cbm::algo::trd::Unpack::Unpack().

◆ GetNumCrobs()

size_t cbm::algo::trd::ReadoutConfig::GetNumCrobs ( uint16_t equipmentId)

Number of CROBS of a component.

Parameters
EquipmentID
Returns
Number of CROBS

Definition at line 45 of file trd/ReadoutConfig.cxx.

References fReadoutMap.

Referenced by GetNumElinks(), and cbm::algo::trd::Unpack::Unpack().

◆ GetNumElinks()

size_t cbm::algo::trd::ReadoutConfig::GetNumElinks ( uint16_t equipmentId,
uint16_t crobId )

Number of elinks of a component - CROB pair.

Parameters
EquipmentID
CROBID
Returns
Number of elinks

Definition at line 56 of file trd/ReadoutConfig.cxx.

References fReadoutMap, and GetNumCrobs().

Referenced by cbm::algo::trd::Unpack::Unpack().

◆ GetSystemTimeOffset()

int64_t cbm::algo::trd::ReadoutConfig::GetSystemTimeOffset ( )
inline

Get system time offset.

Definition at line 94 of file trd/ReadoutConfig.h.

References fSystemTimeOffset.

Referenced by cbm::algo::trd::Unpack::Unpack().

◆ Init()

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().

◆ Map()

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)

Parameters
equipIdEquipment identifier (component)
crobCROB number within component
elinkElink number within CROB
Returns
pair (ASIC address, channel addresses )

Definition at line 117 of file trd/ReadoutConfig.cxx.

References fChannelMap, fReadoutMap, and size().

Referenced by cbm::algo::trd::Unpack::Unpack().

◆ PrintReadoutMap()

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.

◆ SetElinkTimeOffset()

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().

◆ SetSystemTimeOffset()

void cbm::algo::trd::ReadoutConfig::SetSystemTimeOffset ( int64_t offsetNs)
inline

Get system time offset.

Definition at line 91 of file trd/ReadoutConfig.h.

References fSystemTimeOffset.

Referenced by CbmTaskTrdUnpackParWrite::Init().

Member Data Documentation

◆ fChannelMap

std::map<uint16_t, std::vector<std::vector<std::vector<uint32_t> > > > cbm::algo::trd::ReadoutConfig::fChannelMap = {}
private

Definition at line 106 of file trd/ReadoutConfig.h.

Referenced by Init(), Map(), and PrintReadoutMap().

◆ fElinkTimeOffsetMap

std::map<uint32_t, std::vector<int32_t> > cbm::algo::trd::ReadoutConfig::fElinkTimeOffsetMap
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().

◆ fReadoutMap

std::map<uint16_t, std::vector<std::vector<uint16_t> > > cbm::algo::trd::ReadoutConfig::fReadoutMap = {}
private

◆ fSystemTimeOffset

int64_t cbm::algo::trd::ReadoutConfig::fSystemTimeOffset = 0
private

Definition at line 98 of file trd/ReadoutConfig.h.

Referenced by GetSystemTimeOffset(), and SetSystemTimeOffset().


The documentation for this class was generated from the following files: