CMS 3D CMS Logo

L1GtfeWord.h
Go to the documentation of this file.
1 #ifndef L1GlobalTrigger_L1GtfeWord_h
2 #define L1GlobalTrigger_L1GtfeWord_h
3 
18 // system include files
19 #include <iosfwd>
20 
21 // user include files
25 
26 // forward declarations
27 
28 // class interface
29 
30 class L1GtfeWord {
31 public:
33  L1GtfeWord(); // empty constructor, all members set to zero;
34 
36  L1GtfeWord(cms_uint16_t boardIdValue,
37  cms_uint16_t recordLength1Value,
38  cms_uint16_t recordLengthValue,
39  cms_uint16_t bxNrValue,
40  cms_uint32_t setupVersionValue,
41  cms_uint16_t activeBoardsValue,
42  cms_uint16_t altNrBxBoardValue,
43  cms_uint32_t totalTriggerNrValue);
44 
46  virtual ~L1GtfeWord();
47 
49  bool operator==(const L1GtfeWord&) const;
50 
52  bool operator!=(const L1GtfeWord&) const;
53 
54 public:
56 
58  inline const cms_uint16_t boardId() const { return m_boardId; }
59 
61  void setBoardId(cms_uint16_t boardIdValue) { m_boardId = boardIdValue; }
62 
64  void setBoardId(const cms_uint64_t& word64);
65 
68  void setBoardIdWord64(cms_uint64_t& word64, int iWord);
69 
71  inline const cms_uint16_t recordLength1() const { return m_recordLength1; }
72 
73  void setRecordLength1(cms_uint16_t recordLengthValue) { m_recordLength1 = recordLengthValue; }
74 
75  void setRecordLength1(const cms_uint64_t& word64);
76 
79  void setRecordLength1Word64(cms_uint64_t& word64, int iWord);
80 
82  inline const cms_uint16_t recordLength() const { return m_recordLength; }
83 
84  void setRecordLength(cms_uint16_t recordLengthValue) { m_recordLength = recordLengthValue; }
85 
86  void setRecordLength(const cms_uint64_t& word64);
87 
90  void setRecordLengthWord64(cms_uint64_t& word64, int iWord);
91 
93  inline const cms_uint16_t bxNr() const { return m_bxNr; }
94 
95  void setBxNr(cms_uint16_t bxNrValue) { m_bxNr = bxNrValue; }
96 
97  void setBxNr(const cms_uint64_t& word64);
98 
101  void setBxNrWord64(cms_uint64_t& word64, int iWord);
102 
104  inline const cms_uint32_t setupVersion() const { return m_setupVersion; }
105 
106  void setSetupVersion(cms_uint32_t setupVersionValue) { m_setupVersion = setupVersionValue; }
107 
108  void setSetupVersion(const cms_uint64_t& word64);
109 
112  void setSetupVersionWord64(cms_uint64_t& word64, int iWord);
113 
115  const int bstFlag() const;
116  void setBstFlag(const int);
117 
119  inline const cms_uint16_t activeBoards() const { return m_activeBoards; }
120 
121  void setActiveBoards(cms_uint16_t activeBoardsValue) { m_activeBoards = activeBoardsValue; }
122 
123  void setActiveBoards(const cms_uint64_t& word64);
124 
127  void setActiveBoardsWord64(cms_uint64_t& word64, int iWord);
128 
131  void setActiveBoardsWord64(cms_uint64_t& word64, int iWord, cms_int16_t activeBoardsValue);
132 
134  inline const cms_uint16_t altNrBxBoard() const { return m_altNrBxBoard; }
135 
136  void setAltNrBxBoard(cms_uint16_t altNrBxBoardValue) { m_altNrBxBoard = altNrBxBoardValue; }
137 
138  void setAltNrBxBoard(const cms_uint64_t& word64);
139 
142  void setAltNrBxBoardWord64(cms_uint64_t& word64, int iWord);
143 
146  void setAltNrBxBoardWord64(cms_uint64_t& word64, int iWord, cms_int16_t altNrBxBoardValue);
147 
149  inline const cms_uint32_t totalTriggerNr() const { return m_totalTriggerNr; }
150 
151  void setTotalTriggerNr(cms_uint32_t totalTriggerNrValue) { m_totalTriggerNr = totalTriggerNrValue; }
152 
153  void setTotalTriggerNr(const cms_uint64_t& word64);
154 
157  void setTotalTriggerNrWord64(cms_uint64_t& word64, int iWord);
158 
160  inline const unsigned int getSize() const {
161  int unitLengthBits = L1GlobalTriggerReadoutSetup::UnitLength;
162 
163  return BlockSize * unitLengthBits;
164  }
165 
166 public:
168  virtual void reset();
169 
171  virtual void print(std::ostream& myCout) const;
172 
175  virtual void unpack(const unsigned char* gtfePtr);
176 
177 private:
178  // block description in the raw GT record
179 
180  // block size in 64bits words
181  static const int BlockSize;
182 
183  static const int BoardIdWord;
184  static const int RecordLength1Word;
185  static const int RecordLengthWord;
186  static const int BxNrWord;
187  static const int SetupVersionWord;
188 
189  static const cms_uint64_t BoardIdMask;
192  static const cms_uint64_t BxNrMask;
194 
195  static const cms_uint32_t BstFlagMask;
196 
197  // shifts could be computed from masks...
198  static const int BoardIdShift;
199  static const int RecordLength1Shift;
200  static const int RecordLengthShift;
201  static const int BxNrShift;
202  static const int SetupVersionShift;
203 
204  //
205  static const int ActiveBoardsWord;
206  static const int AltNrBxBoardWord;
207  static const int TotalTriggerNrWord;
208 
212 
213  static const int ActiveBoardsShift;
214  static const int AltNrBxBoardShift;
215  static const int TotalTriggerNrShift;
216 
217 private:
220 
223 
226 
230 
233 
239 
242 };
243 
244 #endif /*L1GlobalTrigger_L1GtfeWord_h*/
cms_uint32_t
unsigned int cms_uint32_t
Definition: typedefs.h:15
L1GtfeWord::activeBoards
const cms_uint16_t activeBoards() const
get/set boards contributing to EVM respectively DAQ record
Definition: L1GtfeWord.h:119
L1GtfeWord::BoardIdShift
static const int BoardIdShift
Definition: L1GtfeWord.h:198
L1GtfeWord::SetupVersionMask
static const cms_uint64_t SetupVersionMask
Definition: L1GtfeWord.h:193
L1GlobalTriggerReadoutSetup::UnitLength
static const int UnitLength
one unit in the word is UnitLength bits
Definition: L1GlobalTriggerReadoutSetup.h:56
L1GtfeWord::m_recordLength1
cms_uint16_t m_recordLength1
record length for alternative 1
Definition: L1GtfeWord.h:222
L1GtfeWord::AltNrBxBoardWord
static const int AltNrBxBoardWord
Definition: L1GtfeWord.h:206
L1GtfeWord::BstFlagMask
static const cms_uint32_t BstFlagMask
Definition: L1GtfeWord.h:195
L1GtfeWord::bstFlag
const int bstFlag() const
get / set BST flag: 0 or 1 - via setup version (no private member)
Definition: L1GtfeWord.cc:173
L1GtfeWord::operator!=
bool operator!=(const L1GtfeWord &) const
unequal operator
Definition: L1GtfeWord.cc:107
L1GtfeWord::BoardIdWord
static const int BoardIdWord
Definition: L1GtfeWord.h:183
L1GtfeWord::RecordLengthWord
static const int RecordLengthWord
Definition: L1GtfeWord.h:185
L1GlobalTriggerReadoutSetupFwd.h
L1GtfeWord::setTotalTriggerNr
void setTotalTriggerNr(cms_uint32_t totalTriggerNrValue)
Definition: L1GtfeWord.h:151
L1GtfeWord::BlockSize
static const int BlockSize
Definition: L1GtfeWord.h:181
L1GtfeWord::totalTriggerNr
const cms_uint32_t totalTriggerNr() const
get/set total number of L1A sent since start of run
Definition: L1GtfeWord.h:149
L1GtfeWord::setRecordLength
void setRecordLength(cms_uint16_t recordLengthValue)
Definition: L1GtfeWord.h:84
L1GtfeWord::print
virtual void print(std::ostream &myCout) const
pretty print the content of a L1GtfeWord
Definition: L1GtfeWord.cc:253
L1GtfeWord::BxNrWord
static const int BxNrWord
Definition: L1GtfeWord.h:186
L1GtfeWord::setRecordLength1
void setRecordLength1(cms_uint16_t recordLengthValue)
Definition: L1GtfeWord.h:73
L1GtfeWord::setupVersion
const cms_uint32_t setupVersion() const
get/set setup version
Definition: L1GtfeWord.h:104
L1GtfeWord
Definition: L1GtfeWord.h:30
L1GtfeWord::SetupVersionShift
static const int SetupVersionShift
Definition: L1GtfeWord.h:202
L1GtfeWord::m_totalTriggerNr
cms_uint32_t m_totalTriggerNr
total number of L1A sent since start of run
Definition: L1GtfeWord.h:241
L1GtfeWord::operator==
bool operator==(const L1GtfeWord &) const
equal operator
Definition: L1GtfeWord.cc:69
L1GtfeWord::RecordLength1Shift
static const int RecordLength1Shift
Definition: L1GtfeWord.h:199
L1GtfeWord::setRecordLengthWord64
void setRecordLengthWord64(cms_uint64_t &word64, int iWord)
Definition: L1GtfeWord.cc:142
L1GtfeWord::setAltNrBxBoardWord64
void setAltNrBxBoardWord64(cms_uint64_t &word64, int iWord)
Definition: L1GtfeWord.cc:212
L1GtfeWord::recordLength
const cms_uint16_t recordLength() const
get/set record length for alternative 0
Definition: L1GtfeWord.h:82
L1GtfeWord::m_recordLength
cms_uint16_t m_recordLength
record length for alternative 0
Definition: L1GtfeWord.h:225
L1GtfeWord::setRecordLength1Word64
void setRecordLength1Word64(cms_uint64_t &word64, int iWord)
Definition: L1GtfeWord.cc:129
L1GtfeWord::SetupVersionWord
static const int SetupVersionWord
Definition: L1GtfeWord.h:187
L1GtfeWord::TotalTriggerNrShift
static const int TotalTriggerNrShift
Definition: L1GtfeWord.h:215
L1GtfeWord::reset
virtual void reset()
reset the content of a L1GtfeWord
Definition: L1GtfeWord.cc:240
L1GtfeWord::RecordLength1Mask
static const cms_uint64_t RecordLength1Mask
Definition: L1GtfeWord.h:190
L1GtfeWord::ActiveBoardsWord
static const int ActiveBoardsWord
Definition: L1GtfeWord.h:205
L1GtfeWord::setSetupVersionWord64
void setSetupVersionWord64(cms_uint64_t &word64, int iWord)
Definition: L1GtfeWord.cc:166
L1GtfeWord::setBoardIdWord64
void setBoardIdWord64(cms_uint64_t &word64, int iWord)
Definition: L1GtfeWord.cc:116
L1GtfeWord::setActiveBoards
void setActiveBoards(cms_uint16_t activeBoardsValue)
Definition: L1GtfeWord.h:121
typedefs.h
L1GtfeWord::TotalTriggerNrMask
static const cms_uint64_t TotalTriggerNrMask
Definition: L1GtfeWord.h:211
L1GtfeWord::getSize
const unsigned int getSize() const
get the size of the GTFE block in GT DAQ record (in multiple of 8 bits)
Definition: L1GtfeWord.h:160
L1GtfeWord::L1GtfeWord
L1GtfeWord()
constructors
Definition: L1GtfeWord.cc:29
L1GtfeWord::setTotalTriggerNrWord64
void setTotalTriggerNrWord64(cms_uint64_t &word64, int iWord)
Definition: L1GtfeWord.cc:233
L1GtfeWord::m_setupVersion
cms_uint32_t m_setupVersion
Definition: L1GtfeWord.h:229
L1GlobalTriggerReadoutSetup.h
L1GtfeWord::bxNr
const cms_uint16_t bxNr() const
get/set bunch cross number as counted in the GTFE board
Definition: L1GtfeWord.h:93
L1GtfeWord::TotalTriggerNrWord
static const int TotalTriggerNrWord
Definition: L1GtfeWord.h:207
L1GtfeWord::BxNrMask
static const cms_uint64_t BxNrMask
Definition: L1GtfeWord.h:192
L1GtfeWord::RecordLengthShift
static const int RecordLengthShift
Definition: L1GtfeWord.h:200
L1GtfeWord::m_activeBoards
cms_uint16_t m_activeBoards
active boards contributing to EVM respectively DAQ record
Definition: L1GtfeWord.h:232
L1GtfeWord::setActiveBoardsWord64
void setActiveBoardsWord64(cms_uint64_t &word64, int iWord)
Definition: L1GtfeWord.cc:191
L1GtfeWord::ActiveBoardsShift
static const int ActiveBoardsShift
Definition: L1GtfeWord.h:213
cms_uint64_t
unsigned long long cms_uint64_t
Definition: typedefs.h:17
cms_uint16_t
unsigned short cms_uint16_t
Definition: typedefs.h:13
L1GtfeWord::boardId
const cms_uint16_t boardId() const
get/set board ID
Definition: L1GtfeWord.h:58
L1GtfeWord::RecordLengthMask
static const cms_uint64_t RecordLengthMask
Definition: L1GtfeWord.h:191
L1GtfeWord::m_boardId
cms_uint16_t m_boardId
board identifier
Definition: L1GtfeWord.h:219
L1GtfeWord::setAltNrBxBoard
void setAltNrBxBoard(cms_uint16_t altNrBxBoardValue)
Definition: L1GtfeWord.h:136
L1GtfeWord::AltNrBxBoardMask
static const cms_uint64_t AltNrBxBoardMask
Definition: L1GtfeWord.h:210
L1GtfeWord::BxNrShift
static const int BxNrShift
Definition: L1GtfeWord.h:201
L1GtfeWord::m_altNrBxBoard
cms_uint16_t m_altNrBxBoard
Definition: L1GtfeWord.h:238
L1GtfeWord::m_bxNr
cms_uint16_t m_bxNr
bunch cross number as counted in the GTFE board
Definition: L1GtfeWord.h:228
L1GtfeWord::ActiveBoardsMask
static const cms_uint64_t ActiveBoardsMask
Definition: L1GtfeWord.h:209
L1GtfeWord::recordLength1
const cms_uint16_t recordLength1() const
get/set record length for alternative 1
Definition: L1GtfeWord.h:71
L1GtfeWord::AltNrBxBoardShift
static const int AltNrBxBoardShift
Definition: L1GtfeWord.h:214
L1GtfeWord::setBstFlag
void setBstFlag(const int)
Definition: L1GtfeWord.cc:180
L1GtfeWord::setBxNr
void setBxNr(cms_uint16_t bxNrValue)
Definition: L1GtfeWord.h:95
L1GtfeWord::unpack
virtual void unpack(const unsigned char *gtfePtr)
Definition: L1GtfeWord.cc:290
L1GtfeWord::~L1GtfeWord
virtual ~L1GtfeWord()
destructor
Definition: L1GtfeWord.cc:64
L1GtfeWord::setBxNrWord64
void setBxNrWord64(cms_uint64_t &word64, int iWord)
Definition: L1GtfeWord.cc:153
L1GtfeWord::BoardIdMask
static const cms_uint64_t BoardIdMask
Definition: L1GtfeWord.h:189
L1GtfeWord::setBoardId
void setBoardId(cms_uint16_t boardIdValue)
set BoardId from a BoardId value
Definition: L1GtfeWord.h:61
L1GtfeWord::setSetupVersion
void setSetupVersion(cms_uint32_t setupVersionValue)
Definition: L1GtfeWord.h:106
L1GtfeWord::RecordLength1Word
static const int RecordLength1Word
Definition: L1GtfeWord.h:184
L1GtfeWord::altNrBxBoard
const cms_uint16_t altNrBxBoard() const
get/set alternative for number of BX per board
Definition: L1GtfeWord.h:134
cms_int16_t
short cms_int16_t
Definition: typedefs.h:12