CMS 3D CMS Logo

L1CaloRegion.h
Go to the documentation of this file.
1 #ifndef L1CALOREGION_H
2 #define L1CALOREGION_H
3 
4 #include <ostream>
5 
7 
21 class L1CaloRegion {
22 public:
24  L1CaloRegion();
25 
28  unsigned et, bool overFlow, bool tauVeto, bool mip, bool quiet, unsigned crate, unsigned card, unsigned rgn);
29 
31  L1CaloRegion(unsigned et, bool fineGrain, unsigned crate, unsigned rgn);
32 
34  L1CaloRegion(unsigned et, bool overFlow, bool fineGrain, bool mip, bool quiet, unsigned ieta, unsigned iphi);
35 
37  L1CaloRegion(uint16_t data, unsigned ieta, unsigned iphi, int16_t bx);
38 
40  ~L1CaloRegion();
41 
42  // named ctors
43 
45  static L1CaloRegion makeHBHERegion(const unsigned et,
46  const bool overFlow,
47  const bool tauVeto,
48  const bool mip,
49  const bool quiet,
50  const unsigned crate,
51  const unsigned card,
52  const unsigned rgn);
53 
55  static L1CaloRegion makeHFRegion(const unsigned et, const bool fineGrain, const unsigned crate, const unsigned rgn);
56 
58  static L1CaloRegion makeRegionFromGctIndices(const unsigned et,
59  const bool overFlow,
60  const bool fineGrain,
61  const bool mip,
62  const bool quiet,
63  const unsigned ieta,
64  const unsigned iphi);
66  static L1CaloRegion makeRegionFromUnpacker(const uint16_t data,
67  const unsigned ieta,
68  const unsigned iphi,
69  const uint16_t block,
70  const uint16_t index,
71  const int16_t bx);
72 
74  static L1CaloRegion makeGctJetRegion(const unsigned et,
75  const bool overFlow,
76  const bool fineGrain,
77  const unsigned ieta,
78  const unsigned iphi,
79  const int16_t bx);
80 
81  // get/set methods for the data
82 
84  void reset() { m_data = 0; }
85 
87  uint16_t raw() const { return m_data; }
88 
90  unsigned et() const { return (isHf() ? m_data & 0xff : m_data & 0x3ff); }
91 
93  unsigned etFullScale() const { return m_data & 0xfff; }
94 
96  bool overFlow() const { return ((m_data >> 10) & 0x1) != 0; }
97 
99  bool tauVeto() const { return (isHf() ? false : fineGrain()); }
100 
102  bool fineGrain() const { return ((m_data >> 11) & 0x1) != 0; }
103 
105  bool mip() const { return ((m_data >> 12) & 0x1) != 0; }
106 
108  bool quiet() const { return ((m_data >> 13) & 0x1) != 0; }
109 
112 
115 
117  void setBx(int16_t bx);
118 
120  void setRawData(uint32_t data) { m_data = data; }
121 
123  void setMip(bool mip);
124 
126  void setQuiet(bool quiet);
127 
128  // get methods for the geographical information
129 
131  L1CaloRegionDetId id() const { return m_id; }
132 
134  bool isHf() const { return m_id.isHf(); }
135  bool isHbHe() const { return !m_id.isHf(); }
136 
138  unsigned rctCrate() const { return m_id.rctCrate(); }
139 
141  unsigned rctCard() const { return m_id.rctCard(); }
142 
144  unsigned rctRegionIndex() const { return m_id.rctRegion(); }
145 
147  unsigned rctEta() const { return m_id.rctEta(); }
148 
150  unsigned rctPhi() const { return m_id.rctPhi(); }
151 
153  unsigned gctEta() const { return m_id.ieta(); }
154 
156  unsigned gctPhi() const { return m_id.iphi(); }
157 
159  unsigned capBlock() const { return m_captureBlock; }
160 
162  unsigned capIndex() const { return m_captureIndex; }
163 
165  int16_t bx() const { return m_bx; }
166 
168  int operator==(const L1CaloRegion& c) const {
169  return ((m_data == c.raw() && m_id == c.id()) || (this->empty() && c.empty()));
170  }
171 
173  int operator!=(const L1CaloRegion& c) const { return !(*this == c); }
174 
176  bool empty() const { return (m_data == 0); }
177 
179  friend std::ostream& operator<<(std::ostream& os, const L1CaloRegion& reg);
180 
181 private:
184 
186  void pack(unsigned et, bool overFlow, bool fineGrain, bool mip, bool quiet);
187 
189  void pack12BitsEt(unsigned et, bool overFlow, bool fineGrain, bool mip, bool quiet);
190 
193 
195  uint16_t m_data;
196  uint16_t m_captureBlock;
197  uint8_t m_captureIndex;
198  int16_t m_bx;
199 };
200 
201 #endif /*L1CALOREGION_H*/
L1CaloRegion::fineGrain
bool fineGrain() const
get fine grain bit
Definition: L1CaloRegion.h:102
L1CaloRegion::setCaptureIndex
void setCaptureIndex(uint16_t capIndex)
set cap index
Definition: L1CaloRegion.h:114
L1CaloRegion::capIndex
unsigned capIndex() const
what index within capture block
Definition: L1CaloRegion.h:162
L1CaloRegion::id
L1CaloRegionDetId id() const
get global region ID
Definition: L1CaloRegion.h:131
L1CaloRegion::reset
void reset()
reset the data content (not position id!)
Definition: L1CaloRegion.h:84
L1CaloRegion::setBx
void setBx(int16_t bx)
set bx
Definition: L1CaloRegion.cc:103
L1CaloRegionDetId::rctRegion
unsigned rctRegion() const
return RCT region index (0-1 for barrel, 0-7 for HF)
Definition: L1CaloRegionDetId.cc:77
L1CaloRegion
A calorimeter trigger region (sum of 4x4 trigger towers)
Definition: L1CaloRegion.h:21
L1CaloRegion::gctEta
unsigned gctEta() const
get GCT eta index
Definition: L1CaloRegion.h:153
L1CaloRegionDetId::rctEta
unsigned rctEta() const
return local RCT eta index (0-10)
Definition: L1CaloRegionDetId.h:55
L1CaloRegion::bx
int16_t bx() const
get bunch-crossing index
Definition: L1CaloRegion.h:165
L1CaloRegion::operator<<
friend std::ostream & operator<<(std::ostream &os, const L1CaloRegion &reg)
print to stream
L1CaloRegion::makeRegionFromGctIndices
static L1CaloRegion makeRegionFromGctIndices(const unsigned et, const bool overFlow, const bool fineGrain, const bool mip, const bool quiet, const unsigned ieta, const unsigned iphi)
construct region from GCT indices
Definition: L1CaloRegion.cc:68
L1CaloRegion::rctEta
unsigned rctEta() const
get local eta index (within RCT crate)
Definition: L1CaloRegion.h:147
L1CaloRegion::makeHFRegion
static L1CaloRegion makeHFRegion(const unsigned et, const bool fineGrain, const unsigned crate, const unsigned rgn)
construct HF region from components
Definition: L1CaloRegion.cc:59
L1CaloRegion::setQuiet
void setQuiet(bool quiet)
set quiet bit (required for GCT emulator standalone operation)
Definition: L1CaloRegion.cc:115
L1CaloRegion::setMip
void setMip(bool mip)
set MIP bit (required for GCT emulator standalone operation)
Definition: L1CaloRegion.cc:106
L1CaloRegionDetId::ieta
unsigned ieta() const
global eta index (0-21)
Definition: L1CaloRegionDetId.h:37
LEDCalibrationChannels.iphi
iphi
Definition: LEDCalibrationChannels.py:64
L1CaloRegion::setRawData
void setRawData(uint32_t data)
set data
Definition: L1CaloRegion.h:120
L1CaloRegionDetId::isHf
bool isHf() const
return central or forward type
Definition: L1CaloRegionDetId.h:43
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
L1CaloRegion::m_captureBlock
uint16_t m_captureBlock
Definition: L1CaloRegion.h:196
L1CaloRegion::m_id
L1CaloRegionDetId m_id
region id
Definition: L1CaloRegion.h:192
L1CaloRegion::m_bx
int16_t m_bx
Definition: L1CaloRegion.h:198
L1CaloRegionDetId
Definition: L1CaloRegionDetId.h:18
L1CaloRegion::isHbHe
bool isHbHe() const
Definition: L1CaloRegion.h:135
L1CaloRegion::m_captureIndex
uint8_t m_captureIndex
Definition: L1CaloRegion.h:197
L1CaloRegion::operator!=
int operator!=(const L1CaloRegion &c) const
inequality operator
Definition: L1CaloRegion.h:173
L1CaloRegion::L1CaloRegion
L1CaloRegion()
default constructor
Definition: L1CaloRegion.cc:11
L1CaloRegion::pack12BitsEt
void pack12BitsEt(unsigned et, bool overFlow, bool fineGrain, bool mip, bool quiet)
pack the raw data from arguments (used in constructors)
Definition: L1CaloRegion.cc:129
L1CaloRegion::makeRegionFromUnpacker
static L1CaloRegion makeRegionFromUnpacker(const uint16_t data, const unsigned ieta, const unsigned iphi, const uint16_t block, const uint16_t index, const int16_t bx)
constructor from raw data and GCT indices for unpacking
Definition: L1CaloRegion.cc:78
L1CaloRegion::mip
bool mip() const
get MIP bit
Definition: L1CaloRegion.h:105
L1CaloRegion::empty
bool empty() const
is there any information in the candidate
Definition: L1CaloRegion.h:176
L1CaloRegionDetId.h
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
L1CaloRegion::overFlow
bool overFlow() const
get overflow
Definition: L1CaloRegion.h:96
L1CaloRegion::rctCrate
unsigned rctCrate() const
get RCT crate ID
Definition: L1CaloRegion.h:138
L1CaloRegion::et
unsigned et() const
get Et
Definition: L1CaloRegion.h:90
L1CaloRegion::rctCard
unsigned rctCard() const
get RCT reciever card ID (valid output for HB/HE)
Definition: L1CaloRegion.h:141
L1CaloRegion::~L1CaloRegion
~L1CaloRegion()
destructor
Definition: L1CaloRegion.cc:44
L1CaloRegion::m_data
uint16_t m_data
region data : et, overflow, fine grain/tau veto, mip and quiet bits
Definition: L1CaloRegion.h:195
L1CaloRegionDetId::iphi
unsigned iphi() const
global phi index (0-17)
Definition: L1CaloRegionDetId.h:40
groupFilesInBlocks.block
block
Definition: groupFilesInBlocks.py:150
L1CaloRegionDetId::rctPhi
unsigned rctPhi() const
return local RCT phi index (0-1)
Definition: L1CaloRegionDetId.h:58
L1CaloRegion::raw
uint16_t raw() const
get raw data
Definition: L1CaloRegion.h:87
L1CaloRegion::capBlock
unsigned capBlock() const
which capture block did this come from
Definition: L1CaloRegion.h:159
L1CaloRegion::makeHBHERegion
static L1CaloRegion makeHBHERegion(const unsigned et, const bool overFlow, const bool tauVeto, const bool mip, const bool quiet, const unsigned crate, const unsigned card, const unsigned rgn)
constructor HB/HE region from components
Definition: L1CaloRegion.cc:49
L1CaloRegion::pack
void pack(unsigned et, bool overFlow, bool fineGrain, bool mip, bool quiet)
pack the raw data from arguments (used in constructors)
Definition: L1CaloRegion.cc:123
L1CaloRegion::tauVeto
bool tauVeto() const
get tau veto bit
Definition: L1CaloRegion.h:99
L1CaloRegion::isHf
bool isHf() const
forward or central region
Definition: L1CaloRegion.h:134
L1CaloRegionDetId::rctCard
unsigned rctCard() const
return RCT card number (0-6)
Definition: L1CaloRegionDetId.cc:61
L1CaloRegion::quiet
bool quiet() const
get quiet bit
Definition: L1CaloRegion.h:108
L1CaloRegion::makeGctJetRegion
static L1CaloRegion makeGctJetRegion(const unsigned et, const bool overFlow, const bool fineGrain, const unsigned ieta, const unsigned iphi, const int16_t bx)
construct region for use in GCT internal jet-finding
Definition: L1CaloRegion.cc:89
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
L1CaloRegion::operator==
int operator==(const L1CaloRegion &c) const
equality operator, including rank, feature bits, and position
Definition: L1CaloRegion.h:168
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
L1CaloRegion::etFullScale
unsigned etFullScale() const
get Et for internal GCT use
Definition: L1CaloRegion.h:93
L1CaloRegion::rctPhi
unsigned rctPhi() const
get local phi index (within RCT crate)
Definition: L1CaloRegion.h:150
L1CaloRegion::setCaptureBlock
void setCaptureBlock(uint16_t capBlock)
set cap block
Definition: L1CaloRegion.h:111
L1CaloRegion::setRegionId
void setRegionId(L1CaloRegionDetId id)
set region ID
Definition: L1CaloRegion.h:183
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46
L1CaloRegion::rctRegionIndex
unsigned rctRegionIndex() const
get RCT region index
Definition: L1CaloRegion.h:144
L1CaloRegion::gctPhi
unsigned gctPhi() const
get GCT phi index
Definition: L1CaloRegion.h:156
L1CaloRegionDetId::rctCrate
unsigned rctCrate() const
return RCT crate number (0-17)
Definition: L1CaloRegionDetId.cc:55