CMS 3D CMS Logo

L1GctJetCand.h
Go to the documentation of this file.
1 #ifndef L1GCTJETCAND_H
2 #define L1GCTJETCAND_H
3 
4 #include <ostream>
5 #include <string>
6 
8 
10 
16 
17 class L1GctJetCand : public L1GctCand {
18 public:
20  L1GctJetCand();
21 
23  L1GctJetCand(uint16_t rawData, bool isTau, bool isFor);
24 
26  L1GctJetCand(uint16_t rawData, bool isTau, bool isFor, uint16_t block, uint16_t index, int16_t bx);
27 
30  L1GctJetCand(unsigned rank, unsigned phi, unsigned eta, bool isTau, bool isFor);
31 
35  unsigned rank, unsigned phi, unsigned eta, bool isTau, bool isFor, uint16_t block, uint16_t index, int16_t bx);
36 
38  ~L1GctJetCand() override;
39 
41  L1CaloRegionDetId regionId() const override;
42 
44  std::string name() const;
45 
47  bool empty() const override { return (rank() == 0); }
48 
50  uint16_t raw() const { return m_data; }
51 
53  unsigned rank() const override { return m_data & 0x3f; }
54 
56  unsigned etaIndex() const override { return (m_data >> 6) & 0xf; }
57 
59  unsigned etaSign() const override { return (m_data >> 9) & 0x1; }
60 
62  unsigned phiIndex() const override { return (m_data >> 10) & 0x1f; }
63 
65  bool isCentral() const { return (!m_isTau) && (!m_isFor); }
66 
68  bool isTau() const { return m_isTau; }
69 
71  bool isForward() const { return m_isFor; }
72 
74  unsigned capBlock() const { return m_captureBlock; }
75 
77  unsigned capIndex() const { return m_captureIndex; }
78 
80  int16_t bx() const { return m_bx; }
81 
83  int operator==(const L1GctJetCand& c) const {
84  return ((m_data == c.raw() && m_isTau == c.isTau() && m_isFor == c.isForward()) || (this->empty() && c.empty()));
85  }
86 
88  int operator!=(const L1GctJetCand& c) const { return !(*this == c); }
89 
90 private:
91  uint16_t m_data;
92  bool m_isTau;
93  bool m_isFor;
94  uint16_t m_captureBlock;
95  uint8_t m_captureIndex;
96  int16_t m_bx;
97 };
98 
99 std::ostream& operator<<(std::ostream& s, const L1GctJetCand& cand);
100 
101 #endif
bool isTau() const
check if this is a tau
Definition: L1GctJetCand.h:68
unsigned capBlock() const
which capture block did this come from
Definition: L1GctJetCand.h:74
int16_t bx() const
get bunch-crossing index
Definition: L1GctJetCand.h:80
bool empty() const override
was an object really found?
Definition: L1GctJetCand.h:47
unsigned phiIndex() const override
get phi index (0-17)
Definition: L1GctJetCand.h:62
std::ostream & operator<<(std::ostream &s, const L1GctJetCand &cand)
Level-1 Trigger jet candidate.
Definition: L1GctJetCand.h:17
unsigned rank() const override
get rank bits
Definition: L1GctJetCand.h:53
bool isForward() const
check if this is a forward jet
Definition: L1GctJetCand.h:71
int16_t m_bx
Definition: L1GctJetCand.h:96
~L1GctJetCand() override
destructor (virtual to prevent compiler warnings)
Definition: L1GctJetCand.cc:56
uint8_t m_captureIndex
Definition: L1GctJetCand.h:95
L1GctJetCand()
default constructor (for vector initialisation etc.)
Definition: L1GctJetCand.cc:10
int operator==(const L1GctJetCand &c) const
equality operator
Definition: L1GctJetCand.h:83
unsigned etaIndex() const override
get eta index (bit 3 is sign, 1 for -ve Z, 0 for +ve Z)
Definition: L1GctJetCand.h:56
std::string name() const
name of object
Definition: L1GctJetCand.cc:59
uint16_t m_data
Definition: L1GctJetCand.h:91
unsigned capIndex() const
what index within capture block
Definition: L1GctJetCand.h:77
ABC for GCT EM and jet candidates.
Definition: L1GctCand.h:12
unsigned etaSign() const override
get eta sign bit (1 for -ve Z, 0 for +ve Z)
Definition: L1GctJetCand.h:59
bool isCentral() const
check if this is a central jet
Definition: L1GctJetCand.h:65
L1CaloRegionDetId regionId() const override
region associated with the candidate
Definition: L1GctJetCand.cc:90
uint16_t raw() const
get the raw data
Definition: L1GctJetCand.h:50
uint16_t m_captureBlock
Definition: L1GctJetCand.h:94
int operator!=(const L1GctJetCand &c) const
inequality operator
Definition: L1GctJetCand.h:88