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*/
short cms_int16_t
Definition: typedefs.h:12
bool operator==(const L1GtfeWord &) const
equal operator
Definition: L1GtfeWord.cc:69
bool operator!=(const L1GtfeWord &) const
unequal operator
Definition: L1GtfeWord.cc:107
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
void setRecordLength1Word64(cms_uint64_t &word64, int iWord)
Definition: L1GtfeWord.cc:129
void setBxNr(cms_uint16_t bxNrValue)
Definition: L1GtfeWord.h:95
static const cms_uint64_t TotalTriggerNrMask
Definition: L1GtfeWord.h:211
static const cms_uint64_t BoardIdMask
Definition: L1GtfeWord.h:189
virtual void print(std::ostream &myCout) const
pretty print the content of a L1GtfeWord
Definition: L1GtfeWord.cc:253
static const int RecordLength1Shift
Definition: L1GtfeWord.h:199
static const int ActiveBoardsWord
Definition: L1GtfeWord.h:205
static const int UnitLength
one unit in the word is UnitLength bits
static const int BlockSize
Definition: L1GtfeWord.h:181
void setActiveBoardsWord64(cms_uint64_t &word64, int iWord)
Definition: L1GtfeWord.cc:191
void setRecordLength(cms_uint16_t recordLengthValue)
Definition: L1GtfeWord.h:84
static const cms_uint64_t SetupVersionMask
Definition: L1GtfeWord.h:193
cms_uint16_t m_recordLength
record length for alternative 0
Definition: L1GtfeWord.h:225
void setSetupVersionWord64(cms_uint64_t &word64, int iWord)
Definition: L1GtfeWord.cc:166
const cms_uint16_t altNrBxBoard() const
get/set alternative for number of BX per board
Definition: L1GtfeWord.h:134
cms_uint16_t m_boardId
board identifier
Definition: L1GtfeWord.h:219
const cms_uint16_t recordLength() const
get/set record length for alternative 0
Definition: L1GtfeWord.h:82
void setAltNrBxBoard(cms_uint16_t altNrBxBoardValue)
Definition: L1GtfeWord.h:136
L1GtfeWord()
constructors
Definition: L1GtfeWord.cc:29
void setTotalTriggerNr(cms_uint32_t totalTriggerNrValue)
Definition: L1GtfeWord.h:151
virtual void reset()
reset the content of a L1GtfeWord
Definition: L1GtfeWord.cc:240
static const cms_uint64_t RecordLength1Mask
Definition: L1GtfeWord.h:190
static const cms_uint64_t RecordLengthMask
Definition: L1GtfeWord.h:191
static const int TotalTriggerNrWord
Definition: L1GtfeWord.h:207
static const cms_uint64_t AltNrBxBoardMask
Definition: L1GtfeWord.h:210
static const int SetupVersionWord
Definition: L1GtfeWord.h:187
const cms_uint32_t totalTriggerNr() const
get/set total number of L1A sent since start of run
Definition: L1GtfeWord.h:149
unsigned short cms_uint16_t
Definition: typedefs.h:13
static const int SetupVersionShift
Definition: L1GtfeWord.h:202
void setRecordLength1(cms_uint16_t recordLengthValue)
Definition: L1GtfeWord.h:73
void setBoardIdWord64(cms_uint64_t &word64, int iWord)
Definition: L1GtfeWord.cc:116
static const int RecordLengthShift
Definition: L1GtfeWord.h:200
const cms_uint16_t activeBoards() const
get/set boards contributing to EVM respectively DAQ record
Definition: L1GtfeWord.h:119
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:232
const cms_uint16_t bxNr() const
get/set bunch cross number as counted in the GTFE board
Definition: L1GtfeWord.h:93
void setBoardId(cms_uint16_t boardIdValue)
set BoardId from a BoardId value
Definition: L1GtfeWord.h:61
static const int TotalTriggerNrShift
Definition: L1GtfeWord.h:215
const cms_uint16_t boardId() const
get/set board ID
Definition: L1GtfeWord.h:58
static const int RecordLength1Word
Definition: L1GtfeWord.h:184
static const int ActiveBoardsShift
Definition: L1GtfeWord.h:213
void setAltNrBxBoardWord64(cms_uint64_t &word64, int iWord)
Definition: L1GtfeWord.cc:212
void setActiveBoards(cms_uint16_t activeBoardsValue)
Definition: L1GtfeWord.h:121
const int bstFlag() const
get / set BST flag: 0 or 1 - via setup version (no private member)
Definition: L1GtfeWord.cc:173
static const cms_uint64_t ActiveBoardsMask
Definition: L1GtfeWord.h:209
cms_uint16_t m_bxNr
bunch cross number as counted in the GTFE board
Definition: L1GtfeWord.h:228
static const cms_uint64_t BxNrMask
Definition: L1GtfeWord.h:192
static const int RecordLengthWord
Definition: L1GtfeWord.h:185
static const int BxNrShift
Definition: L1GtfeWord.h:201
cms_uint16_t m_altNrBxBoard
Definition: L1GtfeWord.h:238
void setBxNrWord64(cms_uint64_t &word64, int iWord)
Definition: L1GtfeWord.cc:153
const cms_uint32_t setupVersion() const
get/set setup version
Definition: L1GtfeWord.h:104
static const int BoardIdWord
Definition: L1GtfeWord.h:183
unsigned long long cms_uint64_t
Definition: typedefs.h:17
void setTotalTriggerNrWord64(cms_uint64_t &word64, int iWord)
Definition: L1GtfeWord.cc:233
static const int AltNrBxBoardShift
Definition: L1GtfeWord.h:214
const cms_uint16_t recordLength1() const
get/set record length for alternative 1
Definition: L1GtfeWord.h:71
cms_uint32_t m_totalTriggerNr
total number of L1A sent since start of run
Definition: L1GtfeWord.h:241
cms_uint32_t m_setupVersion
Definition: L1GtfeWord.h:229
void setSetupVersion(cms_uint32_t setupVersionValue)
Definition: L1GtfeWord.h:106
static const int BxNrWord
Definition: L1GtfeWord.h:186
static const int BoardIdShift
Definition: L1GtfeWord.h:198
void setBstFlag(const int)
Definition: L1GtfeWord.cc:180
static const int AltNrBxBoardWord
Definition: L1GtfeWord.h:206
cms_uint16_t m_recordLength1
record length for alternative 1
Definition: L1GtfeWord.h:222
virtual void unpack(const unsigned char *gtfePtr)
Definition: L1GtfeWord.cc:290
void setRecordLengthWord64(cms_uint64_t &word64, int iWord)
Definition: L1GtfeWord.cc:142
static const cms_uint32_t BstFlagMask
Definition: L1GtfeWord.h:195
virtual ~L1GtfeWord()
destructor
Definition: L1GtfeWord.cc:64