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_uint32_t
unsigned int cms_uint32_t
Definition: typedefs.h:15
L1TcsWord::setAssignedPartitions
void setAssignedPartitions(const cms_uint32_t assignedPartitionsValue)
Definition: L1TcsWord.h:149
L1GlobalTriggerReadoutSetup::UnitLength
static const int UnitLength
one unit in the word is UnitLength bits
Definition: L1GlobalTriggerReadoutSetup.h:56
L1TcsWord::setStatusWord64
void setStatusWord64(cms_uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:180
L1TcsWord::m_orbitNr
cms_uint64_t m_orbitNr
orbit number since start of run (48 bits, in fact)
Definition: L1TcsWord.h:321
L1TcsWord::setLuminositySegmentNrWord64
void setLuminositySegmentNrWord64(cms_uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:193
L1TcsWord::m_luminositySegmentNr
cms_uint16_t m_luminositySegmentNr
luminosity segment number
Definition: L1TcsWord.h:297
L1TcsWord::OrbitNrMask
static const cms_uint64_t OrbitNrMask
Definition: L1TcsWord.h:272
L1TcsWord::StatusMask
static const cms_uint64_t StatusMask
Definition: L1TcsWord.h:235
L1TcsWord::setLuminositySegmentNr
void setLuminositySegmentNr(const cms_uint16_t luminositySegmentNrValue)
Definition: L1TcsWord.h:123
L1GlobalTriggerReadoutSetupFwd.h
L1TcsWord::m_partTrigNr
cms_uint32_t m_partTrigNr
Definition: L1TcsWord.h:313
L1TcsWord::setEventNrWord64
void setEventNrWord64(cms_uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:241
L1TcsWord::LuminositySegmentNrMask
static const cms_uint64_t LuminositySegmentNrMask
Definition: L1TcsWord.h:236
L1TcsWord
Definition: L1TcsWord.h:29
L1TcsWord::unpack
void unpack(const unsigned char *tcsPtr)
Definition: L1TcsWord.cc:339
L1TcsWord::print
void print(std::ostream &myCout) const
pretty print the content of a L1TcsWord
Definition: L1TcsWord.cc:274
L1TcsWord::setOrbitNrFrom
void setOrbitNrFrom(const cms_uint64_t &word64)
set the OrbitNr value from a 64-bits word
Definition: L1TcsWord.cc:248
L1TcsWord::m_triggerType
cms_uint16_t m_triggerType
trigger type, identical with event type in CMS header (event type)
Definition: L1TcsWord.h:291
L1TcsWord::m_status
cms_uint16_t m_status
0000 = normal rate; 1000 = low rate = warning
Definition: L1TcsWord.h:294
L1TcsWord::setPartTrigNr
void setPartTrigNr(const cms_uint32_t partTrigNrValue)
Definition: L1TcsWord.h:163
L1TcsWord::reset
void reset()
reset the content of a L1TcsWord
Definition: L1TcsWord.cc:259
L1TcsWord::DaqNrMask
static const cms_uint64_t DaqNrMask
Definition: L1TcsWord.h:233
L1TcsWord::m_partRunNr
cms_uint32_t m_partRunNr
partition run number
Definition: L1TcsWord.h:302
L1TcsWord::DaqNrShift
static const int DaqNrShift
Definition: L1TcsWord.h:241
L1TcsWord::OrbitNrShift
static const int OrbitNrShift
Definition: L1TcsWord.h:274
L1TcsWord::setOrbitNrWord64
void setOrbitNrWord64(cms_uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:252
L1TcsWord::orbitNr
const cms_uint64_t orbitNr() const
get/set orbit number since start of run
Definition: L1TcsWord.h:185
L1TcsWord::setStatus
void setStatus(const cms_uint16_t statusValue)
Definition: L1TcsWord.h:111
L1TcsWord::setTriggerTypeWord64
void setTriggerTypeWord64(cms_uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:169
L1TcsWord::setOrbitNr
void setOrbitNr(const cms_uint64_t orbitNrValue)
Definition: L1TcsWord.h:187
L1TcsWord::daqNr
const cms_uint16_t daqNr() const
get/set number of DAQ partition to which the L1A has been sent
Definition: L1TcsWord.h:85
L1TcsWord::~L1TcsWord
virtual ~L1TcsWord()
destructor
Definition: L1TcsWord.cc:70
L1TcsWord::setTriggerType
void setTriggerType(const cms_uint16_t triggerTypeValue)
Definition: L1TcsWord.h:99
L1TcsWord::setPartTrigNrWord64
void setPartTrigNrWord64(cms_uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:230
L1TcsWord::m_bxNr
cms_uint16_t m_bxNr
bunch cross number as counted in the TCS chip
Definition: L1TcsWord.h:285
L1TcsWord::eventNr
const cms_uint32_t eventNr() const
get/set event number since last L1 reset generated in TCS chip
Definition: L1TcsWord.h:173
L1TcsWord::BoardIdMask
static const cms_uint64_t BoardIdMask
Definition: L1TcsWord.h:231
L1TcsWord::BxNrWord
static const int BxNrWord
Definition: L1TcsWord.h:224
L1TcsWord::bxNr
const cms_uint16_t bxNr() const
get/set bunch cross number as counted in the TCS chip
Definition: L1TcsWord.h:73
L1TcsWord::StatusShift
static const int StatusShift
Definition: L1TcsWord.h:243
L1TcsWord::TriggerTypeMask
static const cms_uint64_t TriggerTypeMask
Definition: L1TcsWord.h:234
typedefs.h
L1TcsWord::PartTrigNrMask
static const cms_uint64_t PartTrigNrMask
Definition: L1TcsWord.h:262
L1TcsWord::m_assignedPartitions
cms_uint32_t m_assignedPartitions
Definition: L1TcsWord.h:307
L1TcsWord::getSize
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
L1TcsWord::setAssignedPartitionsWord64
void setAssignedPartitionsWord64(cms_uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:217
L1TcsWord::StatusWord
static const int StatusWord
Definition: L1TcsWord.h:227
L1TcsWord::AssignedPartitionsWord
static const int AssignedPartitionsWord
Definition: L1TcsWord.h:249
L1TcsWord::partTrigNr
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
L1TcsWord::PartTrigNrShift
static const int PartTrigNrShift
Definition: L1TcsWord.h:265
L1TcsWord::LuminositySegmentNrShift
static const int LuminositySegmentNrShift
Definition: L1TcsWord.h:244
L1TcsWord::boardId
const cms_uint16_t boardId() const
get/set board ID
Definition: L1TcsWord.h:60
L1TcsWord::operator!=
bool operator!=(const L1TcsWord &) const
unequal operator
Definition: L1TcsWord.cc:125
L1TcsWord::BxNrShift
static const int BxNrShift
Definition: L1TcsWord.h:240
L1TcsWord::L1TcsWord
L1TcsWord()
constructors
Definition: L1TcsWord.cc:30
L1TcsWord::status
const cms_uint16_t status() const
get/set status: 0000 = normal rate; 1000 = low rate = warning
Definition: L1TcsWord.h:109
L1GlobalTriggerReadoutSetup.h
L1TcsWord::BoardIdWord
static const int BoardIdWord
Definition: L1TcsWord.h:223
L1TcsWord::setDaqNr
void setDaqNr(const cms_uint16_t daqNrValue)
Definition: L1TcsWord.h:87
L1TcsWord::setDaqNrWord64
void setDaqNrWord64(cms_uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:156
L1TcsWord::assignedPartitions
const cms_uint32_t assignedPartitions() const
get/set assigned partition: bit "i" correspond to detector partition "i"
Definition: L1TcsWord.h:147
L1TcsWord::TriggerTypeWord
static const int TriggerTypeWord
Definition: L1TcsWord.h:226
L1TcsWord::BlockSize
static const int BlockSize
Definition: L1TcsWord.h:218
L1TcsWord::BxNrMask
static const cms_uint64_t BxNrMask
Definition: L1TcsWord.h:232
L1TcsWord::setEventNr
void setEventNr(const cms_uint32_t eventNrValue)
Definition: L1TcsWord.h:175
L1TcsWord::EventNrWord
static const int EventNrWord
Definition: L1TcsWord.h:260
L1TcsWord::m_daqNr
cms_uint16_t m_daqNr
number of DAQ partition to which the L1A has been sent
Definition: L1TcsWord.h:288
cms_uint64_t
unsigned long long cms_uint64_t
Definition: typedefs.h:17
cms_uint16_t
unsigned short cms_uint16_t
Definition: typedefs.h:13
L1TcsWord::EventNrShift
static const int EventNrShift
Definition: L1TcsWord.h:266
L1TcsWord::m_boardId
cms_uint16_t m_boardId
board identifier
Definition: L1TcsWord.h:282
L1TcsWord::triggerType
const cms_uint16_t triggerType() const
get/set trigger type, identical with event type in CMS header
Definition: L1TcsWord.h:97
L1TcsWord::AssignedPartitionsMask
static const cms_uint64_t AssignedPartitionsMask
Definition: L1TcsWord.h:252
L1TcsWord::operator==
bool operator==(const L1TcsWord &) const
equal operator
Definition: L1TcsWord.cc:75
L1TcsWord::PartRunNrShift
static const int PartRunNrShift
Definition: L1TcsWord.h:254
L1TcsWord::luminositySegmentNr
const cms_uint16_t luminositySegmentNr() const
get/set luminosity segment number
Definition: L1TcsWord.h:121
L1TcsWord::partRunNr
const cms_uint32_t partRunNr() const
get/set partition run number
Definition: L1TcsWord.h:135
L1TcsWord::DaqNrWord
static const int DaqNrWord
Definition: L1TcsWord.h:225
L1TcsWord::BoardIdShift
static const int BoardIdShift
Definition: L1TcsWord.h:239
L1TcsWord::setBxNrWord64
void setBxNrWord64(cms_uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:145
L1TcsWord::PartRunNrMask
static const cms_uint64_t PartRunNrMask
Definition: L1TcsWord.h:251
L1TcsWord::m_eventNr
cms_uint32_t m_eventNr
event number since last L1 reset generated in TCS chip
Definition: L1TcsWord.h:316
L1TcsWord::setBoardIdWord64
void setBoardIdWord64(cms_uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:134
L1TcsWord::PartTrigNrWord
static const int PartTrigNrWord
Definition: L1TcsWord.h:259
L1TcsWord::EventNrMask
static const cms_uint64_t EventNrMask
Definition: L1TcsWord.h:263
L1TcsWord::setPartRunNrWord64
void setPartRunNrWord64(cms_uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:204
L1TcsWord::TriggerTypeShift
static const int TriggerTypeShift
Definition: L1TcsWord.h:242
L1TcsWord::AssignedPartitionsShift
static const int AssignedPartitionsShift
Definition: L1TcsWord.h:255
L1TcsWord::PartRunNrWord
static const int PartRunNrWord
Definition: L1TcsWord.h:248
L1TcsWord::setPartRunNr
void setPartRunNr(const cms_uint32_t partRunNrValue)
Definition: L1TcsWord.h:137
L1TcsWord::setBoardId
void setBoardId(const cms_uint16_t boardIdValue)
set BoardId from a BoardId value
Definition: L1TcsWord.h:63
L1TcsWord::setBxNr
void setBxNr(const cms_uint16_t bxNrValue)
Definition: L1TcsWord.h:75
L1TcsWord::OrbitNrWord
static const int OrbitNrWord
Definition: L1TcsWord.h:270
L1TcsWord::LuminositySegmentNrWord
static const int LuminositySegmentNrWord
Definition: L1TcsWord.h:228