File indexing completed on 2024-04-06 12:04:28
0001 #ifndef L1GlobalTrigger_L1GtfeWord_h
0002 #define L1GlobalTrigger_L1GtfeWord_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
0030 class L1GtfeWord {
0031 public:
0032
0033 L1GtfeWord();
0034
0035
0036 L1GtfeWord(cms_uint16_t boardIdValue,
0037 cms_uint16_t recordLength1Value,
0038 cms_uint16_t recordLengthValue,
0039 cms_uint16_t bxNrValue,
0040 cms_uint32_t setupVersionValue,
0041 cms_uint16_t activeBoardsValue,
0042 cms_uint16_t altNrBxBoardValue,
0043 cms_uint32_t totalTriggerNrValue);
0044
0045
0046 virtual ~L1GtfeWord();
0047
0048
0049 bool operator==(const L1GtfeWord&) const;
0050
0051
0052 bool operator!=(const L1GtfeWord&) const;
0053
0054 public:
0055
0056
0057
0058 inline const cms_uint16_t boardId() const { return m_boardId; }
0059
0060
0061 void setBoardId(cms_uint16_t boardIdValue) { m_boardId = boardIdValue; }
0062
0063
0064 void setBoardId(const cms_uint64_t& word64);
0065
0066
0067
0068 void setBoardIdWord64(cms_uint64_t& word64, int iWord);
0069
0070
0071 inline const cms_uint16_t recordLength1() const { return m_recordLength1; }
0072
0073 void setRecordLength1(cms_uint16_t recordLengthValue) { m_recordLength1 = recordLengthValue; }
0074
0075 void setRecordLength1(const cms_uint64_t& word64);
0076
0077
0078
0079 void setRecordLength1Word64(cms_uint64_t& word64, int iWord);
0080
0081
0082 inline const cms_uint16_t recordLength() const { return m_recordLength; }
0083
0084 void setRecordLength(cms_uint16_t recordLengthValue) { m_recordLength = recordLengthValue; }
0085
0086 void setRecordLength(const cms_uint64_t& word64);
0087
0088
0089
0090 void setRecordLengthWord64(cms_uint64_t& word64, int iWord);
0091
0092
0093 inline const cms_uint16_t bxNr() const { return m_bxNr; }
0094
0095 void setBxNr(cms_uint16_t bxNrValue) { m_bxNr = bxNrValue; }
0096
0097 void setBxNr(const cms_uint64_t& word64);
0098
0099
0100
0101 void setBxNrWord64(cms_uint64_t& word64, int iWord);
0102
0103
0104 inline const cms_uint32_t setupVersion() const { return m_setupVersion; }
0105
0106 void setSetupVersion(cms_uint32_t setupVersionValue) { m_setupVersion = setupVersionValue; }
0107
0108 void setSetupVersion(const cms_uint64_t& word64);
0109
0110
0111
0112 void setSetupVersionWord64(cms_uint64_t& word64, int iWord);
0113
0114
0115 const int bstFlag() const;
0116 void setBstFlag(const int);
0117
0118
0119 inline const cms_uint16_t activeBoards() const { return m_activeBoards; }
0120
0121 void setActiveBoards(cms_uint16_t activeBoardsValue) { m_activeBoards = activeBoardsValue; }
0122
0123 void setActiveBoards(const cms_uint64_t& word64);
0124
0125
0126
0127 void setActiveBoardsWord64(cms_uint64_t& word64, int iWord);
0128
0129
0130
0131 void setActiveBoardsWord64(cms_uint64_t& word64, int iWord, cms_int16_t activeBoardsValue);
0132
0133
0134 inline const cms_uint16_t altNrBxBoard() const { return m_altNrBxBoard; }
0135
0136 void setAltNrBxBoard(cms_uint16_t altNrBxBoardValue) { m_altNrBxBoard = altNrBxBoardValue; }
0137
0138 void setAltNrBxBoard(const cms_uint64_t& word64);
0139
0140
0141
0142 void setAltNrBxBoardWord64(cms_uint64_t& word64, int iWord);
0143
0144
0145
0146 void setAltNrBxBoardWord64(cms_uint64_t& word64, int iWord, cms_int16_t altNrBxBoardValue);
0147
0148
0149 inline const cms_uint32_t totalTriggerNr() const { return m_totalTriggerNr; }
0150
0151 void setTotalTriggerNr(cms_uint32_t totalTriggerNrValue) { m_totalTriggerNr = totalTriggerNrValue; }
0152
0153 void setTotalTriggerNr(const cms_uint64_t& word64);
0154
0155
0156
0157 void setTotalTriggerNrWord64(cms_uint64_t& word64, int iWord);
0158
0159
0160 inline const unsigned int getSize() const {
0161 int unitLengthBits = L1GlobalTriggerReadoutSetup::UnitLength;
0162
0163 return BlockSize * unitLengthBits;
0164 }
0165
0166 public:
0167
0168 virtual void reset();
0169
0170
0171 virtual void print(std::ostream& myCout) const;
0172
0173
0174
0175 virtual void unpack(const unsigned char* gtfePtr);
0176
0177 private:
0178
0179
0180
0181 static const int BlockSize;
0182
0183 static const int BoardIdWord;
0184 static const int RecordLength1Word;
0185 static const int RecordLengthWord;
0186 static const int BxNrWord;
0187 static const int SetupVersionWord;
0188
0189 static const cms_uint64_t BoardIdMask;
0190 static const cms_uint64_t RecordLength1Mask;
0191 static const cms_uint64_t RecordLengthMask;
0192 static const cms_uint64_t BxNrMask;
0193 static const cms_uint64_t SetupVersionMask;
0194
0195 static const cms_uint32_t BstFlagMask;
0196
0197
0198 static const int BoardIdShift;
0199 static const int RecordLength1Shift;
0200 static const int RecordLengthShift;
0201 static const int BxNrShift;
0202 static const int SetupVersionShift;
0203
0204
0205 static const int ActiveBoardsWord;
0206 static const int AltNrBxBoardWord;
0207 static const int TotalTriggerNrWord;
0208
0209 static const cms_uint64_t ActiveBoardsMask;
0210 static const cms_uint64_t AltNrBxBoardMask;
0211 static const cms_uint64_t TotalTriggerNrMask;
0212
0213 static const int ActiveBoardsShift;
0214 static const int AltNrBxBoardShift;
0215 static const int TotalTriggerNrShift;
0216
0217 private:
0218
0219 cms_uint16_t m_boardId;
0220
0221
0222 cms_uint16_t m_recordLength1;
0223
0224
0225 cms_uint16_t m_recordLength;
0226
0227
0228 cms_uint16_t m_bxNr;
0229 cms_uint32_t m_setupVersion;
0230
0231
0232 cms_uint16_t m_activeBoards;
0233
0234
0235
0236
0237
0238 cms_uint16_t m_altNrBxBoard;
0239
0240
0241 cms_uint32_t m_totalTriggerNr;
0242 };
0243
0244 #endif