CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1TcsWord.h
Go to the documentation of this file.
1 #ifndef L1GlobalTrigger_L1TcsWord_h
2 #define L1GlobalTrigger_L1TcsWord_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 declaration
31 class L1TcsWord
32 {
33 
34 public:
35 
37  L1TcsWord(); // empty constructor, all members set to zero;
38 
40  L1TcsWord(
41  boost::uint16_t boardIdValue,
42  boost::uint16_t bxNrValue,
43  boost::uint16_t daqNrValue,
44  boost::uint16_t triggerTypeValue,
45  boost::uint16_t statusValue,
46  boost::uint16_t luminositySegmentNrValue,
47  boost::uint32_t partRunNrValue,
48  boost::uint32_t assignedPartitionsValue,
49  boost::uint32_t partTrigNrValue,
50  boost::uint32_t eventNrValue,
51  boost::uint64_t orbitNrValue );
52 
53 
55  virtual ~L1TcsWord();
56 
58  bool operator==(const L1TcsWord&) const;
59 
61  bool operator!=(const L1TcsWord&) const;
62 
63 public:
64 
66 
68  inline const boost::uint16_t boardId() const
69  {
70  return m_boardId;
71  }
72 
74  void setBoardId(const boost::uint16_t boardIdValue)
75  {
76  m_boardId = boardIdValue;
77  }
78 
80  void setBoardId(const boost::uint64_t& word64);
81 
84  void setBoardIdWord64(boost::uint64_t& word64, int iWord);
85 
86 
87 
89  inline const boost::uint16_t bxNr() const
90  {
91  return m_bxNr;
92  }
93 
94  void setBxNr(const boost::uint16_t bxNrValue)
95  {
96  m_bxNr = bxNrValue;
97  }
98 
100  void setBxNr(const boost::uint64_t& word64);
101 
104  void setBxNrWord64(boost::uint64_t& word64, int iWord);
105 
106 
107 
109  inline const boost::uint16_t daqNr() const
110  {
111  return m_daqNr;
112  }
113 
114  void setDaqNr(const boost::uint16_t daqNrValue)
115  {
116  m_daqNr = daqNrValue;
117  }
118 
120  void setDaqNr(const boost::uint64_t& word64);
121 
124  void setDaqNrWord64(boost::uint64_t& word64, int iWord);
125 
126 
127 
129  inline const boost::uint16_t triggerType() const
130  {
131  return m_triggerType;
132  }
133 
134  void setTriggerType(const boost::uint16_t triggerTypeValue)
135  {
136  m_triggerType = triggerTypeValue;
137  }
138 
140  void setTriggerType(const boost::uint64_t& word64);
141 
144  void setTriggerTypeWord64(boost::uint64_t& word64, int iWord);
145 
146 
147 
149  inline const boost::uint16_t status() const
150  {
151  return m_status;
152  }
153 
154  void setStatus(const boost::uint16_t statusValue)
155  {
156  m_status = statusValue;
157  }
158 
160  void setStatus(const boost::uint64_t& word64);
161 
164  void setStatusWord64(boost::uint64_t& word64, int iWord);
165 
166 
168  inline const boost::uint16_t luminositySegmentNr() const
169  {
170  return m_luminositySegmentNr;
171  }
172 
173  void setLuminositySegmentNr(const boost::uint16_t luminositySegmentNrValue)
174  {
175  m_luminositySegmentNr = luminositySegmentNrValue;
176  }
177 
179  void setLuminositySegmentNr(const boost::uint64_t& word64);
180 
183  void setLuminositySegmentNrWord64(boost::uint64_t& word64, int iWord);
184 
185 
186 
188  inline const boost::uint32_t partRunNr() const
189  {
190  return m_partRunNr;
191  }
192 
193  void setPartRunNr(const boost::uint32_t partRunNrValue)
194  {
195  m_partRunNr = partRunNrValue;
196  }
197 
199  void setPartRunNr(const boost::uint64_t& word64);
200 
203  void setPartRunNrWord64(boost::uint64_t& word64, int iWord);
204 
205 
206 
208  inline const boost::uint32_t assignedPartitions() const
209  {
210  return m_assignedPartitions;
211  }
212 
213  void setAssignedPartitions(const boost::uint32_t assignedPartitionsValue)
214  {
215  m_assignedPartitions = assignedPartitionsValue;
216  }
217 
219  void setAssignedPartitions(const boost::uint64_t& word64);
220 
223  void setAssignedPartitionsWord64(boost::uint64_t& word64, int iWord);
224 
225 
226 
228  inline const boost::uint32_t partTrigNr() const
229  {
230  return m_partTrigNr;
231  }
232 
233  void setPartTrigNr(const boost::uint32_t partTrigNrValue)
234  {
235  m_partTrigNr = partTrigNrValue;
236  }
237 
239  void setPartTrigNr(const boost::uint64_t& word64);
240 
243  void setPartTrigNrWord64(boost::uint64_t& word64, int iWord);
244 
245 
246 
248  inline const boost::uint32_t eventNr() const
249  {
250  return m_eventNr;
251  }
252 
253  void setEventNr(const boost::uint32_t eventNrValue)
254  {
255  m_eventNr = eventNrValue;
256  }
257 
259  void setEventNr(const boost::uint64_t& word64);
260 
263  void setEventNrWord64(boost::uint64_t& word64, int iWord);
264 
265 
266 
268  inline const boost::uint64_t orbitNr() const
269  {
270  return m_orbitNr;
271  }
272 
273  void setOrbitNr(const boost::uint64_t orbitNrValue)
274  {
275  m_orbitNr = orbitNrValue;
276  }
277 
279  void setOrbitNrFrom(const boost::uint64_t& word64);
280 
283  void setOrbitNrWord64(boost::uint64_t& word64, int iWord);
284 
285 
287  inline const unsigned int getSize() const
288  {
289  int unitLengthBits = L1GlobalTriggerReadoutSetup::UnitLength;
290 
291  return BlockSize*unitLengthBits;
292  }
293 
294 public:
295 
297  void reset();
298 
300  void print(std::ostream& myCout) const;
301 
304  void unpack(const unsigned char* tcsPtr);
305 
306 
307 
308 private:
309 
310  // block description in the raw GT record
311 
312  // block size in 64bits words (BlockSize * 64 bits)
313  static const int BlockSize;
314 
315  // word 0
316 
317  // index of the word in the TCS block containig the variable
318  static const int BoardIdWord;
319  static const int BxNrWord;
320  static const int DaqNrWord;
321  static const int TriggerTypeWord;
322  static const int StatusWord;
323  static const int LuminositySegmentNrWord;
324 
325  // mask to get the 64-bit-value from the corresponding word in the TCS block
327  static const boost::uint64_t BxNrMask;
332 
333  // shift to the right to get the value from the "64-bit-value"
334  static const int BoardIdShift;
335  static const int BxNrShift;
336  static const int DaqNrShift;
337  static const int TriggerTypeShift;
338  static const int StatusShift;
339  static const int LuminositySegmentNrShift;
340 
341  // word 1
342 
343  static const int PartRunNrWord;
344  static const int AssignedPartitionsWord;
345 
348 
349  static const int PartRunNrShift;
350  static const int AssignedPartitionsShift;
351 
352  // word 2
353 
354  static const int PartTrigNrWord;
355  static const int EventNrWord;
356 
359 
360  static const int PartTrigNrShift;
361  static const int EventNrShift;
362 
363  // word 3
364 
365  static const int OrbitNrWord;
366 
368 
369  static const int OrbitNrShift;
370 
371 
372  // word 4
373 
374  // empty
375 
376 
377 
378 private:
379 
381  boost::uint16_t m_boardId;
382 
384  boost::uint16_t m_bxNr;
385 
387  boost::uint16_t m_daqNr;
388 
390  boost::uint16_t m_triggerType;
391 
393  boost::uint16_t m_status;
394 
396  boost::uint16_t m_luminositySegmentNr;
397 
398  //
399 
401  boost::uint32_t m_partRunNr;
402 
406  boost::uint32_t m_assignedPartitions;
407 
408  //
409 
412  boost::uint32_t m_partTrigNr;
413 
415  boost::uint32_t m_eventNr;
416 
417  //
418 
421 
422  //
423  // empty word
424 
425 };
426 
427 #endif /*L1GlobalTrigger_L1TcsWord_h*/
const boost::uint32_t partTrigNr() const
get/set total number of L1A sent since start of the run to this DAQ partition
Definition: L1TcsWord.h:228
void setTriggerType(const boost::uint16_t triggerTypeValue)
Definition: L1TcsWord.h:134
L1TcsWord()
constructors
Definition: L1TcsWord.cc:32
static const int OrbitNrWord
Definition: L1TcsWord.h:365
void setBxNr(const boost::uint16_t bxNrValue)
Definition: L1TcsWord.h:94
void setTriggerTypeWord64(boost::uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:219
static const int PartRunNrShift
Definition: L1TcsWord.h:349
const boost::uint16_t daqNr() const
get/set number of DAQ partition to which the L1A has been sent
Definition: L1TcsWord.h:109
boost::uint16_t m_bxNr
bunch cross number as counted in the TCS chip
Definition: L1TcsWord.h:384
const boost::uint64_t orbitNr() const
get/set orbit number since start of run
Definition: L1TcsWord.h:268
boost::uint16_t m_triggerType
trigger type, identical with event type in CMS header (event type)
Definition: L1TcsWord.h:390
void setStatusWord64(boost::uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:240
void reset()
reset the content of a L1TcsWord
Definition: L1TcsWord.cc:385
void setLuminositySegmentNrWord64(boost::uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:262
static const int UnitLength
one unit in the word is UnitLength bits
static const boost::uint64_t PartRunNrMask
Definition: L1TcsWord.h:346
boost::uint32_t m_assignedPartitions
Definition: L1TcsWord.h:406
static const int OrbitNrShift
Definition: L1TcsWord.h:369
const boost::uint16_t status() const
get/set status: 0000 = normal rate; 1000 = low rate = warning
Definition: L1TcsWord.h:149
static const int BxNrShift
Definition: L1TcsWord.h:335
const boost::uint32_t assignedPartitions() const
get/set assigned partition: bit &quot;i&quot; correspond to detector partition &quot;i&quot;
Definition: L1TcsWord.h:208
void setDaqNrWord64(boost::uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:199
static const boost::uint64_t TriggerTypeMask
Definition: L1TcsWord.h:329
static const boost::uint64_t AssignedPartitionsMask
Definition: L1TcsWord.h:347
static const int EventNrWord
Definition: L1TcsWord.h:355
boost::uint16_t m_status
0000 = normal rate; 1000 = low rate = warning
Definition: L1TcsWord.h:393
void setStatus(const boost::uint16_t statusValue)
Definition: L1TcsWord.h:154
void setAssignedPartitions(const boost::uint32_t assignedPartitionsValue)
Definition: L1TcsWord.h:213
static const int PartRunNrWord
Definition: L1TcsWord.h:343
void print(std::ostream &myCout) const
pretty print the content of a L1TcsWord
Definition: L1TcsWord.cc:405
void setPartRunNrWord64(boost::uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:284
boost::uint32_t m_eventNr
event number since last L1 reset generated in TCS chip
Definition: L1TcsWord.h:415
const boost::uint16_t triggerType() const
get/set trigger type, identical with event type in CMS header
Definition: L1TcsWord.h:129
static const boost::uint64_t BxNrMask
Definition: L1TcsWord.h:327
boost::uint16_t m_daqNr
number of DAQ partition to which the L1A has been sent
Definition: L1TcsWord.h:387
static const int LuminositySegmentNrWord
Definition: L1TcsWord.h:323
static const boost::uint64_t EventNrMask
Definition: L1TcsWord.h:358
static const int DaqNrShift
Definition: L1TcsWord.h:336
void setBoardId(const boost::uint16_t boardIdValue)
set BoardId from a BoardId value
Definition: L1TcsWord.h:74
bool operator!=(const L1TcsWord &) const
unequal operator
Definition: L1TcsWord.cc:140
static const int PartTrigNrWord
Definition: L1TcsWord.h:354
static const int BxNrWord
Definition: L1TcsWord.h:319
static const int LuminositySegmentNrShift
Definition: L1TcsWord.h:339
static const int PartTrigNrShift
Definition: L1TcsWord.h:360
void setEventNr(const boost::uint32_t eventNrValue)
Definition: L1TcsWord.h:253
static const int StatusWord
Definition: L1TcsWord.h:322
const boost::uint16_t bxNr() const
get/set bunch cross number as counted in the TCS chip
Definition: L1TcsWord.h:89
static const int AssignedPartitionsWord
Definition: L1TcsWord.h:344
boost::uint64_t m_orbitNr
orbit number since start of run (48 bits, in fact)
Definition: L1TcsWord.h:420
static const int BoardIdShift
Definition: L1TcsWord.h:334
static const int BoardIdWord
Definition: L1TcsWord.h:318
boost::uint16_t m_luminositySegmentNr
luminosity segment number
Definition: L1TcsWord.h:396
void setPartRunNr(const boost::uint32_t partRunNrValue)
Definition: L1TcsWord.h:193
void setBoardIdWord64(boost::uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:158
static const int DaqNrWord
Definition: L1TcsWord.h:320
unsigned long long uint64_t
Definition: Time.h:15
static const boost::uint64_t PartTrigNrMask
Definition: L1TcsWord.h:357
static const int StatusShift
Definition: L1TcsWord.h:338
void setPartTrigNr(const boost::uint32_t partTrigNrValue)
Definition: L1TcsWord.h:233
const unsigned int getSize() const
get the size of the TCS block in GT EVM record (in multiple of 8 bits)
Definition: L1TcsWord.h:287
const boost::uint16_t luminositySegmentNr() const
get/set luminosity segment number
Definition: L1TcsWord.h:168
void setBxNrWord64(boost::uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:178
static const int BlockSize
Definition: L1TcsWord.h:313
const boost::uint16_t boardId() const
get/set board ID
Definition: L1TcsWord.h:68
void unpack(const unsigned char *tcsPtr)
Definition: L1TcsWord.cc:502
static const int EventNrShift
Definition: L1TcsWord.h:361
static const boost::uint64_t BoardIdMask
Definition: L1TcsWord.h:326
static const int TriggerTypeShift
Definition: L1TcsWord.h:337
static const boost::uint64_t OrbitNrMask
Definition: L1TcsWord.h:367
void setPartTrigNrWord64(boost::uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:330
void setOrbitNrWord64(boost::uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:374
static const boost::uint64_t DaqNrMask
Definition: L1TcsWord.h:328
boost::uint16_t m_boardId
board identifier
Definition: L1TcsWord.h:381
static const boost::uint64_t StatusMask
Definition: L1TcsWord.h:330
void setDaqNr(const boost::uint16_t daqNrValue)
Definition: L1TcsWord.h:114
boost::uint32_t m_partTrigNr
Definition: L1TcsWord.h:412
boost::uint32_t m_partRunNr
partition run number
Definition: L1TcsWord.h:401
void setOrbitNrFrom(const boost::uint64_t &word64)
set the OrbitNr value from a 64-bits word
Definition: L1TcsWord.cc:365
const boost::uint32_t eventNr() const
get/set event number since last L1 reset generated in TCS chip
Definition: L1TcsWord.h:248
static const int TriggerTypeWord
Definition: L1TcsWord.h:321
const boost::uint32_t partRunNr() const
get/set partition run number
Definition: L1TcsWord.h:188
void setAssignedPartitionsWord64(boost::uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:307
void setEventNrWord64(boost::uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:352
static const boost::uint64_t LuminositySegmentNrMask
Definition: L1TcsWord.h:331
void setLuminositySegmentNr(const boost::uint16_t luminositySegmentNrValue)
Definition: L1TcsWord.h:173
bool operator==(const L1TcsWord &) const
equal operator
Definition: L1TcsWord.cc:87
static const int AssignedPartitionsShift
Definition: L1TcsWord.h:350
virtual ~L1TcsWord()
destructor
Definition: L1TcsWord.cc:79
void setOrbitNr(const boost::uint64_t orbitNrValue)
Definition: L1TcsWord.h:273