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

#include <ReadoutConfig.h>

Public Member Functions

 ReadoutConfig ()
 Default Constructor if no valid YAMl file available.
 
 ReadoutConfig (const ReadoutSetup &)
 Constructor with values from YAML file.
 
virtual ~ReadoutConfig ()
 Destructor.
 
int32_t GetSystemTimeOffset () const
 System time offset for MUCH.
 
std::vector< uint16_t > GetEquipmentIds ()
 Equipment in the configuration.
 
size_t GetNumElinks (uint16_t equipmentId)
 Number of elinks of a component.
 
std::vector< uint32_t > Map (uint16_t equipId, uint16_t elink)
 API: Mapping from component and elink to addresses per channel.
 
std::vector< bool > MaskMap (uint16_t equipId, uint16_t elink)
 API: Mapping from component and elink to channel mask flags.
 
std::map< uint16_t, std::vector< std::vector< uint32_t > > > GetFullMap ()
 API: Get fullMapping from component and elink to addresses per channel.
 

Private Member Functions

void Init ()
 Initialisation of readout map with hardcoded values.
 
void Init (const ReadoutSetup &)
 Initialisation of readout map with data from param file.
 
void InitHardcoded ()
 Initialisation of readout map from hardcoded valus, backup if YAML missing.
 
uint32_t CreateMuchAddress (uint32_t dpbidx, int32_t iFebId, uint32_t usChan)
 Maps component index, Fed Id and channel number to Much Address.
 
void InitChannelToPadMaps ()
 Init arrays which store positions of PADs.
 
int32_t GetFebId (uint16_t)
 
int8_t GetPadXA (uint8_t febid, uint8_t channelid)
 
int8_t GetPadYA (uint8_t febid, uint8_t channelid)
 
int8_t GetPadXB (uint8_t febid, uint8_t channelid)
 
int8_t GetPadYB (uint8_t febid, uint8_t channelid)
 
int8_t GetPadXRpc (uint8_t febid, uint8_t channelid)
 
int8_t GetPadYRpc (uint8_t febid, uint8_t channelid)
 

Private Attributes

int32_t fTimeOffset = 0
 
std::map< uint16_t, std::vector< std::vector< uint32_t > > > fReadoutMap = {}
 
std::map< uint16_t, std::map< size_t, std::vector< bool > > > fMaskMap = {}
 
const uint16_t numChanPerAsic = 128
 Number of channels in each ASIC.
 
uint16_t numFebsInGemA = 27
 Variables.
 
uint16_t numFebsInGemB = 27
 Number of FEBs connected in GEM Module B.
 
uint16_t numFebsInRpc = 9
 Number of FEBs connected in RPC Module.
 
std::vector< int16_t > fnFebsIdsArrayGemA
 Array to hold FEB IDs connected to GEM Module A.
 
std::vector< int16_t > fnFebsIdsArrayGemB
 Array to hold FEB IDs connected to GEM Module B.
 
std::vector< int16_t > fnFebsIdsArrayRpc
 Array to hold FEB IDs connected to RPC Module.
 
std::vector< int16_t > fChannelsToPadXA
 Array which stores the corresponding x position of PAD of entire module A.
 
std::vector< int16_t > fChannelsToPadYA
 Array which stores the corresponding y position of PAD of entire module A.
 
std::vector< int16_t > fChannelsToPadXB
 Array which stores the corresponding x position of PAD of entire module B.
 
std::vector< int16_t > fChannelsToPadYB
 Array which stores the corresponding y position of PAD of entire module B.
 
std::vector< int16_t > fChannelsToPadXRpc
 Array which stores the corresponding x position of PAD of RPC module.
 
std::vector< int16_t > fChannelsToPadYRpc
 Array which stores the corresponding y position of PAD of RPC module.
 

Static Private Attributes

static const uint16_t numCrobPerComp = 1
 Constants.
 
static const uint16_t numElinksPerCrob = 42
 Number of elinks in each CROB ?
 
static const uint16_t numFebsPerCrob = 9
 Number of FEBs connected to each CROB for mMuch 2019.
 
static const uint16_t numAsicsPerFeb = 1
 Number of ASICs connected in each FEB for MUCH.
 
static constexpr int16_t elink2Feb [numElinksPerCrob]
 

Detailed Description

Definition at line 75 of file much/ReadoutConfig.h.

Constructor & Destructor Documentation

◆ ReadoutConfig() [1/2]

ReadoutConfig::ReadoutConfig ( )

Default Constructor if no valid YAMl file available.

Definition at line 20 of file much/ReadoutConfig.cxx.

References InitHardcoded().

◆ ReadoutConfig() [2/2]

ReadoutConfig::ReadoutConfig ( const ReadoutSetup & config)

Constructor with values from YAML file.

Definition at line 24 of file much/ReadoutConfig.cxx.

References Init().

◆ ~ReadoutConfig()

ReadoutConfig::~ReadoutConfig ( )
virtual

Destructor.

Definition at line 28 of file much/ReadoutConfig.cxx.

Member Function Documentation

◆ CreateMuchAddress()

uint32_t ReadoutConfig::CreateMuchAddress ( uint32_t dpbidx,
int32_t iFebId,
uint32_t usChan )
private

Maps component index, Fed Id and channel number to Much Address.

Below FebID is according to FEB Position in Module GEM A or Module GEM B (Carefully write MUCH Par file)

Switch to smx2.0/smx2.1 data-> fiFlag = 0 for 2.0 and fiFlag = 1 for 2.1

Definition at line 244 of file much/ReadoutConfig.cxx.

References CbmMuchAddress::GetAddress(), GetPadXA(), GetPadXB(), GetPadXRpc(), GetPadYA(), GetPadYB(), GetPadYRpc(), and CbmMuchAddress::SetElementId().

Referenced by Init(), and InitHardcoded().

◆ GetEquipmentIds()

std::vector< uint16_t > ReadoutConfig::GetEquipmentIds ( )

Equipment in the configuration.

Returns
Vector of equipment IDs

Definition at line 32 of file much/ReadoutConfig.cxx.

References fReadoutMap.

◆ GetFebId()

int32_t ReadoutConfig::GetFebId ( uint16_t uAsicIdx)
private

◆ GetFullMap()

std::map< uint16_t, std::vector< std::vector< uint32_t > > > cbm::algo::much::ReadoutConfig::GetFullMap ( )
inline

API: Get fullMapping from component and elink to addresses per channel.

Returns
(map of EqId to 2D vector of addresses per channels and elink)

Definition at line 120 of file much/ReadoutConfig.h.

References fReadoutMap.

◆ GetNumElinks()

size_t ReadoutConfig::GetNumElinks ( uint16_t equipmentId)

Number of elinks of a component.

Parameters
EquipmentID
Returns
Number of elinks

Definition at line 42 of file much/ReadoutConfig.cxx.

References fReadoutMap.

◆ GetPadXA()

int8_t ReadoutConfig::GetPadXA ( uint8_t febid,
uint8_t channelid )
private

Definition at line 359 of file much/ReadoutConfig.cxx.

References fChannelsToPadXA, and numChanPerAsic.

Referenced by CreateMuchAddress().

◆ GetPadXB()

int8_t ReadoutConfig::GetPadXB ( uint8_t febid,
uint8_t channelid )
private

Definition at line 382 of file much/ReadoutConfig.cxx.

References fChannelsToPadXB, and numChanPerAsic.

Referenced by CreateMuchAddress().

◆ GetPadXRpc()

int8_t ReadoutConfig::GetPadXRpc ( uint8_t febid,
uint8_t channelid )
private

Definition at line 402 of file much/ReadoutConfig.cxx.

References fChannelsToPadXRpc, and numChanPerAsic.

Referenced by CreateMuchAddress().

◆ GetPadYA()

int8_t ReadoutConfig::GetPadYA ( uint8_t febid,
uint8_t channelid )
private

Definition at line 371 of file much/ReadoutConfig.cxx.

References fChannelsToPadYA, and numChanPerAsic.

Referenced by CreateMuchAddress().

◆ GetPadYB()

int8_t ReadoutConfig::GetPadYB ( uint8_t febid,
uint8_t channelid )
private

Definition at line 392 of file much/ReadoutConfig.cxx.

References fChannelsToPadYB, and numChanPerAsic.

Referenced by CreateMuchAddress().

◆ GetPadYRpc()

int8_t ReadoutConfig::GetPadYRpc ( uint8_t febid,
uint8_t channelid )
private

Definition at line 412 of file much/ReadoutConfig.cxx.

References fChannelsToPadYRpc, and numChanPerAsic.

Referenced by CreateMuchAddress().

◆ GetSystemTimeOffset()

int32_t cbm::algo::much::ReadoutConfig::GetSystemTimeOffset ( ) const
inline

System time offset for MUCH.

Returns
Value of system time offset

Definition at line 90 of file much/ReadoutConfig.h.

References fTimeOffset.

◆ Init() [1/2]

void cbm::algo::much::ReadoutConfig::Init ( )
private

Initialisation of readout map with hardcoded values.

Referenced by ReadoutConfig().

◆ Init() [2/2]

◆ InitChannelToPadMaps()

void ReadoutConfig::InitChannelToPadMaps ( )
private

Init arrays which store positions of PADs.

Definition at line 439 of file much/ReadoutConfig.cxx.

References fChannelsToPadXA, fChannelsToPadXB, fChannelsToPadXRpc, fChannelsToPadYA, fChannelsToPadYB, and fChannelsToPadYRpc.

Referenced by InitHardcoded().

◆ InitHardcoded()

void ReadoutConfig::InitHardcoded ( )
private

Initialisation of readout map from hardcoded valus, backup if YAML missing.

< Total number of MUCH DPBs in system

Definition at line 151 of file much/ReadoutConfig.cxx.

References CreateMuchAddress(), elink2Feb, fMaskMap, fnFebsIdsArrayGemA, fnFebsIdsArrayGemB, fnFebsIdsArrayRpc, fReadoutMap, fTimeOffset, GetFebId(), InitChannelToPadMaps(), numAsicsPerFeb, numChanPerAsic, numCrobPerComp, numElinksPerCrob, and numFebsPerCrob.

Referenced by ReadoutConfig().

◆ Map()

std::vector< uint32_t > ReadoutConfig::Map ( uint16_t equipId,
uint16_t elink )

API: Mapping from component and elink to addresses per channel.

Parameters
equipIdEquipment identifier (component)
elinkElink number within component
Returns
Vector of MUCH addresses, indexed via channel number

Definition at line 52 of file much/ReadoutConfig.cxx.

References fReadoutMap.

◆ MaskMap()

std::vector< bool > ReadoutConfig::MaskMap ( uint16_t equipId,
uint16_t elink )

API: Mapping from component and elink to channel mask flags.

Parameters
equipIdEquipment identifier (component)
elinkElink number within component
Returns
(vector of mask flags for channels per asic)

Definition at line 66 of file much/ReadoutConfig.cxx.

References fMaskMap.

Member Data Documentation

◆ elink2Feb

int16_t cbm::algo::much::ReadoutConfig::elink2Feb[numElinksPerCrob]
staticconstexprprivate
Initial value:
= {0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2,
3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5,
6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8}

Definition at line 156 of file much/ReadoutConfig.h.

Referenced by Init(), and InitHardcoded().

◆ fChannelsToPadXA

std::vector<int16_t> cbm::algo::much::ReadoutConfig::fChannelsToPadXA
private

Array which stores the corresponding x position of PAD of entire module A.

Definition at line 168 of file much/ReadoutConfig.h.

Referenced by GetPadXA(), Init(), and InitChannelToPadMaps().

◆ fChannelsToPadXB

std::vector<int16_t> cbm::algo::much::ReadoutConfig::fChannelsToPadXB
private

Array which stores the corresponding x position of PAD of entire module B.

Definition at line 172 of file much/ReadoutConfig.h.

Referenced by GetPadXB(), Init(), and InitChannelToPadMaps().

◆ fChannelsToPadXRpc

std::vector<int16_t> cbm::algo::much::ReadoutConfig::fChannelsToPadXRpc
private

Array which stores the corresponding x position of PAD of RPC module.

Definition at line 175 of file much/ReadoutConfig.h.

Referenced by GetPadXRpc(), Init(), and InitChannelToPadMaps().

◆ fChannelsToPadYA

std::vector<int16_t> cbm::algo::much::ReadoutConfig::fChannelsToPadYA
private

Array which stores the corresponding y position of PAD of entire module A.

Definition at line 170 of file much/ReadoutConfig.h.

Referenced by GetPadYA(), Init(), and InitChannelToPadMaps().

◆ fChannelsToPadYB

std::vector<int16_t> cbm::algo::much::ReadoutConfig::fChannelsToPadYB
private

Array which stores the corresponding y position of PAD of entire module B.

Definition at line 174 of file much/ReadoutConfig.h.

Referenced by GetPadYB(), Init(), and InitChannelToPadMaps().

◆ fChannelsToPadYRpc

std::vector<int16_t> cbm::algo::much::ReadoutConfig::fChannelsToPadYRpc
private

Array which stores the corresponding y position of PAD of RPC module.

Definition at line 176 of file much/ReadoutConfig.h.

Referenced by GetPadYRpc(), Init(), and InitChannelToPadMaps().

◆ fMaskMap

std::map<uint16_t, std::map<size_t, std::vector<bool> > > cbm::algo::much::ReadoutConfig::fMaskMap = {}
private

Definition at line 132 of file much/ReadoutConfig.h.

Referenced by Init(), InitHardcoded(), and MaskMap().

◆ fnFebsIdsArrayGemA

std::vector<int16_t> cbm::algo::much::ReadoutConfig::fnFebsIdsArrayGemA
private

Array to hold FEB IDs connected to GEM Module A.

Definition at line 164 of file much/ReadoutConfig.h.

Referenced by GetFebId(), Init(), and InitHardcoded().

◆ fnFebsIdsArrayGemB

std::vector<int16_t> cbm::algo::much::ReadoutConfig::fnFebsIdsArrayGemB
private

Array to hold FEB IDs connected to GEM Module B.

Definition at line 165 of file much/ReadoutConfig.h.

Referenced by GetFebId(), Init(), and InitHardcoded().

◆ fnFebsIdsArrayRpc

std::vector<int16_t> cbm::algo::much::ReadoutConfig::fnFebsIdsArrayRpc
private

Array to hold FEB IDs connected to RPC Module.

Definition at line 166 of file much/ReadoutConfig.h.

Referenced by GetFebId(), Init(), and InitHardcoded().

◆ fReadoutMap

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

◆ fTimeOffset

int32_t cbm::algo::much::ReadoutConfig::fTimeOffset = 0
private

Definition at line 124 of file much/ReadoutConfig.h.

Referenced by GetSystemTimeOffset(), Init(), and InitHardcoded().

◆ numAsicsPerFeb

const uint16_t cbm::algo::much::ReadoutConfig::numAsicsPerFeb = 1
staticprivate

Number of ASICs connected in each FEB for MUCH.

Definition at line 150 of file much/ReadoutConfig.h.

Referenced by Init(), and InitHardcoded().

◆ numChanPerAsic

const uint16_t cbm::algo::much::ReadoutConfig::numChanPerAsic = 128
private

Number of channels in each ASIC.

Definition at line 151 of file much/ReadoutConfig.h.

Referenced by GetPadXA(), GetPadXB(), GetPadXRpc(), GetPadYA(), GetPadYB(), GetPadYRpc(), Init(), and InitHardcoded().

◆ numCrobPerComp

const uint16_t cbm::algo::much::ReadoutConfig::numCrobPerComp = 1
staticprivate

Constants.

Number of CROBs possible per DPB

Definition at line 147 of file much/ReadoutConfig.h.

Referenced by Init(), and InitHardcoded().

◆ numElinksPerCrob

const uint16_t cbm::algo::much::ReadoutConfig::numElinksPerCrob = 42
staticprivate

Number of elinks in each CROB ?

Definition at line 148 of file much/ReadoutConfig.h.

Referenced by Init(), and InitHardcoded().

◆ numFebsInGemA

uint16_t cbm::algo::much::ReadoutConfig::numFebsInGemA = 27
private

Variables.

Number of FEBs connected in GEM Module A

Definition at line 161 of file much/ReadoutConfig.h.

Referenced by GetFebId(), and Init().

◆ numFebsInGemB

uint16_t cbm::algo::much::ReadoutConfig::numFebsInGemB = 27
private

Number of FEBs connected in GEM Module B.

Definition at line 162 of file much/ReadoutConfig.h.

Referenced by GetFebId(), and Init().

◆ numFebsInRpc

uint16_t cbm::algo::much::ReadoutConfig::numFebsInRpc = 9
private

Number of FEBs connected in RPC Module.

Definition at line 163 of file much/ReadoutConfig.h.

Referenced by GetFebId(), and Init().

◆ numFebsPerCrob

const uint16_t cbm::algo::much::ReadoutConfig::numFebsPerCrob = 9
staticprivate

Number of FEBs connected to each CROB for mMuch 2019.

Definition at line 149 of file much/ReadoutConfig.h.

Referenced by Init(), and InitHardcoded().


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