CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 
21 class L1GctEmCand : public L1GctCand {
22 public:
24  L1GctEmCand();
25 
27  L1GctEmCand(uint16_t rawData, bool iso);
28 
30  L1GctEmCand(uint16_t rawData, bool iso, uint16_t block, uint16_t index, int16_t bx);
31 
34  L1GctEmCand(unsigned rank, unsigned phi, unsigned eta, bool iso);
35 
38  L1GctEmCand(unsigned rank, unsigned phi, unsigned eta, bool iso, uint16_t block, uint16_t index, int16_t bx);
39 
42 
44  ~L1GctEmCand() override;
45 
47  L1CaloRegionDetId regionId() const override;
48 
50  std::string name() const;
51 
53  bool empty() const override { return (rank() == 0); }
54 
56  uint16_t raw() const { return m_data; }
57 
59  unsigned rank() const override { return m_data & 0x3f; }
60 
62  unsigned etaIndex() const override { return (m_data >> 6) & 0xf; }
63 
65  unsigned etaSign() const override { return (m_data >> 9) & 0x1; }
66 
68  unsigned phiIndex() const override { return (m_data >> 10) & 0x1f; }
69 
71  bool isolated() const { return m_iso; }
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 L1GctEmCand& c) const {
84  return ((m_data == c.raw() && m_iso == c.isolated()) || (this->empty() && c.empty()));
85  }
86 
88  int operator!=(const L1GctEmCand& c) const { return !(*this == c); }
89 
90 private:
91  // set internal data from rank and region ieta, iphi
92  void construct(unsigned rank, unsigned eta, unsigned phi);
93 
94 private:
95  uint16_t m_data;
96  bool m_iso;
97  uint16_t m_captureBlock;
98  uint8_t m_captureIndex;
99  int16_t m_bx;
100 };
101 
102 std::ostream& operator<<(std::ostream& s, const L1GctEmCand& cand);
103 
104 #endif
unsigned etaIndex() const override
get eta index -6 to -0, +0 to +6 (bit 3 is sign, 1 for -ve Z, 0 for +ve Z)
Definition: L1GctEmCand.h:62
unsigned capIndex() const
what index within capture block
Definition: L1GctEmCand.h:77
const edm::EventSetup & c
uint16_t raw() const
get the raw data
Definition: L1GctEmCand.h:56
int operator==(const L1GctEmCand &c) const
equality operator
Definition: L1GctEmCand.h:83
Level-1 Region Calorimeter Trigger EM candidate.
Definition: L1CaloEmCand.h:17
uint16_t m_captureBlock
Definition: L1GctEmCand.h:97
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:167
~L1GctEmCand() override
destructor (virtual to prevent compiler warnings)
Definition: L1GctEmCand.cc:65
Level-1 Trigger EM candidate at output of GCT.
Definition: L1GctEmCand.h:21
uint16_t m_data
Definition: L1GctEmCand.h:95
bool empty() const override
was an object really found?
Definition: L1GctEmCand.h:53
void construct(unsigned rank, unsigned eta, unsigned phi)
Definition: L1GctEmCand.cc:78
int16_t m_bx
Definition: L1GctEmCand.h:99
std::string name() const
name of object
Definition: L1GctEmCand.cc:68
L1CaloRegionDetId regionId() const override
region associated with the candidate
Definition: L1GctEmCand.cc:71
L1GctEmCand()
default constructor (for vector initialisation etc.)
Definition: L1GctEmCand.cc:11
bool isolated() const
which stream did this come from
Definition: L1GctEmCand.h:71
unsigned etaSign() const override
get eta sign (1 for -ve Z, 0 for +ve Z)
Definition: L1GctEmCand.h:65
int16_t bx() const
get bunch-crossing index
Definition: L1GctEmCand.h:80
int operator!=(const L1GctEmCand &c) const
inequality operator
Definition: L1GctEmCand.h:88
ABC for GCT EM and jet candidates.
Definition: L1GctCand.h:12
uint8_t m_captureIndex
Definition: L1GctEmCand.h:98
unsigned phiIndex() const override
get phi index (0-17)
Definition: L1GctEmCand.h:68
unsigned rank() const override
get rank bits
Definition: L1GctEmCand.h:59
unsigned capBlock() const
which capture block did this come from
Definition: L1GctEmCand.h:74