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.

29 { kRawsumBitWidth = 10, kRawsumMaxValue = (1 << kRawsumBitWidth) - 1 };

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) {}

◆ ~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.

111 { return m_bx; }

References m_bx.

Referenced by setBx(), and setupJet().

◆ calibratedEt()

unsigned L1GctJet::calibratedEt ( const lutPtr  lut) const

Definition at line 117 of file L1GctJet.cc.

117 { return m_rawsum; }

References m_rawsum.

◆ globalEta()

unsigned L1GctJet::globalEta ( ) const
inline

eta value in global CMS coordinates

Definition at line 93 of file L1GctJet.h.

93 { return m_id.ieta(); }

References L1CaloRegionDetId::ieta(), and m_id.

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

◆ globalPhi()

unsigned L1GctJet::globalPhi ( ) const
inline

phi value in global CMS coordinates

Definition at line 96 of file L1GctJet.h.

96 { return m_id.iphi(); }

References L1CaloRegionDetId::iphi(), and m_id.

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

◆ hwEta()

unsigned L1GctJet::hwEta ( ) const

eta value as encoded in hardware at the GCT output

Definition at line 89 of file L1GctJet.cc.

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 }

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

Referenced by jetCand().

◆ hwPhi()

unsigned L1GctJet::hwPhi ( ) const

phi value as encoded in hardware at the GCT output

Definition at line 96 of file L1GctJet.cc.

96  {
97  // Force into 5 bits.
98  return m_id.iphi() & 0x1f;
99 }

References L1CaloRegionDetId::iphi(), and m_id.

Referenced by jetCand().

◆ id()

L1CaloRegionDetId L1GctJet::id ( void  ) const
inline

Definition at line 57 of file L1GctJet.h.

57 { return m_id(); }

References m_id.

◆ 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.

67 { return (!m_forwardJet && m_tauVeto); }

References m_forwardJet, and m_tauVeto.

◆ isForwardJet()

bool L1GctJet::isForwardJet ( ) const
inline

test whether this jet candidate is a forward jet

Definition at line 70 of file L1GctJet.h.

70 { return m_forwardJet; }

References m_forwardJet.

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

◆ isNullJet()

bool L1GctJet::isNullJet ( ) const
inline

test whether this jet candidate has been filled

Definition at line 73 of file L1GctJet.h.

73 { return ((m_rawsum == 0) && (globalEta() == 0) && (globalPhi() == 0)); }

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

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

◆ isTauJet()

bool L1GctJet::isTauJet ( ) const
inline

test whether this jet candidate is a valid tau jet

Definition at line 64 of file L1GctJet.h.

64 { return (!m_forwardJet && !m_tauVeto); }

References m_forwardJet, and m_tauVeto.

Referenced by jetCand().

◆ 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.

102  {
103  return L1GctJetCand(rank(lut), hwPhi(), hwEta(), isTauJet(), isForwardJet(), (uint16_t)0, (uint16_t)0, m_bx);
104 }

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

Referenced by jetCand().

◆ 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.

107  {
109  if (rctEta() < luts.size())
110  result = jetCand(luts.at(rctEta()));
111  return result;
112 }

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

◆ lutValue()

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

Definition at line 120 of file L1GctJet.cc.

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 }

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

Referenced by rank().

◆ operator!=()

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

test whether two jets are different

Definition at line 60 of file L1GctJet.cc.

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 }

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

◆ operator==()

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

test whether two jets are the same

Definition at line 47 of file L1GctJet.cc.

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 }

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

◆ overFlow()

bool L1GctJet::overFlow ( ) const
inline

get overflow

Definition at line 61 of file L1GctJet.h.

61 { return m_overFlow; }

References m_overFlow.

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

◆ rank()

uint16_t L1GctJet::rank ( const lutPtr  lut) const

The two separate Lut outputs.

Definition at line 115 of file L1GctJet.cc.

115 { return lutValue(lut); }

References lutValue().

Referenced by jetCand().

◆ rawsum()

uint16_t L1GctJet::rawsum ( ) const
inline

Definition at line 56 of file L1GctJet.h.

56 { return m_rawsum; }

References m_rawsum.

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

◆ rctEta()

unsigned L1GctJet::rctEta ( ) const
inline

eta value in global CMS coordinates

Definition at line 99 of file L1GctJet.h.

99 { return m_id.rctEta(); }

References m_id, and L1CaloRegionDetId::rctEta().

Referenced by jetCand().

◆ rctPhi()

unsigned L1GctJet::rctPhi ( ) const
inline

phi value in global CMS coordinates

Definition at line 102 of file L1GctJet.h.

102 { return m_id.rctPhi(); }

References m_id, and L1CaloRegionDetId::rctPhi().

◆ setBx()

void L1GctJet::setBx ( const int16_t  bx)
inline

Definition at line 53 of file L1GctJet.h.

53 { m_bx = bx; }

References bx(), and m_bx.

Referenced by L1GctJetFinderBase::setupObjects().

◆ setDetId()

void L1GctJet::setDetId ( const L1CaloRegionDetId  detId)
inline

Definition at line 49 of file L1GctJet.h.

49 { m_id = detId; }

References m_id.

◆ setForward()

void L1GctJet::setForward ( const bool  forward)
inline

Definition at line 52 of file L1GctJet.h.

52 { m_forwardJet = forward; }

References m_forwardJet.

◆ setOverFlow()

void L1GctJet::setOverFlow ( const bool  overFlow)
inline

Definition at line 50 of file L1GctJet.h.

50 { m_overFlow = overFlow; }

References m_overFlow, and overFlow().

◆ setRawsum()

void L1GctJet::setRawsum ( const uint16_t  rawsum)
inline

Definition at line 45 of file L1GctJet.h.

45  {
48  }

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

◆ setTauVeto()

void L1GctJet::setTauVeto ( const bool  tauVeto)
inline

Definition at line 51 of file L1GctJet.h.

51 { m_tauVeto = tauVeto; }

References m_tauVeto, and tauVeto().

◆ 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.

78  {
81  m_id = temp;
83  m_forwardJet = forwardJet;
84  m_tauVeto = tauVeto || forwardJet;
85  m_bx = bx;
86 }

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

◆ tauVeto()

bool L1GctJet::tauVeto ( ) const
inline

Definition at line 58 of file L1GctJet.h.

58 { return m_tauVeto; }

References m_tauVeto.

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

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().

L1GctJetCand
Level-1 Trigger jet candidate.
Definition: L1GctJetCand.h:17
L1CaloRegionDetId::rctEta
unsigned rctEta() const
return local RCT eta index (0-10)
Definition: L1CaloRegionDetId.h:55
L1GctJet::rctEta
unsigned rctEta() const
eta value in global CMS coordinates
Definition: L1GctJet.h:99
L1GctJet::kRawsumMaxValue
Definition: L1GctJet.h:29
L1GctJet::rank
uint16_t rank(const lutPtr lut) const
The two separate Lut outputs.
Definition: L1GctJet.cc:115
L1GctJet::rawsum
uint16_t rawsum() const
Definition: L1GctJet.h:56
L1GctJet::globalEta
unsigned globalEta() const
eta value in global CMS coordinates
Definition: L1GctJet.h:93
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
L1CaloRegionDetId::ieta
unsigned ieta() const
global eta index (0-21)
Definition: L1CaloRegionDetId.h:37
L1GctJetEtCalibrationLut::JET_ENERGY_BITWIDTH
static const unsigned JET_ENERGY_BITWIDTH
Input bitwidth of jet energy; must be 10 or more.
Definition: L1GctJetEtCalibrationLut.h:32
L1CaloRegionDetId
Definition: L1CaloRegionDetId.h:18
L1GctJet::jetCand
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
PVValHelper::eta
Definition: PVValidationHelpers.h:69
L1GctJet::lutValue
uint16_t lutValue(const lutPtr lut) const
Definition: L1GctJet.cc:120
L1GctJet::isTauJet
bool isTauJet() const
test whether this jet candidate is a valid tau jet
Definition: L1GctJet.h:64
L1GctJet::isNullJet
bool isNullJet() const
test whether this jet candidate has been filled
Definition: L1GctJet.h:73
L1GctJet::m_bx
int16_t m_bx
Definition: L1GctJet.h:128
L1GctJet::hwPhi
unsigned hwPhi() const
phi value as encoded in hardware at the GCT output
Definition: L1GctJet.cc:96
L1GctJet::globalPhi
unsigned globalPhi() const
phi value in global CMS coordinates
Definition: L1GctJet.h:96
L1GctJet::m_rawsum
uint16_t m_rawsum
Definition: L1GctJet.h:122
L1CaloRegionDetId::iphi
unsigned iphi() const
global phi index (0-17)
Definition: L1CaloRegionDetId.h:40
cand
Definition: decayParser.h:32
L1GctJet::m_forwardJet
bool m_forwardJet
Definition: L1GctJet.h:126
L1GctJet::hwEta
unsigned hwEta() const
eta value as encoded in hardware at the GCT output
Definition: L1GctJet.cc:89
L1CaloRegionDetId::rctPhi
unsigned rctPhi() const
return local RCT phi index (0-1)
Definition: L1CaloRegionDetId.h:58
DDAxes::phi
L1GctJet::m_id
L1CaloRegionDetId m_id
region id, encodes eta and phi
Definition: L1GctJet.h:124
L1GctJet::isForwardJet
bool isForwardJet() const
test whether this jet candidate is a forward jet
Definition: L1GctJet.h:70
L1GctJet::bx
int16_t bx() const
the bunch crossing number
Definition: L1GctJet.h:111
L1GctJet::m_tauVeto
bool m_tauVeto
Definition: L1GctJet.h:127
mps_fire.result
result
Definition: mps_fire.py:311
L1GctJet::m_overFlow
bool m_overFlow
Definition: L1GctJet.h:125
L1GctJet::tauVeto
bool tauVeto() const
Definition: L1GctJet.h:58
L1GctJet::kRawsumBitWidth
Definition: L1GctJet.h:29
L1GctJet::overFlow
bool overFlow() const
get overflow
Definition: L1GctJet.h:61