File indexing completed on 2024-04-06 12:04:28
0001 #ifndef L1GlobalTrigger_L1GtPsbWord_h
0002 #define L1GlobalTrigger_L1GtPsbWord_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 L1GtPsbWord {
0030 public:
0031 static const int NumberAData = 8;
0032 static const int NumberBData = 8;
0033
0034 public:
0035
0036 L1GtPsbWord();
0037
0038
0039 L1GtPsbWord(cms_uint16_t boardIdValue,
0040 int bxInEventValue,
0041 cms_uint16_t bxNrValue,
0042 cms_uint32_t eventNrValue,
0043 cms_uint16_t aDataValue[NumberAData],
0044 cms_uint16_t bDataValue[NumberBData],
0045 cms_uint16_t localBxNrValue);
0046
0047
0048 virtual ~L1GtPsbWord();
0049
0050
0051 bool operator==(const L1GtPsbWord&) const;
0052
0053
0054 bool operator!=(const L1GtPsbWord&) const;
0055
0056 public:
0057
0058 inline const cms_uint16_t boardId() const { return m_boardId; }
0059
0060 void setBoardId(cms_uint16_t boardIdValue) { m_boardId = boardIdValue; }
0061
0062
0063
0064 void setBoardId(const cms_uint64_t& word64, int iWord);
0065
0066
0067
0068 void setBoardIdWord64(cms_uint64_t& word64, int iWord);
0069
0070
0071 inline const int bxInEvent() const { return m_bxInEvent; }
0072
0073 void setBxInEvent(int bxInEventValue) { m_bxInEvent = bxInEventValue; }
0074
0075
0076
0077 void setBxInEvent(const cms_uint64_t& word64, int iWord);
0078
0079
0080
0081 void setBxInEventWord64(cms_uint64_t& word64, int iWord);
0082
0083
0084 inline const cms_uint16_t bxNr() const { return m_bxNr; }
0085
0086 void setBxNr(cms_uint16_t bxNrValue) { m_bxNr = bxNrValue; }
0087
0088
0089
0090 void setBxNr(const cms_uint64_t& word64, int iWord);
0091
0092
0093
0094 void setBxNrWord64(cms_uint64_t& word64, int iWord);
0095
0096
0097 inline const cms_uint32_t eventNr() const { return m_eventNr; }
0098
0099 void setEventNr(cms_uint32_t eventNrValue) { m_eventNr = eventNrValue; }
0100
0101
0102
0103 void setEventNr(const cms_uint64_t& word64, int iWord);
0104
0105
0106
0107 void setEventNrWord64(cms_uint64_t& word64, int iWord);
0108
0109
0110 const cms_uint16_t aData(int iA) const;
0111 void setAData(cms_uint16_t aDataVal, int iA);
0112
0113
0114
0115 void setAData(const cms_uint64_t& word64, int iWord);
0116
0117
0118
0119 void setADataWord64(cms_uint64_t& word64, int iWord);
0120
0121
0122 const cms_uint16_t bData(int iB) const;
0123 void setBData(cms_uint16_t bDataVal, int iB);
0124
0125
0126
0127 void setBData(const cms_uint64_t& word64, int iWord);
0128
0129
0130
0131 void setBDataWord64(cms_uint64_t& word64, int iWord);
0132
0133
0134 inline const cms_uint16_t localBxNr() const { return m_localBxNr; }
0135
0136 void setLocalBxNr(cms_uint16_t localBxNrValue) { m_localBxNr = localBxNrValue; }
0137
0138
0139
0140 void setLocalBxNr(const cms_uint64_t& word64, int iWord);
0141
0142
0143
0144 void setLocalBxNrWord64(cms_uint64_t& word64, int iWord);
0145
0146
0147 inline const unsigned int getSize() const {
0148 int unitLengthBits = L1GlobalTriggerReadoutSetup::UnitLength;
0149
0150 return BlockSize * unitLengthBits;
0151 }
0152
0153 public:
0154
0155 void reset();
0156
0157
0158 void print(std::ostream& myCout) const;
0159
0160 private:
0161
0162
0163
0164 static const int BlockSize = 6;
0165
0166
0167
0168
0169 static const int BoardIdWord = 0;
0170 static const int BxInEventWord = 0;
0171 static const int BxNrWord = 0;
0172 static const int EventNrWord = 0;
0173
0174
0175 static const cms_uint64_t BoardIdMask = 0xFFFF000000000000ULL;
0176 static const cms_uint64_t BxInEventMask = 0x0000F00000000000ULL;
0177 static const cms_uint64_t BxNrMask = 0x00000FFF00000000ULL;
0178 static const cms_uint64_t EventNrMask = 0x0000000000FFFFFFULL;
0179
0180
0181 static const int BoardIdShift = 48;
0182 static const int BxInEventShift = 44;
0183 static const int BxNrShift = 32;
0184 static const int EventNrShift = 0;
0185
0186
0187 static const int DataCHSize = 16;
0188 static const cms_uint64_t DataCHMask = 0x000000000000FFFFULL;
0189
0190
0191 static const int ADataCH0Word = 1;
0192
0193
0194 static const int ADataCH4Word = 2;
0195
0196
0197 static const int BDataCH0Word = 3;
0198
0199
0200 static const int BDataCH4Word = 4;
0201
0202
0203 static const int LocalBxNrWord = 5;
0204 static const cms_uint64_t LocalBxNrMask = 0x0000000000000FFFULL;
0205 static const int LocalBxNrShift = 0;
0206
0207 private:
0208
0209
0210 cms_uint16_t m_boardId;
0211
0212 int m_bxInEvent;
0213
0214
0215
0216 cms_uint16_t m_bxNr;
0217 cms_uint32_t m_eventNr;
0218
0219 cms_uint16_t m_aData[NumberAData];
0220
0221 cms_uint16_t m_bData[NumberBData];
0222
0223 cms_uint16_t m_localBxNr;
0224
0225 };
0226
0227 #endif