File indexing completed on 2024-04-06 12:04:04
0001 #ifndef DataFormats_EcalDig_EcalEBPhase2TriggerPrimitiveSample_h
0002 #define DataFormats_EcalDig_EcalEBPhase2TriggerPrimitiveSample_h
0003
0004 #include <ostream>
0005 #include <cstdint>
0006
0007
0008
0009
0010
0011
0012 class EcalEBPhase2TriggerPrimitiveSample {
0013 public:
0014 EcalEBPhase2TriggerPrimitiveSample();
0015 EcalEBPhase2TriggerPrimitiveSample(uint32_t data);
0016 EcalEBPhase2TriggerPrimitiveSample(int encodedEt);
0017 EcalEBPhase2TriggerPrimitiveSample(int encodedEt, bool isASpike);
0018 EcalEBPhase2TriggerPrimitiveSample(int encodedEt, bool isASpike, int timing);
0019
0020
0021 void setValue(uint32_t data) { theSample_ = data; }
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031 uint32_t raw() const { return theSample_ & 0x3ffff; }
0032
0033
0034 int encodedEt() const { return (theSample_ & 0x3ffff) & 0xFFF; }
0035
0036 bool l1aSpike() const { return (theSample_ & 0x3ffff & 0x1000) != 0; }
0037
0038 int time() const { return (theSample_ & 0x3ffff) >> 13; }
0039
0040
0041 uint32_t operator()() { return theSample_ & 0x3ffff; }
0042
0043 private:
0044 uint32_t theSample_;
0045 };
0046
0047 std::ostream& operator<<(std::ostream& s, const EcalEBPhase2TriggerPrimitiveSample& samp);
0048
0049 #endif