CMS 3D CMS Logo

L1TcsWord.h
Go to the documentation of this file.
1 #ifndef L1GlobalTrigger_L1TcsWord_h
2 #define L1GlobalTrigger_L1TcsWord_h
3 
18 // system include files
19 #include <iosfwd>
20 
21 // user include files
25 
26 // forward declarations
27 
28 // class declaration
29 class L1TcsWord {
30 public:
32  L1TcsWord(); // empty constructor, all members set to zero;
33 
35  L1TcsWord(cms_uint16_t boardIdValue,
36  cms_uint16_t bxNrValue,
37  cms_uint16_t daqNrValue,
38  cms_uint16_t triggerTypeValue,
39  cms_uint16_t statusValue,
40  cms_uint16_t luminositySegmentNrValue,
41  cms_uint32_t partRunNrValue,
42  cms_uint32_t assignedPartitionsValue,
43  cms_uint32_t partTrigNrValue,
44  cms_uint32_t eventNrValue,
45  cms_uint64_t orbitNrValue);
46 
48  virtual ~L1TcsWord();
49 
51  bool operator==(const L1TcsWord&) const;
52 
54  bool operator!=(const L1TcsWord&) const;
55 
56 public:
58 
60  inline const cms_uint16_t boardId() const { return m_boardId; }
61 
63  void setBoardId(const cms_uint16_t boardIdValue) { m_boardId = boardIdValue; }
64 
66  void setBoardId(const cms_uint64_t& word64);
67 
70  void setBoardIdWord64(cms_uint64_t& word64, int iWord);
71 
73  inline const cms_uint16_t bxNr() const { return m_bxNr; }
74 
75  void setBxNr(const cms_uint16_t bxNrValue) { m_bxNr = bxNrValue; }
76 
78  void setBxNr(const cms_uint64_t& word64);
79 
82  void setBxNrWord64(cms_uint64_t& word64, int iWord);
83 
85  inline const cms_uint16_t daqNr() const { return m_daqNr; }
86 
87  void setDaqNr(const cms_uint16_t daqNrValue) { m_daqNr = daqNrValue; }
88 
90  void setDaqNr(const cms_uint64_t& word64);
91 
94  void setDaqNrWord64(cms_uint64_t& word64, int iWord);
95 
97  inline const cms_uint16_t triggerType() const { return m_triggerType; }
98 
99  void setTriggerType(const cms_uint16_t triggerTypeValue) { m_triggerType = triggerTypeValue; }
100 
102  void setTriggerType(const cms_uint64_t& word64);
103 
106  void setTriggerTypeWord64(cms_uint64_t& word64, int iWord);
107 
109  inline const cms_uint16_t status() const { return m_status; }
110 
111  void setStatus(const cms_uint16_t statusValue) { m_status = statusValue; }
112 
114  void setStatus(const cms_uint64_t& word64);
115 
118  void setStatusWord64(cms_uint64_t& word64, int iWord);
119 
121  inline const cms_uint16_t luminositySegmentNr() const { return m_luminositySegmentNr; }
122 
123  void setLuminositySegmentNr(const cms_uint16_t luminositySegmentNrValue) {
124  m_luminositySegmentNr = luminositySegmentNrValue;
125  }
126 
128  void setLuminositySegmentNr(const cms_uint64_t& word64);
129 
132  void setLuminositySegmentNrWord64(cms_uint64_t& word64, int iWord);
133 
135  inline const cms_uint32_t partRunNr() const { return m_partRunNr; }
136 
137  void setPartRunNr(const cms_uint32_t partRunNrValue) { m_partRunNr = partRunNrValue; }
138 
140  void setPartRunNr(const cms_uint64_t& word64);
141 
144  void setPartRunNrWord64(cms_uint64_t& word64, int iWord);
145 
147  inline const cms_uint32_t assignedPartitions() const { return m_assignedPartitions; }
148 
149  void setAssignedPartitions(const cms_uint32_t assignedPartitionsValue) {
150  m_assignedPartitions = assignedPartitionsValue;
151  }
152 
154  void setAssignedPartitions(const cms_uint64_t& word64);
155 
158  void setAssignedPartitionsWord64(cms_uint64_t& word64, int iWord);
159 
161  inline const cms_uint32_t partTrigNr() const { return m_partTrigNr; }
162 
163  void setPartTrigNr(const cms_uint32_t partTrigNrValue) { m_partTrigNr = partTrigNrValue; }
164 
166  void setPartTrigNr(const cms_uint64_t& word64);
167 
170  void setPartTrigNrWord64(cms_uint64_t& word64, int iWord);
171 
173  inline const cms_uint32_t eventNr() const { return m_eventNr; }
174 
175  void setEventNr(const cms_uint32_t eventNrValue) { m_eventNr = eventNrValue; }
176 
178  void setEventNr(const cms_uint64_t& word64);
179 
182  void setEventNrWord64(cms_uint64_t& word64, int iWord);
183 
185  inline const cms_uint64_t orbitNr() const { return m_orbitNr; }
186 
187  void setOrbitNr(const cms_uint64_t orbitNrValue) { m_orbitNr = orbitNrValue; }
188 
190  void setOrbitNrFrom(const cms_uint64_t& word64);
191 
194  void setOrbitNrWord64(cms_uint64_t& word64, int iWord);
195 
197  inline const unsigned int getSize() const {
198  int unitLengthBits = L1GlobalTriggerReadoutSetup::UnitLength;
199 
200  return BlockSize * unitLengthBits;
201  }
202 
203 public:
205  void reset();
206 
208  void print(std::ostream& myCout) const;
209 
212  void unpack(const unsigned char* tcsPtr);
213 
214 private:
215  // block description in the raw GT record
216 
217  // block size in 64bits words (BlockSize * 64 bits)
218  static const int BlockSize;
219 
220  // word 0
221 
222  // index of the word in the TCS block containig the variable
223  static const int BoardIdWord;
224  static const int BxNrWord;
225  static const int DaqNrWord;
226  static const int TriggerTypeWord;
227  static const int StatusWord;
228  static const int LuminositySegmentNrWord;
229 
230  // mask to get the 64-bit-value from the corresponding word in the TCS block
231  static const cms_uint64_t BoardIdMask;
232  static const cms_uint64_t BxNrMask;
233  static const cms_uint64_t DaqNrMask;
235  static const cms_uint64_t StatusMask;
237 
238  // shift to the right to get the value from the "64-bit-value"
239  static const int BoardIdShift;
240  static const int BxNrShift;
241  static const int DaqNrShift;
242  static const int TriggerTypeShift;
243  static const int StatusShift;
244  static const int LuminositySegmentNrShift;
245 
246  // word 1
247 
248  static const int PartRunNrWord;
249  static const int AssignedPartitionsWord;
250 
253 
254  static const int PartRunNrShift;
255  static const int AssignedPartitionsShift;
256 
257  // word 2
258 
259  static const int PartTrigNrWord;
260  static const int EventNrWord;
261 
263  static const cms_uint64_t EventNrMask;
264 
265  static const int PartTrigNrShift;
266  static const int EventNrShift;
267 
268  // word 3
269 
270  static const int OrbitNrWord;
271 
272  static const cms_uint64_t OrbitNrMask;
273 
274  static const int OrbitNrShift;
275 
276  // word 4
277 
278  // empty
279 
280 private:
283 
286 
289 
292 
295 
298 
299  //
300 
303 
308 
309  //
310 
314 
317 
318  //
319 
322 
323  //
324  // empty word
325 };
326 
327 #endif /*L1GlobalTrigger_L1TcsWord_h*/
cms_uint16_t m_triggerType
trigger type, identical with event type in CMS header (event type)
Definition: L1TcsWord.h:291
L1TcsWord()
constructors
Definition: L1TcsWord.cc:30
static const int OrbitNrWord
Definition: L1TcsWord.h:270
cms_uint32_t m_partRunNr
partition run number
Definition: L1TcsWord.h:302
void setBoardIdWord64(cms_uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:134
static const int PartRunNrShift
Definition: L1TcsWord.h:254
const cms_uint32_t assignedPartitions() const
get/set assigned partition: bit "i" correspond to detector partition "i"
Definition: L1TcsWord.h:147
void setBxNrWord64(cms_uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:145
const cms_uint64_t orbitNr() const
get/set orbit number since start of run
Definition: L1TcsWord.h:185
void reset()
reset the content of a L1TcsWord
Definition: L1TcsWord.cc:259
void setBxNr(const cms_uint16_t bxNrValue)
Definition: L1TcsWord.h:75
static const int UnitLength
one unit in the word is UnitLength bits
static const int OrbitNrShift
Definition: L1TcsWord.h:274
const cms_uint16_t status() const
get/set status: 0000 = normal rate; 1000 = low rate = warning
Definition: L1TcsWord.h:109
cms_uint32_t m_partTrigNr
Definition: L1TcsWord.h:313
void setAssignedPartitions(const cms_uint32_t assignedPartitionsValue)
Definition: L1TcsWord.h:149
cms_uint16_t m_bxNr
bunch cross number as counted in the TCS chip
Definition: L1TcsWord.h:285
static const int BxNrShift
Definition: L1TcsWord.h:240
void setOrbitNrFrom(const cms_uint64_t &word64)
set the OrbitNr value from a 64-bits word
Definition: L1TcsWord.cc:248
const cms_uint16_t luminositySegmentNr() const
get/set luminosity segment number
Definition: L1TcsWord.h:121
static const cms_uint64_t OrbitNrMask
Definition: L1TcsWord.h:272
static const cms_uint64_t LuminositySegmentNrMask
Definition: L1TcsWord.h:236
cms_uint16_t m_daqNr
number of DAQ partition to which the L1A has been sent
Definition: L1TcsWord.h:288
void setLuminositySegmentNr(const cms_uint16_t luminositySegmentNrValue)
Definition: L1TcsWord.h:123
void setAssignedPartitionsWord64(cms_uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:217
static const cms_uint64_t BxNrMask
Definition: L1TcsWord.h:232
void setOrbitNrWord64(cms_uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:252
static const cms_uint64_t PartTrigNrMask
Definition: L1TcsWord.h:262
static const int EventNrWord
Definition: L1TcsWord.h:260
const cms_uint16_t bxNr() const
get/set bunch cross number as counted in the TCS chip
Definition: L1TcsWord.h:73
void setStatus(const cms_uint16_t statusValue)
Definition: L1TcsWord.h:111
void setTriggerTypeWord64(cms_uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:169
static const int PartRunNrWord
Definition: L1TcsWord.h:248
void setPartRunNr(const cms_uint32_t partRunNrValue)
Definition: L1TcsWord.h:137
static const cms_uint64_t StatusMask
Definition: L1TcsWord.h:235
const cms_uint32_t eventNr() const
get/set event number since last L1 reset generated in TCS chip
Definition: L1TcsWord.h:173
static const int LuminositySegmentNrWord
Definition: L1TcsWord.h:228
void setPartTrigNr(const cms_uint32_t partTrigNrValue)
Definition: L1TcsWord.h:163
static const int DaqNrShift
Definition: L1TcsWord.h:241
cms_uint32_t m_eventNr
event number since last L1 reset generated in TCS chip
Definition: L1TcsWord.h:316
cms_uint16_t m_boardId
board identifier
Definition: L1TcsWord.h:282
static const cms_uint64_t DaqNrMask
Definition: L1TcsWord.h:233
static const int PartTrigNrWord
Definition: L1TcsWord.h:259
unsigned short cms_uint16_t
Definition: typedefs.h:13
static const cms_uint64_t BoardIdMask
Definition: L1TcsWord.h:231
static const int BxNrWord
Definition: L1TcsWord.h:224
const unsigned int getSize() const
get the size of the TCS block in GT EVM record (in multiple of 8 bits)
Definition: L1TcsWord.h:197
static const cms_uint64_t EventNrMask
Definition: L1TcsWord.h:263
cms_uint64_t m_orbitNr
orbit number since start of run (48 bits, in fact)
Definition: L1TcsWord.h:321
static const int LuminositySegmentNrShift
Definition: L1TcsWord.h:244
static const int PartTrigNrShift
Definition: L1TcsWord.h:265
void setLuminositySegmentNrWord64(cms_uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:193
const cms_uint16_t daqNr() const
get/set number of DAQ partition to which the L1A has been sent
Definition: L1TcsWord.h:85
const cms_uint32_t partRunNr() const
get/set partition run number
Definition: L1TcsWord.h:135
cms_uint16_t m_luminositySegmentNr
luminosity segment number
Definition: L1TcsWord.h:297
unsigned int cms_uint32_t
Definition: typedefs.h:15
bool operator!=(const L1TcsWord &) const
unequal operator
Definition: L1TcsWord.cc:125
static const int StatusWord
Definition: L1TcsWord.h:227
static const int AssignedPartitionsWord
Definition: L1TcsWord.h:249
static const int BoardIdShift
Definition: L1TcsWord.h:239
void setBoardId(const cms_uint16_t boardIdValue)
set BoardId from a BoardId value
Definition: L1TcsWord.h:63
static const int BoardIdWord
Definition: L1TcsWord.h:223
void print(std::ostream &myCout) const
pretty print the content of a L1TcsWord
Definition: L1TcsWord.cc:274
static const int DaqNrWord
Definition: L1TcsWord.h:225
static const cms_uint64_t PartRunNrMask
Definition: L1TcsWord.h:251
cms_uint16_t m_status
0000 = normal rate; 1000 = low rate = warning
Definition: L1TcsWord.h:294
static const int StatusShift
Definition: L1TcsWord.h:243
static const cms_uint64_t TriggerTypeMask
Definition: L1TcsWord.h:234
const cms_uint32_t partTrigNr() const
get/set total number of L1A sent since start of the run to this DAQ partition
Definition: L1TcsWord.h:161
bool operator==(const L1TcsWord &) const
equal operator
Definition: L1TcsWord.cc:75
static const int BlockSize
Definition: L1TcsWord.h:218
void setEventNrWord64(cms_uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:241
void unpack(const unsigned char *tcsPtr)
Definition: L1TcsWord.cc:339
void setPartRunNrWord64(cms_uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:204
static const int EventNrShift
Definition: L1TcsWord.h:266
static const int TriggerTypeShift
Definition: L1TcsWord.h:242
cms_uint32_t m_assignedPartitions
Definition: L1TcsWord.h:307
void setPartTrigNrWord64(cms_uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:230
void setTriggerType(const cms_uint16_t triggerTypeValue)
Definition: L1TcsWord.h:99
const cms_uint16_t boardId() const
get/set board ID
Definition: L1TcsWord.h:60
unsigned long long cms_uint64_t
Definition: typedefs.h:17
void setEventNr(const cms_uint32_t eventNrValue)
Definition: L1TcsWord.h:175
void setDaqNrWord64(cms_uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:156
static const int TriggerTypeWord
Definition: L1TcsWord.h:226
void setDaqNr(const cms_uint16_t daqNrValue)
Definition: L1TcsWord.h:87
const cms_uint16_t triggerType() const
get/set trigger type, identical with event type in CMS header
Definition: L1TcsWord.h:97
void setOrbitNr(const cms_uint64_t orbitNrValue)
Definition: L1TcsWord.h:187
static const cms_uint64_t AssignedPartitionsMask
Definition: L1TcsWord.h:252
static const int AssignedPartitionsShift
Definition: L1TcsWord.h:255
virtual ~L1TcsWord()
destructor
Definition: L1TcsWord.cc:70
void setStatusWord64(cms_uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:180