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

$Date$ $Revision$

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

Implementation: <TODO: enter implementation details>

Author
: Vasile Mihai Ghete - HEPHY Vienna

$Date$ $Revision$

Definition at line 33 of file L1GtfeExtWord.h.

Constructor & Destructor Documentation

L1GtfeExtWord::L1GtfeExtWord ( )

constructors

Definition at line 37 of file L1GtfeExtWord.cc.

37  :
38  L1GtfeWord(), m_bstSource(0) {
39 
40  // empty
41 
42 }
L1GtfeWord()
constructors
Definition: L1GtfeWord.cc:31
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 45 of file L1GtfeExtWord.cc.

References m_bst.

45  :
46  L1GtfeWord(), m_bstSource(0) {
47 
48  m_bst.resize(bstSizeBytes);
49 
50 }
L1GtfeWord()
constructors
Definition: L1GtfeWord.cc:31
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 54 of file L1GtfeExtWord.cc.

59  :
60  L1GtfeWord(
61  boardIdValue, recordLength1Value, recordLengthValue, bxNrValue, setupVersionValue,
62  activeBoardsValue, altNrBxBoardValue, totalTriggerNrValue), m_bst(bstValue),
63  m_bstSource(bstSourceValue)
64 
65 {
66 
67  // empty
68 }
L1GtfeWord()
constructors
Definition: L1GtfeWord.cc:31
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 71 of file L1GtfeExtWord.cc.

71  {
72 
73  // empty now
74 
75 }

Member Function Documentation

const cms_uint16_t L1GtfeExtWord::beamMode ( ) const

Definition at line 254 of file L1GtfeExtWord.cc.

References BeamModeFirstBlock, BeamModeLastBlock, BstBitSize, and m_bst.

Referenced by SiStripMonitorDigi::analyze(), HcalDeadCellMonitor::analyze(), L1TGT::analyze(), L1TSync::analyze(), L1TSync_Offline::analyze(), L1TBPTX::analyze(), DQMProvInfo::makeGtInfo(), and ConditionDumperInEdm::produce().

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

References BeamMomentumFirstBlock, BeamMomentumLastBlock, BstBitSize, and m_bst.

Referenced by L1TGT::analyze(), DQMProvInfo::makeGtInfo(), and ConditionDumperInEdm::produce().

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

References m_bst.

71  {
72  return m_bst;
73  }
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 403 of file L1GtfeExtWord.cc.

References edm::hlt::Exception, and m_bst.

404 {
405 
406  int NumberBstBlocks = m_bst.size();
407 
408  if (iB < 0 || iB >= NumberBstBlocks) {
409  throw cms::Exception("BstIndexError")
410  << "\nError: index for BST array out of range. Allowed range: [0, "
411  << NumberBstBlocks << ") " << std::endl;
412 
413  } else {
414  return m_bst[iB];
415  }
416 
417 }
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 76 of file L1GtfeExtWord.h.

References m_bst.

Referenced by L1GTEvmDigiToRaw::produce().

76  {
77  return m_bst.size();
78  }
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 179 of file L1GtfeExtWord.cc.

References BstBitSize, BstMasterStatusFirstBlock, BstMasterStatusLastBlock, and m_bst.

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

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

References m_bstSource.

114  {
115  return m_bstSource;
116  }
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 492 of file L1GtfeExtWord.cc.

References L1GtfeWord::getSize(), and m_bst.

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

492  {
493 
494  L1GtfeWord gtfeWord;
495  unsigned int gtfeSize = gtfeWord.getSize();
496 
497  unsigned int gtfeExtSize;
498 
499  // 2 bytes to write if real BST message or simulated BST message
500  unsigned int bytesBstWriter = 2;
501 
502  // size of BST block, using rounded 64-bit words (8 bytes per 64-bit word)
503 
504  unsigned int bstSize = m_bst.size();
505 
506  if ( (bstSize +bytesBstWriter )%8 == 0) {
507  gtfeExtSize = gtfeSize + bstSize + bytesBstWriter;
508  }
509  else {
510  gtfeExtSize = gtfeSize + bstSize + bytesBstWriter + (8 - (bstSize + bytesBstWriter)%8 );
511  }
512 
513  return gtfeExtSize;
514 }
const unsigned int getSize() const
get the size of the GTFE block in GT DAQ record (in multiple of 8 bits)
Definition: L1GtfeWord.h:231
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 118 of file L1GtfeExtWord.cc.

References BstBitSize, GpsTimeFirstBlock, GpsTimeLastBlock, and m_bst.

Referenced by L1TGT::analyze().

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

References BstBitSize, LhcFillNumberFirstBlock, LhcFillNumberLastBlock, and m_bst.

Referenced by L1TGT::analyze(), L1TSync::analyze(), L1TSync_Offline::analyze(), L1TBPTX::analyze(), DQMProvInfo::makeGtInfo(), and ConditionDumperInEdm::produce().

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

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

equal operator

Definition at line 78 of file L1GtfeExtWord.cc.

References m_bst, m_bstSource, and query::result.

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

References BstBitSize, m_bst, ParticleTypeBeam1FirstBlock, and ParticleTypeBeam1LastBlock.

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

References BstBitSize, m_bst, ParticleTypeBeam2FirstBlock, and ParticleTypeBeam2LastBlock.

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

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

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

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

References m_bst, and L1GtfeWord::reset().

Referenced by BeautifulSoup.BeautifulStoneSoup::__init__(), and L1GlobalTriggerEvmRawToDigi::produce().

527 {
528 
530  m_bst.clear();
531 
532 }
virtual void reset()
reset the content of a L1GtfeWord
Definition: L1GtfeWord.cc:308
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 519 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().

519  {
520 
521  m_bst.resize(bstSizeBytes);
522 
523 }
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 436 of file L1GtfeExtWord.cc.

References BstBitSize, BstBlockMask, and m_bst.

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

References m_bstSource.

Referenced by L1GlobalTrigger::produce().

118  {
119  m_bstSource = bstSourceVal;
120  }
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 468 of file L1GtfeExtWord.cc.

References BstSourceMask, BstSourceShift, and m_bstSource.

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

References BstSourceShift, getSize(), and m_bstSource.

476  {
477 
478  // BST always in the last word of GTFE extended - size must be correct!
479  int gtfeSize = this->getSize();
480 
481  int BstSourceWord = gtfeSize/8 - 1; // counting starts at 0
482 
483  if (iWord == BstSourceWord) {
484  word64 = word64 | (static_cast<cms_uint64_t> (m_bstSource)
485  << BstSourceShift);
486  }
487 
488 }
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 450 of file L1GtfeExtWord.cc.

References BstBitSize, BstFirstWord, and m_bst.

Referenced by L1GTEvmDigiToRaw::packGTFE().

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

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

Referenced by L1GlobalTrigger::produce().

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

References BstBitSize, m_bst, TotalIntensityBeam1FirstBlock, and TotalIntensityBeam1LastBlock.

Referenced by HcalDeadCellMonitor::analyze(), L1TGT::analyze(), DQMProvInfo::makeGtInfo(), and ConditionDumperInEdm::produce().

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

References BstBitSize, m_bst, TotalIntensityBeam2FirstBlock, and TotalIntensityBeam2LastBlock.

Referenced by HcalDeadCellMonitor::analyze(), L1TGT::analyze(), DQMProvInfo::makeGtInfo(), and ConditionDumperInEdm::produce().

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

References BstBitSize, m_bst, TurnCountNumberFirstBlock, and TurnCountNumberLastBlock.

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

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

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

Referenced by L1GlobalTriggerEvmRawToDigi::produce().

594 {
595  LogDebug("L1GtfeExtWord")
596  << "\nUnpacking GTFE block.\n"
597  << std::endl;
598 
599  L1GtfeWord::unpack(gtfePtr);
600 
601  // TODO make BlockSize protected & use friends instead of creating L1GtfeWord?
602  L1GtfeWord gtfeWord;
603  const unsigned char* gtfeExtPtr = gtfePtr + gtfeWord.getSize();
604 
605  const cms_uint64_t* payload =
606  reinterpret_cast<cms_uint64_t*>(const_cast<unsigned char*>(gtfeExtPtr));
607 
608  int BlockSizeExt = this->getSize()/8;
609  int NumberBstBlocks = m_bst.size();
610 
611  if (edm::isDebugEnabled() ) {
612 
613  for (int iWord = BstFirstWord; iWord < BlockSizeExt; ++iWord) {
614 
615  int jWord = iWord - BstFirstWord;
616  LogTrace("L1GtfeExtWord")
617  << std::setw(4) << iWord << " "
618  << std::hex << std::setfill('0')
619  << std::setw(16) << payload[jWord]
620  << std::dec << std::setfill(' ')
621  << std::endl;
622 
623  }
624  }
625 
626  int blocksPerWord = sizeof(cms_uint64_t)*8/BstBitSize;
627 
628  for (int iB = 0; iB < NumberBstBlocks; ++iB) {
629 
630  // keep capitalization for similarity with other functions
631  int BstWord = iB/blocksPerWord;
632 
633  setBst(payload[BstWord], iB);
634 
635  }
636 
637 }
#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:231
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.
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:382

Member Data Documentation

const int L1GtfeExtWord::BeamModeFirstBlock = 26
staticprivate

Definition at line 177 of file L1GtfeExtWord.h.

Referenced by beamMode().

const int L1GtfeExtWord::BeamModeLastBlock = 27
staticprivate

Definition at line 178 of file L1GtfeExtWord.h.

Referenced by beamMode().

const int L1GtfeExtWord::BeamMomentumFirstBlock = 30
staticprivate

Definition at line 186 of file L1GtfeExtWord.h.

Referenced by beamMomentum().

const int L1GtfeExtWord::BeamMomentumLastBlock = 31
staticprivate

Definition at line 187 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 161 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 154 of file L1GtfeExtWord.h.

Referenced by setBstWord64(), and unpack().

const int L1GtfeExtWord::BstMasterStatusFirstBlock = 17
staticprivate

Definition at line 168 of file L1GtfeExtWord.h.

Referenced by bstMasterStatus().

const int L1GtfeExtWord::BstMasterStatusLastBlock = 17
staticprivate

Definition at line 169 of file L1GtfeExtWord.h.

Referenced by bstMasterStatus().

const cms_uint64_t L1GtfeExtWord::BstSourceMask = 0xFFFF000000000000ULL
staticprivate

Definition at line 196 of file L1GtfeExtWord.h.

Referenced by setBstSource().

const int L1GtfeExtWord::BstSourceShift = 48
staticprivate

Definition at line 198 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 165 of file L1GtfeExtWord.h.

Referenced by gpsTime(), and setGpsTime().

const int L1GtfeExtWord::GpsTimeLastBlock = 7
staticprivate

Definition at line 166 of file L1GtfeExtWord.h.

Referenced by gpsTime(), and setGpsTime().

const int L1GtfeExtWord::LhcFillNumberFirstBlock = 22
staticprivate

Definition at line 174 of file L1GtfeExtWord.h.

Referenced by lhcFillNumber().

const int L1GtfeExtWord::LhcFillNumberLastBlock = 25
staticprivate

Definition at line 175 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 208 of file L1GtfeExtWord.h.

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

const int L1GtfeExtWord::ParticleTypeBeam1FirstBlock = 28
staticprivate

Definition at line 180 of file L1GtfeExtWord.h.

Referenced by particleTypeBeam1().

const int L1GtfeExtWord::ParticleTypeBeam1LastBlock = 28
staticprivate

Definition at line 181 of file L1GtfeExtWord.h.

Referenced by particleTypeBeam1().

const int L1GtfeExtWord::ParticleTypeBeam2FirstBlock = 29
staticprivate

Definition at line 183 of file L1GtfeExtWord.h.

Referenced by particleTypeBeam2().

const int L1GtfeExtWord::ParticleTypeBeam2LastBlock = 29
staticprivate

Definition at line 184 of file L1GtfeExtWord.h.

Referenced by particleTypeBeam2().

const int L1GtfeExtWord::TotalIntensityBeam1FirstBlock = 32
staticprivate

Definition at line 189 of file L1GtfeExtWord.h.

Referenced by totalIntensityBeam1().

const int L1GtfeExtWord::TotalIntensityBeam1LastBlock = 35
staticprivate

Definition at line 190 of file L1GtfeExtWord.h.

Referenced by totalIntensityBeam1().

const int L1GtfeExtWord::TotalIntensityBeam2FirstBlock = 36
staticprivate

Definition at line 192 of file L1GtfeExtWord.h.

Referenced by totalIntensityBeam2().

const int L1GtfeExtWord::TotalIntensityBeam2LastBlock = 39
staticprivate

Definition at line 193 of file L1GtfeExtWord.h.

Referenced by totalIntensityBeam2().

const int L1GtfeExtWord::TurnCountNumberFirstBlock = 18
staticprivate

Definition at line 171 of file L1GtfeExtWord.h.

Referenced by turnCountNumber().

const int L1GtfeExtWord::TurnCountNumberLastBlock = 21
staticprivate

Definition at line 172 of file L1GtfeExtWord.h.

Referenced by turnCountNumber().