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
HOTriggerPrimitiveDigi::raw_ieta
int raw_ieta() const
get the raw ieta value
Definition: HOTriggerPrimitiveDigi.h:28
HOTriggerPrimitiveDigi::raw
uint32_t raw() const
get the raw (packed) Triger Primitive
Definition: HOTriggerPrimitiveDigi.h:26
HOTriggerPrimitiveDigi::operator()
uint32_t operator()()
for streaming
Definition: HOTriggerPrimitiveDigi.h:51
HOTriggerPrimitiveDigi::HOTriggerPrimitiveDigi
HOTriggerPrimitiveDigi()
Definition: HOTriggerPrimitiveDigi.h:19
HOTriggerPrimitiveDigi::HOTriggerPrimitiveDigi
HOTriggerPrimitiveDigi(uint32_t data)
Definition: HOTriggerPrimitiveDigi.h:20
HOTriggerPrimitiveDigi::theHO_TP
uint32_t theHO_TP
Definition: HOTriggerPrimitiveDigi.h:54
HOTriggerPrimitiveDigi::nsamples
int nsamples() const
get the number of samples used to compute the TP
Definition: HOTriggerPrimitiveDigi.h:38
HOTriggerPrimitiveDigi::key_type
HcalDetId key_type
For the sorted collection.
Definition: HOTriggerPrimitiveDigi.h:17
HOTriggerPrimitiveDigi::id
const HcalDetId id() const
Definition: HOTriggerPrimitiveDigi.h:23
HOTriggerPrimitiveDigi
Definition: HOTriggerPrimitiveDigi.h:15
HOTriggerPrimitiveDigi::ieta_sign
int ieta_sign() const
get the sign of ieta (int: +/- 1)
Definition: HOTriggerPrimitiveDigi.h:30
operator<<
std::ostream & operator<<(std::ostream &, const HOTriggerPrimitiveDigi &)
Definition: HOTriggerPrimitiveDigi.cc:32
HcalOuter
Definition: HcalAssistant.h:35
HOTriggerPrimitiveDigi::ieta
int ieta() const
get the signed ieta value
Definition: HOTriggerPrimitiveDigi.h:34
HcalDetId.h
HcalDetId
Definition: HcalDetId.h:12
HOTriggerPrimitiveDigi::ieta_abs
int ieta_abs() const
get the absolute value of ieta
Definition: HOTriggerPrimitiveDigi.h:32
HOTriggerPrimitiveDigi::whichSampleTriggered
int whichSampleTriggered() const
get the number of the triggering sample
Definition: HOTriggerPrimitiveDigi.h:40
HOTriggerPrimitiveDigi::HO_TP_SAMPLES_MAX
static const int HO_TP_SAMPLES_MAX
Definition: HOTriggerPrimitiveDigi.h:44
HOTriggerPrimitiveDigi::iphi
int iphi() const
get the iphi value
Definition: HOTriggerPrimitiveDigi.h:36
HOTriggerPrimitiveDigi::bits
int bits() const
get the single-bit data
Definition: HOTriggerPrimitiveDigi.h:42
HOTriggerPrimitiveDigi::data
bool data(int whichbit=HO_TP_SAMPLES_MAX) const
Definition: HOTriggerPrimitiveDigi.cc:23