00001 #ifndef ECALTRIGGERPRIMITIVESAMPLE_H 00002 #define ECALTRIGGERPRIMITIVESAMPLE_H 1 00003 00004 #include <boost/cstdint.hpp> 00005 #include <ostream> 00006 00007 00008 00015 class EcalTriggerPrimitiveSample { 00016 public: 00017 EcalTriggerPrimitiveSample(); 00018 EcalTriggerPrimitiveSample(uint16_t data); 00019 EcalTriggerPrimitiveSample(int encodedEt, bool finegrain, int triggerFlag); 00020 00022 void setValue(uint16_t data){ theSample = data;} 00024 uint16_t raw() const { return theSample; } 00026 int compressedEt() const { return theSample&0xFF; } 00028 bool fineGrain() const { return (theSample&0x100)!=0; } 00030 int ttFlag() const { return (theSample>>9)&0x7; } 00031 00033 uint16_t operator()() { return theSample; } 00034 00035 private: 00036 uint16_t theSample; 00037 }; 00038 00039 std::ostream& operator<<(std::ostream& s, const EcalTriggerPrimitiveSample& samp); 00040 00041 00042 00043 00044 #endif