File indexing completed on 2024-04-06 12:04:28
0001 #ifndef L1GlobalTrigger_L1TcsWord_h
0002 #define L1GlobalTrigger_L1TcsWord_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019 #include <iosfwd>
0020
0021
0022 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutSetupFwd.h"
0023 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutSetup.h"
0024 #include "FWCore/Utilities/interface/typedefs.h"
0025
0026
0027
0028
0029 class L1TcsWord {
0030 public:
0031
0032 L1TcsWord();
0033
0034
0035 L1TcsWord(cms_uint16_t boardIdValue,
0036 cms_uint16_t bxNrValue,
0037 cms_uint16_t daqNrValue,
0038 cms_uint16_t triggerTypeValue,
0039 cms_uint16_t statusValue,
0040 cms_uint16_t luminositySegmentNrValue,
0041 cms_uint32_t partRunNrValue,
0042 cms_uint32_t assignedPartitionsValue,
0043 cms_uint32_t partTrigNrValue,
0044 cms_uint32_t eventNrValue,
0045 cms_uint64_t orbitNrValue);
0046
0047
0048 virtual ~L1TcsWord();
0049
0050
0051 bool operator==(const L1TcsWord&) const;
0052
0053
0054 bool operator!=(const L1TcsWord&) const;
0055
0056 public:
0057
0058
0059
0060 inline const cms_uint16_t boardId() const { return m_boardId; }
0061
0062
0063 void setBoardId(const cms_uint16_t boardIdValue) { m_boardId = boardIdValue; }
0064
0065
0066 void setBoardId(const cms_uint64_t& word64);
0067
0068
0069
0070 void setBoardIdWord64(cms_uint64_t& word64, int iWord);
0071
0072
0073 inline const cms_uint16_t bxNr() const { return m_bxNr; }
0074
0075 void setBxNr(const cms_uint16_t bxNrValue) { m_bxNr = bxNrValue; }
0076
0077
0078 void setBxNr(const cms_uint64_t& word64);
0079
0080
0081
0082 void setBxNrWord64(cms_uint64_t& word64, int iWord);
0083
0084
0085 inline const cms_uint16_t daqNr() const { return m_daqNr; }
0086
0087 void setDaqNr(const cms_uint16_t daqNrValue) { m_daqNr = daqNrValue; }
0088
0089
0090 void setDaqNr(const cms_uint64_t& word64);
0091
0092
0093
0094 void setDaqNrWord64(cms_uint64_t& word64, int iWord);
0095
0096
0097 inline const cms_uint16_t triggerType() const { return m_triggerType; }
0098
0099 void setTriggerType(const cms_uint16_t triggerTypeValue) { m_triggerType = triggerTypeValue; }
0100
0101
0102 void setTriggerType(const cms_uint64_t& word64);
0103
0104
0105
0106 void setTriggerTypeWord64(cms_uint64_t& word64, int iWord);
0107
0108
0109 inline const cms_uint16_t status() const { return m_status; }
0110
0111 void setStatus(const cms_uint16_t statusValue) { m_status = statusValue; }
0112
0113
0114 void setStatus(const cms_uint64_t& word64);
0115
0116
0117
0118 void setStatusWord64(cms_uint64_t& word64, int iWord);
0119
0120
0121 inline const cms_uint16_t luminositySegmentNr() const { return m_luminositySegmentNr; }
0122
0123 void setLuminositySegmentNr(const cms_uint16_t luminositySegmentNrValue) {
0124 m_luminositySegmentNr = luminositySegmentNrValue;
0125 }
0126
0127
0128 void setLuminositySegmentNr(const cms_uint64_t& word64);
0129
0130
0131
0132 void setLuminositySegmentNrWord64(cms_uint64_t& word64, int iWord);
0133
0134
0135 inline const cms_uint32_t partRunNr() const { return m_partRunNr; }
0136
0137 void setPartRunNr(const cms_uint32_t partRunNrValue) { m_partRunNr = partRunNrValue; }
0138
0139
0140 void setPartRunNr(const cms_uint64_t& word64);
0141
0142
0143
0144 void setPartRunNrWord64(cms_uint64_t& word64, int iWord);
0145
0146
0147 inline const cms_uint32_t assignedPartitions() const { return m_assignedPartitions; }
0148
0149 void setAssignedPartitions(const cms_uint32_t assignedPartitionsValue) {
0150 m_assignedPartitions = assignedPartitionsValue;
0151 }
0152
0153
0154 void setAssignedPartitions(const cms_uint64_t& word64);
0155
0156
0157
0158 void setAssignedPartitionsWord64(cms_uint64_t& word64, int iWord);
0159
0160
0161 inline const cms_uint32_t partTrigNr() const { return m_partTrigNr; }
0162
0163 void setPartTrigNr(const cms_uint32_t partTrigNrValue) { m_partTrigNr = partTrigNrValue; }
0164
0165
0166 void setPartTrigNr(const cms_uint64_t& word64);
0167
0168
0169
0170 void setPartTrigNrWord64(cms_uint64_t& word64, int iWord);
0171
0172
0173 inline const cms_uint32_t eventNr() const { return m_eventNr; }
0174
0175 void setEventNr(const cms_uint32_t eventNrValue) { m_eventNr = eventNrValue; }
0176
0177
0178 void setEventNr(const cms_uint64_t& word64);
0179
0180
0181
0182 void setEventNrWord64(cms_uint64_t& word64, int iWord);
0183
0184
0185 inline const cms_uint64_t orbitNr() const { return m_orbitNr; }
0186
0187 void setOrbitNr(const cms_uint64_t orbitNrValue) { m_orbitNr = orbitNrValue; }
0188
0189
0190 void setOrbitNrFrom(const cms_uint64_t& word64);
0191
0192
0193
0194 void setOrbitNrWord64(cms_uint64_t& word64, int iWord);
0195
0196
0197 inline const unsigned int getSize() const {
0198 int unitLengthBits = L1GlobalTriggerReadoutSetup::UnitLength;
0199
0200 return BlockSize * unitLengthBits;
0201 }
0202
0203 public:
0204
0205 void reset();
0206
0207
0208 void print(std::ostream& myCout) const;
0209
0210
0211
0212 void unpack(const unsigned char* tcsPtr);
0213
0214 private:
0215
0216
0217
0218 static const int BlockSize;
0219
0220
0221
0222
0223 static const int BoardIdWord;
0224 static const int BxNrWord;
0225 static const int DaqNrWord;
0226 static const int TriggerTypeWord;
0227 static const int StatusWord;
0228 static const int LuminositySegmentNrWord;
0229
0230
0231 static const cms_uint64_t BoardIdMask;
0232 static const cms_uint64_t BxNrMask;
0233 static const cms_uint64_t DaqNrMask;
0234 static const cms_uint64_t TriggerTypeMask;
0235 static const cms_uint64_t StatusMask;
0236 static const cms_uint64_t LuminositySegmentNrMask;
0237
0238
0239 static const int BoardIdShift;
0240 static const int BxNrShift;
0241 static const int DaqNrShift;
0242 static const int TriggerTypeShift;
0243 static const int StatusShift;
0244 static const int LuminositySegmentNrShift;
0245
0246
0247
0248 static const int PartRunNrWord;
0249 static const int AssignedPartitionsWord;
0250
0251 static const cms_uint64_t PartRunNrMask;
0252 static const cms_uint64_t AssignedPartitionsMask;
0253
0254 static const int PartRunNrShift;
0255 static const int AssignedPartitionsShift;
0256
0257
0258
0259 static const int PartTrigNrWord;
0260 static const int EventNrWord;
0261
0262 static const cms_uint64_t PartTrigNrMask;
0263 static const cms_uint64_t EventNrMask;
0264
0265 static const int PartTrigNrShift;
0266 static const int EventNrShift;
0267
0268
0269
0270 static const int OrbitNrWord;
0271
0272 static const cms_uint64_t OrbitNrMask;
0273
0274 static const int OrbitNrShift;
0275
0276
0277
0278
0279
0280 private:
0281
0282 cms_uint16_t m_boardId;
0283
0284
0285 cms_uint16_t m_bxNr;
0286
0287
0288 cms_uint16_t m_daqNr;
0289
0290
0291 cms_uint16_t m_triggerType;
0292
0293
0294 cms_uint16_t m_status;
0295
0296
0297 cms_uint16_t m_luminositySegmentNr;
0298
0299
0300
0301
0302 cms_uint32_t m_partRunNr;
0303
0304
0305
0306
0307 cms_uint32_t m_assignedPartitions;
0308
0309
0310
0311
0312
0313 cms_uint32_t m_partTrigNr;
0314
0315
0316 cms_uint32_t m_eventNr;
0317
0318
0319
0320
0321 cms_uint64_t m_orbitNr;
0322
0323
0324
0325 };
0326
0327 #endif