CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/DataFormats/HcalDigi/interface/HcalQIESample.h

Go to the documentation of this file.
00001 #ifndef DIGIHCAL_HCALQIESAMPLE_H
00002 #define DIGIHCAL_HCALQIESAMPLE_H
00003 
00004 #include <ostream>
00005 #include <boost/cstdint.hpp>
00006 
00015 class HcalQIESample {
00016 public:
00017   HcalQIESample() { theSample=0; }
00018   HcalQIESample(uint16_t data) { theSample=data; }
00019   HcalQIESample(int adc, int capid, int fiber, int fiberchan, bool dv=true, bool er=false);
00020   
00022   uint16_t raw() const { return theSample; }
00024   int adc() const { return theSample&0x7F; }
00026   double nominal_fC() const;
00028   int capid() const { return (theSample>>7)&0x3; }
00030   bool dv() const { return (theSample&0x0200)!=0; }
00032   bool er() const { return (theSample&0x0400)!=0; }
00034   int fiber() const { return ((theSample>>13)&0x7)+1; }
00036   int fiberChan() const { return (theSample>>11)&0x3; }
00038   int fiberAndChan() const { return (theSample>>11)&0x1F; }
00039   
00041   uint16_t operator()() { return theSample; }
00042   
00043 private:
00044   uint16_t theSample;
00045 };
00046 
00047 std::ostream& operator<<(std::ostream&, const HcalQIESample&);
00048   
00049 #endif