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 <boost/cstdint.hpp>
22 #include <iosfwd>
23 
24 // 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  boost::uint16_t boardIdValue,
43  boost::uint16_t recordLength1Value,
44  boost::uint16_t recordLengthValue,
45  boost::uint16_t bxNrValue,
46  boost::uint32_t setupVersionValue,
47  boost::uint16_t activeBoardsValue,
48  boost::uint16_t altNrBxBoardValue,
49  boost::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 boost::uint16_t boardId() const
68  {
69  return m_boardId;
70  }
71 
73  void setBoardId(boost::uint16_t boardIdValue)
74  {
75  m_boardId = boardIdValue;
76  }
77 
79  void setBoardId(const boost::uint64_t& word64);
80 
83  void setBoardIdWord64(boost::uint64_t& word64, int iWord);
84 
85 
87  inline const boost::uint16_t recordLength1() const
88  {
89  return m_recordLength1;
90  }
91 
92  void setRecordLength1(boost::uint16_t recordLengthValue)
93  {
94  m_recordLength1 = recordLengthValue;
95  }
96 
97  void setRecordLength1(const boost::uint64_t& word64);
98 
101  void setRecordLength1Word64(boost::uint64_t& word64, int iWord);
102 
103 
104 
106  inline const boost::uint16_t recordLength() const
107  {
108  return m_recordLength;
109  }
110 
111  void setRecordLength(boost::uint16_t recordLengthValue)
112  {
113  m_recordLength = recordLengthValue;
114  }
115 
116  void setRecordLength(const boost::uint64_t& word64);
117 
120  void setRecordLengthWord64(boost::uint64_t& word64, int iWord);
121 
122 
124  inline const boost::uint16_t bxNr() const
125  {
126  return m_bxNr;
127  }
128 
129  void setBxNr(boost::uint16_t bxNrValue)
130  {
131  m_bxNr = bxNrValue;
132  }
133 
134  void setBxNr(const boost::uint64_t& word64);
135 
138  void setBxNrWord64(boost::uint64_t& word64, int iWord);
139 
140 
142  inline const boost::uint32_t setupVersion() const
143  {
144  return m_setupVersion;
145  }
146 
147  void setSetupVersion(boost::uint32_t setupVersionValue)
148  {
149  m_setupVersion = setupVersionValue;
150  }
151 
152  void setSetupVersion(const boost::uint64_t& word64);
153 
156  void setSetupVersionWord64(boost::uint64_t& word64, int iWord);
157 
158 
160  const int bstFlag() const;
161  void setBstFlag(const int);
162 
163 
165  inline const boost::uint16_t activeBoards() const
166  {
167  return m_activeBoards;
168  }
169 
170  void setActiveBoards(boost::uint16_t activeBoardsValue)
171  {
172  m_activeBoards = activeBoardsValue;
173  }
174 
175  void setActiveBoards(const boost::uint64_t& word64);
176 
179  void setActiveBoardsWord64(boost::uint64_t& word64, int iWord);
180 
183  void setActiveBoardsWord64(boost::uint64_t& word64, int iWord,
184  boost::int16_t activeBoardsValue);
185 
186 
187 
189  inline const boost::uint16_t altNrBxBoard() const
190  {
191  return m_altNrBxBoard;
192  }
193 
194  void setAltNrBxBoard(boost::uint16_t altNrBxBoardValue)
195  {
196  m_altNrBxBoard = altNrBxBoardValue;
197  }
198 
199  void setAltNrBxBoard(const boost::uint64_t& word64);
200 
203  void setAltNrBxBoardWord64(boost::uint64_t& word64, int iWord);
204 
207  void setAltNrBxBoardWord64(boost::uint64_t& word64, int iWord,
208  boost::int16_t altNrBxBoardValue);
209 
210 
211 
213  inline const boost::uint32_t totalTriggerNr() const
214  {
215  return m_totalTriggerNr;
216  }
217 
218  void setTotalTriggerNr(boost::uint32_t totalTriggerNrValue)
219  {
220  m_totalTriggerNr = totalTriggerNrValue;
221  }
222 
223  void setTotalTriggerNr(const boost::uint64_t& word64);
224 
227  void setTotalTriggerNrWord64(boost::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 
266  static const boost::uint64_t BxNrMask;
268 
269  static const boost::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 
295  boost::uint16_t m_boardId;
296 
298  boost::uint16_t m_recordLength1;
299 
301  boost::uint16_t m_recordLength;
302 
304  boost::uint16_t m_bxNr;
305  boost::uint32_t m_setupVersion;
306 
308  boost::uint16_t m_activeBoards;
309 
314  boost::uint16_t m_altNrBxBoard;
315 
317  boost::uint32_t m_totalTriggerNr;
318 
319 };
320 
321 #endif /*L1GlobalTrigger_L1GtfeWord_h*/
bool operator==(const L1GtfeWord &) const
equal operator
Definition: L1GtfeWord.cc:64
void setTotalTriggerNrWord64(boost::uint64_t &word64, int iWord)
Definition: L1GtfeWord.cc:295
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
static const boost::uint64_t SetupVersionMask
Definition: L1GtfeWord.h:267
void setBoardIdWord64(boost::uint64_t &word64, int iWord)
Definition: L1GtfeWord.cc:122
virtual void print(std::ostream &myCout) const
pretty print the content of a L1GtfeWord
Definition: L1GtfeWord.cc:323
static const boost::uint64_t AltNrBxBoardMask
Definition: L1GtfeWord.h:284
static const boost::uint64_t TotalTriggerNrMask
Definition: L1GtfeWord.h:285
void setAltNrBxBoardWord64(boost::uint64_t &word64, int iWord)
Definition: L1GtfeWord.cc:265
static const int RecordLength1Shift
Definition: L1GtfeWord.h:273
const boost::uint16_t recordLength() const
get/set record length for alternative 0
Definition: L1GtfeWord.h:106
static const int ActiveBoardsWord
Definition: L1GtfeWord.h:279
static const int UnitLength
one unit in the word is UnitLength bits
boost::uint16_t m_activeBoards
active boards contributing to EVM respectively DAQ record
Definition: L1GtfeWord.h:308
static const int BlockSize
Definition: L1GtfeWord.h:255
boost::uint16_t m_boardId
board identifier
Definition: L1GtfeWord.h:295
const boost::uint16_t bxNr() const
get/set bunch cross number as counted in the GTFE board
Definition: L1GtfeWord.h:124
void setRecordLength1Word64(boost::uint64_t &word64, int iWord)
Definition: L1GtfeWord.cc:140
const boost::uint32_t totalTriggerNr() const
get/set total number of L1A sent since start of run
Definition: L1GtfeWord.h:213
const boost::uint32_t setupVersion() const
get/set setup version
Definition: L1GtfeWord.h:142
static const boost::uint64_t BxNrMask
Definition: L1GtfeWord.h:266
void setSetupVersionWord64(boost::uint64_t &word64, int iWord)
Definition: L1GtfeWord.cc:196
void setRecordLength1(boost::uint16_t recordLengthValue)
Definition: L1GtfeWord.h:92
L1GtfeWord()
constructors
Definition: L1GtfeWord.cc:31
void setActiveBoards(boost::uint16_t activeBoardsValue)
Definition: L1GtfeWord.h:170
virtual void reset()
reset the content of a L1GtfeWord
Definition: L1GtfeWord.cc:308
static const int TotalTriggerNrWord
Definition: L1GtfeWord.h:281
static const boost::uint64_t BoardIdMask
Definition: L1GtfeWord.h:263
static const boost::uint32_t BstFlagMask
Definition: L1GtfeWord.h:269
static const int SetupVersionWord
Definition: L1GtfeWord.h:261
static const boost::uint64_t RecordLength1Mask
Definition: L1GtfeWord.h:264
boost::uint16_t m_altNrBxBoard
Definition: L1GtfeWord.h:314
const boost::uint16_t boardId() const
get/set board ID
Definition: L1GtfeWord.h:67
static const int SetupVersionShift
Definition: L1GtfeWord.h:276
void setAltNrBxBoard(boost::uint16_t altNrBxBoardValue)
Definition: L1GtfeWord.h:194
void setRecordLengthWord64(boost::uint64_t &word64, int iWord)
Definition: L1GtfeWord.cc:159
void setBxNr(boost::uint16_t bxNrValue)
Definition: L1GtfeWord.h:129
static const int RecordLengthShift
Definition: L1GtfeWord.h:274
const boost::uint16_t recordLength1() const
get/set record length for alternative 1
Definition: L1GtfeWord.h:87
void setBxNrWord64(boost::uint64_t &word64, int iWord)
Definition: L1GtfeWord.cc:178
boost::uint32_t m_totalTriggerNr
total number of L1A sent since start of run
Definition: L1GtfeWord.h:317
static const int TotalTriggerNrShift
Definition: L1GtfeWord.h:289
static const int RecordLength1Word
Definition: L1GtfeWord.h:258
void setBoardId(boost::uint16_t boardIdValue)
set BoardId from a BoardId value
Definition: L1GtfeWord.h:73
static const int ActiveBoardsShift
Definition: L1GtfeWord.h:287
unsigned long long uint64_t
Definition: Time.h:15
boost::uint16_t m_recordLength1
record length for alternative 1
Definition: L1GtfeWord.h:298
const int bstFlag() const
get / set BST flag: 0 or 1 - via setup version (no private member)
Definition: L1GtfeWord.cc:208
static const boost::uint64_t ActiveBoardsMask
Definition: L1GtfeWord.h:283
void setActiveBoardsWord64(boost::uint64_t &word64, int iWord)
Definition: L1GtfeWord.cc:233
static const int RecordLengthWord
Definition: L1GtfeWord.h:259
static const int BxNrShift
Definition: L1GtfeWord.h:275
boost::uint32_t m_setupVersion
Definition: L1GtfeWord.h:305
const boost::uint16_t activeBoards() const
get/set boards contributing to EVM respectively DAQ record
Definition: L1GtfeWord.h:165
void setTotalTriggerNr(boost::uint32_t totalTriggerNrValue)
Definition: L1GtfeWord.h:218
static const int BoardIdWord
Definition: L1GtfeWord.h:257
boost::uint16_t m_recordLength
record length for alternative 0
Definition: L1GtfeWord.h:301
static const int AltNrBxBoardShift
Definition: L1GtfeWord.h:288
void setRecordLength(boost::uint16_t recordLengthValue)
Definition: L1GtfeWord.h:111
boost::uint16_t m_bxNr
bunch cross number as counted in the GTFE board
Definition: L1GtfeWord.h:304
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
const boost::uint16_t altNrBxBoard() const
get/set alternative for number of BX per board
Definition: L1GtfeWord.h:189
virtual void unpack(const unsigned char *gtfePtr)
Definition: L1GtfeWord.cc:382
virtual ~L1GtfeWord()
destructor
Definition: L1GtfeWord.cc:56
void setSetupVersion(boost::uint32_t setupVersionValue)
Definition: L1GtfeWord.h:147
static const boost::uint64_t RecordLengthMask
Definition: L1GtfeWord.h:265