CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1GtfeWord.h
Go to the documentation of this file.
1 #ifndef L1GlobalTrigger_L1GtfeWord_h
2 #define L1GlobalTrigger_L1GtfeWord_h
3 
20 // system include files
21 #include <iosfwd>
22 
23 // user include files
27 
28 // forward declarations
29 
30 // class interface
31 
33 {
34 
35 public:
36 
38  L1GtfeWord(); // empty constructor, all members set to zero;
39 
41  L1GtfeWord(
42  cms_uint16_t boardIdValue,
43  cms_uint16_t recordLength1Value,
44  cms_uint16_t recordLengthValue,
45  cms_uint16_t bxNrValue,
46  cms_uint32_t setupVersionValue,
47  cms_uint16_t activeBoardsValue,
48  cms_uint16_t altNrBxBoardValue,
49  cms_uint32_t totalTriggerNrValue
50  );
51 
52 
54  virtual ~L1GtfeWord();
55 
57  bool operator==(const L1GtfeWord&) const;
58 
60  bool operator!=(const L1GtfeWord&) const;
61 
62 public:
63 
65 
67  inline const cms_uint16_t boardId() const
68  {
69  return m_boardId;
70  }
71 
73  void setBoardId(cms_uint16_t boardIdValue)
74  {
75  m_boardId = boardIdValue;
76  }
77 
79  void setBoardId(const cms_uint64_t& word64);
80 
83  void setBoardIdWord64(cms_uint64_t& word64, int iWord);
84 
85 
87  inline const cms_uint16_t recordLength1() const
88  {
89  return m_recordLength1;
90  }
91 
92  void setRecordLength1(cms_uint16_t recordLengthValue)
93  {
94  m_recordLength1 = recordLengthValue;
95  }
96 
97  void setRecordLength1(const cms_uint64_t& word64);
98 
101  void setRecordLength1Word64(cms_uint64_t& word64, int iWord);
102 
103 
104 
106  inline const cms_uint16_t recordLength() const
107  {
108  return m_recordLength;
109  }
110 
111  void setRecordLength(cms_uint16_t recordLengthValue)
112  {
113  m_recordLength = recordLengthValue;
114  }
115 
116  void setRecordLength(const cms_uint64_t& word64);
117 
120  void setRecordLengthWord64(cms_uint64_t& word64, int iWord);
121 
122 
124  inline const cms_uint16_t bxNr() const
125  {
126  return m_bxNr;
127  }
128 
129  void setBxNr(cms_uint16_t bxNrValue)
130  {
131  m_bxNr = bxNrValue;
132  }
133 
134  void setBxNr(const cms_uint64_t& word64);
135 
138  void setBxNrWord64(cms_uint64_t& word64, int iWord);
139 
140 
142  inline const cms_uint32_t setupVersion() const
143  {
144  return m_setupVersion;
145  }
146 
147  void setSetupVersion(cms_uint32_t setupVersionValue)
148  {
149  m_setupVersion = setupVersionValue;
150  }
151 
152  void setSetupVersion(const cms_uint64_t& word64);
153 
156  void setSetupVersionWord64(cms_uint64_t& word64, int iWord);
157 
158 
160  const int bstFlag() const;
161  void setBstFlag(const int);
162 
163 
165  inline const cms_uint16_t activeBoards() const
166  {
167  return m_activeBoards;
168  }
169 
170  void setActiveBoards(cms_uint16_t activeBoardsValue)
171  {
172  m_activeBoards = activeBoardsValue;
173  }
174 
175  void setActiveBoards(const cms_uint64_t& word64);
176 
179  void setActiveBoardsWord64(cms_uint64_t& word64, int iWord);
180 
183  void setActiveBoardsWord64(cms_uint64_t& word64, int iWord,
184  cms_int16_t activeBoardsValue);
185 
186 
187 
189  inline const cms_uint16_t altNrBxBoard() const
190  {
191  return m_altNrBxBoard;
192  }
193 
194  void setAltNrBxBoard(cms_uint16_t altNrBxBoardValue)
195  {
196  m_altNrBxBoard = altNrBxBoardValue;
197  }
198 
199  void setAltNrBxBoard(const cms_uint64_t& word64);
200 
203  void setAltNrBxBoardWord64(cms_uint64_t& word64, int iWord);
204 
207  void setAltNrBxBoardWord64(cms_uint64_t& word64, int iWord,
208  cms_int16_t altNrBxBoardValue);
209 
210 
211 
213  inline const cms_uint32_t totalTriggerNr() const
214  {
215  return m_totalTriggerNr;
216  }
217 
218  void setTotalTriggerNr(cms_uint32_t totalTriggerNrValue)
219  {
220  m_totalTriggerNr = totalTriggerNrValue;
221  }
222 
223  void setTotalTriggerNr(const cms_uint64_t& word64);
224 
227  void setTotalTriggerNrWord64(cms_uint64_t& word64, int iWord);
228 
229 
231  inline const unsigned int getSize() const
232  {
233  int unitLengthBits = L1GlobalTriggerReadoutSetup::UnitLength;
234 
235  return BlockSize*unitLengthBits;
236  }
237 
238 public:
239 
241  virtual void reset();
242 
244  virtual void print(std::ostream& myCout) const;
245 
248  virtual void unpack(const unsigned char* gtfePtr);
249 
250 private:
251 
252  // block description in the raw GT record
253 
254  // block size in 64bits words
255  static const int BlockSize;
256 
257  static const int BoardIdWord;
258  static const int RecordLength1Word;
259  static const int RecordLengthWord;
260  static const int BxNrWord;
261  static const int SetupVersionWord;
262 
263  static const cms_uint64_t BoardIdMask;
266  static const cms_uint64_t BxNrMask;
268 
269  static const cms_uint32_t BstFlagMask;
270 
271  // shifts could be computed from masks...
272  static const int BoardIdShift;
273  static const int RecordLength1Shift;
274  static const int RecordLengthShift;
275  static const int BxNrShift;
276  static const int SetupVersionShift;
277 
278  //
279  static const int ActiveBoardsWord;
280  static const int AltNrBxBoardWord;
281  static const int TotalTriggerNrWord;
282 
286 
287  static const int ActiveBoardsShift;
288  static const int AltNrBxBoardShift;
289  static const int TotalTriggerNrShift;
290 
291 
292 private:
293 
296 
299 
302 
306 
309 
315 
318 
319 };
320 
321 #endif /*L1GlobalTrigger_L1GtfeWord_h*/
short cms_int16_t
Definition: typedefs.h:12
bool operator==(const L1GtfeWord &) const
equal operator
Definition: L1GtfeWord.cc:64
bool operator!=(const L1GtfeWord &) const
unequal operator
Definition: L1GtfeWord.cc:105
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 setRecordLength1Word64(cms_uint64_t &word64, int iWord)
Definition: L1GtfeWord.cc:140
void setBxNr(cms_uint16_t bxNrValue)
Definition: L1GtfeWord.h:129
static const cms_uint64_t TotalTriggerNrMask
Definition: L1GtfeWord.h:285
static const cms_uint64_t BoardIdMask
Definition: L1GtfeWord.h:263
virtual void print(std::ostream &myCout) const
pretty print the content of a L1GtfeWord
Definition: L1GtfeWord.cc:323
static const int RecordLength1Shift
Definition: L1GtfeWord.h:273
static const int ActiveBoardsWord
Definition: L1GtfeWord.h:279
static const int UnitLength
one unit in the word is UnitLength bits
static const int BlockSize
Definition: L1GtfeWord.h:255
void setActiveBoardsWord64(cms_uint64_t &word64, int iWord)
Definition: L1GtfeWord.cc:233
void setRecordLength(cms_uint16_t recordLengthValue)
Definition: L1GtfeWord.h:111
static const cms_uint64_t SetupVersionMask
Definition: L1GtfeWord.h:267
cms_uint16_t m_recordLength
record length for alternative 0
Definition: L1GtfeWord.h:301
void setSetupVersionWord64(cms_uint64_t &word64, int iWord)
Definition: L1GtfeWord.cc:196
const cms_uint16_t altNrBxBoard() const
get/set alternative for number of BX per board
Definition: L1GtfeWord.h:189
cms_uint16_t m_boardId
board identifier
Definition: L1GtfeWord.h:295
const cms_uint16_t recordLength() const
get/set record length for alternative 0
Definition: L1GtfeWord.h:106
void setAltNrBxBoard(cms_uint16_t altNrBxBoardValue)
Definition: L1GtfeWord.h:194
L1GtfeWord()
constructors
Definition: L1GtfeWord.cc:31
void setTotalTriggerNr(cms_uint32_t totalTriggerNrValue)
Definition: L1GtfeWord.h:218
virtual void reset()
reset the content of a L1GtfeWord
Definition: L1GtfeWord.cc:308
static const cms_uint64_t RecordLength1Mask
Definition: L1GtfeWord.h:264
static const cms_uint64_t RecordLengthMask
Definition: L1GtfeWord.h:265
static const int TotalTriggerNrWord
Definition: L1GtfeWord.h:281
static const cms_uint64_t AltNrBxBoardMask
Definition: L1GtfeWord.h:284
static const int SetupVersionWord
Definition: L1GtfeWord.h:261
const cms_uint32_t totalTriggerNr() const
get/set total number of L1A sent since start of run
Definition: L1GtfeWord.h:213
unsigned short cms_uint16_t
Definition: typedefs.h:13
static const int SetupVersionShift
Definition: L1GtfeWord.h:276
void setRecordLength1(cms_uint16_t recordLengthValue)
Definition: L1GtfeWord.h:92
void setBoardIdWord64(cms_uint64_t &word64, int iWord)
Definition: L1GtfeWord.cc:122
static const int RecordLengthShift
Definition: L1GtfeWord.h:274
const cms_uint16_t activeBoards() const
get/set boards contributing to EVM respectively DAQ record
Definition: L1GtfeWord.h:165
unsigned int cms_uint32_t
Definition: typedefs.h:15
cms_uint16_t m_activeBoards
active boards contributing to EVM respectively DAQ record
Definition: L1GtfeWord.h:308
const cms_uint16_t bxNr() const
get/set bunch cross number as counted in the GTFE board
Definition: L1GtfeWord.h:124
void setBoardId(cms_uint16_t boardIdValue)
set BoardId from a BoardId value
Definition: L1GtfeWord.h:73
static const int TotalTriggerNrShift
Definition: L1GtfeWord.h:289
const cms_uint16_t boardId() const
get/set board ID
Definition: L1GtfeWord.h:67
static const int RecordLength1Word
Definition: L1GtfeWord.h:258
static const int ActiveBoardsShift
Definition: L1GtfeWord.h:287
void setAltNrBxBoardWord64(cms_uint64_t &word64, int iWord)
Definition: L1GtfeWord.cc:265
void setActiveBoards(cms_uint16_t activeBoardsValue)
Definition: L1GtfeWord.h:170
const int bstFlag() const
get / set BST flag: 0 or 1 - via setup version (no private member)
Definition: L1GtfeWord.cc:208
static const cms_uint64_t ActiveBoardsMask
Definition: L1GtfeWord.h:283
cms_uint16_t m_bxNr
bunch cross number as counted in the GTFE board
Definition: L1GtfeWord.h:304
static const cms_uint64_t BxNrMask
Definition: L1GtfeWord.h:266
static const int RecordLengthWord
Definition: L1GtfeWord.h:259
static const int BxNrShift
Definition: L1GtfeWord.h:275
cms_uint16_t m_altNrBxBoard
Definition: L1GtfeWord.h:314
void setBxNrWord64(cms_uint64_t &word64, int iWord)
Definition: L1GtfeWord.cc:178
const cms_uint32_t setupVersion() const
get/set setup version
Definition: L1GtfeWord.h:142
static const int BoardIdWord
Definition: L1GtfeWord.h:257
unsigned long long cms_uint64_t
Definition: typedefs.h:17
void setTotalTriggerNrWord64(cms_uint64_t &word64, int iWord)
Definition: L1GtfeWord.cc:295
static const int AltNrBxBoardShift
Definition: L1GtfeWord.h:288
const cms_uint16_t recordLength1() const
get/set record length for alternative 1
Definition: L1GtfeWord.h:87
cms_uint32_t m_totalTriggerNr
total number of L1A sent since start of run
Definition: L1GtfeWord.h:317
cms_uint32_t m_setupVersion
Definition: L1GtfeWord.h:305
void setSetupVersion(cms_uint32_t setupVersionValue)
Definition: L1GtfeWord.h:147
static const int BxNrWord
Definition: L1GtfeWord.h:260
static const int BoardIdShift
Definition: L1GtfeWord.h:272
void setBstFlag(const int)
Definition: L1GtfeWord.cc:217
static const int AltNrBxBoardWord
Definition: L1GtfeWord.h:280
cms_uint16_t m_recordLength1
record length for alternative 1
Definition: L1GtfeWord.h:298
virtual void unpack(const unsigned char *gtfePtr)
Definition: L1GtfeWord.cc:382
void setRecordLengthWord64(cms_uint64_t &word64, int iWord)
Definition: L1GtfeWord.cc:159
static const cms_uint32_t BstFlagMask
Definition: L1GtfeWord.h:269
virtual ~L1GtfeWord()
destructor
Definition: L1GtfeWord.cc:56