![]() |
Project
|
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) |
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.
o2::mch::raw::GBTEncoder< FORMAT, CHARGESUM, VERSION >::GBTEncoder | ( | uint16_t | linkId | ) |
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.
elinkGroupId | 0..7 |
elinkIndexInGroup | 0..4 |
chId | 0..63 dualSampa channel |
data | vector of SampaCluster objects |
Definition at line 131 of file GBTEncoder.h.
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
elinkGroupId | 0..7 |
elinkIndexInGroup | 0..4 |
bunchcrossing | local (to sampa) bunch crossing |
Definition at line 141 of file GBTEncoder.h.
|
inline |
returns the GBT id
Definition at line 88 of file GBTEncoder.h.
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.
void o2::mch::raw::GBTEncoder< FORMAT, CHARGESUM, VERSION >::resetLocalBunchCrossing | ( | ) |
reset local bunch-crossing counter.
(the one that is used in the sampa headers)
|
inline |
return the number of bytes our current buffer is
Definition at line 91 of file GBTEncoder.h.
|
static |
Sets to true to bypass simulation of time misalignment of elinks.
Definition at line 84 of file GBTEncoder.h.