CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 boost::shared_ptr
< L1GctJetEtCalibrationLut
lutPtr
 
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 27 of file L1GctJet.h.

Member Typedef Documentation

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

Definition at line 38 of file L1GctJet.h.

Member Enumeration Documentation

Enumerator
kRawsumBitWidth 
kRawsumMaxValue 

Definition at line 32 of file L1GctJet.h.

Constructor & Destructor Documentation

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 8 of file L1GctJet.cc.

9  :
11  m_id(eta, phi),
13  m_forwardJet(forwardJet),
14  m_tauVeto(tauVeto || forwardJet),
15  m_bx(bx)
16 {
17 }
bool m_tauVeto
Definition: L1GctJet.h:122
bool tauVeto() const
Definition: L1GctJet.h:56
uint16_t rawsum() const
Definition: L1GctJet.h:54
int16_t m_bx
Definition: L1GctJet.h:123
uint16_t m_rawsum
Definition: L1GctJet.h:117
bool m_forwardJet
Definition: L1GctJet.h:121
int16_t bx() const
the bunch crossing number
Definition: L1GctJet.h:104
L1CaloRegionDetId m_id
region id, encodes eta and phi
Definition: L1GctJet.h:119
bool m_overFlow
Definition: L1GctJet.h:120
bool overFlow() const
get overflow
Definition: L1GctJet.h:59
L1GctJet::~L1GctJet ( )

Definition at line 19 of file L1GctJet.cc.

20 {
21 }

Member Function Documentation

int16_t L1GctJet::bx ( ) const
inline

the bunch crossing number

Definition at line 104 of file L1GctJet.h.

References m_bx.

Referenced by setBx(), and setupJet().

104 { return m_bx; }
int16_t m_bx
Definition: L1GctJet.h:123
unsigned L1GctJet::calibratedEt ( const lutPtr  lut) const

Definition at line 113 of file L1GctJet.cc.

References m_rawsum.

114 {
115  return m_rawsum;
116 }
uint16_t m_rawsum
Definition: L1GctJet.h:117
unsigned L1GctJet::globalEta ( ) const
inline

eta value in global CMS coordinates

Definition at line 86 of file L1GctJet.h.

References L1CaloRegionDetId::ieta(), and m_id.

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

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

phi value in global CMS coordinates

Definition at line 89 of file L1GctJet.h.

References L1CaloRegionDetId::iphi(), and m_id.

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

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

eta value as encoded in hardware at the GCT output

Definition at line 79 of file L1GctJet.cc.

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

Referenced by jetCand().

80 {
81  // Force into 4 bits.
82  // Count eta bins separately for central and forward jets. Set MSB to indicate the Wheel
83  return (((m_id.rctEta() % 7) & 0x7) | (m_id.ieta()<11 ? 0x8 : 0));
84 }
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:119
unsigned L1GctJet::hwPhi ( ) const

phi value as encoded in hardware at the GCT output

Definition at line 87 of file L1GctJet.cc.

References L1CaloRegionDetId::iphi(), and m_id.

Referenced by jetCand().

88 {
89  // Force into 5 bits.
90  return m_id.iphi() & 0x1f;
91 }
L1CaloRegionDetId m_id
region id, encodes eta and phi
Definition: L1GctJet.h:119
unsigned iphi() const
global phi index (0-17)
L1CaloRegionDetId L1GctJet::id ( void  ) const
inline

Definition at line 55 of file L1GctJet.h.

References m_id.

55 { return m_id(); }
L1CaloRegionDetId m_id
region id, encodes eta and phi
Definition: L1GctJet.h:119
bool L1GctJet::isCentralJet ( ) const
inline

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

Definition at line 65 of file L1GctJet.h.

References m_forwardJet, and m_tauVeto.

Referenced by operator<<().

65 { return (!m_forwardJet && m_tauVeto); }
bool m_tauVeto
Definition: L1GctJet.h:122
bool m_forwardJet
Definition: L1GctJet.h:121
bool L1GctJet::isForwardJet ( ) const
inline

test whether this jet candidate is a forward jet

Definition at line 68 of file L1GctJet.h.

References m_forwardJet.

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

68 { return m_forwardJet; }
bool m_forwardJet
Definition: L1GctJet.h:121
bool L1GctJet::isNullJet ( ) const
inline

test whether this jet candidate has been filled

Definition at line 71 of file L1GctJet.h.

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

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

71 { return ((m_rawsum==0) && (globalEta()==0) && (globalPhi()==0)); }
uint16_t m_rawsum
Definition: L1GctJet.h:117
unsigned globalPhi() const
phi value in global CMS coordinates
Definition: L1GctJet.h:89
unsigned globalEta() const
eta value in global CMS coordinates
Definition: L1GctJet.h:86
bool L1GctJet::isTauJet ( ) const
inline

test whether this jet candidate is a valid tau jet

Definition at line 62 of file L1GctJet.h.

References m_forwardJet, and m_tauVeto.

Referenced by jetCand(), and operator<<().

62 { return (!m_forwardJet && !m_tauVeto); }
bool m_tauVeto
Definition: L1GctJet.h:122
bool m_forwardJet
Definition: L1GctJet.h:121
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 94 of file L1GctJet.cc.

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

Referenced by jetCand().

95 {
96  return L1GctJetCand(rank(lut), hwPhi(), hwEta(), isTauJet(), isForwardJet(), (uint16_t) 0, (uint16_t) 0, m_bx);
97 }
unsigned hwEta() const
eta value as encoded in hardware at the GCT output
Definition: L1GctJet.cc:79
Level-1 Trigger jet candidate.
Definition: L1GctJetCand.h:18
unsigned hwPhi() const
phi value as encoded in hardware at the GCT output
Definition: L1GctJet.cc:87
uint16_t rank(const lutPtr lut) const
The two separate Lut outputs.
Definition: L1GctJet.cc:108
int16_t m_bx
Definition: L1GctJet.h:123
bool isTauJet() const
test whether this jet candidate is a valid tau jet
Definition: L1GctJet.h:62
tuple lut
Definition: lumiPlot.py:244
bool isForwardJet() const
test whether this jet candidate is a forward jet
Definition: L1GctJet.h:68
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 100 of file L1GctJet.cc.

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

101 {
103  if (rctEta() < luts.size()) result = jetCand(luts.at(rctEta()));
104  return result;
105 }
Level-1 Trigger jet candidate.
Definition: L1GctJetCand.h:18
tuple result
Definition: mps_fire.py:95
unsigned rctEta() const
eta value in global CMS coordinates
Definition: L1GctJet.h:92
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:94
uint16_t L1GctJet::lutValue ( const lutPtr  lut) const
private

Definition at line 119 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:122
tuple result
Definition: mps_fire.py:95
uint16_t m_rawsum
Definition: L1GctJet.h:117
tuple lut
Definition: lumiPlot.py:244
bool m_forwardJet
Definition: L1GctJet.h:121
static const unsigned JET_ENERGY_BITWIDTH
Input bitwidth of jet energy; must be 10 or more.
bool m_overFlow
Definition: L1GctJet.h:120
bool L1GctJet::operator!= ( const L1GctJet cand) const

test whether two jets are different

Definition at line 53 of file L1GctJet.cc.

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

54 {
55  bool result=false;
56  result |= !(this->rawsum()==cand.rawsum());
57  result |= !(this->overFlow()==cand.overFlow());
58  result |= !(this->isForwardJet()==cand.isForwardJet());
59  result |= !(this->tauVeto()==cand.tauVeto());
60  result |= !(this->globalEta()==cand.globalEta());
61  result |= !(this->globalPhi()==cand.globalPhi());
62  result &= !(this->isNullJet() && cand.isNullJet());
63  return result;
64 }
bool tauVeto() const
Definition: L1GctJet.h:56
uint16_t rawsum() const
Definition: L1GctJet.h:54
tuple result
Definition: mps_fire.py:95
bool isNullJet() const
test whether this jet candidate has been filled
Definition: L1GctJet.h:71
unsigned globalPhi() const
phi value in global CMS coordinates
Definition: L1GctJet.h:89
unsigned globalEta() const
eta value in global CMS coordinates
Definition: L1GctJet.h:86
bool overFlow() const
get overflow
Definition: L1GctJet.h:59
bool isForwardJet() const
test whether this jet candidate is a forward jet
Definition: L1GctJet.h:68
bool L1GctJet::operator== ( const L1GctJet cand) const

test whether two jets are the same

Definition at line 39 of file L1GctJet.cc.

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

40 {
41  bool result=true;
42  result &= (this->rawsum()==cand.rawsum());
43  result &= (this->overFlow()==cand.overFlow());
44  result &= (this->isForwardJet()==cand.isForwardJet());
45  result &= (this->tauVeto()==cand.tauVeto());
46  result &= (this->globalEta()==cand.globalEta());
47  result &= (this->globalPhi()==cand.globalPhi());
48  result |= (this->isNullJet() && cand.isNullJet());
49  return result;
50 }
bool tauVeto() const
Definition: L1GctJet.h:56
uint16_t rawsum() const
Definition: L1GctJet.h:54
tuple result
Definition: mps_fire.py:95
bool isNullJet() const
test whether this jet candidate has been filled
Definition: L1GctJet.h:71
unsigned globalPhi() const
phi value in global CMS coordinates
Definition: L1GctJet.h:89
unsigned globalEta() const
eta value in global CMS coordinates
Definition: L1GctJet.h:86
bool overFlow() const
get overflow
Definition: L1GctJet.h:59
bool isForwardJet() const
test whether this jet candidate is a forward jet
Definition: L1GctJet.h:68
bool L1GctJet::overFlow ( ) const
inline

get overflow

Definition at line 59 of file L1GctJet.h.

References m_overFlow.

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

59 { return m_overFlow; }
bool m_overFlow
Definition: L1GctJet.h:120
uint16_t L1GctJet::rank ( const lutPtr  lut) const

The two separate Lut outputs.

Definition at line 108 of file L1GctJet.cc.

References lutValue().

Referenced by jetCand().

109 {
110  return lutValue(lut);
111 }
tuple lut
Definition: lumiPlot.py:244
uint16_t lutValue(const lutPtr lut) const
Definition: L1GctJet.cc:119
uint16_t L1GctJet::rawsum ( ) const
inline

Definition at line 54 of file L1GctJet.h.

References m_rawsum.

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

54 { return m_rawsum; }
uint16_t m_rawsum
Definition: L1GctJet.h:117
unsigned L1GctJet::rctEta ( ) const
inline

eta value in global CMS coordinates

Definition at line 92 of file L1GctJet.h.

References m_id, and L1CaloRegionDetId::rctEta().

Referenced by jetCand().

92 { 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:119
unsigned L1GctJet::rctPhi ( ) const
inline

phi value in global CMS coordinates

Definition at line 95 of file L1GctJet.h.

References m_id, and L1CaloRegionDetId::rctPhi().

95 { return m_id.rctPhi(); }
unsigned rctPhi() const
return local RCT phi index (0-1)
L1CaloRegionDetId m_id
region id, encodes eta and phi
Definition: L1GctJet.h:119
void L1GctJet::setBx ( const int16_t  bx)
inline

Definition at line 51 of file L1GctJet.h.

References bx(), and m_bx.

Referenced by L1GctJetFinderBase::setupObjects().

51 { m_bx = bx; }
int16_t m_bx
Definition: L1GctJet.h:123
int16_t bx() const
the bunch crossing number
Definition: L1GctJet.h:104
void L1GctJet::setDetId ( const L1CaloRegionDetId  detId)
inline

Definition at line 47 of file L1GctJet.h.

References m_id.

47 { m_id = detId; }
L1CaloRegionDetId m_id
region id, encodes eta and phi
Definition: L1GctJet.h:119
void L1GctJet::setForward ( const bool  forward)
inline

Definition at line 50 of file L1GctJet.h.

References m_forwardJet.

50 { m_forwardJet = forward; }
bool m_forwardJet
Definition: L1GctJet.h:121
void L1GctJet::setOverFlow ( const bool  overFlow)
inline

Definition at line 48 of file L1GctJet.h.

References m_overFlow, and overFlow().

48 { m_overFlow = overFlow; }
bool m_overFlow
Definition: L1GctJet.h:120
bool overFlow() const
get overflow
Definition: L1GctJet.h:59
void L1GctJet::setRawsum ( const uint16_t  rawsum)
inline

Definition at line 46 of file L1GctJet.h.

References kRawsumMaxValue, m_overFlow, and m_rawsum.

uint16_t rawsum() const
Definition: L1GctJet.h:54
uint16_t m_rawsum
Definition: L1GctJet.h:117
bool m_overFlow
Definition: L1GctJet.h:120
void L1GctJet::setTauVeto ( const bool  tauVeto)
inline

Definition at line 49 of file L1GctJet.h.

References m_tauVeto, and tauVeto().

49 { m_tauVeto = tauVeto; }
bool m_tauVeto
Definition: L1GctJet.h:122
bool tauVeto() const
Definition: L1GctJet.h:56
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 66 of file L1GctJet.cc.

References bx(), kRawsumMaxValue, m_bx, m_forwardJet, m_id, m_overFlow, m_rawsum, m_tauVeto, and groupFilesInBlocks::temp.

68 {
71  m_id = temp;
73  m_forwardJet = forwardJet;
74  m_tauVeto = tauVeto || forwardJet;
75  m_bx = bx;
76 }
bool m_tauVeto
Definition: L1GctJet.h:122
bool tauVeto() const
Definition: L1GctJet.h:56
uint16_t rawsum() const
Definition: L1GctJet.h:54
int16_t m_bx
Definition: L1GctJet.h:123
uint16_t m_rawsum
Definition: L1GctJet.h:117
bool m_forwardJet
Definition: L1GctJet.h:121
int16_t bx() const
the bunch crossing number
Definition: L1GctJet.h:104
L1CaloRegionDetId m_id
region id, encodes eta and phi
Definition: L1GctJet.h:119
bool m_overFlow
Definition: L1GctJet.h:120
bool overFlow() const
get overflow
Definition: L1GctJet.h:59
bool L1GctJet::tauVeto ( ) const
inline

Definition at line 56 of file L1GctJet.h.

References m_tauVeto.

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

56 { return m_tauVeto; }
bool m_tauVeto
Definition: L1GctJet.h:122

Friends And Related Function Documentation

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

Definition at line 23 of file L1GctJet.cc.

24 {
25  os << "L1 Gct jet";
26  os << " energy sum " << cand.m_rawsum;
27  if (cand.overFlow()) { os << ", overflow bit set;"; }
28  os << " Eta " << cand.globalEta();
29  os << " Phi " << cand.globalPhi();
30  if (cand.isForwardJet()) { os << ", Forward jet"; }
31  if (cand.isCentralJet()) { os << ", Central jet"; }
32  if (cand.isTauJet()) { os << ", Tau jet"; }
33  if (cand.isNullJet()) { os << ", Null jet"; }
34 
35  return os;
36 }
bool isTauJet() const
test whether this jet candidate is a valid tau jet
Definition: L1GctJet.h:62
uint16_t m_rawsum
Definition: L1GctJet.h:117
bool isNullJet() const
test whether this jet candidate has been filled
Definition: L1GctJet.h:71
unsigned globalPhi() const
phi value in global CMS coordinates
Definition: L1GctJet.h:89
unsigned globalEta() const
eta value in global CMS coordinates
Definition: L1GctJet.h:86
bool overFlow() const
get overflow
Definition: L1GctJet.h:59
bool isForwardJet() const
test whether this jet candidate is a forward jet
Definition: L1GctJet.h:68
bool isCentralJet() const
test whether this jet candidate is a (non-tau) central jet
Definition: L1GctJet.h:65

Member Data Documentation

int16_t L1GctJet::m_bx
private

Definition at line 123 of file L1GctJet.h.

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

bool L1GctJet::m_forwardJet
private

Definition at line 121 of file L1GctJet.h.

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

L1CaloRegionDetId L1GctJet::m_id
private

region id, encodes eta and phi

Definition at line 119 of file L1GctJet.h.

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

bool L1GctJet::m_overFlow
private

Definition at line 120 of file L1GctJet.h.

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

uint16_t L1GctJet::m_rawsum
private

Definition at line 117 of file L1GctJet.h.

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

bool L1GctJet::m_tauVeto
private

Definition at line 122 of file L1GctJet.h.

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