CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1CaloEmCand.h
Go to the documentation of this file.
1 #ifndef L1CALOEMCAND_H
2 #define L1CALOEMCAND_H
3 
4 #include <ostream>
5 
7 
18 class L1CaloEmCand {
19 public:
20 
22  L1CaloEmCand();
23 
25  L1CaloEmCand(uint16_t data, unsigned crate, bool iso);
26 
29  L1CaloEmCand(uint16_t data, unsigned crate, bool iso, uint16_t index, int16_t bx, bool dummy);
30 
32  L1CaloEmCand(unsigned rank, unsigned region, unsigned card, unsigned crate, bool iso);
33 
35  L1CaloEmCand(unsigned rank, unsigned region, unsigned card, unsigned crate, bool iso, uint16_t index, int16_t bx);
36 
38  ~L1CaloEmCand();
39 
41  uint16_t raw() const { return m_data; }
42 
44  unsigned rank() const { return m_data & 0x3f; }
45 
47  unsigned rctCard() const { return (m_data>>7) & 0x7; }
48 
50  unsigned rctRegion() const { return (m_data>>6) & 0x1; }
51 
53  unsigned rctCrate() const { return m_rctCrate; }
54 
56  bool isolated() const { return m_iso; }
57 
59  unsigned index() const { return m_index; }
60 
62  int16_t bx() const { return m_bx; }
63 
66 
68  void setBx(int16_t bx);
69 
71  int operator==(const L1CaloEmCand& c) const { return ((m_data==c.raw() && m_iso==c.isolated() && m_rctCrate==c.rctCrate() && this->regionId()==c.regionId()) || (this->empty() && c.empty())); }
72 
74  int operator!=(const L1CaloEmCand& c) const { return !(*this == c); }
75 
77  bool empty() const { return (rank() == 0); }
78 
79 
80  private:
81 
82  // rank, card and region ID are contained in the data on the cable
83  uint16_t m_data;
84 
85  // members to store geographical information (crate/cable)
86  // these should probably be packed into a single uint16_t (or m_data) ???
87  uint16_t m_rctCrate;
88  bool m_iso;
89  uint16_t m_index;
90  int16_t m_bx;
91 
92  };
93 
94 
95 std::ostream& operator<<(std::ostream& s, const L1CaloEmCand& cand);
96 
97 
98 
99 #endif
uint16_t raw() const
get the raw data
Definition: L1CaloEmCand.h:41
int operator==(const L1CaloEmCand &c) const
equality operator, including rank, isolation, position
Definition: L1CaloEmCand.h:71
void setBx(int16_t bx)
set BX
Definition: L1CaloEmCand.cc:69
Level-1 Region Calorimeter Trigger EM candidate.
Definition: L1CaloEmCand.h:18
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
L1CaloEmCand()
default constructor (for vector initialisation etc.)
Definition: L1CaloEmCand.cc:11
bool empty() const
is there any information in the candidate
Definition: L1CaloEmCand.h:77
~L1CaloEmCand()
destructor
Definition: L1CaloEmCand.cc:67
uint16_t m_index
Definition: L1CaloEmCand.h:89
L1CaloRegionDetId regionId() const
get DetID object
Definition: L1CaloEmCand.h:65
unsigned rctCrate() const
get RCT crate
Definition: L1CaloEmCand.h:53
bool isolated() const
which stream did this come from
Definition: L1CaloEmCand.h:56
int16_t bx() const
get bunch-crossing index
Definition: L1CaloEmCand.h:62
int16_t m_bx
Definition: L1CaloEmCand.h:90
unsigned rank() const
get rank bits
Definition: L1CaloEmCand.h:44
unsigned rctCard() const
get RCT receiver card
Definition: L1CaloEmCand.h:47
uint16_t m_rctCrate
Definition: L1CaloEmCand.h:87
uint16_t m_data
Definition: L1CaloEmCand.h:83
unsigned index() const
get index on cable
Definition: L1CaloEmCand.h:59
unsigned rctRegion() const
get RCT region ID
Definition: L1CaloEmCand.h:50
int operator!=(const L1CaloEmCand &c) const
inequality operator
Definition: L1CaloEmCand.h:74