48 m_bst.resize(bstSizeBytes);
59 const std::vector<cms_uint16_t>& bstValue,
cms_uint16_t bstSourceValue) :
61 boardIdValue, recordLength1Value, recordLengthValue, bxNrValue, setupVersionValue,
62 activeBoardsValue, altNrBxBoardValue, totalTriggerNrValue), m_bst(bstValue),
63 m_bstSource(bstSourceValue)
86 if (gtfeThis != gtfeResult) {
93 for (
unsigned int iB = 0; iB <
m_bst.size(); ++iB) {
112 return !( result == *
this);
124 int bstSize =
m_bst.size();
146 int bstSize =
m_bst.size();
149 edm::LogError(
"L1GtfeExtWord") <<
"Error: BST message length "
150 << bstSize <<
" smaller than the required GpsTimeLastBlock "
185 int bstSize =
m_bst.size();
196 bms = bms | (
m_bst[iB] << BstShift );
210 int bstSize =
m_bst.size();
235 int bstSize =
m_bst.size();
260 int bstSize =
m_bst.size();
271 bm = bm | (
m_bst[iB] << BstShift );
284 int bstSize =
m_bst.size();
295 ptb = ptb | (
m_bst[iB] << BstShift );
308 int bstSize =
m_bst.size();
319 ptb = ptb | (
m_bst[iB] << BstShift );
333 int bstSize =
m_bst.size();
344 bm = bm | (
m_bst[iB] << BstShift );
357 int bstSize =
m_bst.size();
382 int bstSize =
m_bst.size();
406 int NumberBstBlocks =
m_bst.size();
408 if (iB < 0 || iB >= NumberBstBlocks) {
410 <<
"\nError: index for BST array out of range. Allowed range: [0, "
411 << NumberBstBlocks <<
") " << std::endl;
422 int NumberBstBlocks =
m_bst.size();
424 if (iB < 0 || iB >= NumberBstBlocks) {
426 <<
"\nError: index for BST array out of range. Allowed range: [0, "
427 << NumberBstBlocks <<
") " << std::endl;
440 const int scaledIB = iB%(
sizeof(word64)*8/
BstBitSize);
454 const int scaledIB = iB%(
sizeof(word64)*8/
BstBitSize);
458 if (iWord == BstWord) {
479 int gtfeSize = this->
getSize();
481 int BstSourceWord = gtfeSize/8 - 1;
483 if (iWord == BstSourceWord) {
495 unsigned int gtfeSize = gtfeWord.
getSize();
497 unsigned int gtfeExtSize;
500 unsigned int bytesBstWriter = 2;
504 unsigned int bstSize =
m_bst.size();
506 if ( (bstSize +bytesBstWriter )%8 == 0) {
507 gtfeExtSize = gtfeSize + bstSize + bytesBstWriter;
510 gtfeExtSize = gtfeSize + bstSize + bytesBstWriter + (8 - (bstSize + bytesBstWriter)%8 );
521 m_bst.resize(bstSizeBytes);
537 myCout <<
"\n L1GtfeExtWord::print \n" << std::endl;
539 unsigned int sizeW64 = 64;
540 unsigned int dataBlocksPerLine = sizeW64 / 8;
544 unsigned int numberBstBlocks =
m_bst.size();
548 if (numberBstBlocks == 0) {
550 myCout <<
"\n BST source [hex]: " << std::hex << std::setw(4)
551 << std::setfill(
'0') <<
m_bstSource << std::setfill(
' ')
552 << std::dec << std::endl;
557 for (
unsigned int iB = 0; iB < numberBstBlocks; iB += dataBlocksPerLine) {
559 myCout <<
"\n" << std::hex <<
" hex: ";
561 for (
unsigned int jB = iB; jB < dataBlocksPerLine + iB; ++jB) {
563 if (jB >= numberBstBlocks) {
567 myCout << std::setw(2) << std::setfill(
'0') <<
m_bst[jB] <<
" "
568 << std::setfill(
' ');
571 myCout <<
"\n" << std::dec <<
" dec: ";
573 for (
unsigned int jB = iB; jB < dataBlocksPerLine + iB; ++jB) {
575 if (jB >= numberBstBlocks) {
579 myCout << std::setw(3) << std::setfill(
'0') <<
m_bst[jB] <<
" "
580 << std::setfill(
' ');
587 myCout <<
"\n BST source [hex]: " << std::hex << std::setw(4)
588 << std::setfill(
'0') <<
m_bstSource << std::setfill(
' ')
589 << std::dec << std::endl;
596 <<
"\nUnpacking GTFE block.\n"
603 const unsigned char* gtfeExtPtr = gtfePtr + gtfeWord.
getSize();
606 reinterpret_cast<cms_uint64_t*
>(
const_cast<unsigned char*
>(gtfeExtPtr));
608 int BlockSizeExt = this->
getSize()/8;
609 int NumberBstBlocks =
m_bst.size();
613 for (
int iWord =
BstFirstWord; iWord < BlockSizeExt; ++iWord) {
617 << std::setw(4) << iWord <<
" "
618 << std::hex << std::setfill(
'0')
619 << std::setw(16) << payload[jWord]
620 << std::dec << std::setfill(
' ')
628 for (
int iB = 0; iB < NumberBstBlocks; ++iB) {
631 int BstWord = iB/blocksPerWord;
633 setBst(payload[BstWord], iB);
static const int BstMasterStatusLastBlock
const unsigned int getSize() const
get the size of the GTFE block in GT DAQ record (in multiple of 8 bits)
void setBstSource(const cms_uint16_t bstSourceVal)
virtual void print(std::ostream &myCout) const
pretty print the content of a L1GtfeWord
static const int TotalIntensityBeam1FirstBlock
static const int ParticleTypeBeam1FirstBlock
static const int GpsTimeLastBlock
static const cms_uint64_t BstBlockMask
static const int ParticleTypeBeam2LastBlock
static const int TotalIntensityBeam1LastBlock
void reset()
reset the content of a L1GtfeExtWord
const cms_uint64_t gpsTime() const
LHC-BOB-ES-0001 (EDMS 638899)
void setBst(const cms_uint16_t bstVal, const int iB)
static const int TurnCountNumberLastBlock
L1GtfeExtWord()
constructors
static const int ParticleTypeBeam1LastBlock
bool operator==(const L1GtfeExtWord &) const
equal operator
static const int TotalIntensityBeam2LastBlock
const cms_uint16_t bstMasterStatus() const
void setBstWord64(cms_uint64_t &word64, int iB, const int iWord)
const unsigned int getSize() const
get the size of the GTFE block in GT EVM record (in multiple of 8 bits)
const cms_uint16_t beamMomentum() const
const std::vector< cms_uint16_t > & bst() const
get the full BST block
static const int ParticleTypeBeam2FirstBlock
virtual void reset()
reset the content of a L1GtfeWord
bool operator!=(const L1GtfeExtWord &) const
unequal operator
virtual void unpack(const unsigned char *gtfePtr)
static const int BeamMomentumFirstBlock
static const cms_uint64_t BstSourceMask
static const int GpsTimeFirstBlock
BST blocks: conversion to defined quantities (LHC-BOB-ES-0001)
unsigned short cms_uint16_t
static const int TurnCountNumberFirstBlock
static const int BstFirstWord
block description in the raw GT record
unsigned int cms_uint32_t
static const int TotalIntensityBeam2FirstBlock
void setBstSourceWord64(cms_uint64_t &word64, const int iWord)
const cms_uint32_t totalIntensityBeam2() const
const cms_uint32_t totalIntensityBeam1() const
void resize(int bstSizeBytes)
resize the BST vector to get the right size of the block
static const int BstSourceShift
const cms_uint32_t lhcFillNumber() const
std::vector< cms_uint16_t > m_bst
BST message - each byte is an vector element.
virtual ~L1GtfeExtWord()
destructor
static const int BeamModeLastBlock
virtual void print(std::ostream &myCout) const
pretty print the content of a L1GtfeExtWord
void setGpsTime(const cms_uint64_t)
cms_uint16_t m_bstSource
hex message indicating the source of BST message (beam or simulated)
const cms_uint16_t particleTypeBeam2() const
static const int BstBitSize
size in bits for a BST block
static const int BstMasterStatusFirstBlock
static const int LhcFillNumberLastBlock
unsigned long long cms_uint64_t
const cms_uint32_t turnCountNumber() const
static const int BeamMomentumLastBlock
const cms_uint16_t beamMode() const
static const int BeamModeFirstBlock
virtual void unpack(const unsigned char *gtfePtr)
const cms_uint16_t particleTypeBeam1() const
static const int LhcFillNumberFirstBlock