CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_0/src/DataFormats/L1GlobalCaloTrigger/interface/L1GctHFRingEtSums.h

Go to the documentation of this file.
00001 #ifndef L1GCTHFRINGETSUMS_H
00002 #define L1GCTHFRINGETSUMS_H
00003 
00004 #include <ostream>
00005 #include <string>
00006 #include <stdint.h>
00007 
00015 
00016 
00017 class L1GctHFRingEtSums {
00018 
00019  public:
00020   static const unsigned N_SUMS=4;
00021 
00022  public:
00023 
00025   L1GctHFRingEtSums();
00026 
00028   ~L1GctHFRingEtSums();
00029 
00033   static L1GctHFRingEtSums fromConcRingSums(const uint16_t capBlock,
00034                                             const uint16_t capIndex,
00035                                             const int16_t bx,
00036                                             const uint32_t data);
00037   
00039   static L1GctHFRingEtSums fromGctEmulator(const int16_t bx,
00040                                            const uint16_t etSumPosEtaRing1,
00041                                            const uint16_t etSumNegEtaRing1,
00042                                            const uint16_t etSumPosEtaRing2,
00043                                            const uint16_t etSumNegEtaRing2);
00044   
00045   // optional named ctor for GT if required
00046   // arguments to be defined
00047   // static L1GctHfRingEtSums fromGtPsb()
00048   
00049   // get number of ring sums
00050   static unsigned nSums() { return N_SUMS; }
00051   
00052   // getters
00053   
00055   uint16_t capBlock() const { return capBlock_; }
00056 
00058   uint16_t capIndex() const { return capIndex_; }
00059 
00061   int16_t bx() const { return bx_; }
00062 
00064   bool empty() const { return (data_ == 0); }
00065 
00067   uint16_t raw() const { return data_; }
00068   
00075   uint16_t etSum(unsigned const i) const;
00076 
00077 
00078   // setters
00079   
00081   void setCapBlock(uint16_t capBlock) { capBlock_ = capBlock; }
00082 
00084   void setCapIndex(uint16_t capIndex) { capIndex_ = capIndex; }
00085 
00087   void setBx(uint16_t bx) { bx_ = bx; }
00088 
00090   void setEtSum(unsigned i, uint16_t et);
00091 
00093   void setData(uint32_t data) { data_ = data; }
00094 
00095 
00097 
00099   bool operator==(const L1GctHFRingEtSums& c) const;
00100   
00102   bool operator!=(const L1GctHFRingEtSums& c) const { return !(*this == c); }
00103 
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 L1GctHFRingEtSums& cand);
00118 
00119 #endif