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