test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
 
virtual void print (std::ostream &myCout) const
 pretty print the content of a L1GtfeExtWord More...
 
void reset ()
 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
 
virtual void unpack (const unsigned char *gtfePtr)
 
virtual ~L1GtfeExtWord ()
 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::L1GtfeExtWord ( )

constructors

Definition at line 35 of file L1GtfeExtWord.cc.

35  :
36  L1GtfeWord(), m_bstSource(0) {
37 
38  // empty
39 
40 }
L1GtfeWord()
constructors
Definition: L1GtfeWord.cc:29
cms_uint16_t m_bstSource
hex message indicating the source of BST message (beam or simulated)
L1GtfeExtWord::L1GtfeExtWord ( int  bstSizeBytes)

all members set to zero, m_bst has bstSizeBytes zero elements

Definition at line 43 of file L1GtfeExtWord.cc.

References m_bst.

43  :
44  L1GtfeWord(), m_bstSource(0) {
45 
46  m_bst.resize(bstSizeBytes);
47 
48 }
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 ( 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 52 of file L1GtfeExtWord.cc.

57  :
58  L1GtfeWord(
59  boardIdValue, recordLength1Value, recordLengthValue, bxNrValue, setupVersionValue,
60  activeBoardsValue, altNrBxBoardValue, totalTriggerNrValue), m_bst(bstValue),
61  m_bstSource(bstSourceValue)
62 
63 {
64 
65  // empty
66 }
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 ( )
virtual

destructor

Definition at line 69 of file L1GtfeExtWord.cc.

69  {
70 
71  // empty now
72 
73 }

Member Function Documentation

const cms_uint16_t L1GtfeExtWord::beamMode ( ) const

Definition at line 252 of file L1GtfeExtWord.cc.

References BeamModeFirstBlock, BeamModeLastBlock, BstBitSize, and m_bst.

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

253 {
254 
255  cms_uint16_t bm = 0;
256 
257  // return 0 if BST message too small
258  int bstSize = m_bst.size();
259  if (BeamModeLastBlock >= bstSize) {
260  return bm;
261  }
262 
263  for (int iB = BeamModeFirstBlock; iB <= BeamModeLastBlock; ++iB) {
264 
265  // keep capitalization for similarity with other functions
266  const int scaledIB = iB - BeamModeFirstBlock;
267  const int BstShift = BstBitSize*scaledIB;
268 
269  bm = bm | ( m_bst[iB] << BstShift );
270 
271  }
272 
273  return bm;
274 }
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
const cms_uint16_t L1GtfeExtWord::beamMomentum ( ) const

Definition at line 325 of file L1GtfeExtWord.cc.

References BeamMomentumFirstBlock, BeamMomentumLastBlock, BstBitSize, and m_bst.

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

326 {
327 
328  cms_uint16_t bm = 0;
329 
330  // return 0 if BST message too small
331  int bstSize = m_bst.size();
332  if (BeamMomentumLastBlock >= bstSize) {
333  return bm;
334  }
335 
336  for (int iB = BeamMomentumFirstBlock; iB <= BeamMomentumLastBlock; ++iB) {
337 
338  // keep capitalization for similarity with other functions
339  const int scaledIB = iB - BeamMomentumFirstBlock;
340  const int BstShift = BstBitSize*scaledIB;
341 
342  bm = bm | ( m_bst[iB] << BstShift );
343 
344  }
345 
346  return bm;
347 }
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
const std::vector<cms_uint16_t>& L1GtfeExtWord::bst ( ) const
inline

get the full BST block

Definition at line 69 of file L1GtfeExtWord.h.

References m_bst.

69  {
70  return m_bst;
71  }
std::vector< cms_uint16_t > m_bst
BST message - each byte is an vector element.
const uint16_t L1GtfeExtWord::bst ( int  iB) const

get/set BST block for index iB

Definition at line 401 of file L1GtfeExtWord.cc.

References Exception, and m_bst.

402 {
403 
404  int NumberBstBlocks = m_bst.size();
405 
406  if (iB < 0 || iB >= NumberBstBlocks) {
407  throw cms::Exception("BstIndexError")
408  << "\nError: index for BST array out of range. Allowed range: [0, "
409  << NumberBstBlocks << ") " << std::endl;
410 
411  } else {
412  return m_bst[iB];
413  }
414 
415 }
std::vector< cms_uint16_t > m_bst
BST message - each byte is an vector element.
const unsigned int L1GtfeExtWord::bstLengthBytes ( ) const
inline

get the size of the BST block

Definition at line 74 of file L1GtfeExtWord.h.

References m_bst.

Referenced by L1GTEvmDigiToRaw::produce().

74  {
75  return m_bst.size();
76  }
std::vector< cms_uint16_t > m_bst
BST message - each byte is an vector element.
const cms_uint16_t L1GtfeExtWord::bstMasterStatus ( ) const

Definition at line 177 of file L1GtfeExtWord.cc.

References BstBitSize, BstMasterStatusFirstBlock, BstMasterStatusLastBlock, and m_bst.

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

178 {
179 
180  cms_uint16_t bms = 0;
181 
182  // return 0 if BST message too small
183  int bstSize = m_bst.size();
184  if (BstMasterStatusLastBlock >= bstSize) {
185  return bms;
186  }
187 
188  for (int iB = BstMasterStatusFirstBlock; iB <= BstMasterStatusLastBlock; ++iB) {
189 
190  // keep capitalization for similarity with other functions
191  const int scaledIB = iB - BstMasterStatusFirstBlock;
192  const int BstShift = BstBitSize*scaledIB;
193 
194  bms = bms | ( m_bst[iB] << BstShift );
195 
196  }
197 
198  return bms;
199 }
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
const cms_uint16_t L1GtfeExtWord::bstSource ( ) const
inline

get/set hex message indicating the source of BST message

Definition at line 112 of file L1GtfeExtWord.h.

References m_bstSource.

112  {
113  return m_bstSource;
114  }
cms_uint16_t m_bstSource
hex message indicating the source of BST message (beam or simulated)
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 490 of file L1GtfeExtWord.cc.

References L1GtfeWord::getSize(), and m_bst.

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

490  {
491 
492  L1GtfeWord gtfeWord;
493  unsigned int gtfeSize = gtfeWord.getSize();
494 
495  unsigned int gtfeExtSize;
496 
497  // 2 bytes to write if real BST message or simulated BST message
498  unsigned int bytesBstWriter = 2;
499 
500  // size of BST block, using rounded 64-bit words (8 bytes per 64-bit word)
501 
502  unsigned int bstSize = m_bst.size();
503 
504  if ( (bstSize +bytesBstWriter )%8 == 0) {
505  gtfeExtSize = gtfeSize + bstSize + bytesBstWriter;
506  }
507  else {
508  gtfeExtSize = gtfeSize + bstSize + bytesBstWriter + (8 - (bstSize + bytesBstWriter)%8 );
509  }
510 
511  return gtfeExtSize;
512 }
const unsigned int getSize() const
get the size of the GTFE block in GT DAQ record (in multiple of 8 bits)
Definition: L1GtfeWord.h:229
std::vector< cms_uint16_t > m_bst
BST message - each byte is an vector element.
const cms_uint64_t L1GtfeExtWord::gpsTime ( ) const

LHC-BOB-ES-0001 (EDMS 638899)

Definition at line 116 of file L1GtfeExtWord.cc.

References BstBitSize, GpsTimeFirstBlock, GpsTimeLastBlock, and m_bst.

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

117 {
118 
119  cms_uint64_t gpst = 0ULL;
120 
121  // return 0 if BST message too small
122  int bstSize = m_bst.size();
123  if (GpsTimeLastBlock >= bstSize) {
124  return gpst;
125  }
126 
127  for (int iB = GpsTimeFirstBlock; iB <= GpsTimeLastBlock; ++iB) {
128 
129  // keep capitalization for similarity with other functions
130  const int scaledIB = iB - GpsTimeFirstBlock;
131  const int BstShift = BstBitSize*scaledIB;
132 
133  gpst = gpst |
134  ( (static_cast<cms_uint64_t> (m_bst[iB])) << BstShift );
135 
136  }
137 
138  return gpst;
139 }
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
const cms_uint32_t L1GtfeExtWord::lhcFillNumber ( ) const

Definition at line 227 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().

228 {
229 
230  cms_uint32_t lhcfn = 0;
231 
232  // return 0 if BST message too small
233  int bstSize = m_bst.size();
234  if (LhcFillNumberLastBlock >= bstSize) {
235  return lhcfn;
236  }
237 
238  for (int iB = LhcFillNumberFirstBlock; iB <= LhcFillNumberLastBlock; ++iB) {
239 
240  // keep capitalization for similarity with other functions
241  const int scaledIB = iB - LhcFillNumberFirstBlock;
242  const int BstShift = BstBitSize*scaledIB;
243 
244  lhcfn = lhcfn |
245  ( (static_cast<cms_uint32_t> (m_bst[iB])) << BstShift );
246 
247  }
248 
249  return lhcfn;
250 }
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
bool L1GtfeExtWord::operator!= ( const L1GtfeExtWord result) const

unequal operator

Definition at line 107 of file L1GtfeExtWord.cc.

108 {
109 
110  return !( result == *this);
111 
112 }
bool L1GtfeExtWord::operator== ( const L1GtfeExtWord result) const

equal operator

Definition at line 76 of file L1GtfeExtWord.cc.

References m_bst, m_bstSource, and mps_fire::result.

77 {
78 
79  // base class
80 
81  const L1GtfeWord gtfeResult = result;
82  const L1GtfeWord gtfeThis = *this;
83 
84  if (gtfeThis != gtfeResult) {
85  return false;
86  }
87 
88 
89  //
90 
91  for (unsigned int iB = 0; iB < m_bst.size(); ++iB) {
92  if(m_bst[iB] != result.m_bst[iB]) {
93  return false;
94  }
95  }
96 
97  if ( m_bstSource != result.m_bstSource) {
98  return false;
99  }
100 
101  // all members identical
102  return true;
103 
104 }
tuple result
Definition: mps_fire.py:84
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)
const cms_uint16_t L1GtfeExtWord::particleTypeBeam1 ( ) const

Definition at line 276 of file L1GtfeExtWord.cc.

References BstBitSize, m_bst, ParticleTypeBeam1FirstBlock, and ParticleTypeBeam1LastBlock.

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

277 {
278 
279  cms_uint16_t ptb = 0;
280 
281  // return 0 if BST message too small
282  int bstSize = m_bst.size();
283  if (ParticleTypeBeam1LastBlock >= bstSize) {
284  return ptb;
285  }
286 
287  for (int iB = ParticleTypeBeam1FirstBlock; iB <= ParticleTypeBeam1LastBlock; ++iB) {
288 
289  // keep capitalization for similarity with other functions
290  const int scaledIB = iB - ParticleTypeBeam1FirstBlock;
291  const int BstShift = BstBitSize*scaledIB;
292 
293  ptb = ptb | ( m_bst[iB] << BstShift );
294 
295  }
296 
297  return ptb;
298 }
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
const cms_uint16_t L1GtfeExtWord::particleTypeBeam2 ( ) const

Definition at line 300 of file L1GtfeExtWord.cc.

References BstBitSize, m_bst, ParticleTypeBeam2FirstBlock, and ParticleTypeBeam2LastBlock.

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

301 {
302 
303  cms_uint16_t ptb = 0;
304 
305  // return 0 if BST message too small
306  int bstSize = m_bst.size();
307  if (ParticleTypeBeam2LastBlock >= bstSize) {
308  return ptb;
309  }
310 
311  for (int iB = ParticleTypeBeam2FirstBlock; iB <= ParticleTypeBeam2LastBlock; ++iB) {
312 
313  // keep capitalization for similarity with other functions
314  const int scaledIB = iB - ParticleTypeBeam2FirstBlock;
315  const int BstShift = BstBitSize*scaledIB;
316 
317  ptb = ptb | ( m_bst[iB] << BstShift );
318 
319  }
320 
321  return ptb;
322 
323 }
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
void L1GtfeExtWord::print ( std::ostream &  myCout) const
virtual

pretty print the content of a L1GtfeExtWord

Reimplemented from L1GtfeWord.

Definition at line 533 of file L1GtfeExtWord.cc.

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

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

533  {
534 
535  myCout << "\n L1GtfeExtWord::print \n" << std::endl;
536 
537  unsigned int sizeW64 = 64;
538  unsigned int dataBlocksPerLine = sizeW64 / 8; // 8x8 bits per line
539 
540  L1GtfeWord::print(myCout);
541 
542  unsigned int numberBstBlocks = m_bst.size();
543 
544  myCout << "\n BST ";
545 
546  if (numberBstBlocks == 0) {
547 
548  myCout << "\n BST source [hex]: " << std::hex << std::setw(4)
549  << std::setfill('0') << m_bstSource << std::setfill(' ')
550  << std::dec << std::endl;
551 
552  return;
553  }
554 
555  for (unsigned int iB = 0; iB < numberBstBlocks; iB += dataBlocksPerLine) {
556 
557  myCout << "\n" << std::hex << " hex: ";
558 
559  for (unsigned int jB = iB; jB < dataBlocksPerLine + iB; ++jB) {
560 
561  if (jB >= numberBstBlocks) {
562  break;
563  }
564 
565  myCout << std::setw(2) << std::setfill('0') << m_bst[jB] << " "
566  << std::setfill(' ');
567  }
568 
569  myCout << "\n" << std::dec << " dec: ";
570 
571  for (unsigned int jB = iB; jB < dataBlocksPerLine + iB; ++jB) {
572 
573  if (jB >= numberBstBlocks) {
574  break;
575  }
576 
577  myCout << std::setw(3) << std::setfill('0') << m_bst[jB] << " "
578  << std::setfill(' ');
579  }
580 
581  myCout << std::endl;
582 
583  }
584 
585  myCout << "\n BST source [hex]: " << std::hex << std::setw(4)
586  << std::setfill('0') << m_bstSource << std::setfill(' ')
587  << std::dec << std::endl;
588 
589 }
virtual void print(std::ostream &myCout) const
pretty print the content of a L1GtfeWord
Definition: L1GtfeWord.cc:321
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)
void L1GtfeExtWord::reset ( void  )
virtual

reset the content of a L1GtfeExtWord

Reimplemented from L1GtfeWord.

Definition at line 524 of file L1GtfeExtWord.cc.

References m_bst, and L1GtfeWord::reset().

Referenced by L1GlobalTriggerEvmRawToDigi::produce().

525 {
526 
528  m_bst.clear();
529 
530 }
virtual void reset()
reset the content of a L1GtfeWord
Definition: L1GtfeWord.cc:306
std::vector< cms_uint16_t > m_bst
BST message - each byte is an vector element.
void L1GtfeExtWord::resize ( int  bstSizeBytes)

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

Definition at line 517 of file L1GtfeExtWord.cc.

References m_bst.

Referenced by Vispa.Gui.TextDialog.TextDialog::__init__(), Vispa.Plugins.ConfigEditor.ToolDialog.ToolDialog::__init__(), Vispa.Main.MainWindow.MainWindow::_loadIni(), L1GlobalTriggerEvmRawToDigi::produce(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

517  {
518 
519  m_bst.resize(bstSizeBytes);
520 
521 }
std::vector< cms_uint16_t > m_bst
BST message - each byte is an vector element.
void L1GtfeExtWord::setBst ( const cms_uint16_t  bstVal,
const int  iB 
)

Referenced by unpack().

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 434 of file L1GtfeExtWord.cc.

References BstBitSize, BstBlockMask, and m_bst.

435 {
436 
437  // keep capitalization for similarity with other functions //FIXME check it again
438  const int scaledIB = iB%(sizeof(word64)*8/BstBitSize);
439  const int BstShift = BstBitSize*scaledIB;
440  const cms_uint64_t BstMask = 0x0000000000000000ULL | (BstBlockMask << BstShift);
441 
442  m_bst[iB] = static_cast<cms_uint16_t> ((word64 & BstMask) >> BstShift);
443 
444 }
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
void L1GtfeExtWord::setBstSource ( const cms_uint16_t  bstSourceVal)
inline

Definition at line 116 of file L1GtfeExtWord.h.

References m_bstSource.

Referenced by L1GlobalTrigger::produce().

116  {
117  m_bstSource = bstSourceVal;
118  }
cms_uint16_t m_bstSource
hex message indicating the source of BST message (beam or simulated)
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 466 of file L1GtfeExtWord.cc.

References BstSourceMask, BstSourceShift, and m_bstSource.

466  {
467 
468  m_bstSource = (word64 & BstSourceMask) >> BstSourceShift;
469 
470 }
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)
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 474 of file L1GtfeExtWord.cc.

References BstSourceShift, getSize(), and m_bstSource.

474  {
475 
476  // BST always in the last word of GTFE extended - size must be correct!
477  int gtfeSize = this->getSize();
478 
479  int BstSourceWord = gtfeSize/8 - 1; // counting starts at 0
480 
481  if (iWord == BstSourceWord) {
482  word64 = word64 | (static_cast<cms_uint64_t> (m_bstSource)
483  << BstSourceShift);
484  }
485 
486 }
const unsigned int getSize() const
get the size of the GTFE block in GT EVM record (in multiple of 8 bits)
static const int BstSourceShift
cms_uint16_t m_bstSource
hex message indicating the source of BST message (beam or simulated)
unsigned long long cms_uint64_t
Definition: typedefs.h:17
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 448 of file L1GtfeExtWord.cc.

References BstBitSize, BstFirstWord, and m_bst.

Referenced by L1GTEvmDigiToRaw::packGTFE().

449 {
450 
451  // keep capitalization for similarity with other functions
452  const int scaledIB = iB%(sizeof(word64)*8/BstBitSize);
453  const int BstShift = BstBitSize*scaledIB;
454  const int BstWord = iB/(sizeof(word64)*8/BstBitSize) + BstFirstWord;
455 
456  if (iWord == BstWord) {
457  word64 = word64 |
458  (static_cast<cms_uint64_t> (m_bst[iB]) << BstShift);
459  }
460 
461 
462 }
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
void L1GtfeExtWord::setGpsTime ( const cms_uint64_t  gpsTimeValue)

Definition at line 141 of file L1GtfeExtWord.cc.

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

Referenced by L1GlobalTrigger::produce().

141  {
142 
143  // return if BST message too small
144  int bstSize = m_bst.size();
145  if (GpsTimeLastBlock >= bstSize) {
146 
147  edm::LogError("L1GtfeExtWord") << "Error: BST message length "
148  << bstSize << " smaller than the required GpsTimeLastBlock "
149  << GpsTimeLastBlock << "\n Cannot set GpsTime" << std::endl;
150 
151  return;
152  }
153 
154  for (int iB = GpsTimeFirstBlock; iB <= GpsTimeLastBlock; ++iB) {
155 
156  // keep capitalization for similarity with other functions
157  const int scaledIB = iB - GpsTimeFirstBlock;
158  const int BstShift = BstBitSize*scaledIB;
159  const cms_uint64_t BstMask = 0x0000000000000000ULL | (BstBlockMask << BstShift);
160 
161  m_bst[iB] = static_cast<cms_uint16_t> ((gpsTimeValue & BstMask) >> BstShift);
162 
163  //LogTrace("L1GtfeExtWord")
164  //<< "BstShift: value [dec] = " << BstShift << "\n"
165  //<< "BstBlockMask: value [hex] = " << std::hex << BstBlockMask << "\n"
166  //<< "BstMask: value [hex] = "<< BstMask << std::dec
167  //<< std::endl;
168 
169  //LogTrace("L1GtfeExtWord")
170  //<< "BST block " << iB << ": value [hex] = " << std::hex << m_bst[iB] << std::dec
171  //<< std::endl;
172 
173  }
174 
175 }
static const int GpsTimeLastBlock
static const cms_uint64_t BstBlockMask
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
const cms_uint32_t L1GtfeExtWord::totalIntensityBeam1 ( ) const

Definition at line 349 of file L1GtfeExtWord.cc.

References BstBitSize, m_bst, TotalIntensityBeam1FirstBlock, and TotalIntensityBeam1LastBlock.

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

350 {
351 
352  cms_uint32_t tib = 0;
353 
354  // return 0 if BST message too small
355  int bstSize = m_bst.size();
356  if (TotalIntensityBeam1LastBlock >= bstSize) {
357  return tib;
358  }
359 
360  for (int iB = TotalIntensityBeam1FirstBlock; iB <= TotalIntensityBeam1LastBlock; ++iB) {
361 
362  // keep capitalization for similarity with other functions
363  const int scaledIB = iB - TotalIntensityBeam1FirstBlock;
364  const int BstShift = BstBitSize*scaledIB;
365 
366  tib = tib |
367  ( (static_cast<cms_uint32_t> (m_bst[iB])) << BstShift );
368 
369  }
370 
371  return tib;
372 }
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
const cms_uint32_t L1GtfeExtWord::totalIntensityBeam2 ( ) const

Definition at line 374 of file L1GtfeExtWord.cc.

References BstBitSize, m_bst, TotalIntensityBeam2FirstBlock, and TotalIntensityBeam2LastBlock.

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

375 {
376 
377  cms_uint32_t tib = 0;
378 
379  // return 0 if BST message too small
380  int bstSize = m_bst.size();
381  if (TotalIntensityBeam2LastBlock >= bstSize) {
382  return tib;
383  }
384 
385  for (int iB = TotalIntensityBeam2FirstBlock; iB <= TotalIntensityBeam2LastBlock; ++iB) {
386 
387  // keep capitalization for similarity with other functions
388  const int scaledIB = iB - TotalIntensityBeam2FirstBlock;
389  const int BstShift = BstBitSize*scaledIB;
390 
391  tib = tib |
392  ( (static_cast<cms_uint32_t> (m_bst[iB])) << BstShift );
393 
394  }
395 
396  return tib;
397 }
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
const cms_uint32_t L1GtfeExtWord::turnCountNumber ( ) const

Definition at line 202 of file L1GtfeExtWord.cc.

References BstBitSize, m_bst, TurnCountNumberFirstBlock, and TurnCountNumberLastBlock.

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

203 {
204 
205  cms_uint32_t tcn = 0;
206 
207  // return 0 if BST message too small
208  int bstSize = m_bst.size();
209  if (TurnCountNumberLastBlock >= bstSize) {
210  return tcn;
211  }
212 
213  for (int iB = TurnCountNumberFirstBlock; iB <= TurnCountNumberLastBlock; ++iB) {
214 
215  // keep capitalization for similarity with other functions
216  const int scaledIB = iB - TurnCountNumberFirstBlock;
217  const int BstShift = BstBitSize*scaledIB;
218 
219  tcn = tcn |
220  ( (static_cast<cms_uint32_t> (m_bst[iB])) << BstShift );
221 
222  }
223 
224  return tcn;
225 }
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
void L1GtfeExtWord::unpack ( const unsigned char *  gtfePtr)
virtual

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

Reimplemented from L1GtfeWord.

Definition at line 591 of file L1GtfeExtWord.cc.

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

Referenced by L1GlobalTriggerEvmRawToDigi::produce().

592 {
593  LogDebug("L1GtfeExtWord")
594  << "\nUnpacking GTFE block.\n"
595  << std::endl;
596 
597  L1GtfeWord::unpack(gtfePtr);
598 
599  // TODO make BlockSize protected & use friends instead of creating L1GtfeWord?
600  L1GtfeWord gtfeWord;
601  const unsigned char* gtfeExtPtr = gtfePtr + gtfeWord.getSize();
602 
603  const cms_uint64_t* payload =
604  reinterpret_cast<cms_uint64_t const*>(gtfeExtPtr);
605 
606  int BlockSizeExt = this->getSize()/8;
607  int NumberBstBlocks = m_bst.size();
608 
609  if (edm::isDebugEnabled() ) {
610 
611  for (int iWord = BstFirstWord; iWord < BlockSizeExt; ++iWord) {
612 
613  int jWord = iWord - BstFirstWord;
614  LogTrace("L1GtfeExtWord")
615  << std::setw(4) << iWord << " "
616  << std::hex << std::setfill('0')
617  << std::setw(16) << payload[jWord]
618  << std::dec << std::setfill(' ')
619  << std::endl;
620 
621  }
622  }
623 
624  int blocksPerWord = sizeof(cms_uint64_t)*8/BstBitSize;
625 
626  for (int iB = 0; iB < NumberBstBlocks; ++iB) {
627 
628  // keep capitalization for similarity with other functions
629  int BstWord = iB/blocksPerWord;
630 
631  setBst(payload[BstWord], iB);
632 
633  }
634 
635 }
#define LogDebug(id)
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:229
void setBst(const cms_uint16_t bstVal, const int iB)
const unsigned int getSize() const
get the size of the GTFE block in GT EVM record (in multiple of 8 bits)
static const int BstFirstWord
block description in the raw GT record
#define LogTrace(id)
std::vector< cms_uint16_t > m_bst
BST message - each byte is an vector element.
string const
Definition: compareJSON.py:14
static const int BstBitSize
size in bits for a BST block
unsigned long long cms_uint64_t
Definition: typedefs.h:17
virtual void unpack(const unsigned char *gtfePtr)
Definition: L1GtfeWord.cc:380

Member Data Documentation

const int L1GtfeExtWord::BeamModeFirstBlock = 26
staticprivate

Definition at line 175 of file L1GtfeExtWord.h.

Referenced by beamMode().

const int L1GtfeExtWord::BeamModeLastBlock = 27
staticprivate

Definition at line 176 of file L1GtfeExtWord.h.

Referenced by beamMode().

const int L1GtfeExtWord::BeamMomentumFirstBlock = 30
staticprivate

Definition at line 184 of file L1GtfeExtWord.h.

Referenced by beamMomentum().

const int L1GtfeExtWord::BeamMomentumLastBlock = 31
staticprivate

Definition at line 185 of file L1GtfeExtWord.h.

Referenced by beamMomentum().

const int L1GtfeExtWord::BstBitSize = 8
staticprivate
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 159 of file L1GtfeExtWord.h.

Referenced by setBst(), and setGpsTime().

const int L1GtfeExtWord::BstFirstWord = 2
staticprivate

block description in the raw GT record

index of first word for BST blocks

Definition at line 152 of file L1GtfeExtWord.h.

Referenced by setBstWord64(), and unpack().

const int L1GtfeExtWord::BstMasterStatusFirstBlock = 17
staticprivate

Definition at line 166 of file L1GtfeExtWord.h.

Referenced by bstMasterStatus().

const int L1GtfeExtWord::BstMasterStatusLastBlock = 17
staticprivate

Definition at line 167 of file L1GtfeExtWord.h.

Referenced by bstMasterStatus().

const cms_uint64_t L1GtfeExtWord::BstSourceMask = 0xFFFF000000000000ULL
staticprivate

Definition at line 194 of file L1GtfeExtWord.h.

Referenced by setBstSource().

const int L1GtfeExtWord::BstSourceShift = 48
staticprivate

Definition at line 196 of file L1GtfeExtWord.h.

Referenced by setBstSource(), and setBstSourceWord64().

const int L1GtfeExtWord::GpsTimeFirstBlock = 0
staticprivate

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

Definition at line 163 of file L1GtfeExtWord.h.

Referenced by gpsTime(), and setGpsTime().

const int L1GtfeExtWord::GpsTimeLastBlock = 7
staticprivate

Definition at line 164 of file L1GtfeExtWord.h.

Referenced by gpsTime(), and setGpsTime().

const int L1GtfeExtWord::LhcFillNumberFirstBlock = 22
staticprivate

Definition at line 172 of file L1GtfeExtWord.h.

Referenced by lhcFillNumber().

const int L1GtfeExtWord::LhcFillNumberLastBlock = 25
staticprivate

Definition at line 173 of file L1GtfeExtWord.h.

Referenced by lhcFillNumber().

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

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

Definition at line 206 of file L1GtfeExtWord.h.

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

const int L1GtfeExtWord::ParticleTypeBeam1FirstBlock = 28
staticprivate

Definition at line 178 of file L1GtfeExtWord.h.

Referenced by particleTypeBeam1().

const int L1GtfeExtWord::ParticleTypeBeam1LastBlock = 28
staticprivate

Definition at line 179 of file L1GtfeExtWord.h.

Referenced by particleTypeBeam1().

const int L1GtfeExtWord::ParticleTypeBeam2FirstBlock = 29
staticprivate

Definition at line 181 of file L1GtfeExtWord.h.

Referenced by particleTypeBeam2().

const int L1GtfeExtWord::ParticleTypeBeam2LastBlock = 29
staticprivate

Definition at line 182 of file L1GtfeExtWord.h.

Referenced by particleTypeBeam2().

const int L1GtfeExtWord::TotalIntensityBeam1FirstBlock = 32
staticprivate

Definition at line 187 of file L1GtfeExtWord.h.

Referenced by totalIntensityBeam1().

const int L1GtfeExtWord::TotalIntensityBeam1LastBlock = 35
staticprivate

Definition at line 188 of file L1GtfeExtWord.h.

Referenced by totalIntensityBeam1().

const int L1GtfeExtWord::TotalIntensityBeam2FirstBlock = 36
staticprivate

Definition at line 190 of file L1GtfeExtWord.h.

Referenced by totalIntensityBeam2().

const int L1GtfeExtWord::TotalIntensityBeam2LastBlock = 39
staticprivate

Definition at line 191 of file L1GtfeExtWord.h.

Referenced by totalIntensityBeam2().

const int L1GtfeExtWord::TurnCountNumberFirstBlock = 18
staticprivate

Definition at line 169 of file L1GtfeExtWord.h.

Referenced by turnCountNumber().

const int L1GtfeExtWord::TurnCountNumberLastBlock = 21
staticprivate

Definition at line 170 of file L1GtfeExtWord.h.

Referenced by turnCountNumber().