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