CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends
L1GctJet Class Reference

A Level-1 jet candidate, used within GCT emulation. More...

#include <L1GctJet.h>

Public Types

typedef std::shared_ptr< L1GctJetEtCalibrationLutlutPtr
 
enum  numberOfBits { kRawsumBitWidth = 10, kRawsumMaxValue = (1 << kRawsumBitWidth) - 1 }
 

Public Member Functions

int16_t bx () const
 the bunch crossing number More...
 
unsigned calibratedEt (const lutPtr lut) const
 
unsigned globalEta () const
 eta value in global CMS coordinates More...
 
unsigned globalPhi () const
 phi value in global CMS coordinates More...
 
unsigned hwEta () const
 eta value as encoded in hardware at the GCT output More...
 
unsigned hwPhi () const
 phi value as encoded in hardware at the GCT output More...
 
L1CaloRegionDetId id () const
 
bool isCentralJet () const
 test whether this jet candidate is a (non-tau) central jet More...
 
bool isForwardJet () const
 test whether this jet candidate is a forward jet More...
 
bool isNullJet () const
 test whether this jet candidate has been filled More...
 
bool isTauJet () const
 test whether this jet candidate is a valid tau jet More...
 
L1GctJetCand jetCand (const lutPtr lut) const
 Functions to convert from internal format to external jet candidates at the output of the jetFinder. More...
 
L1GctJetCand jetCand (const std::vector< lutPtr > &luts) const
 Function to convert from internal format to external jet candidates at the output of the jetFinder. More...
 
 L1GctJet (const uint16_t rawsum=0, const unsigned eta=0, const unsigned phi=0, const bool overFlow=false, const bool forwardJet=true, const bool tauVeto=true, const int16_t bx=0)
 
bool operator!= (const L1GctJet &cand) const
 test whether two jets are different More...
 
bool operator== (const L1GctJet &cand) const
 test whether two jets are the same More...
 
bool overFlow () const
 get overflow More...
 
uint16_t rank (const lutPtr lut) const
 The two separate Lut outputs. More...
 
uint16_t rawsum () const
 
unsigned rctEta () const
 eta value in global CMS coordinates More...
 
unsigned rctPhi () const
 phi value in global CMS coordinates More...
 
void setBx (const int16_t bx)
 
void setDetId (const L1CaloRegionDetId detId)
 
void setForward (const bool forward)
 
void setOverFlow (const bool overFlow)
 
void setRawsum (const uint16_t rawsum)
 
void setTauVeto (const bool tauVeto)
 
void setupJet (const uint16_t rawsum, const unsigned eta, const unsigned phi, const bool overFlow, const bool forwardJet, const bool tauVeto=true, const int16_t bx=0)
 Setup an existing jet all in one go. More...
 
bool tauVeto () const
 
 ~L1GctJet ()
 

Private Member Functions

uint16_t lutValue (const lutPtr lut) const
 

Private Attributes

int16_t m_bx
 
bool m_forwardJet
 
L1CaloRegionDetId m_id
 region id, encodes eta and phi More...
 
bool m_overFlow
 
uint16_t m_rawsum
 
bool m_tauVeto
 

Friends

std::ostream & operator<< (std::ostream &os, const L1GctJet &cand)
 

Detailed Description

A Level-1 jet candidate, used within GCT emulation.

Author
Jim Brooke & Robert Frazier
Date
April 2006

Move this to DataFormats/L1GlobalCaloTrigger if possible

Definition at line 26 of file L1GctJet.h.

Member Typedef Documentation

◆ lutPtr

typedef std::shared_ptr<L1GctJetEtCalibrationLut> L1GctJet::lutPtr

Definition at line 32 of file L1GctJet.h.

Member Enumeration Documentation

◆ numberOfBits

Enumerator
kRawsumBitWidth 
kRawsumMaxValue 

Definition at line 29 of file L1GctJet.h.

Constructor & Destructor Documentation

◆ L1GctJet()

L1GctJet::L1GctJet ( const uint16_t  rawsum = 0,
const unsigned  eta = 0,
const unsigned  phi = 0,
const bool  overFlow = false,
const bool  forwardJet = true,
const bool  tauVeto = true,
const int16_t  bx = 0 
)

Definition at line 6 of file L1GctJet.cc.

14  m_id(eta, phi),
16  m_forwardJet(forwardJet),
17  m_tauVeto(tauVeto || forwardJet),
18  m_bx(bx) {}
bool m_tauVeto
Definition: L1GctJet.h:127
uint16_t rawsum() const
Definition: L1GctJet.h:56
bool tauVeto() const
Definition: L1GctJet.h:58
int16_t m_bx
Definition: L1GctJet.h:128
uint16_t m_rawsum
Definition: L1GctJet.h:122
bool m_forwardJet
Definition: L1GctJet.h:126
L1CaloRegionDetId m_id
region id, encodes eta and phi
Definition: L1GctJet.h:124
bool m_overFlow
Definition: L1GctJet.h:125
int16_t bx() const
the bunch crossing number
Definition: L1GctJet.h:111
bool overFlow() const
get overflow
Definition: L1GctJet.h:61

◆ ~L1GctJet()

L1GctJet::~L1GctJet ( )

Definition at line 20 of file L1GctJet.cc.

20 {}

Member Function Documentation

◆ bx()

int16_t L1GctJet::bx ( ) const
inline

the bunch crossing number

Definition at line 111 of file L1GctJet.h.

References m_bx.

Referenced by setBx(), and setupJet().

111 { return m_bx; }
int16_t m_bx
Definition: L1GctJet.h:128

◆ calibratedEt()

unsigned L1GctJet::calibratedEt ( const lutPtr  lut) const

Definition at line 117 of file L1GctJet.cc.

References m_rawsum.

117 { return m_rawsum; }
uint16_t m_rawsum
Definition: L1GctJet.h:122

◆ globalEta()

unsigned L1GctJet::globalEta ( ) const
inline

eta value in global CMS coordinates

Definition at line 93 of file L1GctJet.h.

References L1CaloRegionDetId::ieta(), and m_id.

Referenced by isNullJet(), operator!=(), and operator==().

93 { return m_id.ieta(); }
unsigned ieta() const
global eta index (0-21)
L1CaloRegionDetId m_id
region id, encodes eta and phi
Definition: L1GctJet.h:124

◆ globalPhi()

unsigned L1GctJet::globalPhi ( ) const
inline

phi value in global CMS coordinates

Definition at line 96 of file L1GctJet.h.

References L1CaloRegionDetId::iphi(), and m_id.

Referenced by isNullJet(), operator!=(), and operator==().

96 { return m_id.iphi(); }
L1CaloRegionDetId m_id
region id, encodes eta and phi
Definition: L1GctJet.h:124
unsigned iphi() const
global phi index (0-17)

◆ hwEta()

unsigned L1GctJet::hwEta ( ) const

eta value as encoded in hardware at the GCT output

Definition at line 89 of file L1GctJet.cc.

References L1CaloRegionDetId::ieta(), m_id, and L1CaloRegionDetId::rctEta().

Referenced by jetCand().

89  {
90  // Force into 4 bits.
91  // Count eta bins separately for central and forward jets. Set MSB to indicate the Wheel
92  return (((m_id.rctEta() % 7) & 0x7) | (m_id.ieta() < 11 ? 0x8 : 0));
93 }
unsigned ieta() const
global eta index (0-21)
unsigned rctEta() const
return local RCT eta index (0-10)
L1CaloRegionDetId m_id
region id, encodes eta and phi
Definition: L1GctJet.h:124

◆ hwPhi()

unsigned L1GctJet::hwPhi ( ) const

phi value as encoded in hardware at the GCT output

Definition at line 96 of file L1GctJet.cc.

References L1CaloRegionDetId::iphi(), and m_id.

Referenced by jetCand().

96  {
97  // Force into 5 bits.
98  return m_id.iphi() & 0x1f;
99 }
L1CaloRegionDetId m_id
region id, encodes eta and phi
Definition: L1GctJet.h:124
unsigned iphi() const
global phi index (0-17)

◆ id()

L1CaloRegionDetId L1GctJet::id ( void  ) const
inline

Definition at line 57 of file L1GctJet.h.

References m_id.

57 { return m_id(); }
L1CaloRegionDetId m_id
region id, encodes eta and phi
Definition: L1GctJet.h:124

◆ isCentralJet()

bool L1GctJet::isCentralJet ( ) const
inline

test whether this jet candidate is a (non-tau) central jet

Definition at line 67 of file L1GctJet.h.

References m_forwardJet, and m_tauVeto.

67 { return (!m_forwardJet && m_tauVeto); }
bool m_tauVeto
Definition: L1GctJet.h:127
bool m_forwardJet
Definition: L1GctJet.h:126

◆ isForwardJet()

bool L1GctJet::isForwardJet ( ) const
inline

test whether this jet candidate is a forward jet

Definition at line 70 of file L1GctJet.h.

References m_forwardJet.

Referenced by jetCand(), operator!=(), and operator==().

70 { return m_forwardJet; }
bool m_forwardJet
Definition: L1GctJet.h:126

◆ isNullJet()

bool L1GctJet::isNullJet ( ) const
inline

test whether this jet candidate has been filled

Definition at line 73 of file L1GctJet.h.

References globalEta(), globalPhi(), and m_rawsum.

Referenced by operator!=(), and operator==().

73 { return ((m_rawsum == 0) && (globalEta() == 0) && (globalPhi() == 0)); }
unsigned globalEta() const
eta value in global CMS coordinates
Definition: L1GctJet.h:93
uint16_t m_rawsum
Definition: L1GctJet.h:122
unsigned globalPhi() const
phi value in global CMS coordinates
Definition: L1GctJet.h:96

◆ isTauJet()

bool L1GctJet::isTauJet ( ) const
inline

test whether this jet candidate is a valid tau jet

Definition at line 64 of file L1GctJet.h.

References m_forwardJet, and m_tauVeto.

Referenced by jetCand().

64 { return (!m_forwardJet && !m_tauVeto); }
bool m_tauVeto
Definition: L1GctJet.h:127
bool m_forwardJet
Definition: L1GctJet.h:126

◆ jetCand() [1/2]

L1GctJetCand L1GctJet::jetCand ( const lutPtr  lut) const

Functions to convert from internal format to external jet candidates at the output of the jetFinder.

Function to convert from internal format to external jet candidates at the output of the jetFinder.

Definition at line 102 of file L1GctJet.cc.

References hwEta(), hwPhi(), isForwardJet(), isTauJet(), m_bx, and rank().

Referenced by jetCand().

102  {
103  return L1GctJetCand(rank(lut), hwPhi(), hwEta(), isTauJet(), isForwardJet(), (uint16_t)0, (uint16_t)0, m_bx);
104 }
unsigned hwEta() const
eta value as encoded in hardware at the GCT output
Definition: L1GctJet.cc:89
Level-1 Trigger jet candidate.
Definition: L1GctJetCand.h:17
int16_t m_bx
Definition: L1GctJet.h:128
uint16_t rank(const lutPtr lut) const
The two separate Lut outputs.
Definition: L1GctJet.cc:115
bool isTauJet() const
test whether this jet candidate is a valid tau jet
Definition: L1GctJet.h:64
unsigned hwPhi() const
phi value as encoded in hardware at the GCT output
Definition: L1GctJet.cc:96
bool isForwardJet() const
test whether this jet candidate is a forward jet
Definition: L1GctJet.h:70

◆ jetCand() [2/2]

L1GctJetCand L1GctJet::jetCand ( const std::vector< lutPtr > &  luts) const

Function to convert from internal format to external jet candidates at the output of the jetFinder.

Definition at line 107 of file L1GctJet.cc.

References jetCand(), rctEta(), and mps_fire::result.

107  {
109  if (rctEta() < luts.size())
110  result = jetCand(luts.at(rctEta()));
111  return result;
112 }
Level-1 Trigger jet candidate.
Definition: L1GctJetCand.h:17
L1GctJetCand jetCand(const lutPtr lut) const
Functions to convert from internal format to external jet candidates at the output of the jetFinder...
Definition: L1GctJet.cc:102
unsigned rctEta() const
eta value in global CMS coordinates
Definition: L1GctJet.h:99

◆ lutValue()

uint16_t L1GctJet::lutValue ( const lutPtr  lut) const
private

Definition at line 120 of file L1GctJet.cc.

References L1GctJetEtCalibrationLut::JET_ENERGY_BITWIDTH, m_forwardJet, m_overFlow, m_rawsum, m_tauVeto, and mps_fire::result.

Referenced by rank().

120  {
121  uint16_t result;
122  if (m_overFlow) {
123  // Set output values to maximum
124  result = 0x3f;
125  } else {
126  unsigned addrBits = m_rawsum;
127  // Set the MSB for tau jets
128  if (!m_tauVeto && !m_forwardJet) {
130  }
131  uint16_t address = static_cast<uint16_t>(addrBits);
132  result = lut->lutValue(address);
133  }
134  return result;
135 }
bool m_tauVeto
Definition: L1GctJet.h:127
uint16_t m_rawsum
Definition: L1GctJet.h:122
bool m_forwardJet
Definition: L1GctJet.h:126
static const unsigned JET_ENERGY_BITWIDTH
Input bitwidth of jet energy; must be 10 or more.
bool m_overFlow
Definition: L1GctJet.h:125

◆ operator!=()

bool L1GctJet::operator!= ( const L1GctJet cand) const

test whether two jets are different

Definition at line 60 of file L1GctJet.cc.

References globalEta(), globalPhi(), isForwardJet(), isNullJet(), overFlow(), rawsum(), mps_fire::result, and tauVeto().

60  {
61  bool result = false;
62  result |= !(this->rawsum() == cand.rawsum());
63  result |= !(this->overFlow() == cand.overFlow());
64  result |= !(this->isForwardJet() == cand.isForwardJet());
65  result |= !(this->tauVeto() == cand.tauVeto());
66  result |= !(this->globalEta() == cand.globalEta());
67  result |= !(this->globalPhi() == cand.globalPhi());
68  result &= !(this->isNullJet() && cand.isNullJet());
69  return result;
70 }
uint16_t rawsum() const
Definition: L1GctJet.h:56
unsigned globalEta() const
eta value in global CMS coordinates
Definition: L1GctJet.h:93
bool tauVeto() const
Definition: L1GctJet.h:58
bool isNullJet() const
test whether this jet candidate has been filled
Definition: L1GctJet.h:73
unsigned globalPhi() const
phi value in global CMS coordinates
Definition: L1GctJet.h:96
bool isForwardJet() const
test whether this jet candidate is a forward jet
Definition: L1GctJet.h:70
bool overFlow() const
get overflow
Definition: L1GctJet.h:61

◆ operator==()

bool L1GctJet::operator== ( const L1GctJet cand) const

test whether two jets are the same

Definition at line 47 of file L1GctJet.cc.

References globalEta(), globalPhi(), isForwardJet(), isNullJet(), overFlow(), rawsum(), mps_fire::result, and tauVeto().

47  {
48  bool result = true;
49  result &= (this->rawsum() == cand.rawsum());
50  result &= (this->overFlow() == cand.overFlow());
51  result &= (this->isForwardJet() == cand.isForwardJet());
52  result &= (this->tauVeto() == cand.tauVeto());
53  result &= (this->globalEta() == cand.globalEta());
54  result &= (this->globalPhi() == cand.globalPhi());
55  result |= (this->isNullJet() && cand.isNullJet());
56  return result;
57 }
uint16_t rawsum() const
Definition: L1GctJet.h:56
unsigned globalEta() const
eta value in global CMS coordinates
Definition: L1GctJet.h:93
bool tauVeto() const
Definition: L1GctJet.h:58
bool isNullJet() const
test whether this jet candidate has been filled
Definition: L1GctJet.h:73
unsigned globalPhi() const
phi value in global CMS coordinates
Definition: L1GctJet.h:96
bool isForwardJet() const
test whether this jet candidate is a forward jet
Definition: L1GctJet.h:70
bool overFlow() const
get overflow
Definition: L1GctJet.h:61

◆ overFlow()

bool L1GctJet::overFlow ( ) const
inline

get overflow

Definition at line 61 of file L1GctJet.h.

References m_overFlow.

Referenced by operator!=(), operator==(), setOverFlow(), and setupJet().

61 { return m_overFlow; }
bool m_overFlow
Definition: L1GctJet.h:125

◆ rank()

uint16_t L1GctJet::rank ( const lutPtr  lut) const

The two separate Lut outputs.

Definition at line 115 of file L1GctJet.cc.

References lutValue().

Referenced by jetCand().

115 { return lutValue(lut); }
uint16_t lutValue(const lutPtr lut) const
Definition: L1GctJet.cc:120

◆ rawsum()

uint16_t L1GctJet::rawsum ( ) const
inline

Definition at line 56 of file L1GctJet.h.

References m_rawsum.

Referenced by operator!=(), operator==(), setRawsum(), and setupJet().

56 { return m_rawsum; }
uint16_t m_rawsum
Definition: L1GctJet.h:122

◆ rctEta()

unsigned L1GctJet::rctEta ( ) const
inline

eta value in global CMS coordinates

Definition at line 99 of file L1GctJet.h.

References m_id, and L1CaloRegionDetId::rctEta().

Referenced by jetCand().

99 { return m_id.rctEta(); }
unsigned rctEta() const
return local RCT eta index (0-10)
L1CaloRegionDetId m_id
region id, encodes eta and phi
Definition: L1GctJet.h:124

◆ rctPhi()

unsigned L1GctJet::rctPhi ( ) const
inline

phi value in global CMS coordinates

Definition at line 102 of file L1GctJet.h.

References m_id, and L1CaloRegionDetId::rctPhi().

102 { return m_id.rctPhi(); }
L1CaloRegionDetId m_id
region id, encodes eta and phi
Definition: L1GctJet.h:124
unsigned rctPhi() const
return local RCT phi index (0-1)

◆ setBx()

void L1GctJet::setBx ( const int16_t  bx)
inline

Definition at line 53 of file L1GctJet.h.

References bx(), and m_bx.

Referenced by L1GctJetFinderBase::setupObjects().

53 { m_bx = bx; }
int16_t m_bx
Definition: L1GctJet.h:128
int16_t bx() const
the bunch crossing number
Definition: L1GctJet.h:111

◆ setDetId()

void L1GctJet::setDetId ( const L1CaloRegionDetId  detId)
inline

Definition at line 49 of file L1GctJet.h.

References hcalRecHitTable_cff::detId, and m_id.

49 { m_id = detId; }
L1CaloRegionDetId m_id
region id, encodes eta and phi
Definition: L1GctJet.h:124

◆ setForward()

void L1GctJet::setForward ( const bool  forward)
inline

Definition at line 52 of file L1GctJet.h.

References m_forwardJet.

52 { m_forwardJet = forward; }
bool m_forwardJet
Definition: L1GctJet.h:126

◆ setOverFlow()

void L1GctJet::setOverFlow ( const bool  overFlow)
inline

Definition at line 50 of file L1GctJet.h.

References m_overFlow, and overFlow().

50 { m_overFlow = overFlow; }
bool m_overFlow
Definition: L1GctJet.h:125
bool overFlow() const
get overflow
Definition: L1GctJet.h:61

◆ setRawsum()

void L1GctJet::setRawsum ( const uint16_t  rawsum)
inline

Definition at line 45 of file L1GctJet.h.

References kRawsumMaxValue, m_overFlow, m_rawsum, and rawsum().

45  {
48  }
uint16_t rawsum() const
Definition: L1GctJet.h:56
uint16_t m_rawsum
Definition: L1GctJet.h:122
bool m_overFlow
Definition: L1GctJet.h:125

◆ setTauVeto()

void L1GctJet::setTauVeto ( const bool  tauVeto)
inline

Definition at line 51 of file L1GctJet.h.

References m_tauVeto, and tauVeto().

51 { m_tauVeto = tauVeto; }
bool m_tauVeto
Definition: L1GctJet.h:127
bool tauVeto() const
Definition: L1GctJet.h:58

◆ setupJet()

void L1GctJet::setupJet ( const uint16_t  rawsum,
const unsigned  eta,
const unsigned  phi,
const bool  overFlow,
const bool  forwardJet,
const bool  tauVeto = true,
const int16_t  bx = 0 
)

Setup an existing jet all in one go.

Definition at line 72 of file L1GctJet.cc.

References bx(), PVValHelper::eta, kRawsumMaxValue, m_bx, m_forwardJet, m_id, m_overFlow, m_rawsum, m_tauVeto, overFlow(), phi, rawsum(), tauVeto(), and groupFilesInBlocks::temp.

78  {
81  m_id = temp;
83  m_forwardJet = forwardJet;
84  m_tauVeto = tauVeto || forwardJet;
85  m_bx = bx;
86 }
bool m_tauVeto
Definition: L1GctJet.h:127
uint16_t rawsum() const
Definition: L1GctJet.h:56
bool tauVeto() const
Definition: L1GctJet.h:58
int16_t m_bx
Definition: L1GctJet.h:128
uint16_t m_rawsum
Definition: L1GctJet.h:122
bool m_forwardJet
Definition: L1GctJet.h:126
L1CaloRegionDetId m_id
region id, encodes eta and phi
Definition: L1GctJet.h:124
bool m_overFlow
Definition: L1GctJet.h:125
int16_t bx() const
the bunch crossing number
Definition: L1GctJet.h:111
bool overFlow() const
get overflow
Definition: L1GctJet.h:61

◆ tauVeto()

bool L1GctJet::tauVeto ( ) const
inline

Definition at line 58 of file L1GctJet.h.

References m_tauVeto.

Referenced by operator!=(), operator==(), setTauVeto(), and setupJet().

58 { return m_tauVeto; }
bool m_tauVeto
Definition: L1GctJet.h:127

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const L1GctJet cand 
)
friend

Definition at line 22 of file L1GctJet.cc.

22  {
23  os << "L1 Gct jet";
24  os << " energy sum " << cand.m_rawsum;
25  if (cand.overFlow()) {
26  os << ", overflow bit set;";
27  }
28  os << " Eta " << cand.globalEta();
29  os << " Phi " << cand.globalPhi();
30  if (cand.isForwardJet()) {
31  os << ", Forward jet";
32  }
33  if (cand.isCentralJet()) {
34  os << ", Central jet";
35  }
36  if (cand.isTauJet()) {
37  os << ", Tau jet";
38  }
39  if (cand.isNullJet()) {
40  os << ", Null jet";
41  }
42 
43  return os;
44 }

Member Data Documentation

◆ m_bx

int16_t L1GctJet::m_bx
private

Definition at line 128 of file L1GctJet.h.

Referenced by bx(), jetCand(), setBx(), and setupJet().

◆ m_forwardJet

bool L1GctJet::m_forwardJet
private

Definition at line 126 of file L1GctJet.h.

Referenced by isCentralJet(), isForwardJet(), isTauJet(), lutValue(), setForward(), and setupJet().

◆ m_id

L1CaloRegionDetId L1GctJet::m_id
private

region id, encodes eta and phi

Definition at line 124 of file L1GctJet.h.

Referenced by globalEta(), globalPhi(), hwEta(), hwPhi(), id(), rctEta(), rctPhi(), setDetId(), and setupJet().

◆ m_overFlow

bool L1GctJet::m_overFlow
private

Definition at line 125 of file L1GctJet.h.

Referenced by lutValue(), overFlow(), setOverFlow(), setRawsum(), and setupJet().

◆ m_rawsum

uint16_t L1GctJet::m_rawsum
private

Definition at line 122 of file L1GctJet.h.

Referenced by calibratedEt(), isNullJet(), lutValue(), rawsum(), setRawsum(), and setupJet().

◆ m_tauVeto

bool L1GctJet::m_tauVeto
private

Definition at line 127 of file L1GctJet.h.

Referenced by isCentralJet(), isTauJet(), lutValue(), setTauVeto(), setupJet(), and tauVeto().