CMS 3D CMS Logo

L1CaloEmCand.h
Go to the documentation of this file.
1 #ifndef L1CALOEMCAND_H
2 #define L1CALOEMCAND_H
3 
4 #include <ostream>
5 
7 
17 class L1CaloEmCand {
18 public:
20  L1CaloEmCand();
21 
23  L1CaloEmCand(uint16_t data, unsigned crate, bool iso);
24 
27  L1CaloEmCand(uint16_t data, unsigned crate, bool iso, uint16_t index, int16_t bx, bool dummy);
28 
30  L1CaloEmCand(unsigned rank, unsigned region, unsigned card, unsigned crate, bool iso);
31 
33  L1CaloEmCand(unsigned rank, unsigned region, unsigned card, unsigned crate, bool iso, uint16_t index, int16_t bx);
34 
36  ~L1CaloEmCand();
37 
39  uint16_t raw() const { return m_data; }
40 
42  unsigned rank() const { return m_data & 0x3f; }
43 
45  unsigned rctCard() const { return (m_data >> 7) & 0x7; }
46 
48  unsigned rctRegion() const { return (m_data >> 6) & 0x1; }
49 
51  unsigned rctCrate() const { return m_rctCrate; }
52 
54  bool isolated() const { return m_iso; }
55 
57  unsigned index() const { return m_index; }
58 
60  int16_t bx() const { return m_bx; }
61 
64 
66  void setBx(int16_t bx);
67 
69  int operator==(const L1CaloEmCand& c) const {
70  return ((m_data == c.raw() && m_iso == c.isolated() && m_rctCrate == c.rctCrate() &&
71  this->regionId() == c.regionId()) ||
72  (this->empty() && c.empty()));
73  }
74 
76  int operator!=(const L1CaloEmCand& c) const { return !(*this == c); }
77 
79  bool empty() const { return (rank() == 0); }
80 
81 private:
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 std::ostream& operator<<(std::ostream& s, const L1CaloEmCand& cand);
94 
95 #endif
L1CaloEmCand::bx
int16_t bx() const
get bunch-crossing index
Definition: L1CaloEmCand.h:60
L1CaloEmCand::m_iso
bool m_iso
Definition: L1CaloEmCand.h:88
L1CaloEmCand::raw
uint16_t raw() const
get the raw data
Definition: L1CaloEmCand.h:39
L1CaloEmCand::L1CaloEmCand
L1CaloEmCand()
default constructor (for vector initialisation etc.)
Definition: L1CaloEmCand.cc:11
L1CaloEmCand::~L1CaloEmCand
~L1CaloEmCand()
destructor
Definition: L1CaloEmCand.cc:47
L1CaloEmCand::setBx
void setBx(int16_t bx)
set BX
Definition: L1CaloEmCand.cc:49
L1CaloEmCand::regionId
L1CaloRegionDetId regionId() const
get DetID object
Definition: L1CaloEmCand.h:63
L1CaloEmCand::isolated
bool isolated() const
which stream did this come from
Definition: L1CaloEmCand.h:54
alignCSCRings.s
s
Definition: alignCSCRings.py:92
L1CaloRegionDetId
Definition: L1CaloRegionDetId.h:18
L1CaloEmCand::m_data
uint16_t m_data
Definition: L1CaloEmCand.h:83
operator<<
std::ostream & operator<<(std::ostream &s, const L1CaloEmCand &cand)
L1CaloEmCand::index
unsigned index() const
get index on cable
Definition: L1CaloEmCand.h:57
L1CaloRegionDetId.h
L1CaloEmCand::m_rctCrate
uint16_t m_rctCrate
Definition: L1CaloEmCand.h:87
L1CaloEmCand::rctCrate
unsigned rctCrate() const
get RCT crate
Definition: L1CaloEmCand.h:51
cand
Definition: decayParser.h:32
L1CaloEmCand::m_bx
int16_t m_bx
Definition: L1CaloEmCand.h:90
HLT_FULL_cff.region
region
Definition: HLT_FULL_cff.py:88286
L1CaloEmCand::operator==
int operator==(const L1CaloEmCand &c) const
equality operator, including rank, isolation, position
Definition: L1CaloEmCand.h:69
L1CaloEmCand::rctCard
unsigned rctCard() const
get RCT receiver card
Definition: L1CaloEmCand.h:45
L1CaloEmCand::m_index
uint16_t m_index
Definition: L1CaloEmCand.h:89
L1CaloEmCand::rctRegion
unsigned rctRegion() const
get RCT region ID
Definition: L1CaloEmCand.h:48
L1CaloEmCand::rank
unsigned rank() const
get rank bits
Definition: L1CaloEmCand.h:42
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
dummy
Definition: DummySelector.h:38
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:56
L1CaloEmCand::operator!=
int operator!=(const L1CaloEmCand &c) const
inequality operator
Definition: L1CaloEmCand.h:76
L1CaloEmCand
Level-1 Region Calorimeter Trigger EM candidate.
Definition: L1CaloEmCand.h:17
L1CaloEmCand::empty
bool empty() const
is there any information in the candidate
Definition: L1CaloEmCand.h:79