CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HOTriggerPrimitiveDigi.h
Go to the documentation of this file.
1 #ifndef DIGIHCAL_HOTRIGGERPRIMITIVEDIGI_H
2 #define DIGIHCAL_HOTRIGGERPRIMITIVEDIGI_H
3 
4 #include <boost/cstdint.hpp>
5 #include <ostream>
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 raw_ieta() const
get the raw ieta value
int bits() const
get the single-bit data
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
static const int HO_TP_SAMPLES_MAX
int iphi() const
get the iphi value
HcalDetId key_type
For the sorted collection.
int ieta_abs() const
get the absolute value of ieta
uint32_t raw() const
get the raw (packed) Triger Primitive
const HcalDetId id() const
uint32_t operator()()
for streaming
HOTriggerPrimitiveDigi(uint32_t data)
int ieta_sign() const
get the sign of ieta (int: +/- 1)
bool data(int whichbit=HO_TP_SAMPLES_MAX) const
int ieta() const
get the signed ieta value
int nsamples() const
get the number of samples used to compute the TP
int whichSampleTriggered() const
get the number of the triggering sample