00001 #ifndef L1GCTHFBITCOUNTS_H 00002 #define L1GCTHFBITCOUNTS_H 00003 00004 #include <ostream> 00005 #include <string> 00006 #include <stdint.h> 00007 00015 00016 00017 class L1GctHFBitCounts { 00018 00019 public: 00020 static const unsigned N_SUMS=4; 00021 00022 public: 00023 00025 L1GctHFBitCounts(); 00026 00028 ~L1GctHFBitCounts(); 00029 00033 static L1GctHFBitCounts fromConcHFBitCounts(const uint16_t capBlock, 00034 const uint16_t capIndex, 00035 const int16_t bx, 00036 const uint32_t data); 00037 00039 static L1GctHFBitCounts fromGctEmulator(const int16_t bx, 00040 const uint16_t bitCountPosEtaRing1, 00041 const uint16_t bitCountNegEtaRing1, 00042 const uint16_t bitCountPosEtaRing2, 00043 const uint16_t bitCountNegEtaRing2); 00044 00045 // optional named ctor for GT if required 00046 // arguments to be defined 00047 // static L1GctHFBitCounts fromGtPsb() 00048 00049 00050 // getters 00051 00052 // get number of ring sums 00053 static unsigned nCounts() { return N_SUMS; } 00054 00056 uint16_t capBlock() const { return capBlock_; } 00057 00059 uint16_t capIndex() const { return capIndex_; } 00060 00062 int16_t bx() const { return bx_; } 00063 00065 bool empty() const { return (data_ == 0); } 00066 00068 uint16_t raw() const { return data_; } 00069 00076 uint16_t bitCount(unsigned const i) const; 00077 00078 00079 // setters 00080 00082 void setCapBlock(uint16_t capBlock) { capBlock_ = capBlock; } 00083 00085 void setCapIndex(uint16_t capIndex) { capIndex_ = capIndex; } 00086 00088 void setBx(int16_t bx) { bx_ = bx; } 00089 00091 void setBitCount(unsigned i, uint16_t c); 00092 00094 void setData(uint32_t data) { data_ = data; } 00095 00096 00098 00100 bool operator==(const L1GctHFBitCounts& c) const; 00101 00103 bool operator!=(const L1GctHFBitCounts& c) const { return !(*this == c); } 00104 00105 private: 00106 00107 // source of the data 00108 uint16_t capBlock_; 00109 uint16_t capIndex_; 00110 int16_t bx_; 00111 00112 // the captured data 00113 uint16_t data_; 00114 00115 }; 00116 00117 std::ostream& operator<<(std::ostream& s, const L1GctHFBitCounts& cand); 00118 00119 #endif