test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1GctRegion.cc
Go to the documentation of this file.
2 
4 
6 
8 {
9  bool of = ( r_in.isHf() ? (r_in.et() == 0xff) : r_in.overFlow() );
10  L1GctRegion r( r_in.et(), of, r_in.fineGrain(), r_in.gctEta(), r_in.gctPhi(), r_in.bx() );
11  return r;
12 }
13 
14 L1GctRegion L1GctRegion::makeProtoJetRegion(const unsigned et, const bool overFlow, const bool fineGrain, const bool tauIsolationVeto,
15  const unsigned ieta, const unsigned iphi, const int16_t bx)
16 {
17  L1GctRegion r( et, overFlow, fineGrain, ieta, iphi, bx );
18  if (tauIsolationVeto) {
19  r.setFeatureBit0();
20  } else {
21  r.clrFeatureBit0();
22  }
23  return r;
24 }
25 
26 L1GctRegion L1GctRegion::makeFinalJetRegion(const unsigned et, const bool overFlow, const bool fineGrain,
27  const unsigned ieta, const unsigned iphi, const int16_t bx)
28 {
29  L1GctRegion r( et, overFlow, fineGrain, ieta, iphi, bx );
30  return r;
31 }
32 
33 // constructor for internal use
34 L1GctRegion::L1GctRegion(const unsigned et,
35  const bool overFlow,
36  const bool fineGrain,
37  const unsigned ieta,
38  const unsigned iphi,
39  const int16_t bx) :
40  L1CaloRegion( L1CaloRegion::makeGctJetRegion( ((overFlow || et>kGctRegionMaxValue) ? kGctRegionMaxValue : (et & kGctRegionMaxValue) ),
41  (overFlow || et>kGctRegionMaxValue), fineGrain, ieta, iphi, bx) ) { }
42 
43 void L1GctRegion::setBit(const unsigned bitNum, const bool onOff)
44 {
45  if ((bitNum==14) || (bitNum==15)) {
46  uint16_t data = raw();
47  uint16_t mask = 1 << bitNum;
48  data &= ~mask;
49  if (onOff) data |= mask;
50  setRawData(data);
51  }
52 }
int16_t bx() const
get bunch-crossing index
Definition: L1CaloRegion.h:192
unsigned et() const
get Et
Definition: L1CaloRegion.h:116
bool overFlow() const
get overflow
Definition: L1CaloRegion.h:122
void setRawData(uint32_t data)
set data
Definition: L1CaloRegion.h:146
void setFeatureBit0()
Definition: L1GctRegion.h:49
Gct version of a calorimeter region, used within GCT emulation.
Definition: L1GctRegion.h:17
static L1GctRegion makeProtoJetRegion(const unsigned et, const bool overFlow, const bool fineGrain, const bool tauIsolationVeto, const unsigned ieta, const unsigned iphi, const int16_t bx)
Definition: L1GctRegion.cc:14
static L1GctRegion makeJfInputRegion(const L1CaloRegion &)
Definition: L1GctRegion.cc:7
void setBit(const unsigned bitNum, const bool onOff)
Definition: L1GctRegion.cc:43
static L1GctRegion makeFinalJetRegion(const unsigned et, const bool overFlow, const bool fineGrain, const unsigned ieta, const unsigned iphi, const int16_t bx)
Definition: L1GctRegion.cc:26
uint16_t raw() const
get raw data
Definition: L1CaloRegion.h:113
bool fineGrain() const
get fine grain bit
Definition: L1CaloRegion.h:128
unsigned gctEta() const
get GCT eta index
Definition: L1CaloRegion.h:180
unsigned gctPhi() const
get GCT phi index
Definition: L1CaloRegion.h:183
A calorimeter trigger region (sum of 4x4 trigger towers)
Definition: L1CaloRegion.h:22
bool isHf() const
forward or central region
Definition: L1CaloRegion.h:161
void clrFeatureBit0()
Definition: L1GctRegion.h:50