CMS 3D CMS Logo

EcalEBPhase2TriggerPrimitiveSample.h
Go to the documentation of this file.
1 #ifndef DataFormats_EcalDig_EcalEBPhase2TriggerPrimitiveSample_h
2 #define DataFormats_EcalDig_EcalEBPhase2TriggerPrimitiveSample_h
3 
4 #include <ostream>
5 #include <cstdint>
6 
13 public:
18  EcalEBPhase2TriggerPrimitiveSample(int encodedEt, bool isASpike, int timing);
19 
21  void setValue(uint32_t data) { theSample_ = data; }
22  // The sample is a 18 bit word defined as:
23  //
24  // o o o o o o o o o o o o o o o o o o
25  // |________| |_______________________|
26  // ~60ps res spike Et
27  // time info flag
28  //
29 
31  uint32_t raw() const { return theSample_ & 0x3ffff; }
32 
34  int encodedEt() const { return (theSample_ & 0x3ffff) & 0xFFF; }
35 
36  bool l1aSpike() const { return (theSample_ & 0x3ffff & 0x1000) != 0; }
37 
38  int time() const { return (theSample_ & 0x3ffff) >> 13; }
39 
41  uint32_t operator()() { return theSample_ & 0x3ffff; }
42 
43 private:
44  uint32_t theSample_;
45 };
46 
47 std::ostream& operator<<(std::ostream& s, const EcalEBPhase2TriggerPrimitiveSample& samp);
48 
49 #endif
std::ostream & operator<<(std::ostream &s, const EcalEBPhase2TriggerPrimitiveSample &samp)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
int encodedEt() const
get the encoded Et (12 bits)