CMS 3D CMS Logo

L1GctInternHFData.h

Go to the documentation of this file.
00001 #ifndef L1GCTINTERNHFDATA_H
00002 #define L1GCTINTERNHFDATA_H
00003 
00004 #include <ostream>
00005 #include <string>
00006 
00007 
00015 
00016 
00017 class L1GctInternHFData {
00018 
00019  public:
00020 
00022   enum L1GctInternHFDataType { null,
00023                                conc_hf_ring_et_sums,
00024                                conc_hf_bit_counts
00025   };
00026   
00028   L1GctInternHFData();
00029 
00031   ~L1GctInternHFData();
00032 
00033   static L1GctInternHFData fromConcRingSums(const uint16_t capBlock,
00034                                             const uint16_t capIndex,
00035                                             const int16_t bx,
00036                                             const uint32_t data);
00037   
00038   static L1GctInternHFData fromConcBitCounts(const uint16_t capBlock,
00039                                              const uint16_t capIndex,
00040                                              const int16_t bx,
00041                                              const uint32_t data);
00042   
00044 
00046   L1GctInternHFData::L1GctInternHFDataType type() const { return type_; }
00047 
00049   uint16_t capBlock() const { return capBlock_; }
00050 
00052   uint16_t capIndex() const { return capIndex_; }
00053 
00055   int16_t bx() const { return bx_; }
00056 
00058   bool empty() const { return (data_ == 0); }
00059 
00060 
00062 
00064   bool isRingSums() const { return (type_ == conc_hf_ring_et_sums); }
00065 
00067   uint32_t raw() const { return data_; }
00068   
00070   uint16_t value(unsigned const i);
00071 
00073   uint16_t et(unsigned const i);
00074 
00076   uint16_t count(unsigned const i);
00077 
00078 
00079   // setters  
00080   
00082   void setCapBlock(uint16_t const capBlock) { capBlock_ = capBlock; }
00083 
00085   void setCapIndex(uint16_t const capIndex) { capIndex_ = capIndex; }
00086 
00088   void setBx(int16_t const bx) { bx_ = bx; }
00089 
00091   void setType(L1GctInternHFDataType type) { type_ = type; }
00092 
00094   void setValue(unsigned const i, uint16_t const val);
00095 
00097   void setEt(unsigned const i, uint16_t const et);
00098 
00100   void setCount(unsigned const i, uint16_t const count);
00101 
00102   void setData(uint32_t const data) { data_ = data; }
00103   
00104 
00106 
00108   bool operator==(const L1GctInternHFData& c) const;
00109   
00111   bool operator!=(const L1GctInternHFData& c) const { return !(*this == c); }
00112 
00113 
00114  private:
00115 
00116   // type of data
00117   L1GctInternHFDataType type_;
00118 
00119   // source of the data
00120   uint16_t capBlock_;
00121   uint16_t capIndex_;
00122   int16_t bx_;
00123 
00124   // the captured data
00125   uint32_t data_;
00126 
00127  };
00128 
00129 std::ostream& operator<<(std::ostream& s, const L1GctInternHFData& cand);
00130 
00131 #endif

Generated on Tue Jun 9 17:31:10 2009 for CMSSW by  doxygen 1.5.4