CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1CaloMipQuietRegion.h
Go to the documentation of this file.
1 #ifndef L1CALOMIPQUIETREGION_H
2 #define L1CALOMIPQUIETREGION_H
3 
4 #include <ostream>
5 
7 
16 {
17 public:
18 
19  // ** Constructors/Destructors **
20 
23 
25  L1CaloMipQuietRegion(bool mip, bool quiet, unsigned crate, unsigned card, unsigned rgn, int16_t bx);
26 
28  L1CaloMipQuietRegion(bool mip, bool quiet, unsigned ieta, unsigned iphi, int16_t bx=0);
29 
32 
33 
34  // ** Operators **
35 
37  bool operator==(const L1CaloMipQuietRegion& rhs) const;
38 
40  bool operator!=(const L1CaloMipQuietRegion& rhs) const { return !(*this == rhs); }
41 
42 
43  // ** Get methods for the data **
44 
45  uint8_t raw() const { return m_data; }
46 
47  bool mip() const { return (m_data & 0x1)!=0; }
48 
49  bool quiet() const { return ((m_data>>1) & 0x1)!=0; }
50 
51  int16_t bx() const { return m_bx; }
52 
53 
54  // ** Set methods for the data **
55 
56  void setMip(bool mip) { mip ? m_data|=1 : m_data&=~1; }
57 
58  void setQuiet(bool quiet) { quiet ? m_data|=2 : m_data&=~2; }
59 
60  void setBx(int16_t bx) { m_bx = bx; }
61 
62 
63  // ** Get methods for geographical information **
64 
65  L1CaloRegionDetId id() const { return m_id; }
66 
67  unsigned rctCrate() const { return m_id.rctCrate(); }
68 
69  unsigned rctCard() const { return m_id.rctCard(); }
70 
71  unsigned rctRegionIndex() const { return m_id.rctRegion(); }
72 
73  unsigned rctEta() const { return m_id.rctEta(); }
74 
75  unsigned rctPhi() const { return m_id.rctPhi(); }
76 
77  unsigned gctEta() const { return m_id.ieta(); }
78 
79  unsigned gctPhi() const { return m_id.iphi(); }
80 
81 
82  // ** Misc **
83 
85  bool empty() const { return false; }
86 
88  void reset() { m_data = 0; m_bx = 0; }
89 
90 
91 private:
92 
93  // ** Private Data **
94 
96 
97  uint8_t m_data;
98 
99  int16_t m_bx;
100 
101 
102  // ** Private Methods **
103 
105  void pack(bool mip, bool quiet) { m_data = (mip?1:0)|(quiet?2:0); }
106 
107 };
108 
110 std::ostream& operator<< (std::ostream& os, const L1CaloMipQuietRegion& rhs);
111 
112 
113 
114 #endif /*L1CALOMIPQUIETREGION_H*/
L1CaloRegionDetId id() const
Get global region ID.
unsigned gctPhi() const
Get GCT phi index.
unsigned rctRegionIndex() const
Get RCT region index.
unsigned ieta() const
global eta index (0-21)
void setQuiet(bool quiet)
Set Quiet bit.
unsigned rctPhi() const
return local RCT phi index (0-1)
unsigned rctEta() const
return local RCT eta index (0-10)
void setMip(bool mip)
Set MIP bit.
int16_t bx() const
Get bunch crossing.
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:188
unsigned gctEta() const
Get GCT eta index.
unsigned rctRegion() const
return RCT region index (0-1 for barrel, 0-7 for HF)
unsigned rctCard() const
Get RCT reciever card ID.
unsigned rctPhi() const
Get local phi index (within RCT crate).
unsigned rctEta() const
Get local eta index (within RCT crate).
uint8_t m_data
MIP and Quiet bits for the region, packed in bit0 + bit1 respectively.
L1CaloMipQuietRegion()
Default constructor.
int16_t m_bx
Bunch crossing.
bool mip() const
Get MIP bit.
~L1CaloMipQuietRegion()
Destructor.
bool operator==(const L1CaloMipQuietRegion &rhs) const
Equality operator; compares all data: MIP/Quiet bits, bunch crossing &amp; geographical.
L1CaloRegionDetId m_id
Geographical info: region ID.
Miniumum Ionising Particle (MIP) and Quiet bits for a calorimeter trigger region. ...
uint8_t raw() const
Get raw data.
bool empty() const
Is the object empty? Currently always returns false.
unsigned rctCard() const
return RCT card number (0-6)
unsigned rctCrate() const
return RCT crate number (0-17)
void pack(bool mip, bool quiet)
For use in constructors - packs MIP/Quiet bools up into m_data;.
bool quiet() const
Get Quiet bit.
unsigned iphi() const
global phi index (0-17)
void reset()
Resets the data content - i.e. resets MIP/Quiet and bx, but not position ID!
unsigned rctCrate() const
Get RCT crate ID.
bool operator!=(const L1CaloMipQuietRegion &rhs) const
Inequality operator.
void setBx(int16_t bx)
Set bunch crossing.