CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch2/src/DataFormats/L1GlobalCaloTrigger/interface/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 #include <stdint.h>
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                                wheel_hf_ring_et_sums,
00026                                wheel_hf_bit_counts
00027   };
00028   
00030   L1GctInternHFData();
00031 
00033   ~L1GctInternHFData();
00034 
00035   static L1GctInternHFData fromConcRingSums(const uint16_t capBlock,
00036                                             const uint16_t capIndex,
00037                                             const int16_t bx,
00038                                             const uint32_t data);
00039   
00040   static L1GctInternHFData fromConcBitCounts(const uint16_t capBlock,
00041                                              const uint16_t capIndex,
00042                                              const int16_t bx,
00043                                              const uint32_t data);
00044   
00045   static L1GctInternHFData fromWheelRingSums(const uint16_t capBlock,
00046                                              const uint16_t capIndex,
00047                                              const int16_t bx,
00048                                              const uint32_t data);
00049   
00050   static L1GctInternHFData fromWheelBitCounts(const uint16_t capBlock,
00051                                               const uint16_t capIndex,
00052                                               const int16_t bx,
00053                                               const uint32_t data);
00054 
00056 
00058   L1GctInternHFData::L1GctInternHFDataType type() const { return type_; }
00059 
00061   uint16_t capBlock() const { return capBlock_; }
00062 
00064   uint16_t capIndex() const { return capIndex_; }
00065 
00067   int16_t bx() const { return bx_; }
00068 
00070   bool empty() const { return (data_ == 0); }
00071 
00072 
00074 
00076   bool isRingSums() const { return (type_ == conc_hf_ring_et_sums || type_ == wheel_hf_ring_et_sums); }
00077 
00079   uint32_t raw() const { return data_; }
00080   
00082   uint16_t value(unsigned i) const;
00083 
00085   uint16_t et(unsigned i) const;
00086 
00088   uint16_t count(unsigned i) const;
00089 
00090 
00091   // setters  
00092   
00094   void setCapBlock(uint16_t const capBlock) { capBlock_ = capBlock; }
00095 
00097   void setCapIndex(uint16_t const capIndex) { capIndex_ = capIndex; }
00098 
00100   void setBx(int16_t const bx) { bx_ = bx; }
00101 
00103   void setType(L1GctInternHFDataType type) { type_ = type; }
00104 
00106   void setValue(unsigned const i, uint16_t const val);
00107 
00109   void setEt(unsigned const i, uint16_t const et);
00110 
00112   void setCount(unsigned const i, uint16_t const count);
00113 
00114   void setData(uint32_t const data) { data_ = data; }
00115   
00116 
00118 
00120   bool operator==(const L1GctInternHFData& c) const;
00121   
00123   bool operator!=(const L1GctInternHFData& c) const { return !(*this == c); }
00124 
00125 
00126  private:
00127 
00128   // type of data
00129   L1GctInternHFDataType type_;
00130 
00131   // source of the data
00132   uint16_t capBlock_;
00133   uint16_t capIndex_;
00134   int16_t bx_;
00135 
00136   // the captured data
00137   uint32_t data_;
00138 
00139  };
00140 
00141 std::ostream& operator<<(std::ostream& s, const L1GctInternHFData& cand);
00142 
00143 #endif