|
|
Go to the documentation of this file.
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();
118 gpst = gpst | ((static_cast<cms_uint64_t>(
m_bst[iB])) << BstShift);
126 int bstSize =
m_bst.size();
128 edm::LogError(
"L1GtfeExtWord") <<
"Error: BST message length " << bstSize
130 <<
"\n Cannot set GpsTime" << std::endl;
141 m_bst[iB] = static_cast<cms_uint16_t>((gpsTimeValue & BstMask) >> BstShift);
159 int bstSize =
m_bst.size();
169 bms = bms | (
m_bst[iB] << BstShift);
179 int bstSize =
m_bst.size();
189 tcn = tcn | ((static_cast<cms_uint32_t>(
m_bst[iB])) << BstShift);
199 int bstSize =
m_bst.size();
209 lhcfn = lhcfn | ((static_cast<cms_uint32_t>(
m_bst[iB])) << BstShift);
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();
309 tib = tib | ((static_cast<cms_uint32_t>(
m_bst[iB])) << BstShift);
319 int bstSize =
m_bst.size();
329 tib = tib | ((static_cast<cms_uint32_t>(
m_bst[iB])) << BstShift);
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);
367 m_bst[iB] = static_cast<cms_uint16_t>((word64 & BstMask) >> BstShift);
374 const int scaledIB = iB % (
sizeof(word64) * 8 /
BstBitSize);
378 if (iWord == BstWord) {
379 word64 = word64 | (static_cast<cms_uint64_t>(
m_bst[iB]) << BstShift);
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;
~L1GtfeExtWord() override
destructor
void reset() override
reset the content of a L1GtfeExtWord
unsigned int cms_uint32_t
static const int BeamMomentumLastBlock
void unpack(const unsigned char *gtfePtr) override
static const int GpsTimeFirstBlock
BST blocks: conversion to defined quantities (LHC-BOB-ES-0001)
static const int TotalIntensityBeam1FirstBlock
static const int LhcFillNumberFirstBlock
const std::vector< cms_uint16_t > & bst() const
get the full BST block
bool operator==(const L1GtfeExtWord &) const
equal operator
static const int ParticleTypeBeam2FirstBlock
L1GtfeExtWord()
constructors
static const int BstBitSize
size in bits for a BST block
const cms_uint32_t turnCountNumber() const
static const int ParticleTypeBeam1LastBlock
virtual void print(std::ostream &myCout) const
pretty print the content of a L1GtfeWord
static const int BstMasterStatusLastBlock
static const int BstSourceShift
static const int ParticleTypeBeam1FirstBlock
void setBstWord64(cms_uint64_t &word64, int iB, const int iWord)
static const int BeamModeFirstBlock
const cms_uint32_t totalIntensityBeam1() const
static const int TotalIntensityBeam1LastBlock
static const int TurnCountNumberFirstBlock
void setGpsTime(const cms_uint64_t)
const cms_uint16_t bstMasterStatus() const
void setBstSourceWord64(cms_uint64_t &word64, const int iWord)
static const int BstMasterStatusFirstBlock
virtual void reset()
reset the content of a L1GtfeWord
std::vector< cms_uint16_t > m_bst
BST message - each byte is an vector element.
const cms_uint16_t beamMomentum() const
const unsigned int getSize() const
get the size of the GTFE block in GT DAQ record (in multiple of 8 bits)
const cms_uint16_t particleTypeBeam1() const
static const int BeamModeLastBlock
void resize(int bstSizeBytes)
resize the BST vector to get the right size of the block
bool operator!=(const L1GtfeExtWord &) const
unequal operator
const cms_uint32_t lhcFillNumber() const
static const cms_uint64_t BstSourceMask
void print(std::ostream &myCout) const override
pretty print the content of a L1GtfeExtWord
unsigned long long cms_uint64_t
unsigned short cms_uint16_t
static const cms_uint64_t BstBlockMask
static const int BstFirstWord
block description in the raw GT record
static const int ParticleTypeBeam2LastBlock
static const int TotalIntensityBeam2FirstBlock
const cms_uint32_t totalIntensityBeam2() const
static const int BeamMomentumFirstBlock
void setBstSource(const cms_uint16_t bstSourceVal)
static const int TotalIntensityBeam2LastBlock
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
virtual void unpack(const unsigned char *gtfePtr)
static const int GpsTimeLastBlock
const cms_uint16_t particleTypeBeam2() const
static const int TurnCountNumberLastBlock
void setBst(const cms_uint16_t bstVal, const int iB)
const cms_uint16_t beamMode() const
cms_uint16_t m_bstSource
hex message indicating the source of BST message (beam or simulated)
const cms_uint64_t gpsTime() const
LHC-BOB-ES-0001 (EDMS 638899)