CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Attributes | Private Attributes | Static Private Attributes
L1GtPsbWord Class Reference

#include <L1GtPsbWord.h>

Public Member Functions

const cms_uint16_t aData (int iA) const
 get/set A_DATA_CH_IA More...
 
const cms_uint16_t bData (int iB) const
 get/set B_DATA_CH_IB More...
 
const cms_uint16_t boardId () const
 get/set board ID More...
 
const int bxInEvent () const
 get/set bunch cross in the GT event record More...
 
const cms_uint16_t bxNr () const
 get/set bunch cross number of the actual bx More...
 
const cms_uint32_t eventNr () const
 get/set event number since last L1 reset generated in PSB More...
 
const unsigned int getSize () const
 get the size of the PSB block in GT DAQ record (in multiple of 8 bits) More...
 
 L1GtPsbWord ()
 constructors More...
 
 L1GtPsbWord (cms_uint16_t boardIdValue, int bxInEventValue, cms_uint16_t bxNrValue, cms_uint32_t eventNrValue, cms_uint16_t aDataValue[NumberAData], cms_uint16_t bDataValue[NumberBData], cms_uint16_t localBxNrValue)
 constructor from unpacked values; More...
 
const cms_uint16_t localBxNr () const
 get/set local bunch cross number of the actual bx More...
 
bool operator!= (const L1GtPsbWord &) const
 unequal operator More...
 
bool operator== (const L1GtPsbWord &) const
 equal operator More...
 
void print (std::ostream &myCout) const
 pretty print More...
 
void reset ()
 reset the content of a L1GtPsbWord More...
 
void setAData (cms_uint16_t aDataVal, int iA)
 
void setAData (const cms_uint64_t &word64, int iWord)
 
void setADataWord64 (cms_uint64_t &word64, int iWord)
 
void setBData (cms_uint16_t bDataVal, int iB)
 
void setBData (const cms_uint64_t &word64, int iWord)
 
void setBDataWord64 (cms_uint64_t &word64, int iWord)
 
void setBoardId (cms_uint16_t boardIdValue)
 
void setBoardId (const cms_uint64_t &word64, int iWord)
 
void setBoardIdWord64 (cms_uint64_t &word64, int iWord)
 
void setBxInEvent (int bxInEventValue)
 
void setBxInEvent (const cms_uint64_t &word64, int iWord)
 
void setBxInEventWord64 (cms_uint64_t &word64, int iWord)
 
void setBxNr (cms_uint16_t bxNrValue)
 
void setBxNr (const cms_uint64_t &word64, int iWord)
 
void setBxNrWord64 (cms_uint64_t &word64, int iWord)
 
void setEventNr (cms_uint32_t eventNrValue)
 
void setEventNr (const cms_uint64_t &word64, int iWord)
 
void setEventNrWord64 (cms_uint64_t &word64, int iWord)
 
void setLocalBxNr (cms_uint16_t localBxNrValue)
 
void setLocalBxNr (const cms_uint64_t &word64, int iWord)
 
void setLocalBxNrWord64 (cms_uint64_t &word64, int iWord)
 
virtual ~L1GtPsbWord ()
 destructor More...
 

Static Public Attributes

static const int NumberAData = 8
 
static const int NumberBData = 8
 

Private Attributes

cms_uint16_t m_aData [NumberAData]
 
cms_uint16_t m_bData [NumberBData]
 
cms_uint16_t m_boardId
 
int m_bxInEvent
 
cms_uint16_t m_bxNr
 
cms_uint32_t m_eventNr
 
cms_uint16_t m_localBxNr
 

Static Private Attributes

static const int ADataCH0Word = 1
 
static const int ADataCH4Word = 2
 
static const int BDataCH0Word = 3
 
static const int BDataCH4Word = 4
 
static const int BlockSize = 6
 
static const cms_uint64_t BoardIdMask = 0xFFFF000000000000ULL
 
static const int BoardIdShift = 48
 
static const int BoardIdWord = 0
 
static const cms_uint64_t BxInEventMask = 0x0000F00000000000ULL
 
static const int BxInEventShift = 44
 
static const int BxInEventWord = 0
 
static const cms_uint64_t BxNrMask = 0x00000FFF00000000ULL
 
static const int BxNrShift = 32
 
static const int BxNrWord = 0
 
static const cms_uint64_t DataCHMask = 0x000000000000FFFFULL
 
static const int DataCHSize = 16
 
static const cms_uint64_t EventNrMask = 0x0000000000FFFFFFULL
 
static const int EventNrShift = 0
 
static const int EventNrWord = 0
 
static const cms_uint64_t LocalBxNrMask = 0x0000000000000FFFULL
 
static const int LocalBxNrShift = 0
 
static const int LocalBxNrWord = 5
 

Detailed Description

Description: PSB block in the L1 GT readout record.

Implementation: <TODO: enter implementation details>

Author
: Vasile Mihai Ghete - HEPHY Vienna

Definition at line 29 of file L1GtPsbWord.h.

Constructor & Destructor Documentation

L1GtPsbWord::L1GtPsbWord ( )

constructors

Definition at line 27 of file L1GtPsbWord.cc.

References m_aData, m_bData, m_boardId, m_bxInEvent, m_bxNr, m_eventNr, m_localBxNr, NumberAData, and NumberBData.

27  {
28  m_boardId = 0;
29  m_bxInEvent = 0;
30  m_bxNr = 0;
31  m_eventNr = 0;
32 
33  for (int iA = 0; iA < NumberAData; ++iA) {
34  m_aData[iA] = 0;
35  }
36 
37  for (int iB = 0; iB < NumberBData; ++iB) {
38  m_bData[iB] = 0;
39  }
40 
41  m_localBxNr = 0;
42 }
cms_uint16_t m_localBxNr
Definition: L1GtPsbWord.h:223
cms_uint16_t m_bData[NumberBData]
Definition: L1GtPsbWord.h:221
cms_uint32_t m_eventNr
Definition: L1GtPsbWord.h:217
cms_uint16_t m_bxNr
Definition: L1GtPsbWord.h:216
static const int NumberBData
Definition: L1GtPsbWord.h:32
static const int NumberAData
Definition: L1GtPsbWord.h:31
cms_uint16_t m_boardId
Definition: L1GtPsbWord.h:210
cms_uint16_t m_aData[NumberAData]
Definition: L1GtPsbWord.h:219
L1GtPsbWord::L1GtPsbWord ( cms_uint16_t  boardIdValue,
int  bxInEventValue,
cms_uint16_t  bxNrValue,
cms_uint32_t  eventNrValue,
cms_uint16_t  aDataValue[NumberAData],
cms_uint16_t  bDataValue[NumberBData],
cms_uint16_t  localBxNrValue 
)

constructor from unpacked values;

Definition at line 45 of file L1GtPsbWord.cc.

References m_aData, m_bData, m_boardId, m_bxInEvent, m_bxNr, m_eventNr, m_localBxNr, NumberAData, and NumberBData.

51  {
52  m_boardId = boardIdValue;
53  m_bxInEvent = bxInEventValue;
54  m_bxNr = bxNrValue;
55  m_eventNr = eventNrValue;
56 
57  for (int iA = 0; iA < NumberAData; ++iA) {
58  m_aData[iA] = aDataValue[iA];
59  }
60 
61  for (int iB = 0; iB < NumberBData; ++iB) {
62  m_bData[iB] = bDataValue[iB];
63  }
64 
65  m_localBxNr = localBxNrValue;
66 }
cms_uint16_t m_localBxNr
Definition: L1GtPsbWord.h:223
cms_uint16_t m_bData[NumberBData]
Definition: L1GtPsbWord.h:221
cms_uint32_t m_eventNr
Definition: L1GtPsbWord.h:217
cms_uint16_t m_bxNr
Definition: L1GtPsbWord.h:216
static const int NumberBData
Definition: L1GtPsbWord.h:32
static const int NumberAData
Definition: L1GtPsbWord.h:31
cms_uint16_t m_boardId
Definition: L1GtPsbWord.h:210
cms_uint16_t m_aData[NumberAData]
Definition: L1GtPsbWord.h:219
L1GtPsbWord::~L1GtPsbWord ( )
virtual

destructor

Definition at line 69 of file L1GtPsbWord.cc.

69  {
70  // empty now
71 }

Member Function Documentation

const cms_uint16_t L1GtPsbWord::aData ( int  iA) const

get/set A_DATA_CH_IA

Definition at line 181 of file L1GtPsbWord.cc.

References Exception, m_aData, and NumberAData.

Referenced by ecaldqm::ClusterTask::beginEvent(), L1GtDataEmulAnalyzer::comparePSB(), L1GtHwValidation::comparePSB(), EcalCosmicsHists::determineTriggers(), EcalExclusiveTrigFilter::filter(), and L1Analysis::L1AnalysisGT::Set().

181  {
182  if (iA < 0 || iA > NumberAData) {
183  throw cms::Exception("aDataIndexError")
184  << "\nError: index for A_DATA array out of range. Allowed range: [0, " << NumberAData << ") " << std::endl;
185 
186  } else {
187  return m_aData[iA];
188  }
189 }
static const int NumberAData
Definition: L1GtPsbWord.h:31
cms_uint16_t m_aData[NumberAData]
Definition: L1GtPsbWord.h:219
const cms_uint16_t L1GtPsbWord::bData ( int  iB) const

get/set B_DATA_CH_IB

Definition at line 253 of file L1GtPsbWord.cc.

References Exception, m_bData, and NumberBData.

Referenced by ecaldqm::ClusterTask::beginEvent(), L1GtDataEmulAnalyzer::comparePSB(), L1GtHwValidation::comparePSB(), EcalCosmicsHists::determineTriggers(), EcalExclusiveTrigFilter::filter(), and L1Analysis::L1AnalysisGT::Set().

253  {
254  if (iB < 0 || iB > NumberBData) {
255  throw cms::Exception("bDataIndexError")
256  << "\nError: index for B_DATA array out of range. Allowed range: [0, " << NumberBData << ") " << std::endl;
257 
258  } else {
259  return m_bData[iB];
260  }
261 }
cms_uint16_t m_bData[NumberBData]
Definition: L1GtPsbWord.h:221
static const int NumberBData
Definition: L1GtPsbWord.h:32
const cms_uint16_t L1GtPsbWord::boardId ( ) const
inline
const int L1GtPsbWord::bxInEvent ( ) const
inline
const cms_uint16_t L1GtPsbWord::bxNr ( ) const
inline

get/set bunch cross number of the actual bx

Definition at line 84 of file L1GtPsbWord.h.

References m_bxNr.

Referenced by L1TGT::analyze(), L1GtDataEmulAnalyzer::comparePSB(), and L1GtHwValidation::comparePSB().

84 { return m_bxNr; }
cms_uint16_t m_bxNr
Definition: L1GtPsbWord.h:216
const cms_uint32_t L1GtPsbWord::eventNr ( ) const
inline

get/set event number since last L1 reset generated in PSB

Definition at line 97 of file L1GtPsbWord.h.

References m_eventNr.

Referenced by L1GtDataEmulAnalyzer::comparePSB(), and L1GtHwValidation::comparePSB().

97 { return m_eventNr; }
cms_uint32_t m_eventNr
Definition: L1GtPsbWord.h:217
const unsigned int L1GtPsbWord::getSize ( ) const
inline

get the size of the PSB block in GT DAQ record (in multiple of 8 bits)

Definition at line 147 of file L1GtPsbWord.h.

References BlockSize, and L1GlobalTriggerReadoutSetup::UnitLength.

Referenced by L1GTDigiToRaw::packPSB(), L1GTDigiToRaw::produce(), L1GlobalTriggerRawToDigi::produce(), and L1GlobalTriggerRawToDigi::unpackPSB().

147  {
148  int unitLengthBits = L1GlobalTriggerReadoutSetup::UnitLength;
149 
150  return BlockSize * unitLengthBits;
151  }
static const int BlockSize
Definition: L1GtPsbWord.h:164
static const int UnitLength
one unit in the word is UnitLength bits
const cms_uint16_t L1GtPsbWord::localBxNr ( ) const
inline

get/set local bunch cross number of the actual bx

Definition at line 134 of file L1GtPsbWord.h.

References m_localBxNr.

Referenced by L1TGT::analyze(), L1GtDataEmulAnalyzer::comparePSB(), and L1GtHwValidation::comparePSB().

134 { return m_localBxNr; }
cms_uint16_t m_localBxNr
Definition: L1GtPsbWord.h:223
bool L1GtPsbWord::operator!= ( const L1GtPsbWord result) const

unequal operator

Definition at line 109 of file L1GtPsbWord.cc.

109 { return !(result == *this); }
bool L1GtPsbWord::operator== ( const L1GtPsbWord result) const

equal operator

Definition at line 74 of file L1GtPsbWord.cc.

References m_aData, m_bData, m_boardId, m_bxInEvent, m_bxNr, m_eventNr, m_localBxNr, NumberAData, and NumberBData.

74  {
75  if (m_boardId != result.m_boardId) {
76  return false;
77  }
78  if (m_bxInEvent != result.m_bxInEvent) {
79  return false;
80  }
81  if (m_bxNr != result.m_bxNr) {
82  return false;
83  }
84  if (m_eventNr != result.m_eventNr) {
85  return false;
86  }
87 
88  for (int iA = 0; iA < NumberAData; ++iA) {
89  if (m_aData[iA] != result.m_aData[iA]) {
90  return false;
91  }
92  }
93 
94  for (int iB = 0; iB < NumberBData; ++iB) {
95  if (m_bData[iB] != result.m_bData[iB]) {
96  return false;
97  }
98  }
99 
100  if (m_localBxNr != result.m_localBxNr) {
101  return false;
102  }
103 
104  // all members identical
105  return true;
106 }
cms_uint16_t m_localBxNr
Definition: L1GtPsbWord.h:223
cms_uint16_t m_bData[NumberBData]
Definition: L1GtPsbWord.h:221
cms_uint32_t m_eventNr
Definition: L1GtPsbWord.h:217
cms_uint16_t m_bxNr
Definition: L1GtPsbWord.h:216
static const int NumberBData
Definition: L1GtPsbWord.h:32
static const int NumberAData
Definition: L1GtPsbWord.h:31
cms_uint16_t m_boardId
Definition: L1GtPsbWord.h:210
cms_uint16_t m_aData[NumberAData]
Definition: L1GtPsbWord.h:219
void L1GtPsbWord::print ( std::ostream &  myCout) const

pretty print

Definition at line 348 of file L1GtPsbWord.cc.

References DataCHSize, TauDecayModes::dec, mps_fire::i, m_aData, m_bData, m_boardId, m_bxInEvent, m_bxNr, m_eventNr, and m_localBxNr.

Referenced by L1GtPackUnpackAnalyzer::analyzeGT(), L1GtDataEmulAnalyzer::comparePSB(), L1GtHwValidation::comparePSB(), L1GTDigiToRaw::produce(), and L1GlobalTriggerRawToDigi::produce().

348  {
349  myCout << "\n L1GtPsbWord::print \n" << std::endl;
350 
351  myCout << " Board Id: " << std::hex << " hex: " << std::setw(4) << std::setfill('0') << m_boardId
352  << std::setfill(' ') << std::dec << " dec: " << m_boardId << std::endl;
353 
354  int baseValue = 16; // using hexadecimal values;
355  int hexBxInEvent = (m_bxInEvent + baseValue) % baseValue;
356 
357  myCout << " BxInEvent: " << std::hex << " hex: "
358  << " " << std::setw(1) << hexBxInEvent << std::dec << " dec: " << m_bxInEvent << std::endl;
359 
360  myCout << " BxNr: " << std::hex << " hex: "
361  << " " << std::setw(3) << std::setfill('0') << m_bxNr << std::setfill(' ') << std::dec << " dec: " << m_bxNr
362  << std::endl;
363 
364  myCout << " EventNr: " << std::hex << " hex: "
365  << " " << std::setw(6) << std::setfill('0') << m_eventNr << std::setfill(' ') << std::dec
366  << " dec: " << m_eventNr << std::endl;
367 
368  int sizeW64 = 64;
369  int dataBlocksPerLine = sizeW64 / DataCHSize; // 4x16 bits per line
370 
371  myCout << "\n "
372  << "A_Data_CH3 "
373  << "A_Data_CH2 "
374  << "A_Data_CH1 "
375  << "A_Data_CH0 "
376  << "\n"
377  << std::hex << " hex: " << std::setfill('0');
378 
379  for (int i = 0; i < dataBlocksPerLine; ++i) {
380  int iCh = dataBlocksPerLine - (i + 1); // reverse
381  myCout << std::setw(4) << m_aData[iCh] << " ";
382  }
383 
384  myCout << "\n" << std::dec << " dec: ";
385 
386  for (int i = 0; i < dataBlocksPerLine; ++i) {
387  int iCh = dataBlocksPerLine - (i + 1); // reverse
388  myCout << std::setw(5) << m_aData[iCh] << " ";
389  }
390 
391  myCout << "\n\n "
392  << "A_Data_CH7 "
393  << "A_Data_CH6 "
394  << "A_Data_CH5 "
395  << "A_Data_CH4 "
396  << "\n"
397  << std::hex << " hex: " << std::setfill('0');
398 
399  for (int i = 0; i < dataBlocksPerLine; ++i) {
400  int iCh = dataBlocksPerLine - (i + 1); // reverse
401  myCout << std::setw(4) << m_aData[iCh + dataBlocksPerLine] << " ";
402  }
403 
404  myCout << "\n" << std::dec << " dec: ";
405 
406  for (int i = 0; i < dataBlocksPerLine; ++i) {
407  int iCh = dataBlocksPerLine - (i + 1); // reverse
408  myCout << std::setw(5) << m_aData[iCh + dataBlocksPerLine] << " ";
409  }
410 
411  myCout << std::endl;
412 
413  myCout << "\n "
414  << "B_Data_CH3 "
415  << "B_Data_CH2 "
416  << "B_Data_CH1 "
417  << "B_Data_CH0 "
418  << "\n"
419  << std::hex << " hex: " << std::setfill('0');
420 
421  for (int i = 0; i < dataBlocksPerLine; ++i) {
422  int iCh = dataBlocksPerLine - (i + 1); // reverse
423  myCout << std::setw(4) << m_bData[iCh] << " ";
424  }
425 
426  myCout << "\n" << std::dec << " dec: ";
427 
428  for (int i = 0; i < dataBlocksPerLine; ++i) {
429  int iCh = dataBlocksPerLine - (i + 1); // reverse
430  myCout << std::setw(5) << m_bData[iCh] << " ";
431  }
432 
433  myCout << "\n\n "
434  << "B_Data_CH7 "
435  << "B_Data_CH6 "
436  << "B_Data_CH5 "
437  << "B_Data_CH4 "
438  << "\n"
439  << std::hex << " hex: " << std::setfill('0');
440 
441  for (int i = 0; i < dataBlocksPerLine; ++i) {
442  int iCh = dataBlocksPerLine - (i + 1); // reverse
443  myCout << std::setw(4) << m_bData[iCh + dataBlocksPerLine] << " ";
444  }
445 
446  myCout << "\n" << std::dec << " dec: ";
447 
448  for (int i = 0; i < dataBlocksPerLine; ++i) {
449  int iCh = dataBlocksPerLine - (i + 1); // reverse
450  myCout << std::setw(5) << m_bData[iCh + dataBlocksPerLine] << " ";
451  }
452 
453  myCout << "\n" << std::endl;
454 
455  myCout << " LocalBxNr: " << std::hex << " hex: "
456  << " " << std::setw(3) << std::setfill('0') << m_localBxNr << std::setfill(' ') << std::dec
457  << " dec: " << m_localBxNr << std::endl;
458 }
cms_uint16_t m_localBxNr
Definition: L1GtPsbWord.h:223
cms_uint16_t m_bData[NumberBData]
Definition: L1GtPsbWord.h:221
static const int DataCHSize
Definition: L1GtPsbWord.h:187
cms_uint32_t m_eventNr
Definition: L1GtPsbWord.h:217
cms_uint16_t m_bxNr
Definition: L1GtPsbWord.h:216
cms_uint16_t m_boardId
Definition: L1GtPsbWord.h:210
cms_uint16_t m_aData[NumberAData]
Definition: L1GtPsbWord.h:219
void L1GtPsbWord::reset ( void  )

reset the content of a L1GtPsbWord

Definition at line 330 of file L1GtPsbWord.cc.

References m_aData, m_bData, m_boardId, m_bxInEvent, m_bxNr, m_eventNr, m_localBxNr, NumberAData, and NumberBData.

Referenced by L1GlobalTriggerRawToDigi::produce().

330  {
331  m_boardId = 0;
332  m_bxInEvent = 0;
333  m_bxNr = 0;
334  m_eventNr = 0;
335 
336  for (int iA = 0; iA < NumberAData; ++iA) {
337  m_aData[iA] = 0;
338  }
339 
340  for (int iB = 0; iB < NumberBData; ++iB) {
341  m_bData[iB] = 0;
342  }
343 
344  m_localBxNr = 0;
345 }
cms_uint16_t m_localBxNr
Definition: L1GtPsbWord.h:223
cms_uint16_t m_bData[NumberBData]
Definition: L1GtPsbWord.h:221
cms_uint32_t m_eventNr
Definition: L1GtPsbWord.h:217
cms_uint16_t m_bxNr
Definition: L1GtPsbWord.h:216
static const int NumberBData
Definition: L1GtPsbWord.h:32
static const int NumberAData
Definition: L1GtPsbWord.h:31
cms_uint16_t m_boardId
Definition: L1GtPsbWord.h:210
cms_uint16_t m_aData[NumberAData]
Definition: L1GtPsbWord.h:219
void L1GtPsbWord::setAData ( cms_uint16_t  aDataVal,
int  iA 
)

Definition at line 191 of file L1GtPsbWord.cc.

References Exception, m_aData, and NumberAData.

Referenced by L1GlobalTriggerPSB::fillPsbBlock(), and L1GlobalTriggerRawToDigi::unpackPSB().

191  {
192  if (iA < 0 || iA > NumberAData) {
193  throw cms::Exception("aDataIndexError")
194  << "\nError: index for A_DATA array out of range. Allowed range: [0, " << NumberAData << ") " << std::endl;
195 
196  } else {
197  m_aData[iA] = aDataVal;
198  }
199 }
static const int NumberAData
Definition: L1GtPsbWord.h:31
cms_uint16_t m_aData[NumberAData]
Definition: L1GtPsbWord.h:219
void L1GtPsbWord::setAData ( const cms_uint64_t word64,
int  iWord 
)

set the AData value from a 64-bits word, having the index iWord in the GTFE raw record

Definition at line 203 of file L1GtPsbWord.cc.

References ADataCH0Word, ADataCH4Word, DataCHSize, mps_fire::i, and m_aData.

203  {
204  int sizeW64 = sizeof(word64) * 8;
205  int nSubWords = sizeW64 / DataCHSize;
206 
207  if (iWord == ADataCH0Word) {
208  for (int i = 0; i < nSubWords; ++i) {
209  int dataShift = i * DataCHSize;
210  m_aData[i] = (word64 & (DataCHMask << dataShift)) >> dataShift;
211 
212  // LogTrace("L1GtPsbWord")
213  // << "\n A_Data_CH" << i << " = "
214  // << m_aData[i]
215  // << std::endl;
216  }
217 
218  } else if (iWord == ADataCH4Word) {
219  for (int i = 0; i < nSubWords; ++i) {
220  int dataShift = i * DataCHSize;
221  m_aData[i + nSubWords] = (word64 & (DataCHMask << dataShift)) >> dataShift;
222 
223  // LogTrace("L1GtPsbWord")
224  // << "\n A_Data_CH" << i + nSubWords << " = "
225  // << m_aData[i]
226  // << std::endl;
227  }
228  }
229 }
static const int DataCHSize
Definition: L1GtPsbWord.h:187
static const int ADataCH0Word
Definition: L1GtPsbWord.h:191
cms_uint16_t m_aData[NumberAData]
Definition: L1GtPsbWord.h:219
static const int ADataCH4Word
Definition: L1GtPsbWord.h:194
void L1GtPsbWord::setADataWord64 ( cms_uint64_t word64,
int  iWord 
)

set the AData value in a 64-bits word, having the index iWord in the GTFE raw record

Definition at line 233 of file L1GtPsbWord.cc.

References ADataCH0Word, ADataCH4Word, DataCHSize, mps_fire::i, and m_aData.

Referenced by L1GTDigiToRaw::packPSB().

233  {
234  int sizeW64 = sizeof(word64) * 8;
235  int nSubWords = sizeW64 / DataCHSize;
236 
237  if (iWord == ADataCH0Word) {
238  for (int i = 0; i < nSubWords; ++i) {
239  int dataShift = i * DataCHSize;
240  word64 = word64 | (static_cast<cms_uint64_t>(m_aData[i]) << dataShift);
241  }
242 
243  } else if (iWord == ADataCH4Word) {
244  for (int i = 0; i < nSubWords; ++i) {
245  int dataShift = i * DataCHSize;
246  word64 = word64 | (static_cast<cms_uint64_t>(m_aData[i + nSubWords]) << dataShift);
247  }
248  }
249 }
static const int DataCHSize
Definition: L1GtPsbWord.h:187
static const int ADataCH0Word
Definition: L1GtPsbWord.h:191
unsigned long long cms_uint64_t
Definition: typedefs.h:17
cms_uint16_t m_aData[NumberAData]
Definition: L1GtPsbWord.h:219
static const int ADataCH4Word
Definition: L1GtPsbWord.h:194
void L1GtPsbWord::setBData ( cms_uint16_t  bDataVal,
int  iB 
)

Definition at line 263 of file L1GtPsbWord.cc.

References Exception, m_bData, and NumberBData.

Referenced by L1GlobalTriggerPSB::fillPsbBlock(), and L1GlobalTriggerRawToDigi::unpackPSB().

263  {
264  if (iB < 0 || iB > NumberBData) {
265  throw cms::Exception("bDataIndexError")
266  << "\nError: index for B_DATA array out of range. Allowed range: [0, " << NumberBData << ") " << std::endl;
267 
268  } else {
269  m_bData[iB] = bDataVal;
270  }
271 }
cms_uint16_t m_bData[NumberBData]
Definition: L1GtPsbWord.h:221
static const int NumberBData
Definition: L1GtPsbWord.h:32
void L1GtPsbWord::setBData ( const cms_uint64_t word64,
int  iWord 
)

set the BData value from a 64-bits word, having the index iWord in the GTFE raw record

Definition at line 275 of file L1GtPsbWord.cc.

References BDataCH0Word, BDataCH4Word, DataCHSize, mps_fire::i, and m_bData.

275  {
276  int sizeW64 = sizeof(word64) * 8;
277  int nSubWords = sizeW64 / DataCHSize;
278 
279  if (iWord == BDataCH0Word) {
280  for (int i = 0; i < nSubWords; ++i) {
281  int dataShift = i * DataCHSize;
282  m_bData[i] = (word64 & (DataCHMask << dataShift)) >> dataShift;
283  }
284 
285  } else if (iWord == BDataCH4Word) {
286  for (int i = 0; i < nSubWords; ++i) {
287  int dataShift = i * DataCHSize;
288  m_bData[i + nSubWords] = (word64 & (DataCHMask << dataShift)) >> dataShift;
289  }
290  }
291 }
static const int BDataCH0Word
Definition: L1GtPsbWord.h:197
cms_uint16_t m_bData[NumberBData]
Definition: L1GtPsbWord.h:221
static const int DataCHSize
Definition: L1GtPsbWord.h:187
static const int BDataCH4Word
Definition: L1GtPsbWord.h:200
void L1GtPsbWord::setBDataWord64 ( cms_uint64_t word64,
int  iWord 
)

set the BData value in a 64-bits word, having the index iWord in the GTFE raw record

Definition at line 295 of file L1GtPsbWord.cc.

References BDataCH0Word, BDataCH4Word, DataCHSize, mps_fire::i, and m_bData.

Referenced by L1GTDigiToRaw::packPSB().

295  {
296  int sizeW64 = sizeof(word64) * 8;
297  int nSubWords = sizeW64 / DataCHSize;
298 
299  if (iWord == BDataCH0Word) {
300  for (int i = 0; i < nSubWords; ++i) {
301  int dataShift = i * DataCHSize;
302  word64 = word64 | (static_cast<cms_uint64_t>(m_bData[i]) << dataShift);
303  }
304 
305  } else if (iWord == BDataCH4Word) {
306  for (int i = 0; i < nSubWords; ++i) {
307  int dataShift = i * DataCHSize;
308  word64 = word64 | (static_cast<cms_uint64_t>(m_bData[i + nSubWords]) << dataShift);
309  }
310  }
311 }
static const int BDataCH0Word
Definition: L1GtPsbWord.h:197
cms_uint16_t m_bData[NumberBData]
Definition: L1GtPsbWord.h:221
static const int DataCHSize
Definition: L1GtPsbWord.h:187
static const int BDataCH4Word
Definition: L1GtPsbWord.h:200
unsigned long long cms_uint64_t
Definition: typedefs.h:17
void L1GtPsbWord::setBoardId ( cms_uint16_t  boardIdValue)
inline

Definition at line 60 of file L1GtPsbWord.h.

References m_boardId.

Referenced by L1GlobalTriggerPSB::fillPsbBlock(), and L1GlobalTriggerRawToDigi::unpackPSB().

60 { m_boardId = boardIdValue; }
cms_uint16_t m_boardId
Definition: L1GtPsbWord.h:210
void L1GtPsbWord::setBoardId ( const cms_uint64_t word64,
int  iWord 
)

set the BoardId value from a 64-bits word, having the index iWord in the GTFE raw record

Definition at line 115 of file L1GtPsbWord.cc.

References BoardIdMask, BoardIdShift, BoardIdWord, and m_boardId.

115  {
116  if (iWord == BoardIdWord) {
117  m_boardId = (word64 & BoardIdMask) >> BoardIdShift;
118  }
119 }
static const int BoardIdShift
Definition: L1GtPsbWord.h:181
static const cms_uint64_t BoardIdMask
Definition: L1GtPsbWord.h:175
static const int BoardIdWord
Definition: L1GtPsbWord.h:169
cms_uint16_t m_boardId
Definition: L1GtPsbWord.h:210
void L1GtPsbWord::setBoardIdWord64 ( cms_uint64_t word64,
int  iWord 
)

set the BoardId value in a 64-bits word, having the index iWord in the GTFE raw record

Definition at line 123 of file L1GtPsbWord.cc.

References BoardIdShift, BoardIdWord, and m_boardId.

Referenced by L1GTDigiToRaw::packPSB().

123  {
124  if (iWord == BoardIdWord) {
125  word64 = word64 | (static_cast<cms_uint64_t>(m_boardId) << BoardIdShift);
126  }
127 }
static const int BoardIdShift
Definition: L1GtPsbWord.h:181
static const int BoardIdWord
Definition: L1GtPsbWord.h:169
unsigned long long cms_uint64_t
Definition: typedefs.h:17
cms_uint16_t m_boardId
Definition: L1GtPsbWord.h:210
void L1GtPsbWord::setBxInEvent ( int  bxInEventValue)
inline

Definition at line 73 of file L1GtPsbWord.h.

References m_bxInEvent.

Referenced by L1GlobalTriggerPSB::fillPsbBlock(), and L1GlobalTriggerRawToDigi::unpackPSB().

73 { m_bxInEvent = bxInEventValue; }
void L1GtPsbWord::setBxInEvent ( const cms_uint64_t word64,
int  iWord 
)

set the BxInEvent value from a 64-bits word, having the index iWord in the GTFE raw record

Definition at line 131 of file L1GtPsbWord.cc.

References BxInEventMask, BxInEventShift, BxInEventWord, and m_bxInEvent.

131  {
132  if (iWord == BxInEventWord) {
133  int baseValue = 16; // using hexadecimal values;
134  int hexBxInEvent = (word64 & BxInEventMask) >> BxInEventShift;
135  m_bxInEvent = (hexBxInEvent + baseValue / 2) % baseValue - baseValue / 2;
136  }
137 }
static const cms_uint64_t BxInEventMask
Definition: L1GtPsbWord.h:176
static const int BxInEventShift
Definition: L1GtPsbWord.h:182
static const int BxInEventWord
Definition: L1GtPsbWord.h:170
void L1GtPsbWord::setBxInEventWord64 ( cms_uint64_t word64,
int  iWord 
)

set the BxInEvent value in a 64-bits word, having the index iWord in the GTFE raw record

Definition at line 141 of file L1GtPsbWord.cc.

References BxInEventShift, BxInEventWord, and m_bxInEvent.

Referenced by L1GTDigiToRaw::packPSB().

141  {
142  if (iWord == BxInEventWord) {
143  int baseValue = 16; // using hexadecimal values;
144  int hexBxInEvent = (m_bxInEvent + baseValue) % baseValue;
145  word64 = word64 | (static_cast<cms_uint64_t>(hexBxInEvent) << BxInEventShift);
146  }
147 }
static const int BxInEventShift
Definition: L1GtPsbWord.h:182
static const int BxInEventWord
Definition: L1GtPsbWord.h:170
unsigned long long cms_uint64_t
Definition: typedefs.h:17
void L1GtPsbWord::setBxNr ( cms_uint16_t  bxNrValue)
inline

Definition at line 86 of file L1GtPsbWord.h.

References m_bxNr.

Referenced by L1GlobalTriggerPSB::fillPsbBlock(), and L1GlobalTriggerRawToDigi::unpackPSB().

86 { m_bxNr = bxNrValue; }
cms_uint16_t m_bxNr
Definition: L1GtPsbWord.h:216
void L1GtPsbWord::setBxNr ( const cms_uint64_t word64,
int  iWord 
)

set the BxNr value from a 64-bits word, having the index iWord in the GTFE raw record

Definition at line 150 of file L1GtPsbWord.cc.

References BxNrMask, BxNrShift, BxNrWord, and m_bxNr.

150  {
151  if (iWord == BxNrWord) {
152  m_bxNr = (word64 & BxNrMask) >> BxNrShift;
153  }
154 }
cms_uint16_t m_bxNr
Definition: L1GtPsbWord.h:216
static const int BxNrWord
Definition: L1GtPsbWord.h:171
static const cms_uint64_t BxNrMask
Definition: L1GtPsbWord.h:177
static const int BxNrShift
Definition: L1GtPsbWord.h:183
void L1GtPsbWord::setBxNrWord64 ( cms_uint64_t word64,
int  iWord 
)

set the BxNr value in a 64-bits word, having the index iWord in the GTFE raw record

Definition at line 158 of file L1GtPsbWord.cc.

References BxNrShift, BxNrWord, and m_bxNr.

Referenced by L1GTDigiToRaw::packPSB().

158  {
159  if (iWord == BxNrWord) {
160  word64 = word64 | (static_cast<cms_uint64_t>(m_bxNr) << BxNrShift);
161  }
162 }
cms_uint16_t m_bxNr
Definition: L1GtPsbWord.h:216
static const int BxNrWord
Definition: L1GtPsbWord.h:171
unsigned long long cms_uint64_t
Definition: typedefs.h:17
static const int BxNrShift
Definition: L1GtPsbWord.h:183
void L1GtPsbWord::setEventNr ( cms_uint32_t  eventNrValue)
inline

Definition at line 99 of file L1GtPsbWord.h.

References m_eventNr.

Referenced by L1GlobalTriggerPSB::fillPsbBlock(), and L1GlobalTriggerRawToDigi::unpackPSB().

99 { m_eventNr = eventNrValue; }
cms_uint32_t m_eventNr
Definition: L1GtPsbWord.h:217
void L1GtPsbWord::setEventNr ( const cms_uint64_t word64,
int  iWord 
)

set the EventNr value from a 64-bits word, having the index iWord in the GTFE raw record

Definition at line 165 of file L1GtPsbWord.cc.

References EventNrMask, EventNrShift, EventNrWord, and m_eventNr.

165  {
166  if (iWord == EventNrWord) {
167  m_eventNr = (word64 & EventNrMask) >> EventNrShift;
168  }
169 }
static const int EventNrWord
Definition: L1GtPsbWord.h:172
cms_uint32_t m_eventNr
Definition: L1GtPsbWord.h:217
static const cms_uint64_t EventNrMask
Definition: L1GtPsbWord.h:178
static const int EventNrShift
Definition: L1GtPsbWord.h:184
void L1GtPsbWord::setEventNrWord64 ( cms_uint64_t word64,
int  iWord 
)

set the EventNr value in a 64-bits word, having the index iWord in the GTFE raw record

Definition at line 173 of file L1GtPsbWord.cc.

References EventNrShift, EventNrWord, and m_eventNr.

Referenced by L1GTDigiToRaw::packPSB().

173  {
174  if (iWord == EventNrWord) {
175  word64 = word64 | (static_cast<cms_uint64_t>(m_eventNr) << EventNrShift);
176  }
177 }
static const int EventNrWord
Definition: L1GtPsbWord.h:172
cms_uint32_t m_eventNr
Definition: L1GtPsbWord.h:217
static const int EventNrShift
Definition: L1GtPsbWord.h:184
unsigned long long cms_uint64_t
Definition: typedefs.h:17
void L1GtPsbWord::setLocalBxNr ( cms_uint16_t  localBxNrValue)
inline

Definition at line 136 of file L1GtPsbWord.h.

References m_localBxNr.

Referenced by L1GlobalTriggerPSB::fillPsbBlock(), and L1GlobalTriggerRawToDigi::unpackPSB().

136 { m_localBxNr = localBxNrValue; }
cms_uint16_t m_localBxNr
Definition: L1GtPsbWord.h:223
void L1GtPsbWord::setLocalBxNr ( const cms_uint64_t word64,
int  iWord 
)

set the local bunch cross number bits from a 64-bits word, having the index iWord in the GTFE raw record

Definition at line 315 of file L1GtPsbWord.cc.

References LocalBxNrMask, LocalBxNrShift, LocalBxNrWord, and m_localBxNr.

315  {
316  if (iWord == LocalBxNrWord) {
317  m_localBxNr = (word64 & LocalBxNrMask) >> LocalBxNrShift;
318  }
319 }
static const int LocalBxNrWord
Definition: L1GtPsbWord.h:203
cms_uint16_t m_localBxNr
Definition: L1GtPsbWord.h:223
static const cms_uint64_t LocalBxNrMask
Definition: L1GtPsbWord.h:204
static const int LocalBxNrShift
Definition: L1GtPsbWord.h:205
void L1GtPsbWord::setLocalBxNrWord64 ( cms_uint64_t word64,
int  iWord 
)

set the local bunch cross number bits in a 64-bits word, having the index iWord in the GTFE raw record

Definition at line 323 of file L1GtPsbWord.cc.

References LocalBxNrShift, LocalBxNrWord, and m_localBxNr.

Referenced by L1GTDigiToRaw::packPSB().

323  {
324  if (iWord == LocalBxNrWord) {
325  word64 = word64 | (static_cast<cms_uint64_t>(m_localBxNr) << LocalBxNrShift);
326  }
327 }
static const int LocalBxNrWord
Definition: L1GtPsbWord.h:203
cms_uint16_t m_localBxNr
Definition: L1GtPsbWord.h:223
static const int LocalBxNrShift
Definition: L1GtPsbWord.h:205
unsigned long long cms_uint64_t
Definition: typedefs.h:17

Member Data Documentation

const int L1GtPsbWord::ADataCH0Word = 1
staticprivate

Definition at line 191 of file L1GtPsbWord.h.

Referenced by setAData(), and setADataWord64().

const int L1GtPsbWord::ADataCH4Word = 2
staticprivate

Definition at line 194 of file L1GtPsbWord.h.

Referenced by setAData(), and setADataWord64().

const int L1GtPsbWord::BDataCH0Word = 3
staticprivate

Definition at line 197 of file L1GtPsbWord.h.

Referenced by setBData(), and setBDataWord64().

const int L1GtPsbWord::BDataCH4Word = 4
staticprivate

Definition at line 200 of file L1GtPsbWord.h.

Referenced by setBData(), and setBDataWord64().

const int L1GtPsbWord::BlockSize = 6
staticprivate

Definition at line 164 of file L1GtPsbWord.h.

Referenced by getSize().

const cms_uint64_t L1GtPsbWord::BoardIdMask = 0xFFFF000000000000ULL
staticprivate

Definition at line 175 of file L1GtPsbWord.h.

Referenced by setBoardId().

const int L1GtPsbWord::BoardIdShift = 48
staticprivate

Definition at line 181 of file L1GtPsbWord.h.

Referenced by setBoardId(), and setBoardIdWord64().

const int L1GtPsbWord::BoardIdWord = 0
staticprivate

Definition at line 169 of file L1GtPsbWord.h.

Referenced by setBoardId(), and setBoardIdWord64().

const cms_uint64_t L1GtPsbWord::BxInEventMask = 0x0000F00000000000ULL
staticprivate

Definition at line 176 of file L1GtPsbWord.h.

Referenced by setBxInEvent().

const int L1GtPsbWord::BxInEventShift = 44
staticprivate

Definition at line 182 of file L1GtPsbWord.h.

Referenced by setBxInEvent(), and setBxInEventWord64().

const int L1GtPsbWord::BxInEventWord = 0
staticprivate

Definition at line 170 of file L1GtPsbWord.h.

Referenced by setBxInEvent(), and setBxInEventWord64().

const cms_uint64_t L1GtPsbWord::BxNrMask = 0x00000FFF00000000ULL
staticprivate

Definition at line 177 of file L1GtPsbWord.h.

Referenced by setBxNr().

const int L1GtPsbWord::BxNrShift = 32
staticprivate

Definition at line 183 of file L1GtPsbWord.h.

Referenced by setBxNr(), and setBxNrWord64().

const int L1GtPsbWord::BxNrWord = 0
staticprivate

Definition at line 171 of file L1GtPsbWord.h.

Referenced by setBxNr(), and setBxNrWord64().

const cms_uint64_t L1GtPsbWord::DataCHMask = 0x000000000000FFFFULL
staticprivate

Definition at line 188 of file L1GtPsbWord.h.

const int L1GtPsbWord::DataCHSize = 16
staticprivate

Definition at line 187 of file L1GtPsbWord.h.

Referenced by print(), setAData(), setADataWord64(), setBData(), and setBDataWord64().

const cms_uint64_t L1GtPsbWord::EventNrMask = 0x0000000000FFFFFFULL
staticprivate

Definition at line 178 of file L1GtPsbWord.h.

Referenced by setEventNr().

const int L1GtPsbWord::EventNrShift = 0
staticprivate

Definition at line 184 of file L1GtPsbWord.h.

Referenced by setEventNr(), and setEventNrWord64().

const int L1GtPsbWord::EventNrWord = 0
staticprivate

Definition at line 172 of file L1GtPsbWord.h.

Referenced by setEventNr(), and setEventNrWord64().

const cms_uint64_t L1GtPsbWord::LocalBxNrMask = 0x0000000000000FFFULL
staticprivate

Definition at line 204 of file L1GtPsbWord.h.

Referenced by setLocalBxNr().

const int L1GtPsbWord::LocalBxNrShift = 0
staticprivate

Definition at line 205 of file L1GtPsbWord.h.

Referenced by setLocalBxNr(), and setLocalBxNrWord64().

const int L1GtPsbWord::LocalBxNrWord = 5
staticprivate

Definition at line 203 of file L1GtPsbWord.h.

Referenced by setLocalBxNr(), and setLocalBxNrWord64().

cms_uint16_t L1GtPsbWord::m_aData[NumberAData]
private

Definition at line 219 of file L1GtPsbWord.h.

Referenced by aData(), L1GtPsbWord(), operator==(), print(), reset(), setAData(), and setADataWord64().

cms_uint16_t L1GtPsbWord::m_bData[NumberBData]
private

Definition at line 221 of file L1GtPsbWord.h.

Referenced by bData(), L1GtPsbWord(), operator==(), print(), reset(), setBData(), and setBDataWord64().

cms_uint16_t L1GtPsbWord::m_boardId
private

Definition at line 210 of file L1GtPsbWord.h.

Referenced by boardId(), L1GtPsbWord(), operator==(), print(), reset(), setBoardId(), and setBoardIdWord64().

int L1GtPsbWord::m_bxInEvent
private
cms_uint16_t L1GtPsbWord::m_bxNr
private

Definition at line 216 of file L1GtPsbWord.h.

Referenced by bxNr(), L1GtPsbWord(), operator==(), print(), reset(), setBxNr(), and setBxNrWord64().

cms_uint32_t L1GtPsbWord::m_eventNr
private

Definition at line 217 of file L1GtPsbWord.h.

Referenced by eventNr(), L1GtPsbWord(), operator==(), print(), reset(), setEventNr(), and setEventNrWord64().

cms_uint16_t L1GtPsbWord::m_localBxNr
private
const int L1GtPsbWord::NumberAData = 8
static
const int L1GtPsbWord::NumberBData = 8
static