Project
Loading...
Searching...
No Matches
o2::mch::raw::GBTEncoder< FORMAT, CHARGESUM, VERSION > Class Template Reference

A GBTEncoder manages 40 ElinkEncoder to encode the data of one GBT. More...

#include <GBTEncoder.h>

Public Member Functions

 GBTEncoder (uint16_t linkId)
 
uint16_t linkId () const
 returns the GBT id
 
size_t size () const
 return the number of bytes our current buffer is
 

Methods for testing.

static bool forceNoPhase = false
 

Main interface.

void addChannelData (uint8_t elinkGroupId, uint8_t elinkIndexInGroup, uint8_t chId, const std::vector< SampaCluster > &data)
 
void addHeartbeat (uint8_t elinkGroupId, uint8_t elinkIndexInGroup, uint20_t bunchCrossing)
 
void resetLocalBunchCrossing ()
 
size_t moveToBuffer (std::vector< std::byte > &buffer)
 

Detailed Description

template<typename FORMAT, typename CHARGESUM, int VERSION = 0>
class o2::mch::raw::GBTEncoder< FORMAT, CHARGESUM, VERSION >

A GBTEncoder manages 40 ElinkEncoder to encode the data of one GBT.

Channel data is added using the addChannelData() method. The encoded data (in the form of 64 bits words) is exported to 8-bits words buffer using the moveToBuffer() method.

Definition at line 43 of file GBTEncoder.h.

Constructor & Destructor Documentation

◆ GBTEncoder()

template<typename FORMAT , typename CHARGESUM , int VERSION>
o2::mch::raw::GBTEncoder< FORMAT, CHARGESUM, VERSION >::GBTEncoder ( uint16_t  linkId)

Constructor.

Parameters
linkIdof this GBT (0..11)

Definition at line 121 of file GBTEncoder.h.

Member Function Documentation

◆ addChannelData()

template<typename FORMAT , typename CHARGESUM , int VERSION>
void o2::mch::raw::GBTEncoder< FORMAT, CHARGESUM, VERSION >::addChannelData ( uint8_t  elinkGroupId,
uint8_t  elinkIndexInGroup,
uint8_t  chId,
const std::vector< SampaCluster > &  data 
)

add data for one channel.

Parameters
elinkGroupId0..7
elinkIndexInGroup0..4
chId0..63 dualSampa channel
datavector of SampaCluster objects

Definition at line 131 of file GBTEncoder.h.

◆ addHeartbeat()

template<typename FORMAT , typename CHARGESUM , int VERSION>
void o2::mch::raw::GBTEncoder< FORMAT, CHARGESUM, VERSION >::addHeartbeat ( uint8_t  elinkGroupId,
uint8_t  elinkIndexInGroup,
uint20_t  bunchCrossing 
)

add a Heartbeat (HB) packet for a given dual sampa

Parameters
elinkGroupId0..7
elinkIndexInGroup0..4
bunchcrossinglocal (to sampa) bunch crossing

Definition at line 141 of file GBTEncoder.h.

◆ linkId()

template<typename FORMAT , typename CHARGESUM , int VERSION = 0>
uint16_t o2::mch::raw::GBTEncoder< FORMAT, CHARGESUM, VERSION >::linkId ( ) const
inline

returns the GBT id

Definition at line 88 of file GBTEncoder.h.

◆ moveToBuffer()

template<typename FORMAT , typename CHARGESUM , int VERSION>
size_t o2::mch::raw::GBTEncoder< FORMAT, CHARGESUM, VERSION >::moveToBuffer ( std::vector< std::byte > &  buffer)

Export our encoded data.

The internal GBT words that have been accumulated so far are moved (i.e. deleted from this object) to the external buffer of bytes. Returns the number of bytes added to buffer

Definition at line 150 of file GBTEncoder.h.

◆ resetLocalBunchCrossing()

template<typename FORMAT , typename CHARGESUM , int VERSION = 0>
void o2::mch::raw::GBTEncoder< FORMAT, CHARGESUM, VERSION >::resetLocalBunchCrossing ( )

reset local bunch-crossing counter.

(the one that is used in the sampa headers)

◆ size()

template<typename FORMAT , typename CHARGESUM , int VERSION = 0>
size_t o2::mch::raw::GBTEncoder< FORMAT, CHARGESUM, VERSION >::size ( ) const
inline

return the number of bytes our current buffer is

Definition at line 91 of file GBTEncoder.h.

Member Data Documentation

◆ forceNoPhase

template<typename FORMAT , typename CHARGESUM , int VERSION>
bool o2::mch::raw::GBTEncoder< FORMAT, CHARGESUM, VERSION >::forceNoPhase = false
static

Sets to true to bypass simulation of time misalignment of elinks.

Definition at line 84 of file GBTEncoder.h.


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