CMS 3D CMS Logo

HOTriggerPrimitiveDigi.h
Go to the documentation of this file.
1 #ifndef DIGIHCAL_HOTRIGGERPRIMITIVEDIGI_H
2 #define DIGIHCAL_HOTRIGGERPRIMITIVEDIGI_H
3 
4 #include <ostream>
6 #include <cstdint>
7 
16 public:
17  typedef HcalDetId key_type;
18 
21  HOTriggerPrimitiveDigi(int ieta, int iphi, int nsamples, int whichSampleTriggered, int databits);
22 
23  const HcalDetId id() const { return HcalDetId(HcalOuter, ieta(), iphi(), 4); }
24 
26  uint32_t raw() const { return theHO_TP; }
28  int raw_ieta() const { return theHO_TP & 0x1F; }
30  int ieta_sign() const { return ((theHO_TP & 0x10) ? (-1) : (1)); }
32  int ieta_abs() const { return (theHO_TP & 0x000F); }
34  int ieta() const { return ieta_abs() * ieta_sign(); }
36  int iphi() const { return (theHO_TP >> 5) & 0x007F; }
38  int nsamples() const { return (theHO_TP >> 12) & 0x000F; }
40  int whichSampleTriggered() const { return (theHO_TP >> 16) & 0x000F; }
42  int bits() const { return (theHO_TP >> 20) & 0x03FF; }
43 
44  static const int HO_TP_SAMPLES_MAX = 10;
45 
48  bool data(int whichbit = HO_TP_SAMPLES_MAX) const;
49 
51  uint32_t operator()() { return theHO_TP; }
52 
53 private:
54  uint32_t theHO_TP;
55 };
56 
57 std::ostream& operator<<(std::ostream&, const HOTriggerPrimitiveDigi&);
58 
59 #endif
int ieta() const
get the signed ieta value
int ieta_abs() const
get the absolute value of ieta
int whichSampleTriggered() const
get the number of the triggering sample
int iphi() const
get the iphi value
int bits() const
get the single-bit data
bool data(int whichbit=HO_TP_SAMPLES_MAX) const
static const int HO_TP_SAMPLES_MAX
uint32_t raw() const
get the raw (packed) Triger Primitive
int raw_ieta() const
get the raw ieta value
std::ostream & operator<<(std::ostream &, const HOTriggerPrimitiveDigi &)
HcalDetId key_type
For the sorted collection.
int nsamples() const
get the number of samples used to compute the TP
uint32_t operator()()
for streaming
HOTriggerPrimitiveDigi(uint32_t data)
int ieta_sign() const
get the sign of ieta (int: +/- 1)
const HcalDetId id() const