CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes | Static Private Attributes
L1GtfeExtWord Class Reference

#include <L1GtfeExtWord.h>

Inheritance diagram for L1GtfeExtWord:
L1GtfeWord

Public Member Functions

const cms_uint16_t beamMode () const
 
const cms_uint16_t beamMomentum () const
 
const std::vector< cms_uint16_t > & bst () const
 get the full BST block More...
 
const cms_uint16_t bst (int iB) const
 get/set BST block for index iB More...
 
const unsigned int bstLengthBytes () const
 get the size of the BST block More...
 
const cms_uint16_t bstMasterStatus () const
 
const cms_uint16_t bstSource () const
 get/set hex message indicating the source of BST message More...
 
const unsigned int getSize () const
 get the size of the GTFE block in GT EVM record (in multiple of 8 bits) More...
 
const cms_uint64_t gpsTime () const
 LHC-BOB-ES-0001 (EDMS 638899) More...
 
 L1GtfeExtWord ()
 constructors More...
 
 L1GtfeExtWord (int bstSizeBytes)
 all members set to zero, m_bst has bstSizeBytes zero elements More...
 
 L1GtfeExtWord (cms_uint16_t boardIdValue, cms_uint16_t recordLengthValue, cms_uint16_t recordLength1Value, cms_uint16_t bxNrValue, cms_uint32_t setupVersionValue, cms_uint16_t activeBoardsValue, cms_uint16_t altNrBxBoardValue, cms_uint32_t totalTriggerNrValue, const std::vector< cms_uint16_t > &bstValue, cms_uint16_t bstSourceValue)
 constructor from unpacked values, m_bst size taken from bstValue More...
 
const cms_uint32_t lhcFillNumber () const
 
bool operator!= (const L1GtfeExtWord &) const
 unequal operator More...
 
bool operator== (const L1GtfeExtWord &) const
 equal operator More...
 
const cms_uint16_t particleTypeBeam1 () const
 
const cms_uint16_t particleTypeBeam2 () const
 
void print (std::ostream &myCout) const override
 pretty print the content of a L1GtfeExtWord More...
 
void reset () override
 reset the content of a L1GtfeExtWord More...
 
void resize (int bstSizeBytes)
 resize the BST vector to get the right size of the block More...
 
void setBst (const cms_uint16_t bstVal, const int iB)
 
void setBst (const cms_uint64_t &word64, const int iB)
 set the BST block for index iB from a 64-bits word More...
 
void setBstSource (const cms_uint16_t bstSourceVal)
 
void setBstSource (const cms_uint64_t &word64)
 set the hex message indicating the source of BST message from a 64-bits word More...
 
void setBstSourceWord64 (cms_uint64_t &word64, const int iWord)
 
void setBstWord64 (cms_uint64_t &word64, int iB, const int iWord)
 
void setGpsTime (const cms_uint64_t)
 
const cms_uint32_t totalIntensityBeam1 () const
 
const cms_uint32_t totalIntensityBeam2 () const
 
const cms_uint32_t turnCountNumber () const
 
void unpack (const unsigned char *gtfePtr) override
 
 ~L1GtfeExtWord () override
 destructor More...
 
- Public Member Functions inherited from L1GtfeWord
const cms_uint16_t activeBoards () const
 get/set boards contributing to EVM respectively DAQ record More...
 
const cms_uint16_t altNrBxBoard () const
 get/set alternative for number of BX per board More...
 
const cms_uint16_t boardId () const
 get/set board ID More...
 
const int bstFlag () const
 get / set BST flag: 0 or 1 - via setup version (no private member) More...
 
const cms_uint16_t bxNr () const
 get/set bunch cross number as counted in the GTFE board More...
 
const unsigned int getSize () const
 get the size of the GTFE block in GT DAQ record (in multiple of 8 bits) More...
 
 L1GtfeWord ()
 constructors More...
 
 L1GtfeWord (cms_uint16_t boardIdValue, cms_uint16_t recordLength1Value, cms_uint16_t recordLengthValue, cms_uint16_t bxNrValue, cms_uint32_t setupVersionValue, cms_uint16_t activeBoardsValue, cms_uint16_t altNrBxBoardValue, cms_uint32_t totalTriggerNrValue)
 constructor from unpacked values; More...
 
bool operator!= (const L1GtfeWord &) const
 unequal operator More...
 
bool operator== (const L1GtfeWord &) const
 equal operator More...
 
const cms_uint16_t recordLength () const
 get/set record length for alternative 0 More...
 
const cms_uint16_t recordLength1 () const
 get/set record length for alternative 1 More...
 
void setActiveBoards (cms_uint16_t activeBoardsValue)
 
void setActiveBoards (const cms_uint64_t &word64)
 
void setActiveBoardsWord64 (cms_uint64_t &word64, int iWord)
 
void setActiveBoardsWord64 (cms_uint64_t &word64, int iWord, cms_int16_t activeBoardsValue)
 
void setAltNrBxBoard (cms_uint16_t altNrBxBoardValue)
 
void setAltNrBxBoard (const cms_uint64_t &word64)
 
void setAltNrBxBoardWord64 (cms_uint64_t &word64, int iWord)
 
void setAltNrBxBoardWord64 (cms_uint64_t &word64, int iWord, cms_int16_t altNrBxBoardValue)
 
void setBoardId (cms_uint16_t boardIdValue)
 set BoardId from a BoardId value More...
 
void setBoardId (const cms_uint64_t &word64)
 set the BoardId value from a 64-bits word More...
 
void setBoardIdWord64 (cms_uint64_t &word64, int iWord)
 
void setBstFlag (const int)
 
void setBxNr (cms_uint16_t bxNrValue)
 
void setBxNr (const cms_uint64_t &word64)
 
void setBxNrWord64 (cms_uint64_t &word64, int iWord)
 
void setRecordLength (cms_uint16_t recordLengthValue)
 
void setRecordLength (const cms_uint64_t &word64)
 
void setRecordLength1 (cms_uint16_t recordLengthValue)
 
void setRecordLength1 (const cms_uint64_t &word64)
 
void setRecordLength1Word64 (cms_uint64_t &word64, int iWord)
 
void setRecordLengthWord64 (cms_uint64_t &word64, int iWord)
 
void setSetupVersion (cms_uint32_t setupVersionValue)
 
void setSetupVersion (const cms_uint64_t &word64)
 
void setSetupVersionWord64 (cms_uint64_t &word64, int iWord)
 
void setTotalTriggerNr (cms_uint32_t totalTriggerNrValue)
 
void setTotalTriggerNr (const cms_uint64_t &word64)
 
void setTotalTriggerNrWord64 (cms_uint64_t &word64, int iWord)
 
const cms_uint32_t setupVersion () const
 get/set setup version More...
 
const cms_uint32_t totalTriggerNr () const
 get/set total number of L1A sent since start of run More...
 
virtual ~L1GtfeWord ()
 destructor More...
 

Private Attributes

std::vector< cms_uint16_tm_bst
 BST message - each byte is an vector element. More...
 
cms_uint16_t m_bstSource
 hex message indicating the source of BST message (beam or simulated) More...
 

Static Private Attributes

static const int BeamModeFirstBlock = 26
 
static const int BeamModeLastBlock = 27
 
static const int BeamMomentumFirstBlock = 30
 
static const int BeamMomentumLastBlock = 31
 
static const int BstBitSize = 8
 size in bits for a BST block More...
 
static const cms_uint64_t BstBlockMask = 0xFFULL
 
static const int BstFirstWord = 2
 block description in the raw GT record More...
 
static const int BstMasterStatusFirstBlock = 17
 
static const int BstMasterStatusLastBlock = 17
 
static const cms_uint64_t BstSourceMask = 0xFFFF000000000000ULL
 
static const int BstSourceShift = 48
 
static const int GpsTimeFirstBlock = 0
 BST blocks: conversion to defined quantities (LHC-BOB-ES-0001) More...
 
static const int GpsTimeLastBlock = 7
 
static const int LhcFillNumberFirstBlock = 22
 
static const int LhcFillNumberLastBlock = 25
 
static const int ParticleTypeBeam1FirstBlock = 28
 
static const int ParticleTypeBeam1LastBlock = 28
 
static const int ParticleTypeBeam2FirstBlock = 29
 
static const int ParticleTypeBeam2LastBlock = 29
 
static const int TotalIntensityBeam1FirstBlock = 32
 
static const int TotalIntensityBeam1LastBlock = 35
 
static const int TotalIntensityBeam2FirstBlock = 36
 
static const int TotalIntensityBeam2LastBlock = 39
 
static const int TurnCountNumberFirstBlock = 18
 
static const int TurnCountNumberLastBlock = 21
 

Detailed Description

Description: L1 Global Trigger - extended GTFE block in the readout record.

Implementation: <TODO: enter implementation details>

Author
: Vasile Mihai Ghete - HEPHY Vienna

Description: L1 Global Trigger - GTFE words in the readout record.

Implementation: <TODO: enter implementation details>

Author
: Vasile Mihai Ghete - HEPHY Vienna

Definition at line 31 of file L1GtfeExtWord.h.

Constructor & Destructor Documentation

◆ L1GtfeExtWord() [1/3]

L1GtfeExtWord::L1GtfeExtWord ( )

constructors

Definition at line 34 of file L1GtfeExtWord.cc.

34  : L1GtfeWord(), m_bstSource(0) {
35  // empty
36 }
L1GtfeWord()
constructors
Definition: L1GtfeWord.cc:29
cms_uint16_t m_bstSource
hex message indicating the source of BST message (beam or simulated)

◆ L1GtfeExtWord() [2/3]

L1GtfeExtWord::L1GtfeExtWord ( int  bstSizeBytes)

all members set to zero, m_bst has bstSizeBytes zero elements

Definition at line 39 of file L1GtfeExtWord.cc.

References m_bst.

39 : L1GtfeWord(), m_bstSource(0) { m_bst.resize(bstSizeBytes); }
L1GtfeWord()
constructors
Definition: L1GtfeWord.cc:29
std::vector< cms_uint16_t > m_bst
BST message - each byte is an vector element.
cms_uint16_t m_bstSource
hex message indicating the source of BST message (beam or simulated)

◆ L1GtfeExtWord() [3/3]

L1GtfeExtWord::L1GtfeExtWord ( cms_uint16_t  boardIdValue,
cms_uint16_t  recordLengthValue,
cms_uint16_t  recordLength1Value,
cms_uint16_t  bxNrValue,
cms_uint32_t  setupVersionValue,
cms_uint16_t  activeBoardsValue,
cms_uint16_t  altNrBxBoardValue,
cms_uint32_t  totalTriggerNrValue,
const std::vector< cms_uint16_t > &  bstValue,
cms_uint16_t  bstSourceValue 
)

constructor from unpacked values, m_bst size taken from bstValue

Definition at line 42 of file L1GtfeExtWord.cc.

52  : L1GtfeWord(boardIdValue,
53  recordLength1Value,
54  recordLengthValue,
55  bxNrValue,
56  setupVersionValue,
57  activeBoardsValue,
58  altNrBxBoardValue,
59  totalTriggerNrValue),
60  m_bst(bstValue),
61  m_bstSource(bstSourceValue)
62 
63 {
64  // empty
65 }
L1GtfeWord()
constructors
Definition: L1GtfeWord.cc:29
std::vector< cms_uint16_t > m_bst
BST message - each byte is an vector element.
cms_uint16_t m_bstSource
hex message indicating the source of BST message (beam or simulated)

◆ ~L1GtfeExtWord()

L1GtfeExtWord::~L1GtfeExtWord ( )
override

destructor

Definition at line 68 of file L1GtfeExtWord.cc.

68  {
69  // empty now
70 }

Member Function Documentation

◆ beamMode()

const cms_uint16_t L1GtfeExtWord::beamMode ( ) const

Definition at line 215 of file L1GtfeExtWord.cc.

References BeamModeFirstBlock, BeamModeLastBlock, BstBitSize, and m_bst.

Referenced by GenericTriggerEventFlag::acceptGtLogicalExpression(), SiStripMonitorDigi::analyze(), L1TGT::analyze(), L1TSync::analyze(), L1TSync_Offline::analyze(), L1TBPTX::analyze(), BeamSpotOnlineProducer::produce(), ConditionDumperInEdm::produce(), and L1Analysis::L1AnalysisGT::SetEvm().

215  {
216  cms_uint16_t bm = 0;
217 
218  // return 0 if BST message too small
219  int bstSize = m_bst.size();
220  if (BeamModeLastBlock >= bstSize) {
221  return bm;
222  }
223 
224  for (int iB = BeamModeFirstBlock; iB <= BeamModeLastBlock; ++iB) {
225  // keep capitalization for similarity with other functions
226  const int scaledIB = iB - BeamModeFirstBlock;
227  const int BstShift = BstBitSize * scaledIB;
228 
229  bm = bm | (m_bst[iB] << BstShift);
230  }
231 
232  return bm;
233 }
unsigned short cms_uint16_t
Definition: typedefs.h:13
std::vector< cms_uint16_t > m_bst
BST message - each byte is an vector element.
static const int BeamModeLastBlock
static const int BstBitSize
size in bits for a BST block
static const int BeamModeFirstBlock

◆ beamMomentum()

const cms_uint16_t L1GtfeExtWord::beamMomentum ( ) const

Definition at line 275 of file L1GtfeExtWord.cc.

References BeamMomentumFirstBlock, BeamMomentumLastBlock, BstBitSize, and m_bst.

Referenced by GenericTriggerEventFlag::acceptGtLogicalExpression(), L1TGT::analyze(), ConditionDumperInEdm::produce(), and L1Analysis::L1AnalysisGT::SetEvm().

275  {
276  cms_uint16_t bm = 0;
277 
278  // return 0 if BST message too small
279  int bstSize = m_bst.size();
280  if (BeamMomentumLastBlock >= bstSize) {
281  return bm;
282  }
283 
284  for (int iB = BeamMomentumFirstBlock; iB <= BeamMomentumLastBlock; ++iB) {
285  // keep capitalization for similarity with other functions
286  const int scaledIB = iB - BeamMomentumFirstBlock;
287  const int BstShift = BstBitSize * scaledIB;
288 
289  bm = bm | (m_bst[iB] << BstShift);
290  }
291 
292  return bm;
293 }
static const int BeamMomentumFirstBlock
unsigned short cms_uint16_t
Definition: typedefs.h:13
std::vector< cms_uint16_t > m_bst
BST message - each byte is an vector element.
static const int BstBitSize
size in bits for a BST block
static const int BeamMomentumLastBlock

◆ bst() [1/2]

const std::vector<cms_uint16_t>& L1GtfeExtWord::bst ( ) const
inline

get the full BST block

Definition at line 62 of file L1GtfeExtWord.h.

References m_bst.

62 { return m_bst; }
std::vector< cms_uint16_t > m_bst
BST message - each byte is an vector element.

◆ bst() [2/2]

const uint16_t L1GtfeExtWord::bst ( int  iB) const

get/set BST block for index iB

Definition at line 336 of file L1GtfeExtWord.cc.

References Exception, and m_bst.

336  {
337  int NumberBstBlocks = m_bst.size();
338 
339  if (iB < 0 || iB >= NumberBstBlocks) {
340  throw cms::Exception("BstIndexError")
341  << "\nError: index for BST array out of range. Allowed range: [0, " << NumberBstBlocks << ") " << std::endl;
342 
343  } else {
344  return m_bst[iB];
345  }
346 }
std::vector< cms_uint16_t > m_bst
BST message - each byte is an vector element.

◆ bstLengthBytes()

const unsigned int L1GtfeExtWord::bstLengthBytes ( ) const
inline

get the size of the BST block

Definition at line 65 of file L1GtfeExtWord.h.

References m_bst.

Referenced by L1GTEvmDigiToRaw::produce().

65 { return m_bst.size(); }
std::vector< cms_uint16_t > m_bst
BST message - each byte is an vector element.

◆ bstMasterStatus()

const cms_uint16_t L1GtfeExtWord::bstMasterStatus ( ) const

Definition at line 155 of file L1GtfeExtWord.cc.

References BstBitSize, BstMasterStatusFirstBlock, BstMasterStatusLastBlock, and m_bst.

Referenced by L1TGT::analyze(), ConditionDumperInEdm::produce(), and L1Analysis::L1AnalysisGT::SetEvm().

155  {
156  cms_uint16_t bms = 0;
157 
158  // return 0 if BST message too small
159  int bstSize = m_bst.size();
160  if (BstMasterStatusLastBlock >= bstSize) {
161  return bms;
162  }
163 
164  for (int iB = BstMasterStatusFirstBlock; iB <= BstMasterStatusLastBlock; ++iB) {
165  // keep capitalization for similarity with other functions
166  const int scaledIB = iB - BstMasterStatusFirstBlock;
167  const int BstShift = BstBitSize * scaledIB;
168 
169  bms = bms | (m_bst[iB] << BstShift);
170  }
171 
172  return bms;
173 }
static const int BstMasterStatusLastBlock
unsigned short cms_uint16_t
Definition: typedefs.h:13
std::vector< cms_uint16_t > m_bst
BST message - each byte is an vector element.
static const int BstBitSize
size in bits for a BST block
static const int BstMasterStatusFirstBlock

◆ bstSource()

const cms_uint16_t L1GtfeExtWord::bstSource ( ) const
inline

get/set hex message indicating the source of BST message

Definition at line 96 of file L1GtfeExtWord.h.

References m_bstSource.

96 { return m_bstSource; }
cms_uint16_t m_bstSource
hex message indicating the source of BST message (beam or simulated)

◆ getSize()

const unsigned int L1GtfeExtWord::getSize ( ) const

get the size of the GTFE block in GT EVM record (in multiple of 8 bits)

Definition at line 402 of file L1GtfeExtWord.cc.

References L1GtfeWord::getSize(), and m_bst.

Referenced by L1GTEvmDigiToRaw::packGTFE(), L1GTEvmDigiToRaw::produce(), L1GlobalTriggerEvmRawToDigi::produce(), setBstSourceWord64(), and unpack().

402  {
403  L1GtfeWord gtfeWord;
404  unsigned int gtfeSize = gtfeWord.getSize();
405 
406  unsigned int gtfeExtSize;
407 
408  // 2 bytes to write if real BST message or simulated BST message
409  unsigned int bytesBstWriter = 2;
410 
411  // size of BST block, using rounded 64-bit words (8 bytes per 64-bit word)
412 
413  unsigned int bstSize = m_bst.size();
414 
415  if ((bstSize + bytesBstWriter) % 8 == 0) {
416  gtfeExtSize = gtfeSize + bstSize + bytesBstWriter;
417  } else {
418  gtfeExtSize = gtfeSize + bstSize + bytesBstWriter + (8 - (bstSize + bytesBstWriter) % 8);
419  }
420 
421  return gtfeExtSize;
422 }
const unsigned int getSize() const
get the size of the GTFE block in GT DAQ record (in multiple of 8 bits)
Definition: L1GtfeWord.h:160
std::vector< cms_uint16_t > m_bst
BST message - each byte is an vector element.

◆ gpsTime()

const cms_uint64_t L1GtfeExtWord::gpsTime ( ) const

LHC-BOB-ES-0001 (EDMS 638899)

Definition at line 104 of file L1GtfeExtWord.cc.

References BstBitSize, GpsTimeFirstBlock, GpsTimeLastBlock, and m_bst.

Referenced by L1TGT::analyze(), and L1Analysis::L1AnalysisGT::SetEvm().

104  {
105  cms_uint64_t gpst = 0ULL;
106 
107  // return 0 if BST message too small
108  int bstSize = m_bst.size();
109  if (GpsTimeLastBlock >= bstSize) {
110  return gpst;
111  }
112 
113  for (int iB = GpsTimeFirstBlock; iB <= GpsTimeLastBlock; ++iB) {
114  // keep capitalization for similarity with other functions
115  const int scaledIB = iB - GpsTimeFirstBlock;
116  const int BstShift = BstBitSize * scaledIB;
117 
118  gpst = gpst | ((static_cast<cms_uint64_t>(m_bst[iB])) << BstShift);
119  }
120 
121  return gpst;
122 }
static const int GpsTimeLastBlock
static const int GpsTimeFirstBlock
BST blocks: conversion to defined quantities (LHC-BOB-ES-0001)
std::vector< cms_uint16_t > m_bst
BST message - each byte is an vector element.
static const int BstBitSize
size in bits for a BST block
unsigned long long cms_uint64_t
Definition: typedefs.h:17

◆ lhcFillNumber()

const cms_uint32_t L1GtfeExtWord::lhcFillNumber ( ) const

Definition at line 195 of file L1GtfeExtWord.cc.

References BstBitSize, LhcFillNumberFirstBlock, LhcFillNumberLastBlock, and m_bst.

Referenced by L1TGT::analyze(), L1TSync::analyze(), L1TSync_Offline::analyze(), L1TBPTX::analyze(), ConditionDumperInEdm::produce(), and L1Analysis::L1AnalysisGT::SetEvm().

195  {
196  cms_uint32_t lhcfn = 0;
197 
198  // return 0 if BST message too small
199  int bstSize = m_bst.size();
200  if (LhcFillNumberLastBlock >= bstSize) {
201  return lhcfn;
202  }
203 
204  for (int iB = LhcFillNumberFirstBlock; iB <= LhcFillNumberLastBlock; ++iB) {
205  // keep capitalization for similarity with other functions
206  const int scaledIB = iB - LhcFillNumberFirstBlock;
207  const int BstShift = BstBitSize * scaledIB;
208 
209  lhcfn = lhcfn | ((static_cast<cms_uint32_t>(m_bst[iB])) << BstShift);
210  }
211 
212  return lhcfn;
213 }
unsigned int cms_uint32_t
Definition: typedefs.h:15
std::vector< cms_uint16_t > m_bst
BST message - each byte is an vector element.
static const int BstBitSize
size in bits for a BST block
static const int LhcFillNumberLastBlock
static const int LhcFillNumberFirstBlock

◆ operator!=()

bool L1GtfeExtWord::operator!= ( const L1GtfeExtWord result) const

unequal operator

Definition at line 100 of file L1GtfeExtWord.cc.

References mps_fire::result.

100 { return !(result == *this); }

◆ operator==()

bool L1GtfeExtWord::operator== ( const L1GtfeExtWord result) const

equal operator

Definition at line 73 of file L1GtfeExtWord.cc.

References m_bst, m_bstSource, and mps_fire::result.

73  {
74  // base class
75 
76  const L1GtfeWord gtfeResult = result;
77  const L1GtfeWord gtfeThis = *this;
78 
79  if (gtfeThis != gtfeResult) {
80  return false;
81  }
82 
83  //
84 
85  for (unsigned int iB = 0; iB < m_bst.size(); ++iB) {
86  if (m_bst[iB] != result.m_bst[iB]) {
87  return false;
88  }
89  }
90 
91  if (m_bstSource != result.m_bstSource) {
92  return false;
93  }
94 
95  // all members identical
96  return true;
97 }
std::vector< cms_uint16_t > m_bst
BST message - each byte is an vector element.
cms_uint16_t m_bstSource
hex message indicating the source of BST message (beam or simulated)

◆ particleTypeBeam1()

const cms_uint16_t L1GtfeExtWord::particleTypeBeam1 ( ) const

Definition at line 235 of file L1GtfeExtWord.cc.

References BstBitSize, m_bst, ParticleTypeBeam1FirstBlock, and ParticleTypeBeam1LastBlock.

Referenced by L1Analysis::L1AnalysisGT::SetEvm().

235  {
236  cms_uint16_t ptb = 0;
237 
238  // return 0 if BST message too small
239  int bstSize = m_bst.size();
240  if (ParticleTypeBeam1LastBlock >= bstSize) {
241  return ptb;
242  }
243 
244  for (int iB = ParticleTypeBeam1FirstBlock; iB <= ParticleTypeBeam1LastBlock; ++iB) {
245  // keep capitalization for similarity with other functions
246  const int scaledIB = iB - ParticleTypeBeam1FirstBlock;
247  const int BstShift = BstBitSize * scaledIB;
248 
249  ptb = ptb | (m_bst[iB] << BstShift);
250  }
251 
252  return ptb;
253 }
static const int ParticleTypeBeam1FirstBlock
static const int ParticleTypeBeam1LastBlock
unsigned short cms_uint16_t
Definition: typedefs.h:13
std::vector< cms_uint16_t > m_bst
BST message - each byte is an vector element.
static const int BstBitSize
size in bits for a BST block

◆ particleTypeBeam2()

const cms_uint16_t L1GtfeExtWord::particleTypeBeam2 ( ) const

Definition at line 255 of file L1GtfeExtWord.cc.

References BstBitSize, m_bst, ParticleTypeBeam2FirstBlock, and ParticleTypeBeam2LastBlock.

Referenced by L1Analysis::L1AnalysisGT::SetEvm().

255  {
256  cms_uint16_t ptb = 0;
257 
258  // return 0 if BST message too small
259  int bstSize = m_bst.size();
260  if (ParticleTypeBeam2LastBlock >= bstSize) {
261  return ptb;
262  }
263 
264  for (int iB = ParticleTypeBeam2FirstBlock; iB <= ParticleTypeBeam2LastBlock; ++iB) {
265  // keep capitalization for similarity with other functions
266  const int scaledIB = iB - ParticleTypeBeam2FirstBlock;
267  const int BstShift = BstBitSize * scaledIB;
268 
269  ptb = ptb | (m_bst[iB] << BstShift);
270  }
271 
272  return ptb;
273 }
static const int ParticleTypeBeam2LastBlock
static const int ParticleTypeBeam2FirstBlock
unsigned short cms_uint16_t
Definition: typedefs.h:13
std::vector< cms_uint16_t > m_bst
BST message - each byte is an vector element.
static const int BstBitSize
size in bits for a BST block

◆ print()

void L1GtfeExtWord::print ( std::ostream &  myCout) const
overridevirtual

pretty print the content of a L1GtfeExtWord

Reimplemented from L1GtfeWord.

Definition at line 434 of file L1GtfeExtWord.cc.

References TauDecayModes::dec, m_bst, m_bstSource, and L1GtfeWord::print().

Referenced by L1GlobalTriggerEvmReadoutRecord::print(), L1GTEvmDigiToRaw::produce(), and L1GlobalTriggerEvmRawToDigi::produce().

434  {
435  myCout << "\n L1GtfeExtWord::print \n" << std::endl;
436 
437  unsigned int sizeW64 = 64;
438  unsigned int dataBlocksPerLine = sizeW64 / 8; // 8x8 bits per line
439 
440  L1GtfeWord::print(myCout);
441 
442  unsigned int numberBstBlocks = m_bst.size();
443 
444  myCout << "\n BST ";
445 
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;
449 
450  return;
451  }
452 
453  for (unsigned int iB = 0; iB < numberBstBlocks; iB += dataBlocksPerLine) {
454  myCout << "\n" << std::hex << " hex: ";
455 
456  for (unsigned int jB = iB; jB < dataBlocksPerLine + iB; ++jB) {
457  if (jB >= numberBstBlocks) {
458  break;
459  }
460 
461  myCout << std::setw(2) << std::setfill('0') << m_bst[jB] << " " << std::setfill(' ');
462  }
463 
464  myCout << "\n" << std::dec << " dec: ";
465 
466  for (unsigned int jB = iB; jB < dataBlocksPerLine + iB; ++jB) {
467  if (jB >= numberBstBlocks) {
468  break;
469  }
470 
471  myCout << std::setw(3) << std::setfill('0') << m_bst[jB] << " " << std::setfill(' ');
472  }
473 
474  myCout << std::endl;
475  }
476 
477  myCout << "\n BST source [hex]: " << std::hex << std::setw(4) << std::setfill('0') << m_bstSource
478  << std::setfill(' ') << std::dec << std::endl;
479 }
virtual void print(std::ostream &myCout) const
pretty print the content of a L1GtfeWord
Definition: L1GtfeWord.cc:253
std::vector< cms_uint16_t > m_bst
BST message - each byte is an vector element.
cms_uint16_t m_bstSource
hex message indicating the source of BST message (beam or simulated)

◆ reset()

void L1GtfeExtWord::reset ( void  )
overridevirtual

reset the content of a L1GtfeExtWord

Reimplemented from L1GtfeWord.

Definition at line 428 of file L1GtfeExtWord.cc.

References m_bst, and L1GtfeWord::reset().

Referenced by L1GlobalTriggerEvmRawToDigi::produce().

428  {
430  m_bst.clear();
431 }
virtual void reset()
reset the content of a L1GtfeWord
Definition: L1GtfeWord.cc:240
std::vector< cms_uint16_t > m_bst
BST message - each byte is an vector element.

◆ resize()

void L1GtfeExtWord::resize ( int  bstSizeBytes)

resize the BST vector to get the right size of the block

Definition at line 425 of file L1GtfeExtWord.cc.

References m_bst.

Referenced by L1GlobalTriggerEvmRawToDigi::produce().

425 { m_bst.resize(bstSizeBytes); }
std::vector< cms_uint16_t > m_bst
BST message - each byte is an vector element.

◆ setBst() [1/2]

void L1GtfeExtWord::setBst ( const cms_uint16_t  bstVal,
const int  iB 
)

Referenced by unpack().

◆ setBst() [2/2]

void L1GtfeExtWord::setBst ( const cms_uint64_t word64,
const int  iB 
)

set the BST block for index iB from a 64-bits word

Definition at line 361 of file L1GtfeExtWord.cc.

References BstBitSize, BstBlockMask, and m_bst.

361  {
362  // keep capitalization for similarity with other functions //FIXME check it again
363  const int scaledIB = iB % (sizeof(word64) * 8 / BstBitSize);
364  const int BstShift = BstBitSize * scaledIB;
365  const cms_uint64_t BstMask = 0x0000000000000000ULL | (BstBlockMask << BstShift);
366 
367  m_bst[iB] = static_cast<cms_uint16_t>((word64 & BstMask) >> BstShift);
368 }
static const cms_uint64_t BstBlockMask
unsigned short cms_uint16_t
Definition: typedefs.h:13
std::vector< cms_uint16_t > m_bst
BST message - each byte is an vector element.
static const int BstBitSize
size in bits for a BST block
unsigned long long cms_uint64_t
Definition: typedefs.h:17

◆ setBstSource() [1/2]

void L1GtfeExtWord::setBstSource ( const cms_uint16_t  bstSourceVal)
inline

Definition at line 98 of file L1GtfeExtWord.h.

References m_bstSource.

Referenced by L1GlobalTrigger::produce().

98 { m_bstSource = bstSourceVal; }
cms_uint16_t m_bstSource
hex message indicating the source of BST message (beam or simulated)

◆ setBstSource() [2/2]

void L1GtfeExtWord::setBstSource ( const cms_uint64_t word64)

set the hex message indicating the source of BST message from a 64-bits word

Definition at line 384 of file L1GtfeExtWord.cc.

References BstSourceMask, BstSourceShift, and m_bstSource.

384  {
385  m_bstSource = (word64 & BstSourceMask) >> BstSourceShift;
386 }
static const cms_uint64_t BstSourceMask
static const int BstSourceShift
cms_uint16_t m_bstSource
hex message indicating the source of BST message (beam or simulated)

◆ setBstSourceWord64()

void L1GtfeExtWord::setBstSourceWord64 ( cms_uint64_t word64,
const int  iWord 
)

set hex message indicating the source of BST message in a 64-bits word, having the index iWord in the GTFE raw record

Definition at line 390 of file L1GtfeExtWord.cc.

References BstSourceShift, getSize(), and m_bstSource.

390  {
391  // BST always in the last word of GTFE extended - size must be correct!
392  int gtfeSize = this->getSize();
393 
394  int BstSourceWord = gtfeSize / 8 - 1; // counting starts at 0
395 
396  if (iWord == BstSourceWord) {
397  word64 = word64 | (static_cast<cms_uint64_t>(m_bstSource) << BstSourceShift);
398  }
399 }
static const int BstSourceShift
cms_uint16_t m_bstSource
hex message indicating the source of BST message (beam or simulated)
const unsigned int getSize() const
get the size of the GTFE block in GT EVM record (in multiple of 8 bits)
unsigned long long cms_uint64_t
Definition: typedefs.h:17

◆ setBstWord64()

void L1GtfeExtWord::setBstWord64 ( cms_uint64_t word64,
int  iB,
const int  iWord 
)

set the BST block in a 64-bits word, having the index iWord in the GTFE raw record

Definition at line 372 of file L1GtfeExtWord.cc.

References BstBitSize, BstFirstWord, and m_bst.

Referenced by L1GTEvmDigiToRaw::packGTFE().

372  {
373  // keep capitalization for similarity with other functions
374  const int scaledIB = iB % (sizeof(word64) * 8 / BstBitSize);
375  const int BstShift = BstBitSize * scaledIB;
376  const int BstWord = iB / (sizeof(word64) * 8 / BstBitSize) + BstFirstWord;
377 
378  if (iWord == BstWord) {
379  word64 = word64 | (static_cast<cms_uint64_t>(m_bst[iB]) << BstShift);
380  }
381 }
static const int BstFirstWord
block description in the raw GT record
std::vector< cms_uint16_t > m_bst
BST message - each byte is an vector element.
static const int BstBitSize
size in bits for a BST block
unsigned long long cms_uint64_t
Definition: typedefs.h:17

◆ setGpsTime()

void L1GtfeExtWord::setGpsTime ( const cms_uint64_t  gpsTimeValue)

Definition at line 124 of file L1GtfeExtWord.cc.

References BstBitSize, BstBlockMask, GpsTimeFirstBlock, GpsTimeLastBlock, and m_bst.

Referenced by L1GlobalTrigger::produce().

124  {
125  // return if BST message too small
126  int bstSize = m_bst.size();
127  if (GpsTimeLastBlock >= bstSize) {
128  edm::LogError("L1GtfeExtWord") << "Error: BST message length " << bstSize
129  << " smaller than the required GpsTimeLastBlock " << GpsTimeLastBlock
130  << "\n Cannot set GpsTime" << std::endl;
131 
132  return;
133  }
134 
135  for (int iB = GpsTimeFirstBlock; iB <= GpsTimeLastBlock; ++iB) {
136  // keep capitalization for similarity with other functions
137  const int scaledIB = iB - GpsTimeFirstBlock;
138  const int BstShift = BstBitSize * scaledIB;
139  const cms_uint64_t BstMask = 0x0000000000000000ULL | (BstBlockMask << BstShift);
140 
141  m_bst[iB] = static_cast<cms_uint16_t>((gpsTimeValue & BstMask) >> BstShift);
142 
143  //LogTrace("L1GtfeExtWord")
144  //<< "BstShift: value [dec] = " << BstShift << "\n"
145  //<< "BstBlockMask: value [hex] = " << std::hex << BstBlockMask << "\n"
146  //<< "BstMask: value [hex] = "<< BstMask << std::dec
147  //<< std::endl;
148 
149  //LogTrace("L1GtfeExtWord")
150  //<< "BST block " << iB << ": value [hex] = " << std::hex << m_bst[iB] << std::dec
151  //<< std::endl;
152  }
153 }
static const int GpsTimeLastBlock
static const cms_uint64_t BstBlockMask
Log< level::Error, false > LogError
static const int GpsTimeFirstBlock
BST blocks: conversion to defined quantities (LHC-BOB-ES-0001)
unsigned short cms_uint16_t
Definition: typedefs.h:13
std::vector< cms_uint16_t > m_bst
BST message - each byte is an vector element.
static const int BstBitSize
size in bits for a BST block
unsigned long long cms_uint64_t
Definition: typedefs.h:17

◆ totalIntensityBeam1()

const cms_uint32_t L1GtfeExtWord::totalIntensityBeam1 ( ) const

Definition at line 295 of file L1GtfeExtWord.cc.

References BstBitSize, m_bst, TotalIntensityBeam1FirstBlock, and TotalIntensityBeam1LastBlock.

Referenced by L1TGT::analyze(), ConditionDumperInEdm::produce(), and L1Analysis::L1AnalysisGT::SetEvm().

295  {
296  cms_uint32_t tib = 0;
297 
298  // return 0 if BST message too small
299  int bstSize = m_bst.size();
300  if (TotalIntensityBeam1LastBlock >= bstSize) {
301  return tib;
302  }
303 
304  for (int iB = TotalIntensityBeam1FirstBlock; iB <= TotalIntensityBeam1LastBlock; ++iB) {
305  // keep capitalization for similarity with other functions
306  const int scaledIB = iB - TotalIntensityBeam1FirstBlock;
307  const int BstShift = BstBitSize * scaledIB;
308 
309  tib = tib | ((static_cast<cms_uint32_t>(m_bst[iB])) << BstShift);
310  }
311 
312  return tib;
313 }
static const int TotalIntensityBeam1FirstBlock
static const int TotalIntensityBeam1LastBlock
unsigned int cms_uint32_t
Definition: typedefs.h:15
std::vector< cms_uint16_t > m_bst
BST message - each byte is an vector element.
static const int BstBitSize
size in bits for a BST block

◆ totalIntensityBeam2()

const cms_uint32_t L1GtfeExtWord::totalIntensityBeam2 ( ) const

Definition at line 315 of file L1GtfeExtWord.cc.

References BstBitSize, m_bst, TotalIntensityBeam2FirstBlock, and TotalIntensityBeam2LastBlock.

Referenced by L1TGT::analyze(), ConditionDumperInEdm::produce(), and L1Analysis::L1AnalysisGT::SetEvm().

315  {
316  cms_uint32_t tib = 0;
317 
318  // return 0 if BST message too small
319  int bstSize = m_bst.size();
320  if (TotalIntensityBeam2LastBlock >= bstSize) {
321  return tib;
322  }
323 
324  for (int iB = TotalIntensityBeam2FirstBlock; iB <= TotalIntensityBeam2LastBlock; ++iB) {
325  // keep capitalization for similarity with other functions
326  const int scaledIB = iB - TotalIntensityBeam2FirstBlock;
327  const int BstShift = BstBitSize * scaledIB;
328 
329  tib = tib | ((static_cast<cms_uint32_t>(m_bst[iB])) << BstShift);
330  }
331 
332  return tib;
333 }
static const int TotalIntensityBeam2LastBlock
unsigned int cms_uint32_t
Definition: typedefs.h:15
static const int TotalIntensityBeam2FirstBlock
std::vector< cms_uint16_t > m_bst
BST message - each byte is an vector element.
static const int BstBitSize
size in bits for a BST block

◆ turnCountNumber()

const cms_uint32_t L1GtfeExtWord::turnCountNumber ( ) const

Definition at line 175 of file L1GtfeExtWord.cc.

References BstBitSize, m_bst, TurnCountNumberFirstBlock, and TurnCountNumberLastBlock.

Referenced by L1TGT::analyze(), ConditionDumperInEdm::produce(), and L1Analysis::L1AnalysisGT::SetEvm().

175  {
176  cms_uint32_t tcn = 0;
177 
178  // return 0 if BST message too small
179  int bstSize = m_bst.size();
180  if (TurnCountNumberLastBlock >= bstSize) {
181  return tcn;
182  }
183 
184  for (int iB = TurnCountNumberFirstBlock; iB <= TurnCountNumberLastBlock; ++iB) {
185  // keep capitalization for similarity with other functions
186  const int scaledIB = iB - TurnCountNumberFirstBlock;
187  const int BstShift = BstBitSize * scaledIB;
188 
189  tcn = tcn | ((static_cast<cms_uint32_t>(m_bst[iB])) << BstShift);
190  }
191 
192  return tcn;
193 }
static const int TurnCountNumberLastBlock
static const int TurnCountNumberFirstBlock
unsigned int cms_uint32_t
Definition: typedefs.h:15
std::vector< cms_uint16_t > m_bst
BST message - each byte is an vector element.
static const int BstBitSize
size in bits for a BST block

◆ unpack()

void L1GtfeExtWord::unpack ( const unsigned char *  gtfePtr)
overridevirtual

unpack GTFE gtfePtr pointer to the beginning of the GTFE block in the raw data

Reimplemented from L1GtfeWord.

Definition at line 481 of file L1GtfeExtWord.cc.

References BstBitSize, BstFirstWord, runTheMatrix::const, TauDecayModes::dec, getSize(), L1GtfeWord::getSize(), edm::isDebugEnabled(), LogDebug, LogTrace, m_bst, jetsAK4_Puppi_cff::payload, setBst(), and L1GtfeWord::unpack().

Referenced by L1GlobalTriggerEvmRawToDigi::produce().

481  {
482  LogDebug("L1GtfeExtWord") << "\nUnpacking GTFE block.\n" << std::endl;
483 
484  L1GtfeWord::unpack(gtfePtr);
485 
486  // TODO make BlockSize protected & use friends instead of creating L1GtfeWord?
487  L1GtfeWord gtfeWord;
488  const unsigned char* gtfeExtPtr = gtfePtr + gtfeWord.getSize();
489 
490  const cms_uint64_t* payload = reinterpret_cast<cms_uint64_t const*>(gtfeExtPtr);
491 
492  int BlockSizeExt = this->getSize() / 8;
493  int NumberBstBlocks = m_bst.size();
494 
495  if (edm::isDebugEnabled()) {
496  for (int iWord = BstFirstWord; iWord < BlockSizeExt; ++iWord) {
497  int jWord = iWord - BstFirstWord;
498  LogTrace("L1GtfeExtWord") << std::setw(4) << iWord << " " << std::hex << std::setfill('0') << std::setw(16)
499  << payload[jWord] << std::dec << std::setfill(' ') << std::endl;
500  }
501  }
502 
503  int blocksPerWord = sizeof(cms_uint64_t) * 8 / BstBitSize;
504 
505  for (int iB = 0; iB < NumberBstBlocks; ++iB) {
506  // keep capitalization for similarity with other functions
507  int BstWord = iB / blocksPerWord;
508 
509  setBst(payload[BstWord], iB);
510  }
511 }
bool isDebugEnabled()
const unsigned int getSize() const
get the size of the GTFE block in GT DAQ record (in multiple of 8 bits)
Definition: L1GtfeWord.h:160
void setBst(const cms_uint16_t bstVal, const int iB)
#define LogTrace(id)
static const int BstFirstWord
block description in the raw GT record
std::vector< cms_uint16_t > m_bst
BST message - each byte is an vector element.
static const int BstBitSize
size in bits for a BST block
const unsigned int getSize() const
get the size of the GTFE block in GT EVM record (in multiple of 8 bits)
unsigned long long cms_uint64_t
Definition: typedefs.h:17
virtual void unpack(const unsigned char *gtfePtr)
Definition: L1GtfeWord.cc:290
#define LogDebug(id)

Member Data Documentation

◆ BeamModeFirstBlock

const int L1GtfeExtWord::BeamModeFirstBlock = 26
staticprivate

Definition at line 152 of file L1GtfeExtWord.h.

Referenced by beamMode().

◆ BeamModeLastBlock

const int L1GtfeExtWord::BeamModeLastBlock = 27
staticprivate

Definition at line 153 of file L1GtfeExtWord.h.

Referenced by beamMode().

◆ BeamMomentumFirstBlock

const int L1GtfeExtWord::BeamMomentumFirstBlock = 30
staticprivate

Definition at line 161 of file L1GtfeExtWord.h.

Referenced by beamMomentum().

◆ BeamMomentumLastBlock

const int L1GtfeExtWord::BeamMomentumLastBlock = 31
staticprivate

Definition at line 162 of file L1GtfeExtWord.h.

Referenced by beamMomentum().

◆ BstBitSize

const int L1GtfeExtWord::BstBitSize = 8
staticprivate

◆ BstBlockMask

const cms_uint64_t L1GtfeExtWord::BstBlockMask = 0xFFULL
staticprivate

BST block mask, correlated with the number of bits of a block 8 bit = 0xFF

Definition at line 136 of file L1GtfeExtWord.h.

Referenced by setBst(), and setGpsTime().

◆ BstFirstWord

const int L1GtfeExtWord::BstFirstWord = 2
staticprivate

block description in the raw GT record

index of first word for BST blocks

Definition at line 129 of file L1GtfeExtWord.h.

Referenced by setBstWord64(), and unpack().

◆ BstMasterStatusFirstBlock

const int L1GtfeExtWord::BstMasterStatusFirstBlock = 17
staticprivate

Definition at line 143 of file L1GtfeExtWord.h.

Referenced by bstMasterStatus().

◆ BstMasterStatusLastBlock

const int L1GtfeExtWord::BstMasterStatusLastBlock = 17
staticprivate

Definition at line 144 of file L1GtfeExtWord.h.

Referenced by bstMasterStatus().

◆ BstSourceMask

const cms_uint64_t L1GtfeExtWord::BstSourceMask = 0xFFFF000000000000ULL
staticprivate

Definition at line 171 of file L1GtfeExtWord.h.

Referenced by setBstSource().

◆ BstSourceShift

const int L1GtfeExtWord::BstSourceShift = 48
staticprivate

Definition at line 173 of file L1GtfeExtWord.h.

Referenced by setBstSource(), and setBstSourceWord64().

◆ GpsTimeFirstBlock

const int L1GtfeExtWord::GpsTimeFirstBlock = 0
staticprivate

BST blocks: conversion to defined quantities (LHC-BOB-ES-0001)

Definition at line 140 of file L1GtfeExtWord.h.

Referenced by gpsTime(), and setGpsTime().

◆ GpsTimeLastBlock

const int L1GtfeExtWord::GpsTimeLastBlock = 7
staticprivate

Definition at line 141 of file L1GtfeExtWord.h.

Referenced by gpsTime(), and setGpsTime().

◆ LhcFillNumberFirstBlock

const int L1GtfeExtWord::LhcFillNumberFirstBlock = 22
staticprivate

Definition at line 149 of file L1GtfeExtWord.h.

Referenced by lhcFillNumber().

◆ LhcFillNumberLastBlock

const int L1GtfeExtWord::LhcFillNumberLastBlock = 25
staticprivate

Definition at line 150 of file L1GtfeExtWord.h.

Referenced by lhcFillNumber().

◆ m_bst

std::vector<cms_uint16_t> L1GtfeExtWord::m_bst
private

◆ m_bstSource

cms_uint16_t L1GtfeExtWord::m_bstSource
private

hex message indicating the source of BST message (beam or simulated)

Definition at line 180 of file L1GtfeExtWord.h.

Referenced by bstSource(), operator==(), print(), setBstSource(), and setBstSourceWord64().

◆ ParticleTypeBeam1FirstBlock

const int L1GtfeExtWord::ParticleTypeBeam1FirstBlock = 28
staticprivate

Definition at line 155 of file L1GtfeExtWord.h.

Referenced by particleTypeBeam1().

◆ ParticleTypeBeam1LastBlock

const int L1GtfeExtWord::ParticleTypeBeam1LastBlock = 28
staticprivate

Definition at line 156 of file L1GtfeExtWord.h.

Referenced by particleTypeBeam1().

◆ ParticleTypeBeam2FirstBlock

const int L1GtfeExtWord::ParticleTypeBeam2FirstBlock = 29
staticprivate

Definition at line 158 of file L1GtfeExtWord.h.

Referenced by particleTypeBeam2().

◆ ParticleTypeBeam2LastBlock

const int L1GtfeExtWord::ParticleTypeBeam2LastBlock = 29
staticprivate

Definition at line 159 of file L1GtfeExtWord.h.

Referenced by particleTypeBeam2().

◆ TotalIntensityBeam1FirstBlock

const int L1GtfeExtWord::TotalIntensityBeam1FirstBlock = 32
staticprivate

Definition at line 164 of file L1GtfeExtWord.h.

Referenced by totalIntensityBeam1().

◆ TotalIntensityBeam1LastBlock

const int L1GtfeExtWord::TotalIntensityBeam1LastBlock = 35
staticprivate

Definition at line 165 of file L1GtfeExtWord.h.

Referenced by totalIntensityBeam1().

◆ TotalIntensityBeam2FirstBlock

const int L1GtfeExtWord::TotalIntensityBeam2FirstBlock = 36
staticprivate

Definition at line 167 of file L1GtfeExtWord.h.

Referenced by totalIntensityBeam2().

◆ TotalIntensityBeam2LastBlock

const int L1GtfeExtWord::TotalIntensityBeam2LastBlock = 39
staticprivate

Definition at line 168 of file L1GtfeExtWord.h.

Referenced by totalIntensityBeam2().

◆ TurnCountNumberFirstBlock

const int L1GtfeExtWord::TurnCountNumberFirstBlock = 18
staticprivate

Definition at line 146 of file L1GtfeExtWord.h.

Referenced by turnCountNumber().

◆ TurnCountNumberLastBlock

const int L1GtfeExtWord::TurnCountNumberLastBlock = 21
staticprivate

Definition at line 147 of file L1GtfeExtWord.h.

Referenced by turnCountNumber().