50 const std::vector<cms_uint16_t>& bstValue,
61 m_bstSource(bstSourceValue)
79 if (gtfeThis != gtfeResult) {
85 for (
unsigned int iB = 0; iB <
m_bst.size(); ++iB) {
108 int bstSize =
m_bst.size();
126 int bstSize =
m_bst.size();
128 edm::LogError(
"L1GtfeExtWord") <<
"Error: BST message length " << bstSize
130 <<
"\n Cannot set GpsTime" << std::endl;
159 int bstSize =
m_bst.size();
169 bms = bms | (
m_bst[iB] << BstShift);
179 int bstSize =
m_bst.size();
199 int bstSize =
m_bst.size();
219 int bstSize =
m_bst.size();
229 bm = bm | (
m_bst[iB] << BstShift);
239 int bstSize =
m_bst.size();
249 ptb = ptb | (
m_bst[iB] << BstShift);
259 int bstSize =
m_bst.size();
269 ptb = ptb | (
m_bst[iB] << BstShift);
279 int bstSize =
m_bst.size();
289 bm = bm | (
m_bst[iB] << BstShift);
299 int bstSize =
m_bst.size();
319 int bstSize =
m_bst.size();
337 int NumberBstBlocks =
m_bst.size();
339 if (iB < 0 || iB >= NumberBstBlocks) {
341 <<
"\nError: index for BST array out of range. Allowed range: [0, " << NumberBstBlocks <<
") " << std::endl;
349 int NumberBstBlocks =
m_bst.size();
351 if (iB < 0 || iB >= NumberBstBlocks) {
353 <<
"\nError: index for BST array out of range. Allowed range: [0, " << NumberBstBlocks <<
") " << std::endl;
363 const int scaledIB = iB % (
sizeof(word64) * 8 /
BstBitSize);
374 const int scaledIB = iB % (
sizeof(word64) * 8 /
BstBitSize);
378 if (iWord == BstWord) {
392 int gtfeSize = this->
getSize();
394 int BstSourceWord = gtfeSize / 8 - 1;
396 if (iWord == BstSourceWord) {
404 unsigned int gtfeSize = gtfeWord.
getSize();
406 unsigned int gtfeExtSize;
409 unsigned int bytesBstWriter = 2;
413 unsigned int bstSize =
m_bst.size();
415 if ((bstSize + bytesBstWriter) % 8 == 0) {
416 gtfeExtSize = gtfeSize + bstSize + bytesBstWriter;
418 gtfeExtSize = gtfeSize + bstSize + bytesBstWriter + (8 - (bstSize + bytesBstWriter) % 8);
435 myCout <<
"\n L1GtfeExtWord::print \n" << std::endl;
437 unsigned int sizeW64 = 64;
438 unsigned int dataBlocksPerLine = sizeW64 / 8;
442 unsigned int numberBstBlocks =
m_bst.size();
446 if (numberBstBlocks == 0) {
447 myCout <<
"\n BST source [hex]: " << std::hex << std::setw(4) << std::setfill(
'0') <<
m_bstSource 448 << std::setfill(
' ') <<
std::dec << std::endl;
453 for (
unsigned int iB = 0; iB < numberBstBlocks; iB += dataBlocksPerLine) {
454 myCout <<
"\n" << std::hex <<
" hex: ";
456 for (
unsigned int jB = iB; jB < dataBlocksPerLine + iB; ++jB) {
457 if (jB >= numberBstBlocks) {
461 myCout << std::setw(2) << std::setfill(
'0') <<
m_bst[jB] <<
" " << std::setfill(
' ');
464 myCout <<
"\n" <<
std::dec <<
" dec: ";
466 for (
unsigned int jB = iB; jB < dataBlocksPerLine + iB; ++jB) {
467 if (jB >= numberBstBlocks) {
471 myCout << std::setw(3) << std::setfill(
'0') <<
m_bst[jB] <<
" " << std::setfill(
' ');
477 myCout <<
"\n BST source [hex]: " << std::hex << std::setw(4) << std::setfill(
'0') <<
m_bstSource 478 << std::setfill(
' ') <<
std::dec << std::endl;
482 LogDebug(
"L1GtfeExtWord") <<
"\nUnpacking GTFE block.\n" << std::endl;
488 const unsigned char* gtfeExtPtr = gtfePtr + gtfeWord.
getSize();
492 int BlockSizeExt = this->
getSize() / 8;
493 int NumberBstBlocks =
m_bst.size();
496 for (
int iWord =
BstFirstWord; iWord < BlockSizeExt; ++iWord) {
498 LogTrace(
"L1GtfeExtWord") << std::setw(4) << iWord <<
" " << std::hex << std::setfill(
'0') << std::setw(16)
505 for (
int iB = 0; iB < NumberBstBlocks; ++iB) {
507 int BstWord = iB / blocksPerWord;
virtual void print(std::ostream &myCout) const
pretty print the content of a L1GtfeWord
static const int BstMasterStatusLastBlock
const cms_uint16_t beamMode() const
void setBstSource(const cms_uint16_t bstSourceVal)
static const int TotalIntensityBeam1FirstBlock
static const int ParticleTypeBeam1FirstBlock
const unsigned int getSize() const
get the size of the GTFE block in GT DAQ record (in multiple of 8 bits)
static const int GpsTimeLastBlock
static const cms_uint64_t BstBlockMask
static const int ParticleTypeBeam2LastBlock
static const int TotalIntensityBeam1LastBlock
void setBst(const cms_uint16_t bstVal, const int iB)
bool operator==(const L1GtfeExtWord &) const
equal operator
static const int TurnCountNumberLastBlock
L1GtfeExtWord()
constructors
static const int ParticleTypeBeam1LastBlock
Log< level::Error, false > LogError
static const int TotalIntensityBeam2LastBlock
void setBstWord64(cms_uint64_t &word64, int iB, const int iWord)
const cms_uint16_t bstMasterStatus() const
static const int ParticleTypeBeam2FirstBlock
virtual void reset()
reset the content of a L1GtfeWord
const cms_uint16_t particleTypeBeam1() const
const cms_uint32_t turnCountNumber() const
static const int BeamMomentumFirstBlock
const cms_uint32_t lhcFillNumber() const
bool operator!=(const L1GtfeExtWord &) const
unequal operator
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
void print(std::ostream &myCout) const override
pretty print the content of a L1GtfeExtWord
static const int TurnCountNumberFirstBlock
static const int BstFirstWord
block description in the raw GT record
unsigned int cms_uint32_t
const std::vector< cms_uint16_t > & bst() const
get the full BST block
static const int TotalIntensityBeam2FirstBlock
void setBstSourceWord64(cms_uint64_t &word64, const int iWord)
const cms_uint16_t particleTypeBeam2() const
void resize(int bstSizeBytes)
resize the BST vector to get the right size of the block
static const int BstSourceShift
const cms_uint64_t gpsTime() const
LHC-BOB-ES-0001 (EDMS 638899)
std::vector< cms_uint16_t > m_bst
BST message - each byte is an vector element.
~L1GtfeExtWord() override
destructor
const cms_uint16_t beamMomentum() const
static const int BeamModeLastBlock
void setGpsTime(const cms_uint64_t)
cms_uint16_t m_bstSource
hex message indicating the source of BST message (beam or simulated)
const cms_uint32_t totalIntensityBeam2() const
static const int BstBitSize
size in bits for a BST block
static const int BstMasterStatusFirstBlock
const unsigned int getSize() const
get the size of the GTFE block in GT EVM record (in multiple of 8 bits)
static const int LhcFillNumberLastBlock
unsigned long long cms_uint64_t
static const int BeamMomentumLastBlock
void reset() override
reset the content of a L1GtfeExtWord
static const int BeamModeFirstBlock
const cms_uint32_t totalIntensityBeam1() const
void unpack(const unsigned char *gtfePtr) override
virtual void unpack(const unsigned char *gtfePtr)
static const int LhcFillNumberFirstBlock