File indexing completed on 2024-04-06 12:04:28
0001 #ifndef L1GlobalTrigger_L1GtFdlWord_h
0002 #define L1GlobalTrigger_L1GtFdlWord_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutSetupFwd.h"
0022 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutSetup.h"
0023 #include "FWCore/Utilities/interface/typedefs.h"
0024
0025
0026
0027
0028
0029 class L1GtFdlWord {
0030 public:
0031
0032 L1GtFdlWord();
0033
0034
0035 L1GtFdlWord(cms_uint16_t boardIdValue,
0036 int bxInEventValue,
0037 cms_uint16_t bxNrValue,
0038 cms_uint32_t eventNrValue,
0039 const TechnicalTriggerWord& gtTechnicalTriggerWordValue,
0040 const DecisionWord& gtDecisionWordValue,
0041 const DecisionWordExtended& gtDecisionWordExtendedValue,
0042 cms_uint16_t gtPrescaleFactorIndexTechValue,
0043 cms_uint16_t gtPrescaleFactorIndexAlgoValue,
0044 cms_uint16_t noAlgoValue,
0045 cms_uint16_t finalORValue,
0046 cms_uint32_t orbitNrValue,
0047 cms_uint16_t lumiSegmentNrValue,
0048 cms_uint16_t localBxNrValue);
0049
0050
0051 virtual ~L1GtFdlWord();
0052
0053
0054 bool operator==(const L1GtFdlWord&) const;
0055
0056
0057 bool operator!=(const L1GtFdlWord&) const;
0058
0059 public:
0060
0061
0062
0063 inline const cms_uint16_t boardId() const { return m_boardId; }
0064
0065
0066 void setBoardId(const cms_uint16_t& boardIdValue) { m_boardId = boardIdValue; }
0067
0068
0069 void setBoardId(const cms_uint64_t& word64);
0070
0071
0072
0073 void setBoardIdWord64(cms_uint64_t& word64, const int iWord);
0074
0075
0076 inline const int bxInEvent() const { return m_bxInEvent; }
0077
0078 void setBxInEvent(const int bxInEventValue) { m_bxInEvent = bxInEventValue; }
0079
0080
0081 void setBxInEvent(const cms_uint64_t& word64);
0082
0083
0084
0085 void setBxInEventWord64(cms_uint64_t& word64, const int iWord);
0086
0087
0088 inline const cms_uint16_t bxNr() const { return m_bxNr; }
0089
0090 void setBxNr(const cms_uint16_t& bxNrValue) { m_bxNr = bxNrValue; }
0091
0092
0093 void setBxNr(const cms_uint64_t& word64);
0094
0095
0096
0097 void setBxNrWord64(cms_uint64_t& word64, const int iWord);
0098
0099
0100 inline const cms_uint32_t eventNr() const { return m_eventNr; }
0101
0102 void setEventNr(const cms_uint32_t& eventNrValue) { m_eventNr = eventNrValue; }
0103
0104
0105 void setEventNr(const cms_uint64_t& word64);
0106
0107
0108
0109 void setEventNrWord64(cms_uint64_t& word64, const int iWord);
0110
0111
0112 inline const TechnicalTriggerWord& gtTechnicalTriggerWord() const { return m_gtTechnicalTriggerWord; }
0113
0114 void setGtTechnicalTriggerWord(const TechnicalTriggerWord& gtTechnicalTriggerWordValue) {
0115 m_gtTechnicalTriggerWord = gtTechnicalTriggerWordValue;
0116 }
0117
0118 void printGtTechnicalTriggerWord(std::ostream& myCout) const;
0119
0120
0121 void setGtTechnicalTriggerWord(const cms_uint64_t& word64);
0122
0123
0124
0125 void setGtTechnicalTriggerWordWord64(cms_uint64_t& word64, const int iWord);
0126
0127
0128 inline const DecisionWord& gtDecisionWord() const { return m_gtDecisionWord; }
0129
0130 void setGtDecisionWord(const DecisionWord& gtDecisionWordValue) { m_gtDecisionWord = gtDecisionWordValue; }
0131
0132 void printGtDecisionWord(std::ostream& myCout) const;
0133
0134
0135
0136 void setGtDecisionWordA(const cms_uint64_t& word64);
0137
0138
0139
0140 void setGtDecisionWordB(const cms_uint64_t& word64);
0141
0142
0143
0144
0145 void setGtDecisionWordAWord64(cms_uint64_t& word64, const int iWord);
0146
0147
0148
0149
0150 void setGtDecisionWordBWord64(cms_uint64_t& word64, const int iWord);
0151
0152
0153 inline const DecisionWordExtended& gtDecisionWordExtended() const { return m_gtDecisionWordExtended; }
0154
0155 void setGtDecisionWordExtended(const DecisionWordExtended& gtDecisionWordExtendedValue) {
0156 m_gtDecisionWordExtended = gtDecisionWordExtendedValue;
0157 }
0158
0159 void printGtDecisionWordExtended(std::ostream& myCout) const;
0160
0161
0162 void setGtDecisionWordExtended(const cms_uint64_t& word64);
0163
0164
0165
0166 void setGtDecisionWordExtendedWord64(cms_uint64_t& word64, const int iWord);
0167
0168
0169 inline const cms_uint16_t physicsDeclared() const { return m_physicsDeclared; }
0170
0171 void setPhysicsDeclared(const cms_uint16_t& physicsDeclaredValue) { m_physicsDeclared = physicsDeclaredValue; }
0172
0173
0174 void setPhysicsDeclared(const cms_uint64_t& word64);
0175
0176
0177
0178 void setPhysicsDeclaredWord64(cms_uint64_t& word64, const int iWord);
0179
0180
0181
0182 inline const cms_uint16_t gtPrescaleFactorIndexTech() const { return m_gtPrescaleFactorIndexTech; }
0183
0184 void setGtPrescaleFactorIndexTech(const cms_uint16_t& gtPrescaleFactorIndexTechValue) {
0185 m_gtPrescaleFactorIndexTech = gtPrescaleFactorIndexTechValue;
0186 }
0187
0188
0189 void setGtPrescaleFactorIndexTech(const cms_uint64_t& word64);
0190
0191
0192
0193 void setGtPrescaleFactorIndexTechWord64(cms_uint64_t& word64, const int iWord);
0194
0195 inline const cms_uint16_t gtPrescaleFactorIndexAlgo() const { return m_gtPrescaleFactorIndexAlgo; }
0196
0197 void setGtPrescaleFactorIndexAlgo(const cms_uint16_t& gtPrescaleFactorIndexAlgoValue) {
0198 m_gtPrescaleFactorIndexAlgo = gtPrescaleFactorIndexAlgoValue;
0199 }
0200
0201
0202 void setGtPrescaleFactorIndexAlgo(const cms_uint64_t& word64);
0203
0204
0205
0206 void setGtPrescaleFactorIndexAlgoWord64(cms_uint64_t& word64, const int iWord);
0207
0208
0209 inline const cms_uint16_t noAlgo() const { return m_noAlgo; }
0210
0211 void setNoAlgo(const cms_uint16_t& noAlgoValue) { m_noAlgo = noAlgoValue; }
0212
0213
0214 void setNoAlgo(const cms_uint64_t& word64);
0215
0216
0217
0218 void setNoAlgoWord64(cms_uint64_t& word64, const int iWord);
0219
0220
0221 inline const cms_uint16_t finalOR() const { return m_finalOR; }
0222
0223 void setFinalOR(const cms_uint16_t& finalORValue) { m_finalOR = finalORValue; }
0224
0225
0226 void setFinalOR(const cms_uint64_t& word64);
0227
0228
0229
0230 void setFinalORWord64(cms_uint64_t& word64, const int iWord);
0231
0232 inline const bool globalDecision() const { return static_cast<bool>(m_finalOR); }
0233
0234
0235 inline const cms_uint32_t orbitNr() const { return m_orbitNr; }
0236
0237 void setOrbitNr(const cms_uint32_t& orbitNrValue) { m_orbitNr = orbitNrValue; }
0238
0239
0240 void setOrbitNr(const cms_uint64_t& word64);
0241
0242
0243
0244 void setOrbitNrWord64(cms_uint64_t& word64, const int iWord);
0245
0246
0247 inline const cms_uint16_t lumiSegmentNr() const { return m_lumiSegmentNr; }
0248
0249 void setLumiSegmentNr(const cms_uint16_t& lumiSegmentNrValue) { m_lumiSegmentNr = lumiSegmentNrValue; }
0250
0251
0252 void setLumiSegmentNr(const cms_uint64_t& word64);
0253
0254
0255
0256 void setLumiSegmentNrWord64(cms_uint64_t& word64, const int iWord);
0257
0258
0259 inline const cms_uint16_t localBxNr() const { return m_localBxNr; }
0260
0261 void setLocalBxNr(const cms_uint16_t& localBxNrValue) { m_localBxNr = localBxNrValue; }
0262
0263
0264 void setLocalBxNr(const cms_uint64_t& word64);
0265
0266
0267
0268 void setLocalBxNrWord64(cms_uint64_t& word64, const int iWord);
0269
0270
0271 inline const unsigned int getSize() const {
0272 int unitLengthBits = L1GlobalTriggerReadoutSetup::UnitLength;
0273
0274 return BlockSize * unitLengthBits;
0275 }
0276
0277 public:
0278
0279 void reset();
0280
0281
0282 void print(std::ostream& myCout) const;
0283
0284
0285
0286 void unpack(const unsigned char* fdlPtr);
0287
0288 private:
0289
0290
0291
0292 static const int BlockSize;
0293
0294
0295
0296
0297 static const int BoardIdWord;
0298 static const int BxInEventWord;
0299 static const int BxNrWord;
0300 static const int EventNrWord;
0301
0302
0303 static const cms_uint64_t BoardIdMask;
0304 static const cms_uint64_t BxInEventMask;
0305 static const cms_uint64_t BxNrMask;
0306 static const cms_uint64_t EventNrMask;
0307
0308
0309 static const int BoardIdShift;
0310 static const int BxInEventShift;
0311 static const int BxNrShift;
0312 static const int EventNrShift;
0313
0314
0315
0316 static const int GtTechnicalTriggerWordWord;
0317 static const cms_uint64_t GtTechnicalTriggerWordMask;
0318 static const int GtTechnicalTriggerWordShift;
0319
0320
0321
0322 static const int GtDecisionWordAWord;
0323 static const cms_uint64_t GtDecisionWordAMask;
0324 static const int GtDecisionWordAShift;
0325
0326
0327
0328 static const int GtDecisionWordBWord;
0329 static const cms_uint64_t GtDecisionWordBMask;
0330 static const int GtDecisionWordBShift;
0331
0332
0333 static const int GtDecisionWordExtendedWord;
0334 static const cms_uint64_t GtDecisionWordExtendedMask;
0335 static const int GtDecisionWordExtendedShift;
0336
0337
0338 static const int PhysicsDeclaredWord;
0339 static const int GtPrescaleFactorIndexTechWord;
0340 static const int GtPrescaleFactorIndexAlgoWord;
0341 static const int NoAlgoWord;
0342 static const int FinalORWord;
0343
0344 static const cms_uint64_t PhysicsDeclaredMask;
0345 static const cms_uint64_t GtPrescaleFactorIndexTechMask;
0346 static const cms_uint64_t GtPrescaleFactorIndexAlgoMask;
0347 static const cms_uint64_t NoAlgoMask;
0348 static const cms_uint64_t FinalORMask;
0349
0350 static const int PhysicsDeclaredShift;
0351 static const int GtPrescaleFactorIndexTechShift;
0352 static const int GtPrescaleFactorIndexAlgoShift;
0353 static const int NoAlgoShift;
0354 static const int FinalORShift;
0355
0356
0357 static const int OrbitNrWord;
0358 static const int LumiSegmentNrWord;
0359 static const int LocalBxNrWord;
0360
0361 static const cms_uint64_t OrbitNrMask;
0362 static const cms_uint64_t LumiSegmentNrMask;
0363 static const cms_uint64_t LocalBxNrMask;
0364
0365 static const int OrbitNrShift;
0366 static const int LumiSegmentNrShift;
0367 static const int LocalBxNrShift;
0368
0369 private:
0370
0371 cms_uint16_t m_boardId;
0372
0373
0374 int m_bxInEvent;
0375
0376
0377 cms_uint16_t m_bxNr;
0378
0379
0380 cms_uint32_t m_eventNr;
0381
0382
0383
0384
0385 TechnicalTriggerWord m_gtTechnicalTriggerWord;
0386
0387
0388 DecisionWord m_gtDecisionWord;
0389
0390
0391 DecisionWordExtended m_gtDecisionWordExtended;
0392
0393
0394
0395 cms_uint16_t m_physicsDeclared;
0396
0397
0398
0399 cms_uint16_t m_gtPrescaleFactorIndexTech;
0400 cms_uint16_t m_gtPrescaleFactorIndexAlgo;
0401
0402
0403 cms_uint16_t m_noAlgo;
0404
0405
0406
0407 cms_uint16_t m_finalOR;
0408
0409
0410
0411
0412 cms_uint32_t m_orbitNr;
0413
0414
0415 cms_uint16_t m_lumiSegmentNr;
0416
0417
0418
0419 cms_uint16_t m_localBxNr;
0420 };
0421
0422 #endif