46 m_bst.resize(bstSizeBytes);
57 const std::vector<cms_uint16_t>& bstValue,
cms_uint16_t bstSourceValue) :
59 boardIdValue, recordLength1Value, recordLengthValue, bxNrValue, setupVersionValue,
60 activeBoardsValue, altNrBxBoardValue, totalTriggerNrValue),
m_bst(bstValue),
84 if (gtfeThis != gtfeResult) {
91 for (
unsigned int iB = 0; iB <
m_bst.size(); ++iB) {
110 return !( result == *
this);
122 int bstSize =
m_bst.size();
144 int bstSize =
m_bst.size();
147 edm::LogError(
"L1GtfeExtWord") <<
"Error: BST message length " 148 << bstSize <<
" smaller than the required GpsTimeLastBlock " 183 int bstSize =
m_bst.size();
194 bms = bms | (
m_bst[iB] << BstShift );
208 int bstSize =
m_bst.size();
233 int bstSize =
m_bst.size();
258 int bstSize =
m_bst.size();
269 bm = bm | (
m_bst[iB] << BstShift );
282 int bstSize =
m_bst.size();
293 ptb = ptb | (
m_bst[iB] << BstShift );
306 int bstSize =
m_bst.size();
317 ptb = ptb | (
m_bst[iB] << BstShift );
331 int bstSize =
m_bst.size();
342 bm = bm | (
m_bst[iB] << BstShift );
355 int bstSize =
m_bst.size();
380 int bstSize =
m_bst.size();
404 int NumberBstBlocks =
m_bst.size();
406 if (iB < 0 || iB >= NumberBstBlocks) {
408 <<
"\nError: index for BST array out of range. Allowed range: [0, " 409 << NumberBstBlocks <<
") " << std::endl;
420 int NumberBstBlocks =
m_bst.size();
422 if (iB < 0 || iB >= NumberBstBlocks) {
424 <<
"\nError: index for BST array out of range. Allowed range: [0, " 425 << NumberBstBlocks <<
") " << std::endl;
438 const int scaledIB = iB%(
sizeof(word64)*8/
BstBitSize);
452 const int scaledIB = iB%(
sizeof(word64)*8/
BstBitSize);
456 if (iWord == BstWord) {
477 int gtfeSize = this->
getSize();
479 int BstSourceWord = gtfeSize/8 - 1;
481 if (iWord == BstSourceWord) {
493 unsigned int gtfeSize = gtfeWord.
getSize();
495 unsigned int gtfeExtSize;
498 unsigned int bytesBstWriter = 2;
502 unsigned int bstSize =
m_bst.size();
504 if ( (bstSize +bytesBstWriter )%8 == 0) {
505 gtfeExtSize = gtfeSize + bstSize + bytesBstWriter;
508 gtfeExtSize = gtfeSize + bstSize + bytesBstWriter + (8 - (bstSize + bytesBstWriter)%8 );
519 m_bst.resize(bstSizeBytes);
535 myCout <<
"\n L1GtfeExtWord::print \n" << std::endl;
537 unsigned int sizeW64 = 64;
538 unsigned int dataBlocksPerLine = sizeW64 / 8;
542 unsigned int numberBstBlocks =
m_bst.size();
546 if (numberBstBlocks == 0) {
548 myCout <<
"\n BST source [hex]: " << std::hex << std::setw(4)
549 << std::setfill(
'0') <<
m_bstSource << std::setfill(
' ')
555 for (
unsigned int iB = 0; iB < numberBstBlocks; iB += dataBlocksPerLine) {
557 myCout <<
"\n" << std::hex <<
" hex: ";
559 for (
unsigned int jB = iB; jB < dataBlocksPerLine + iB; ++jB) {
561 if (jB >= numberBstBlocks) {
565 myCout << std::setw(2) << std::setfill(
'0') <<
m_bst[jB] <<
" " 566 << std::setfill(
' ');
569 myCout <<
"\n" <<
std::dec <<
" dec: ";
571 for (
unsigned int jB = iB; jB < dataBlocksPerLine + iB; ++jB) {
573 if (jB >= numberBstBlocks) {
577 myCout << std::setw(3) << std::setfill(
'0') <<
m_bst[jB] <<
" " 578 << std::setfill(
' ');
585 myCout <<
"\n BST source [hex]: " << std::hex << std::setw(4)
586 << std::setfill(
'0') <<
m_bstSource << std::setfill(
' ')
594 <<
"\nUnpacking GTFE block.\n" 601 const unsigned char* gtfeExtPtr = gtfePtr + gtfeWord.
getSize();
606 int BlockSizeExt = this->
getSize()/8;
607 int NumberBstBlocks =
m_bst.size();
611 for (
int iWord =
BstFirstWord; iWord < BlockSizeExt; ++iWord) {
615 << std::setw(4) << iWord <<
" " 616 << std::hex << std::setfill(
'0')
617 << std::setw(16) << payload[jWord]
626 for (
int iB = 0; iB < NumberBstBlocks; ++iB) {
629 int BstWord = iB/blocksPerWord;
631 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
payload
payload postfix for testing
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