CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1GctEmCand.h
Go to the documentation of this file.
1 #ifndef L1GCTEMCAND_H
2 #define L1GCTEMCAND_H
3 
4 #include <ostream>
5 #include <string>
6 
8 
11 
22 class L1GctEmCand : public L1GctCand {
23 public:
24 
26  L1GctEmCand();
27 
29  L1GctEmCand(uint16_t rawData, bool iso);
30 
32  L1GctEmCand(uint16_t rawData, bool iso, uint16_t block, uint16_t index, int16_t bx);
33 
36  L1GctEmCand(unsigned rank, unsigned phi, unsigned eta, bool iso);
37 
40  L1GctEmCand(unsigned rank, unsigned phi, unsigned eta, bool iso, uint16_t block, uint16_t index, int16_t bx);
41 
44 
46  virtual ~L1GctEmCand();
47 
50 
52  std::string name() const;
53 
55  bool empty() const { return (rank() == 0); }
56 
58  uint16_t raw() const { return m_data; }
59 
61  unsigned rank() const { return m_data & 0x3f; }
62 
64  unsigned etaIndex() const { return (m_data>>6) & 0xf; }
65 
67  unsigned etaSign() const { return (m_data>>9) & 0x1; }
68 
70  unsigned phiIndex() const { return (m_data>>10) & 0x1f; }
71 
73  bool isolated() const { return m_iso; }
74 
76  unsigned capBlock() const { return m_captureBlock; }
77 
79  unsigned capIndex() const { return m_captureIndex; }
80 
82  int16_t bx() const { return m_bx; }
83 
85  int operator==(const L1GctEmCand& c) const { return ((m_data==c.raw() && m_iso==c.isolated())
86  || (this->empty() && c.empty())); }
87 
89  int operator!=(const L1GctEmCand& c) const { return !(*this == c); }
90 
91  private:
92 
93  // set internal data from rank and region ieta, iphi
94  void construct(unsigned rank, unsigned eta, unsigned phi);
95 
96  private:
97 
98  uint16_t m_data;
99  bool m_iso;
100  uint16_t m_captureBlock;
101  uint8_t m_captureIndex;
102  int16_t m_bx;
103 
104  };
105 
106 
107 std::ostream& operator<<(std::ostream& s, const L1GctEmCand& cand);
108 
109 
110 
111 #endif
unsigned capIndex() const
what index within capture block
Definition: L1GctEmCand.h:79
unsigned etaSign() const
get eta sign (1 for -ve Z, 0 for +ve Z)
Definition: L1GctEmCand.h:67
uint16_t raw() const
get the raw data
Definition: L1GctEmCand.h:58
unsigned rank() const
get rank bits
Definition: L1GctEmCand.h:61
int operator==(const L1GctEmCand &c) const
equality operator
Definition: L1GctEmCand.h:85
Level-1 Region Calorimeter Trigger EM candidate.
Definition: L1CaloEmCand.h:18
uint16_t m_captureBlock
Definition: L1GctEmCand.h:100
unsigned phiIndex() const
get phi index (0-17)
Definition: L1GctEmCand.h:70
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
Level-1 Trigger EM candidate at output of GCT.
Definition: L1GctEmCand.h:22
uint16_t m_data
Definition: L1GctEmCand.h:98
void construct(unsigned rank, unsigned eta, unsigned phi)
Definition: L1GctEmCand.cc:99
int16_t m_bx
Definition: L1GctEmCand.h:102
L1CaloRegionDetId regionId() const
region associated with the candidate
Definition: L1GctEmCand.cc:92
unsigned etaIndex() const
get eta index -6 to -0, +0 to +6 (bit 3 is sign, 1 for -ve Z, 0 for +ve Z)
Definition: L1GctEmCand.h:64
std::string name() const
name of object
Definition: L1GctEmCand.cc:85
virtual ~L1GctEmCand()
destructor (virtual to prevent compiler warnings)
Definition: L1GctEmCand.cc:82
bool empty() const
was an object really found?
Definition: L1GctEmCand.h:55
L1GctEmCand()
default constructor (for vector initialisation etc.)
Definition: L1GctEmCand.cc:12
bool isolated() const
which stream did this come from
Definition: L1GctEmCand.h:73
int16_t bx() const
get bunch-crossing index
Definition: L1GctEmCand.h:82
int operator!=(const L1GctEmCand &c) const
inequality operator
Definition: L1GctEmCand.h:89
ABC for GCT EM and jet candidates.
Definition: L1GctCand.h:12
uint8_t m_captureIndex
Definition: L1GctEmCand.h:101
unsigned capBlock() const
which capture block did this come from
Definition: L1GctEmCand.h:76