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 00036 int l1aSpike() const { return (theSample >>12) & 0x1; } 00037 00041 int sFGVB() const { return (theSample >>12) & 0x1; } 00042 00044 uint16_t operator()() { return theSample; } 00045 00046 private: 00047 uint16_t theSample; 00048 }; 00049 00050 std::ostream& operator<<(std::ostream& s, const EcalTriggerPrimitiveSample& samp); 00051 00052 00053 00054 00055 #endif