CMS 3D CMS Logo

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 
8 
18 class L1GctInternEmCand { //: public L1GctCand {
19 public:
22 
24  L1GctInternEmCand(uint16_t data, bool iso, unsigned block, unsigned index, int16_t bx);
25 
26  // construct from eta, phi etc
28  unsigned rank, unsigned eta, unsigned etaSgn, unsigned phi, bool iso, unsigned block, unsigned index, int16_t bx);
29 
31  virtual ~L1GctInternEmCand();
32 
35 
37  std::string name() const;
38 
40  bool empty() const;
41 
43  uint16_t raw() const { return m_data; }
44 
46  unsigned rank() const { return m_data & 0x3f; }
47 
49  unsigned etaIndex() const { return (m_data >> 6) & 0x1f; }
50 
52  unsigned etaSign() const { return (m_data >> 10) & 0x1; }
53 
55  unsigned phiIndex() const { return (m_data >> 11) & 0x1f; }
56 
58  bool isolated() const { return m_iso; }
59 
61  unsigned capBlock() const { return m_captureBlock; }
62 
64  unsigned capIndex() const { return m_captureIndex; }
65 
67  int16_t bx() const { return m_bx; }
68 
70  int operator==(const L1GctInternEmCand& c) const {
71  return ((m_data == c.raw() && m_iso == c.isolated()) || (this->empty() && c.empty()));
72  }
73 
75  int operator!=(const L1GctInternEmCand& c) const {
76  return ((m_data != c.raw() || m_iso != c.isolated()) && (!this->empty() || !c.empty()));
77  }
78 
79 private:
80  // set internal data from rank and region ieta, iphi
81  void construct(unsigned rank, unsigned eta, unsigned etaSgn, unsigned phi);
82 
83 private:
84  uint16_t m_data;
85  uint16_t m_captureBlock;
86  uint8_t m_captureIndex;
87  bool m_iso;
88  int16_t m_bx;
89 };
90 
91 std::ostream& operator<<(std::ostream& s, const L1GctInternEmCand& cand);
92 
93 #endif
uint16_t raw() const
get the raw data
virtual ~L1GctInternEmCand()
destructor (virtual to prevent compiler warnings)
bool isolated() const
which stream did this come from
std::string name() const
name of object
void construct(unsigned rank, unsigned eta, unsigned etaSgn, unsigned phi)
unsigned phiIndex() const
get phi index (0-17)
std::ostream & operator<<(std::ostream &s, const L1GctInternEmCand &cand)
unsigned rank() const
get rank bits
unsigned etaSign() const
get eta sign (1 for -ve Z, 0 for +ve Z)
bool empty() const
was an object really found?
int operator==(const L1GctInternEmCand &c) const
equality operator
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
L1GctInternEmCand()
default constructor (for vector initialisation etc.)
unsigned etaIndex() const
get eta index - Barrel 1:4, Endcap 5:7, HF 8:11
int16_t bx() const
get bunch-crossing index
L1CaloRegionDetId regionId() const
region associated with the candidate
unsigned capIndex() const
what index within capture block
int operator!=(const L1GctInternEmCand &c) const
inequality operator
unsigned capBlock() const
which capture block did this come from