File indexing completed on 2024-04-06 12:04:26
0001 #ifndef L1GCTHFRINGETSUMS_H
0002 #define L1GCTHFRINGETSUMS_H
0003
0004 #include <ostream>
0005 #include <string>
0006 #include <cstdint>
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 class L1GctHFRingEtSums {
0017 public:
0018 static const unsigned N_SUMS = 4;
0019
0020 public:
0021
0022 L1GctHFRingEtSums();
0023
0024
0025 ~L1GctHFRingEtSums();
0026
0027
0028
0029
0030 static L1GctHFRingEtSums fromConcRingSums(const uint16_t capBlock,
0031 const uint16_t capIndex,
0032 const int16_t bx,
0033 const uint32_t data);
0034
0035
0036 static L1GctHFRingEtSums fromGctEmulator(const int16_t bx,
0037 const uint16_t etSumPosEtaRing1,
0038 const uint16_t etSumNegEtaRing1,
0039 const uint16_t etSumPosEtaRing2,
0040 const uint16_t etSumNegEtaRing2);
0041
0042
0043
0044
0045
0046
0047 static unsigned nSums() { return N_SUMS; }
0048
0049
0050
0051
0052 uint16_t capBlock() const { return capBlock_; }
0053
0054
0055 uint16_t capIndex() const { return capIndex_; }
0056
0057
0058 int16_t bx() const { return bx_; }
0059
0060
0061 bool empty() const { return (data_ == 0); }
0062
0063
0064 uint16_t raw() const { return data_; }
0065
0066
0067
0068
0069
0070
0071
0072 uint16_t etSum(unsigned const i) const;
0073
0074
0075
0076
0077 void setCapBlock(uint16_t capBlock) { capBlock_ = capBlock; }
0078
0079
0080 void setCapIndex(uint16_t capIndex) { capIndex_ = capIndex; }
0081
0082
0083 void setBx(uint16_t bx) { bx_ = bx; }
0084
0085
0086 void setEtSum(unsigned i, uint16_t et);
0087
0088
0089 void setData(uint32_t data) { data_ = data; }
0090
0091
0092
0093
0094 bool operator==(const L1GctHFRingEtSums& c) const;
0095
0096
0097 bool operator!=(const L1GctHFRingEtSums& c) const { return !(*this == c); }
0098
0099 private:
0100
0101 uint16_t capBlock_;
0102 uint16_t capIndex_;
0103 int16_t bx_;
0104
0105
0106 uint16_t data_;
0107 };
0108
0109 std::ostream& operator<<(std::ostream& s, const L1GctHFRingEtSums& cand);
0110
0111 #endif