test
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 
18 // system include files
19 #include <iosfwd>
20 
21 // user include files
25 
26 // forward declarations
27 
28 // class interface
29 
31 {
32 
33 public:
34 
36  L1GtfeWord(); // empty constructor, all members set to zero;
37 
39  L1GtfeWord(
40  cms_uint16_t boardIdValue,
41  cms_uint16_t recordLength1Value,
42  cms_uint16_t recordLengthValue,
43  cms_uint16_t bxNrValue,
44  cms_uint32_t setupVersionValue,
45  cms_uint16_t activeBoardsValue,
46  cms_uint16_t altNrBxBoardValue,
47  cms_uint32_t totalTriggerNrValue
48  );
49 
50 
52  virtual ~L1GtfeWord();
53 
55  bool operator==(const L1GtfeWord&) const;
56 
58  bool operator!=(const L1GtfeWord&) const;
59 
60 public:
61 
63 
65  inline const cms_uint16_t boardId() const
66  {
67  return m_boardId;
68  }
69 
71  void setBoardId(cms_uint16_t boardIdValue)
72  {
73  m_boardId = boardIdValue;
74  }
75 
77  void setBoardId(const cms_uint64_t& word64);
78 
81  void setBoardIdWord64(cms_uint64_t& word64, int iWord);
82 
83 
85  inline const cms_uint16_t recordLength1() const
86  {
87  return m_recordLength1;
88  }
89 
90  void setRecordLength1(cms_uint16_t recordLengthValue)
91  {
92  m_recordLength1 = recordLengthValue;
93  }
94 
95  void setRecordLength1(const cms_uint64_t& word64);
96 
99  void setRecordLength1Word64(cms_uint64_t& word64, int iWord);
100 
101 
102 
104  inline const cms_uint16_t recordLength() const
105  {
106  return m_recordLength;
107  }
108 
109  void setRecordLength(cms_uint16_t recordLengthValue)
110  {
111  m_recordLength = recordLengthValue;
112  }
113 
114  void setRecordLength(const cms_uint64_t& word64);
115 
118  void setRecordLengthWord64(cms_uint64_t& word64, int iWord);
119 
120 
122  inline const cms_uint16_t bxNr() const
123  {
124  return m_bxNr;
125  }
126 
127  void setBxNr(cms_uint16_t bxNrValue)
128  {
129  m_bxNr = bxNrValue;
130  }
131 
132  void setBxNr(const cms_uint64_t& word64);
133 
136  void setBxNrWord64(cms_uint64_t& word64, int iWord);
137 
138 
140  inline const cms_uint32_t setupVersion() const
141  {
142  return m_setupVersion;
143  }
144 
145  void setSetupVersion(cms_uint32_t setupVersionValue)
146  {
147  m_setupVersion = setupVersionValue;
148  }
149 
150  void setSetupVersion(const cms_uint64_t& word64);
151 
154  void setSetupVersionWord64(cms_uint64_t& word64, int iWord);
155 
156 
158  const int bstFlag() const;
159  void setBstFlag(const int);
160 
161 
163  inline const cms_uint16_t activeBoards() const
164  {
165  return m_activeBoards;
166  }
167 
168  void setActiveBoards(cms_uint16_t activeBoardsValue)
169  {
170  m_activeBoards = activeBoardsValue;
171  }
172 
173  void setActiveBoards(const cms_uint64_t& word64);
174 
177  void setActiveBoardsWord64(cms_uint64_t& word64, int iWord);
178 
181  void setActiveBoardsWord64(cms_uint64_t& word64, int iWord,
182  cms_int16_t activeBoardsValue);
183 
184 
185 
187  inline const cms_uint16_t altNrBxBoard() const
188  {
189  return m_altNrBxBoard;
190  }
191 
192  void setAltNrBxBoard(cms_uint16_t altNrBxBoardValue)
193  {
194  m_altNrBxBoard = altNrBxBoardValue;
195  }
196 
197  void setAltNrBxBoard(const cms_uint64_t& word64);
198 
201  void setAltNrBxBoardWord64(cms_uint64_t& word64, int iWord);
202 
205  void setAltNrBxBoardWord64(cms_uint64_t& word64, int iWord,
206  cms_int16_t altNrBxBoardValue);
207 
208 
209 
211  inline const cms_uint32_t totalTriggerNr() const
212  {
213  return m_totalTriggerNr;
214  }
215 
216  void setTotalTriggerNr(cms_uint32_t totalTriggerNrValue)
217  {
218  m_totalTriggerNr = totalTriggerNrValue;
219  }
220 
221  void setTotalTriggerNr(const cms_uint64_t& word64);
222 
225  void setTotalTriggerNrWord64(cms_uint64_t& word64, int iWord);
226 
227 
229  inline const unsigned int getSize() const
230  {
231  int unitLengthBits = L1GlobalTriggerReadoutSetup::UnitLength;
232 
233  return BlockSize*unitLengthBits;
234  }
235 
236 public:
237 
239  virtual void reset();
240 
242  virtual void print(std::ostream& myCout) const;
243 
246  virtual void unpack(const unsigned char* gtfePtr);
247 
248 private:
249 
250  // block description in the raw GT record
251 
252  // block size in 64bits words
253  static const int BlockSize;
254 
255  static const int BoardIdWord;
256  static const int RecordLength1Word;
257  static const int RecordLengthWord;
258  static const int BxNrWord;
259  static const int SetupVersionWord;
260 
261  static const cms_uint64_t BoardIdMask;
264  static const cms_uint64_t BxNrMask;
266 
267  static const cms_uint32_t BstFlagMask;
268 
269  // shifts could be computed from masks...
270  static const int BoardIdShift;
271  static const int RecordLength1Shift;
272  static const int RecordLengthShift;
273  static const int BxNrShift;
274  static const int SetupVersionShift;
275 
276  //
277  static const int ActiveBoardsWord;
278  static const int AltNrBxBoardWord;
279  static const int TotalTriggerNrWord;
280 
284 
285  static const int ActiveBoardsShift;
286  static const int AltNrBxBoardShift;
287  static const int TotalTriggerNrShift;
288 
289 
290 private:
291 
294 
297 
300 
304 
307 
313 
316 
317 };
318 
319 #endif /*L1GlobalTrigger_L1GtfeWord_h*/
short cms_int16_t
Definition: typedefs.h:12
bool operator==(const L1GtfeWord &) const
equal operator
Definition: L1GtfeWord.cc:62
bool operator!=(const L1GtfeWord &) const
unequal operator
Definition: L1GtfeWord.cc:103
const unsigned int getSize() const
get the size of the GTFE block in GT DAQ record (in multiple of 8 bits)
Definition: L1GtfeWord.h:229
void setRecordLength1Word64(cms_uint64_t &word64, int iWord)
Definition: L1GtfeWord.cc:138
void setBxNr(cms_uint16_t bxNrValue)
Definition: L1GtfeWord.h:127
static const cms_uint64_t TotalTriggerNrMask
Definition: L1GtfeWord.h:283
static const cms_uint64_t BoardIdMask
Definition: L1GtfeWord.h:261
virtual void print(std::ostream &myCout) const
pretty print the content of a L1GtfeWord
Definition: L1GtfeWord.cc:321
static const int RecordLength1Shift
Definition: L1GtfeWord.h:271
static const int ActiveBoardsWord
Definition: L1GtfeWord.h:277
static const int UnitLength
one unit in the word is UnitLength bits
static const int BlockSize
Definition: L1GtfeWord.h:253
void setActiveBoardsWord64(cms_uint64_t &word64, int iWord)
Definition: L1GtfeWord.cc:231
void setRecordLength(cms_uint16_t recordLengthValue)
Definition: L1GtfeWord.h:109
static const cms_uint64_t SetupVersionMask
Definition: L1GtfeWord.h:265
cms_uint16_t m_recordLength
record length for alternative 0
Definition: L1GtfeWord.h:299
void setSetupVersionWord64(cms_uint64_t &word64, int iWord)
Definition: L1GtfeWord.cc:194
const cms_uint16_t altNrBxBoard() const
get/set alternative for number of BX per board
Definition: L1GtfeWord.h:187
cms_uint16_t m_boardId
board identifier
Definition: L1GtfeWord.h:293
const cms_uint16_t recordLength() const
get/set record length for alternative 0
Definition: L1GtfeWord.h:104
void setAltNrBxBoard(cms_uint16_t altNrBxBoardValue)
Definition: L1GtfeWord.h:192
L1GtfeWord()
constructors
Definition: L1GtfeWord.cc:29
void setTotalTriggerNr(cms_uint32_t totalTriggerNrValue)
Definition: L1GtfeWord.h:216
virtual void reset()
reset the content of a L1GtfeWord
Definition: L1GtfeWord.cc:306
static const cms_uint64_t RecordLength1Mask
Definition: L1GtfeWord.h:262
static const cms_uint64_t RecordLengthMask
Definition: L1GtfeWord.h:263
static const int TotalTriggerNrWord
Definition: L1GtfeWord.h:279
static const cms_uint64_t AltNrBxBoardMask
Definition: L1GtfeWord.h:282
static const int SetupVersionWord
Definition: L1GtfeWord.h:259
const cms_uint32_t totalTriggerNr() const
get/set total number of L1A sent since start of run
Definition: L1GtfeWord.h:211
unsigned short cms_uint16_t
Definition: typedefs.h:13
static const int SetupVersionShift
Definition: L1GtfeWord.h:274
void setRecordLength1(cms_uint16_t recordLengthValue)
Definition: L1GtfeWord.h:90
void setBoardIdWord64(cms_uint64_t &word64, int iWord)
Definition: L1GtfeWord.cc:120
static const int RecordLengthShift
Definition: L1GtfeWord.h:272
const cms_uint16_t activeBoards() const
get/set boards contributing to EVM respectively DAQ record
Definition: L1GtfeWord.h:163
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:306
const cms_uint16_t bxNr() const
get/set bunch cross number as counted in the GTFE board
Definition: L1GtfeWord.h:122
void setBoardId(cms_uint16_t boardIdValue)
set BoardId from a BoardId value
Definition: L1GtfeWord.h:71
static const int TotalTriggerNrShift
Definition: L1GtfeWord.h:287
const cms_uint16_t boardId() const
get/set board ID
Definition: L1GtfeWord.h:65
static const int RecordLength1Word
Definition: L1GtfeWord.h:256
static const int ActiveBoardsShift
Definition: L1GtfeWord.h:285
void setAltNrBxBoardWord64(cms_uint64_t &word64, int iWord)
Definition: L1GtfeWord.cc:263
void setActiveBoards(cms_uint16_t activeBoardsValue)
Definition: L1GtfeWord.h:168
const int bstFlag() const
get / set BST flag: 0 or 1 - via setup version (no private member)
Definition: L1GtfeWord.cc:206
static const cms_uint64_t ActiveBoardsMask
Definition: L1GtfeWord.h:281
cms_uint16_t m_bxNr
bunch cross number as counted in the GTFE board
Definition: L1GtfeWord.h:302
static const cms_uint64_t BxNrMask
Definition: L1GtfeWord.h:264
static const int RecordLengthWord
Definition: L1GtfeWord.h:257
static const int BxNrShift
Definition: L1GtfeWord.h:273
cms_uint16_t m_altNrBxBoard
Definition: L1GtfeWord.h:312
void setBxNrWord64(cms_uint64_t &word64, int iWord)
Definition: L1GtfeWord.cc:176
const cms_uint32_t setupVersion() const
get/set setup version
Definition: L1GtfeWord.h:140
static const int BoardIdWord
Definition: L1GtfeWord.h:255
unsigned long long cms_uint64_t
Definition: typedefs.h:17
void setTotalTriggerNrWord64(cms_uint64_t &word64, int iWord)
Definition: L1GtfeWord.cc:293
static const int AltNrBxBoardShift
Definition: L1GtfeWord.h:286
const cms_uint16_t recordLength1() const
get/set record length for alternative 1
Definition: L1GtfeWord.h:85
cms_uint32_t m_totalTriggerNr
total number of L1A sent since start of run
Definition: L1GtfeWord.h:315
cms_uint32_t m_setupVersion
Definition: L1GtfeWord.h:303
void setSetupVersion(cms_uint32_t setupVersionValue)
Definition: L1GtfeWord.h:145
static const int BxNrWord
Definition: L1GtfeWord.h:258
static const int BoardIdShift
Definition: L1GtfeWord.h:270
void setBstFlag(const int)
Definition: L1GtfeWord.cc:215
static const int AltNrBxBoardWord
Definition: L1GtfeWord.h:278
cms_uint16_t m_recordLength1
record length for alternative 1
Definition: L1GtfeWord.h:296
virtual void unpack(const unsigned char *gtfePtr)
Definition: L1GtfeWord.cc:380
void setRecordLengthWord64(cms_uint64_t &word64, int iWord)
Definition: L1GtfeWord.cc:157
static const cms_uint32_t BstFlagMask
Definition: L1GtfeWord.h:267
virtual ~L1GtfeWord()
destructor
Definition: L1GtfeWord.cc:54