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 boost::uint16_t beamMode () const
 
const boost::uint16_t beamMomentum () const
 
const std::vector
< boost::uint16_t > & 
bst () const
 get the full BST block More...
 
const boost::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 boost::uint16_t bstMasterStatus () const
 
const boost::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 boost::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 (boost::uint16_t boardIdValue, boost::uint16_t recordLengthValue, boost::uint16_t recordLength1Value, boost::uint16_t bxNrValue, boost::uint32_t setupVersionValue, boost::uint16_t activeBoardsValue, boost::uint16_t altNrBxBoardValue, boost::uint32_t totalTriggerNrValue, std::vector< boost::uint16_t > bstValue, boost::uint16_t bstSourceValue)
 constructor from unpacked values, m_bst size taken from bstValue More...
 
const boost::uint32_t lhcFillNumber () const
 
bool operator!= (const L1GtfeExtWord &) const
 unequal operator More...
 
bool operator== (const L1GtfeExtWord &) const
 equal operator More...
 
const boost::uint16_t particleTypeBeam1 () const
 
const boost::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 boost::uint16_t bstVal, const int iB)
 
void setBst (const boost::uint64_t &word64, const int iB)
 set the BST block for index iB from a 64-bits word More...
 
void setBstSource (const boost::uint16_t bstSourceVal)
 
void setBstSource (const boost::uint64_t &word64)
 set the hex message indicating the source of BST message from a 64-bits word More...
 
void setBstSourceWord64 (boost::uint64_t &word64, const int iWord)
 
void setBstWord64 (boost::uint64_t &word64, int iB, const int iWord)
 
void setGpsTime (const boost::uint64_t)
 
const boost::uint32_t totalIntensityBeam1 () const
 
const boost::uint32_t totalIntensityBeam2 () const
 
const boost::uint32_t turnCountNumber () const
 
virtual void unpack (const unsigned char *gtfePtr)
 
virtual ~L1GtfeExtWord ()
 destructor More...
 
- Public Member Functions inherited from L1GtfeWord
const boost::uint16_t activeBoards () const
 get/set boards contributing to EVM respectively DAQ record More...
 
const boost::uint16_t altNrBxBoard () const
 get/set alternative for number of BX per board More...
 
const boost::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 boost::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 (boost::uint16_t boardIdValue, boost::uint16_t recordLength1Value, boost::uint16_t recordLengthValue, boost::uint16_t bxNrValue, boost::uint32_t setupVersionValue, boost::uint16_t activeBoardsValue, boost::uint16_t altNrBxBoardValue, boost::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 boost::uint16_t recordLength () const
 get/set record length for alternative 0 More...
 
const boost::uint16_t recordLength1 () const
 get/set record length for alternative 1 More...
 
void setActiveBoards (boost::uint16_t activeBoardsValue)
 
void setActiveBoards (const boost::uint64_t &word64)
 
void setActiveBoardsWord64 (boost::uint64_t &word64, int iWord)
 
void setActiveBoardsWord64 (boost::uint64_t &word64, int iWord, boost::int16_t activeBoardsValue)
 
void setAltNrBxBoard (boost::uint16_t altNrBxBoardValue)
 
void setAltNrBxBoard (const boost::uint64_t &word64)
 
void setAltNrBxBoardWord64 (boost::uint64_t &word64, int iWord)
 
void setAltNrBxBoardWord64 (boost::uint64_t &word64, int iWord, boost::int16_t altNrBxBoardValue)
 
void setBoardId (boost::uint16_t boardIdValue)
 set BoardId from a BoardId value More...
 
void setBoardId (const boost::uint64_t &word64)
 set the BoardId value from a 64-bits word More...
 
void setBoardIdWord64 (boost::uint64_t &word64, int iWord)
 
void setBstFlag (const int)
 
void setBxNr (boost::uint16_t bxNrValue)
 
void setBxNr (const boost::uint64_t &word64)
 
void setBxNrWord64 (boost::uint64_t &word64, int iWord)
 
void setRecordLength (boost::uint16_t recordLengthValue)
 
void setRecordLength (const boost::uint64_t &word64)
 
void setRecordLength1 (boost::uint16_t recordLengthValue)
 
void setRecordLength1 (const boost::uint64_t &word64)
 
void setRecordLength1Word64 (boost::uint64_t &word64, int iWord)
 
void setRecordLengthWord64 (boost::uint64_t &word64, int iWord)
 
void setSetupVersion (boost::uint32_t setupVersionValue)
 
void setSetupVersion (const boost::uint64_t &word64)
 
void setSetupVersionWord64 (boost::uint64_t &word64, int iWord)
 
void setTotalTriggerNr (boost::uint32_t totalTriggerNrValue)
 
void setTotalTriggerNr (const boost::uint64_t &word64)
 
void setTotalTriggerNrWord64 (boost::uint64_t &word64, int iWord)
 
const boost::uint32_t setupVersion () const
 get/set setup version More...
 
const boost::uint32_t totalTriggerNr () const
 get/set total number of L1A sent since start of run More...
 
virtual ~L1GtfeWord ()
 destructor More...
 

Private Attributes

std::vector< boost::uint16_t > m_bst
 BST message - each byte is an vector element. More...
 
boost::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 boost::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 boost::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 36 of file L1GtfeExtWord.cc.

36  :
37  L1GtfeWord() {
38 
39  // empty
40 
41 }
L1GtfeWord()
constructors
Definition: L1GtfeWord.cc:31
L1GtfeExtWord::L1GtfeExtWord ( int  bstSizeBytes)

all members set to zero, m_bst has bstSizeBytes zero elements

Definition at line 44 of file L1GtfeExtWord.cc.

References m_bst.

44  :
45  L1GtfeWord() {
46 
47  m_bst.resize(bstSizeBytes);
48 
49 }
std::vector< boost::uint16_t > m_bst
BST message - each byte is an vector element.
L1GtfeWord()
constructors
Definition: L1GtfeWord.cc:31
L1GtfeExtWord::L1GtfeExtWord ( boost::uint16_t  boardIdValue,
boost::uint16_t  recordLengthValue,
boost::uint16_t  recordLength1Value,
boost::uint16_t  bxNrValue,
boost::uint32_t  setupVersionValue,
boost::uint16_t  activeBoardsValue,
boost::uint16_t  altNrBxBoardValue,
boost::uint32_t  totalTriggerNrValue,
std::vector< boost::uint16_t >  bstValue,
boost::uint16_t  bstSourceValue 
)

constructor from unpacked values, m_bst size taken from bstValue

Definition at line 53 of file L1GtfeExtWord.cc.

58  :
59  L1GtfeWord(
60  boardIdValue, recordLength1Value, recordLengthValue, bxNrValue, setupVersionValue,
61  activeBoardsValue, altNrBxBoardValue, totalTriggerNrValue), m_bst(bstValue),
62  m_bstSource(bstSourceValue)
63 
64 {
65 
66  // empty
67 }
std::vector< boost::uint16_t > m_bst
BST message - each byte is an vector element.
L1GtfeWord()
constructors
Definition: L1GtfeWord.cc:31
boost::uint16_t m_bstSource
hex message indicating the source of BST message (beam or simulated)
L1GtfeExtWord::~L1GtfeExtWord ( )
virtual

destructor

Definition at line 70 of file L1GtfeExtWord.cc.

70  {
71 
72  // empty now
73 
74 }

Member Function Documentation

const boost::uint16_t L1GtfeExtWord::beamMode ( ) const

Definition at line 253 of file L1GtfeExtWord.cc.

References BeamModeFirstBlock, BeamModeLastBlock, BstBitSize, and m_bst.

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

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

Definition at line 326 of file L1GtfeExtWord.cc.

References BeamMomentumFirstBlock, BeamMomentumLastBlock, BstBitSize, and m_bst.

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

327 {
328 
329  boost::uint16_t bm = 0;
330 
331  // return 0 if BST message too small
332  int bstSize = m_bst.size();
333  if (BeamMomentumLastBlock >= bstSize) {
334  return bm;
335  }
336 
337  for (int iB = BeamMomentumFirstBlock; iB <= BeamMomentumLastBlock; ++iB) {
338 
339  // keep capitalization for similarity with other functions
340  const int scaledIB = iB - BeamMomentumFirstBlock;
341  const int BstShift = BstBitSize*scaledIB;
342 
343  bm = bm | ( m_bst[iB] << BstShift );
344 
345  }
346 
347  return bm;
348 }
std::vector< boost::uint16_t > m_bst
BST message - each byte is an vector element.
static const int BeamMomentumFirstBlock
static const int BstBitSize
size in bits for a BST block
static const int BeamMomentumLastBlock
const std::vector<boost::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< boost::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 402 of file L1GtfeExtWord.cc.

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

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

Definition at line 178 of file L1GtfeExtWord.cc.

References BstBitSize, BstMasterStatusFirstBlock, BstMasterStatusLastBlock, and m_bst.

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

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

References L1GtfeWord::getSize(), and m_bst.

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

491  {
492 
493  L1GtfeWord gtfeWord;
494  unsigned int gtfeSize = gtfeWord.getSize();
495 
496  unsigned int gtfeExtSize;
497 
498  // 2 bytes to write if real BST message or simulated BST message
499  unsigned int bytesBstWriter = 2;
500 
501  // size of BST block, using rounded 64-bit words (8 bytes per 64-bit word)
502 
503  unsigned int bstSize = m_bst.size();
504 
505  if ( (bstSize +bytesBstWriter )%8 == 0) {
506  gtfeExtSize = gtfeSize + bstSize + bytesBstWriter;
507  }
508  else {
509  gtfeExtSize = gtfeSize + bstSize + bytesBstWriter + (8 - (bstSize + bytesBstWriter)%8 );
510  }
511 
512  return gtfeExtSize;
513 }
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< boost::uint16_t > m_bst
BST message - each byte is an vector element.
const boost::uint64_t L1GtfeExtWord::gpsTime ( ) const

LHC-BOB-ES-0001 (EDMS 638899)

Definition at line 117 of file L1GtfeExtWord.cc.

References BstBitSize, GpsTimeFirstBlock, GpsTimeLastBlock, and m_bst.

Referenced by L1TGT::analyze().

118 {
119 
120  boost::uint64_t gpst = 0ULL;
121 
122  // return 0 if BST message too small
123  int bstSize = m_bst.size();
124  if (GpsTimeLastBlock >= bstSize) {
125  return gpst;
126  }
127 
128  for (int iB = GpsTimeFirstBlock; iB <= GpsTimeLastBlock; ++iB) {
129 
130  // keep capitalization for similarity with other functions
131  const int scaledIB = iB - GpsTimeFirstBlock;
132  const int BstShift = BstBitSize*scaledIB;
133 
134  gpst = gpst |
135  ( (static_cast<boost::uint64_t> (m_bst[iB])) << BstShift );
136 
137  }
138 
139  return gpst;
140 }
std::vector< boost::uint16_t > m_bst
BST message - each byte is an vector element.
static const int GpsTimeLastBlock
static const int GpsTimeFirstBlock
BST blocks: conversion to defined quantities (LHC-BOB-ES-0001)
unsigned long long uint64_t
Definition: Time.h:15
static const int BstBitSize
size in bits for a BST block
const boost::uint32_t L1GtfeExtWord::lhcFillNumber ( ) const

Definition at line 228 of file L1GtfeExtWord.cc.

References BstBitSize, LhcFillNumberFirstBlock, LhcFillNumberLastBlock, and m_bst.

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

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

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

equal operator

Definition at line 77 of file L1GtfeExtWord.cc.

References m_bst, m_bstSource, and query::result.

78 {
79 
80  // base class
81 
82  const L1GtfeWord gtfeResult = result;
83  const L1GtfeWord gtfeThis = *this;
84 
85  if (gtfeThis != gtfeResult) {
86  return false;
87  }
88 
89 
90  //
91 
92  for (unsigned int iB = 0; iB < m_bst.size(); ++iB) {
93  if(m_bst[iB] != result.m_bst[iB]) {
94  return false;
95  }
96  }
97 
98  if ( m_bstSource != result.m_bstSource) {
99  return false;
100  }
101 
102  // all members identical
103  return true;
104 
105 }
std::vector< boost::uint16_t > m_bst
BST message - each byte is an vector element.
tuple result
Definition: query.py:137
boost::uint16_t m_bstSource
hex message indicating the source of BST message (beam or simulated)
const boost::uint16_t L1GtfeExtWord::particleTypeBeam1 ( ) const

Definition at line 277 of file L1GtfeExtWord.cc.

References BstBitSize, m_bst, ParticleTypeBeam1FirstBlock, and ParticleTypeBeam1LastBlock.

278 {
279 
280  boost::uint16_t ptb = 0;
281 
282  // return 0 if BST message too small
283  int bstSize = m_bst.size();
284  if (ParticleTypeBeam1LastBlock >= bstSize) {
285  return ptb;
286  }
287 
288  for (int iB = ParticleTypeBeam1FirstBlock; iB <= ParticleTypeBeam1LastBlock; ++iB) {
289 
290  // keep capitalization for similarity with other functions
291  const int scaledIB = iB - ParticleTypeBeam1FirstBlock;
292  const int BstShift = BstBitSize*scaledIB;
293 
294  ptb = ptb | ( m_bst[iB] << BstShift );
295 
296  }
297 
298  return ptb;
299 }
std::vector< boost::uint16_t > m_bst
BST message - each byte is an vector element.
static const int ParticleTypeBeam1FirstBlock
static const int ParticleTypeBeam1LastBlock
static const int BstBitSize
size in bits for a BST block
const boost::uint16_t L1GtfeExtWord::particleTypeBeam2 ( ) const

Definition at line 301 of file L1GtfeExtWord.cc.

References BstBitSize, m_bst, ParticleTypeBeam2FirstBlock, and ParticleTypeBeam2LastBlock.

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

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

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

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

References m_bst, and L1GtfeWord::reset().

Referenced by L1GlobalTriggerEvmRawToDigi::produce().

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

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

Definition at line 518 of file L1GtfeExtWord.cc.

References m_bst.

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

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

Referenced by unpack().

void L1GtfeExtWord::setBst ( const boost::uint64_t &  word64,
const int  iB 
)

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

Definition at line 435 of file L1GtfeExtWord.cc.

References BstBitSize, BstBlockMask, and m_bst.

436 {
437 
438  // keep capitalization for similarity with other functions //FIXME check it again
439  const int scaledIB = iB%(sizeof(word64)*8/BstBitSize);
440  const int BstShift = BstBitSize*scaledIB;
441  const boost::uint64_t BstMask = 0x0000000000000000ULL | (BstBlockMask << BstShift);
442 
443  m_bst[iB] = static_cast<boost::uint16_t> ((word64 & BstMask) >> BstShift);
444 
445 }
std::vector< boost::uint16_t > m_bst
BST message - each byte is an vector element.
unsigned long long uint64_t
Definition: Time.h:15
static const int BstBitSize
size in bits for a BST block
static const boost::uint64_t BstBlockMask
void L1GtfeExtWord::setBstSource ( const boost::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  }
boost::uint16_t m_bstSource
hex message indicating the source of BST message (beam or simulated)
void L1GtfeExtWord::setBstSource ( const boost::uint64_t &  word64)

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

Definition at line 467 of file L1GtfeExtWord.cc.

References BstSourceMask, BstSourceShift, and m_bstSource.

467  {
468 
469  m_bstSource = (word64 & BstSourceMask) >> BstSourceShift;
470 
471 }
static const boost::uint64_t BstSourceMask
boost::uint16_t m_bstSource
hex message indicating the source of BST message (beam or simulated)
static const int BstSourceShift
void L1GtfeExtWord::setBstSourceWord64 ( boost::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 475 of file L1GtfeExtWord.cc.

References BstSourceShift, getSize(), and m_bstSource.

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

References BstBitSize, BstFirstWord, and m_bst.

Referenced by L1GTEvmDigiToRaw::packGTFE().

450 {
451 
452  // keep capitalization for similarity with other functions
453  const int scaledIB = iB%(sizeof(word64)*8/BstBitSize);
454  const int BstShift = BstBitSize*scaledIB;
455  const int BstWord = iB/(sizeof(word64)*8/BstBitSize) + BstFirstWord;
456 
457  if (iWord == BstWord) {
458  word64 = word64 |
459  (static_cast<boost::uint64_t> (m_bst[iB]) << BstShift);
460  }
461 
462 
463 }
std::vector< boost::uint16_t > m_bst
BST message - each byte is an vector element.
static const int BstFirstWord
block description in the raw GT record
unsigned long long uint64_t
Definition: Time.h:15
static const int BstBitSize
size in bits for a BST block
void L1GtfeExtWord::setGpsTime ( const boost::uint64_t  gpsTimeValue)

Definition at line 142 of file L1GtfeExtWord.cc.

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

Referenced by L1GlobalTrigger::produce().

142  {
143 
144  // return if BST message too small
145  int bstSize = m_bst.size();
146  if (GpsTimeLastBlock >= bstSize) {
147 
148  edm::LogError("L1GtfeExtWord") << "Error: BST message length "
149  << bstSize << " smaller than the required GpsTimeLastBlock "
150  << GpsTimeLastBlock << "\n Cannot set GpsTime" << std::endl;
151 
152  return;
153  }
154 
155  for (int iB = GpsTimeFirstBlock; iB <= GpsTimeLastBlock; ++iB) {
156 
157  // keep capitalization for similarity with other functions
158  const int scaledIB = iB - GpsTimeFirstBlock;
159  const int BstShift = BstBitSize*scaledIB;
160  const boost::uint64_t BstMask = 0x0000000000000000ULL | (BstBlockMask << BstShift);
161 
162  m_bst[iB] = static_cast<boost::uint16_t> ((gpsTimeValue & BstMask) >> BstShift);
163 
164  //LogTrace("L1GtfeExtWord")
165  //<< "BstShift: value [dec] = " << BstShift << "\n"
166  //<< "BstBlockMask: value [hex] = " << std::hex << BstBlockMask << "\n"
167  //<< "BstMask: value [hex] = "<< BstMask << std::dec
168  //<< std::endl;
169 
170  //LogTrace("L1GtfeExtWord")
171  //<< "BST block " << iB << ": value [hex] = " << std::hex << m_bst[iB] << std::dec
172  //<< std::endl;
173 
174  }
175 
176 }
std::vector< boost::uint16_t > m_bst
BST message - each byte is an vector element.
static const int GpsTimeLastBlock
static const int GpsTimeFirstBlock
BST blocks: conversion to defined quantities (LHC-BOB-ES-0001)
unsigned long long uint64_t
Definition: Time.h:15
static const int BstBitSize
size in bits for a BST block
static const boost::uint64_t BstBlockMask
const boost::uint32_t L1GtfeExtWord::totalIntensityBeam1 ( ) const

Definition at line 350 of file L1GtfeExtWord.cc.

References BstBitSize, m_bst, TotalIntensityBeam1FirstBlock, and TotalIntensityBeam1LastBlock.

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

351 {
352 
353  boost::uint32_t tib = 0;
354 
355  // return 0 if BST message too small
356  int bstSize = m_bst.size();
357  if (TotalIntensityBeam1LastBlock >= bstSize) {
358  return tib;
359  }
360 
361  for (int iB = TotalIntensityBeam1FirstBlock; iB <= TotalIntensityBeam1LastBlock; ++iB) {
362 
363  // keep capitalization for similarity with other functions
364  const int scaledIB = iB - TotalIntensityBeam1FirstBlock;
365  const int BstShift = BstBitSize*scaledIB;
366 
367  tib = tib |
368  ( (static_cast<boost::uint32_t> (m_bst[iB])) << BstShift );
369 
370  }
371 
372  return tib;
373 }
std::vector< boost::uint16_t > m_bst
BST message - each byte is an vector element.
static const int TotalIntensityBeam1FirstBlock
static const int TotalIntensityBeam1LastBlock
static const int BstBitSize
size in bits for a BST block
const boost::uint32_t L1GtfeExtWord::totalIntensityBeam2 ( ) const

Definition at line 375 of file L1GtfeExtWord.cc.

References BstBitSize, m_bst, TotalIntensityBeam2FirstBlock, and TotalIntensityBeam2LastBlock.

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

376 {
377 
378  boost::uint32_t tib = 0;
379 
380  // return 0 if BST message too small
381  int bstSize = m_bst.size();
382  if (TotalIntensityBeam2LastBlock >= bstSize) {
383  return tib;
384  }
385 
386  for (int iB = TotalIntensityBeam2FirstBlock; iB <= TotalIntensityBeam2LastBlock; ++iB) {
387 
388  // keep capitalization for similarity with other functions
389  const int scaledIB = iB - TotalIntensityBeam2FirstBlock;
390  const int BstShift = BstBitSize*scaledIB;
391 
392  tib = tib |
393  ( (static_cast<boost::uint32_t> (m_bst[iB])) << BstShift );
394 
395  }
396 
397  return tib;
398 }
std::vector< boost::uint16_t > m_bst
BST message - each byte is an vector element.
static const int TotalIntensityBeam2LastBlock
static const int TotalIntensityBeam2FirstBlock
static const int BstBitSize
size in bits for a BST block
const boost::uint32_t L1GtfeExtWord::turnCountNumber ( ) const

Definition at line 203 of file L1GtfeExtWord.cc.

References BstBitSize, m_bst, TurnCountNumberFirstBlock, and TurnCountNumberLastBlock.

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

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

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

Referenced by L1GlobalTriggerEvmRawToDigi::produce().

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