![]() |
Project
|
Information stored in the RCU trailer. More...
#include <RCUTrailer.h>
Classes | |
class | Error |
Error handling of the RCU trailer. More... | |
Public Types | |
enum | BufferMode_t { NBUFFERS4 = 0 , NBUFFERS8 = 1 } |
Handler for encoding of the number of ALTRO buffers in the configuration. More... | |
Public Member Functions | |
RCUTrailer ()=default | |
Constructor. | |
~RCUTrailer ()=default | |
destructor | |
void | reset () |
Reset the RCU trailer. | |
void | printStream (std::ostream &stream) const |
Prints the contents of the RCU trailer data. | |
void | constructFromRawPayload (const gsl::span< const uint32_t > payloadwords) |
Decode RCU trailer from the 32-bit words in the raw buffer. | |
int | getRCUID () const |
Get index of the RCU the trailer belongs to. | |
uint32_t | getTrailerSize () const |
Get the trailer size in number of DDL (32 bit) words. | |
uint32_t | getPayloadSize () const |
Get size of the payload as number of DDL (32-bit) words. | |
uint32_t | getTrailerWordCorruptions () const |
Get number of corrupted trailer words (undefined trailer word code) | |
uint8_t | getFirmwareVersion () const |
Get the firmware version. | |
void | setFirmwareVersion (uint8_t version) |
Set the firmware version. | |
void | setRCUID (int rcuid) |
Set the ID of the RCU. | |
void | setPayloadSize (uint32_t size) |
set the payload size in number of DDL (32-bit) words | |
double | getTimeSampleNS () const |
Access to the sampling time. | |
double | getL1PhaseNS () const |
Access to the L1 phase. | |
void | setTimeSamplePhaseNS (uint64_t triggertime, uint64_t timesample) |
Set the time sample length and L1 phase based on the trigger time. | |
uint16_t | getNumberOfChannelAddressMismatch () const |
Get the number of channels with address mismatch. | |
uint16_t | getNumberOfChannelLengthMismatch () const |
Get the number of channels with length mismatch. | |
void | setNumberOfChannelAddressMismatch (uint16_t nchannel) |
Set the number of channels with address mismatch. | |
void | setNumberOfChannelLengthMismatch (uint8_t nchannel) |
Set the number of channels with length mismatch. | |
uint32_t | getFECErrorsA () const |
uint32_t | getFECErrorsB () const |
uint16_t | getActiveFECsA () const |
uint16_t | getActiveFECsB () const |
void | setFECErrorsA (uint32_t value) |
void | setFECErrorsB (uint32_t value) |
void | setActiveFECsA (uint16_t value) |
void | setActiveFECsB (uint16_t value) |
uint16_t | getBaselineCorrection () const |
Get baseline correction method. | |
bool | getPolarity () const |
Check polarity setting. | |
uint16_t | getNumberOfPresamples () const |
Get the number of presamples (after zero suppression) | |
uint16_t | getNumberOfPostsamples () const |
Get the number of postsamples (after zero suppression) | |
bool | hasSecondBaselineCorr () const |
Check if second baseline correction is applied. | |
uint16_t | getGlitchFilter () const |
Get the glitch filter. | |
uint16_t | getNumberOfNonZeroSuppressedPostsamples () const |
Get the number of postsamples before zero suppression. | |
uint16_t | getNumberOfNonZeroSuppressedPresamples () const |
Get the number of presamples before zero suppression. | |
bool | hasZeroSuppression () const |
Check whether zero suppression has been applied. | |
uint16_t | getNumberOfPretriggerSamples () const |
Get the number of pretrigger samples. | |
uint16_t | getNumberOfSamplesPerChannel () const |
Get the number of samples per channel. | |
uint16_t | getNumberOfAltroBuffers () const |
Get the number of ALTRO buffers. | |
bool | isSparseReadout () const |
Check whether readout is in sparse mode. | |
void | setBaselineCorrection (uint16_t baselineCorrection) |
Set baseline correction method. | |
void | setPolarity (bool doSet) |
Set the polarity. | |
void | setNumberOfPresamples (uint16_t npresamples) |
Set the number of presamples (after zero suppression) | |
void | setNumberOfPostsamples (uint16_t npostsamples) |
Set the number of postsamples (after zero suppression) | |
void | setSecondBaselineCorrection (bool doHave) |
Specify whether second basedline correction has been applied. | |
void | setGlitchFilter (uint16_t glitchfilter) |
Set the glitch filter. | |
void | setNumberOfNonZeroSuppressedPostsamples (uint16_t npostsamples) |
Set the number of postsamples before zero suppression. | |
void | setNumberOfNonZeroSuppressedPresamples (uint16_t npresamples) |
Set the number of presamples after zero suppression. | |
void | setNumberOfPretriggerSamples (uint16_t nsamples) |
Set the number of pretrigger samples. | |
void | setNumberOfSamplesPerChannel (uint16_t nsamples) |
Set the number of samples per channel. | |
void | setZeroSuppression (bool doHave) |
Specify whether zero suppression has been applied. | |
void | setSparseReadout (bool isSparse) |
Set sparse readout mode. | |
void | setNumberOfAltroBuffers (BufferMode_t bufmode) |
Set the number of ALTRO buffers. | |
uint16_t | getErrorsG2 () const |
Get value stored in error counter register 2. | |
uint32_t | getErrorsG3 () const |
Get value stored in error counter register 3. | |
uint32_t | getAltroCFGReg1 () const |
Get value stored in ALTRO config register 1. | |
uint32_t | getAltroCFGReg2 () const |
Get value stored in ALTRO config register 1. | |
void | setErrorsG2 (uint16_t value) |
Set error counter register 2. | |
void | setErrorsG3 (uint32_t value) |
Set error counter register 3. | |
void | setAltroCFGReg1 (uint32_t value) |
Set ALTRO config register 1. | |
void | setAltroCFGReg2 (uint32_t value) |
Set ALTRO config register 2. | |
bool | isInitialized () const |
checlks whether the RCU trailer is initialzied | |
std::vector< uint32_t > | encode () const |
Encode RCU trailer as array of DDL (32-bit) words. | |
Static Public Member Functions | |
static RCUTrailer | constructFromPayloadWords (const gsl::span< const uint32_t > payloadwords) |
Decode RCU trailer from payload. | |
static bool | checkLastTrailerWord (uint32_t trailerword) |
Check whether the word is a valid last trailer word. | |
Information stored in the RCU trailer.
The RCU trailer can be found at the end of the payload and contains general information sent by the SRU.
Definition of the trailer words:
Bits | Error type |
---|---|
0 - 11 | Number of channels with address mismatch |
12 - 24 | Number of channels with length mismatch |
25 - 31 | Zeroed (used for trailer word markers) |
Bits | Setting |
---|---|
0-3 | Baseline correction |
4 | Polarity |
5-6 | Number of presamples |
7-10 | Number of postsamples |
11 | Second baseline correction |
12-13 | Glitch filter |
14-16 | Number of postsamples before zero suppression |
17-18 | Number of presamples before zero suppression |
19 | Zero suppression on / off |
20 - 31 | Zeroed (used for trailer word markers) |
Bits | Setting |
---|---|
0 - 4 | L1 phase |
5 - 9 | Length of the time sample |
9 | Sparse readout on / off |
10 - 19 | Number of samples per channel |
20 - 23 | Number of pretrigger samples |
24 | ALTRO buffers (0 - 4 buffers, 1 - 8 buffers) |
25 - 31 | Zeroed (used for trailer word markers) |
Definition at line 74 of file RCUTrailer.h.
Handler for encoding of the number of ALTRO buffers in the configuration.
Enumerator | |
---|---|
NBUFFERS4 | 4 ALTRO buffers |
NBUFFERS8 | 8 ALTRO buffers |
Definition at line 117 of file RCUTrailer.h.
|
default |
Constructor.
|
default |
destructor
|
static |
Check whether the word is a valid last trailer word.
trailerword | Word to be checked |
Definition at line 38 of file RCUTrailer.cxx.
|
static |
Decode RCU trailer from payload.
The trailer is expected at the end of the paylaod. Trailer words are identified via their trailer marker (bits 30 and 31), and are assigned based on the trailer word marker.
Definition at line 267 of file RCUTrailer.cxx.
void RCUTrailer::constructFromRawPayload | ( | const gsl::span< const uint32_t > | payloadwords | ) |
Decode RCU trailer from the 32-bit words in the raw buffer.
buffer | Raw buffer from which to read the trailer |
Read the RCU trailer according to the RCU formware version specified in CDH.
Definition at line 61 of file RCUTrailer.cxx.
std::vector< uint32_t > RCUTrailer::encode | ( | ) | const |
Encode RCU trailer as array of DDL (32-bit) words.
Encoded trailer words always contain the trailer pattern (bit 30 and bit 31 set)
Definition at line 192 of file RCUTrailer.cxx.
|
inline |
Definition at line 215 of file RCUTrailer.h.
|
inline |
Definition at line 216 of file RCUTrailer.h.
|
inline |
Get value stored in ALTRO config register 1.
Definition at line 346 of file RCUTrailer.h.
|
inline |
Get value stored in ALTRO config register 1.
Definition at line 351 of file RCUTrailer.h.
|
inline |
Get baseline correction method.
Definition at line 228 of file RCUTrailer.h.
|
inline |
Get value stored in error counter register 2.
Direct access to RCU trailer registers (not recommended)
Definition at line 336 of file RCUTrailer.h.
|
inline |
Get value stored in error counter register 3.
Definition at line 341 of file RCUTrailer.h.
|
inline |
Definition at line 213 of file RCUTrailer.h.
|
inline |
Definition at line 214 of file RCUTrailer.h.
|
inline |
|
inline |
double RCUTrailer::getL1PhaseNS | ( | ) | const |
Access to the L1 phase.
Definition at line 182 of file RCUTrailer.cxx.
|
inline |
Get the number of ALTRO buffers.
Definition at line 272 of file RCUTrailer.h.
|
inline |
Get the number of channels with address mismatch.
Definition at line 199 of file RCUTrailer.h.
|
inline |
Get the number of channels with length mismatch.
Definition at line 203 of file RCUTrailer.h.
|
inline |
Get the number of postsamples before zero suppression.
Definition at line 252 of file RCUTrailer.h.
|
inline |
Get the number of presamples before zero suppression.
Definition at line 256 of file RCUTrailer.h.
|
inline |
Get the number of postsamples (after zero suppression)
Definition at line 240 of file RCUTrailer.h.
|
inline |
Get the number of presamples (after zero suppression)
Definition at line 236 of file RCUTrailer.h.
|
inline |
Get the number of pretrigger samples.
Definition at line 264 of file RCUTrailer.h.
|
inline |
Get the number of samples per channel.
Definition at line 268 of file RCUTrailer.h.
|
inline |
Get size of the payload as number of DDL (32-bit) words.
Definition at line 154 of file RCUTrailer.h.
|
inline |
|
inline |
Get index of the RCU the trailer belongs to.
Definition at line 146 of file RCUTrailer.h.
double RCUTrailer::getTimeSampleNS | ( | ) | const |
Access to the sampling time.
Error | if the RCU trailer was not properly initializied |
Definition at line 137 of file RCUTrailer.cxx.
|
inline |
Get the trailer size in number of DDL (32 bit) words.
Definition at line 150 of file RCUTrailer.h.
|
inline |
Get number of corrupted trailer words (undefined trailer word code)
Definition at line 158 of file RCUTrailer.h.
|
inline |
Check if second baseline correction is applied.
Definition at line 244 of file RCUTrailer.h.
|
inline |
Check whether zero suppression has been applied.
Definition at line 260 of file RCUTrailer.h.
|
inline |
checlks whether the RCU trailer is initialzied
Definition at line 374 of file RCUTrailer.h.
|
inline |
Check whether readout is in sparse mode.
Definition at line 276 of file RCUTrailer.h.
void RCUTrailer::printStream | ( | std::ostream & | stream | ) | const |
Prints the contents of the RCU trailer data.
stream | stream the trailer has to be put on |
Definition at line 210 of file RCUTrailer.cxx.
void RCUTrailer::reset | ( | ) |
|
inline |
Definition at line 219 of file RCUTrailer.h.
|
inline |
Definition at line 220 of file RCUTrailer.h.
|
inline |
Set ALTRO config register 1.
value | Value for register |
Definition at line 365 of file RCUTrailer.h.
|
inline |
Set ALTRO config register 2.
value | Value for register |
Definition at line 370 of file RCUTrailer.h.
|
inline |
Set baseline correction method.
baselineCorrection | Baseline correction method |
Definition at line 280 of file RCUTrailer.h.
|
inline |
Set error counter register 2.
value | Value for register |
Definition at line 355 of file RCUTrailer.h.
|
inline |
Set error counter register 3.
value | Value for register |
Definition at line 360 of file RCUTrailer.h.
|
inline |
Definition at line 217 of file RCUTrailer.h.
|
inline |
Definition at line 218 of file RCUTrailer.h.
|
inline |
Set the firmware version.
version | Firmware version |
Definition at line 166 of file RCUTrailer.h.
|
inline |
Set the glitch filter.
glitchfilter | Glitch filter |
Definition at line 300 of file RCUTrailer.h.
|
inline |
Set the number of ALTRO buffers.
bufmode | Number of ALTRO buffers (4 or 8 buffers) |
Definition at line 328 of file RCUTrailer.h.
|
inline |
Set the number of channels with address mismatch.
nchannel | Number of channels |
Definition at line 207 of file RCUTrailer.h.
|
inline |
Set the number of channels with length mismatch.
nchannel | Number of channels |
Definition at line 211 of file RCUTrailer.h.
|
inline |
Set the number of postsamples before zero suppression.
npostsamples | Number of postsamples |
Definition at line 304 of file RCUTrailer.h.
|
inline |
Set the number of presamples after zero suppression.
npresamples | Number of presamples |
Definition at line 308 of file RCUTrailer.h.
|
inline |
Set the number of postsamples (after zero suppression)
Definition at line 292 of file RCUTrailer.h.
|
inline |
Set the number of presamples (after zero suppression)
npresamples | Number of presamples |
Definition at line 288 of file RCUTrailer.h.
|
inline |
Set the number of pretrigger samples.
nsamples | Number of samples |
Definition at line 312 of file RCUTrailer.h.
|
inline |
Set the number of samples per channel.
nsamples | Number of samples |
Definition at line 316 of file RCUTrailer.h.
|
inline |
set the payload size in number of DDL (32-bit) words
size | Payload size |
Definition at line 174 of file RCUTrailer.h.
|
inline |
Set the polarity.
doSet | If true polarity is set |
Definition at line 284 of file RCUTrailer.h.
|
inline |
Specify whether second basedline correction has been applied.
doHave | If true a second baseline correction has bben applied |
Definition at line 296 of file RCUTrailer.h.
|
inline |
Set sparse readout mode.
isSparse | True if readout is in sparse mode, false otherwise |
Definition at line 324 of file RCUTrailer.h.
void RCUTrailer::setTimeSamplePhaseNS | ( | uint64_t | triggertime, |
uint64_t | timesample | ||
) |
Set the time sample length and L1 phase based on the trigger time.
time | Trigger time (in ns) |
timesample | Time sample (in ns) |
L1 phase: Collision time with respect to the sample length. Number of phases: Sample length / bunch spacing (25 ns)
Definition at line 161 of file RCUTrailer.cxx.
|
inline |
Specify whether zero suppression has been applied.
doHave | If true zero suppression has been applied |
Definition at line 320 of file RCUTrailer.h.