CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1GctInternEmCand.h
Go to the documentation of this file.
1 #ifndef L1GCTINTERNEMCAND_H
2 #define L1GCTINTERNEMCAND_H
3 
4 #include <ostream>
5 #include <string>
6 
7 
9 
20 class L1GctInternEmCand { //: public L1GctCand {
21 public:
22 
25 
27  L1GctInternEmCand(uint16_t data, bool iso, unsigned block, unsigned index, int16_t bx);
28 
29  // construct from eta, phi etc
30  L1GctInternEmCand(unsigned rank, unsigned eta, unsigned etaSgn, unsigned phi, bool iso, unsigned block, unsigned index, int16_t bx);
31 
33  virtual ~L1GctInternEmCand();
34 
37 
39  std::string name() const;
40 
42  bool empty() const;
43 
45  uint16_t raw() const { return m_data; }
46 
48  unsigned rank() const { return m_data & 0x3f; }
49 
51  unsigned etaIndex() const { return (m_data>>6) & 0x1f; }
52 
54  unsigned etaSign() const { return (m_data>>10) & 0x1; }
55 
57  unsigned phiIndex() const { return (m_data>>11) & 0x1f; }
58 
60  bool isolated() const { return m_iso; }
61 
63  unsigned capBlock() const { return m_captureBlock; }
64 
66  unsigned capIndex() const { return m_captureIndex; }
67 
69  int16_t bx() const { return m_bx; }
70 
72  int operator==(const L1GctInternEmCand& c) const { return ((m_data==c.raw() && m_iso==c.isolated())
73  || (this->empty() && c.empty())); }
74 
76  int operator!=(const L1GctInternEmCand& c) const { return ((m_data!=c.raw() || m_iso!=c.isolated())
77  && (!this->empty() || !c.empty())); }
78 
79  private:
80 
81  // set internal data from rank and region ieta, iphi
82  void construct(unsigned rank, unsigned eta, unsigned etaSgn, unsigned phi);
83 
84  private:
85 
86  uint16_t m_data;
87  uint16_t m_captureBlock;
88  uint8_t m_captureIndex;
89  bool m_iso;
90  int16_t m_bx;
91 
92  };
93 
94 
95 std::ostream& operator<<(std::ostream& s, const L1GctInternEmCand& cand);
96 
97 
98 
99 #endif
L1CaloRegionDetId regionId() const
region associated with the candidate
int16_t bx() const
get bunch-crossing index
bool empty() const
was an object really found?
virtual ~L1GctInternEmCand()
destructor (virtual to prevent compiler warnings)
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:188
unsigned etaIndex() const
get eta index - Barrel 1:4, Endcap 5:7, HF 8:11
unsigned capBlock() const
which capture block did this come from
void construct(unsigned rank, unsigned eta, unsigned etaSgn, unsigned phi)
bool isolated() const
which stream did this come from
unsigned phiIndex() const
get phi index (0-17)
int operator==(const L1GctInternEmCand &c) const
equality operator
uint16_t raw() const
get the raw data
int operator!=(const L1GctInternEmCand &c) const
inequality operator
unsigned capIndex() const
what index within capture block
unsigned etaSign() const
get eta sign (1 for -ve Z, 0 for +ve Z)
std::string name() const
name of object
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
unsigned rank() const
get rank bits
L1GctInternEmCand()
default constructor (for vector initialisation etc.)