CMS 3D CMS Logo

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