#include <L1Trigger/GlobalCaloTrigger/interface/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 | |
unsigned | calibratedEt (const lutPtr lut) const |
unsigned | globalEta () const |
eta value in global CMS coordinates | |
unsigned | globalPhi () const |
phi value in global CMS coordinates | |
unsigned | hwEta () const |
eta value as encoded in hardware at the GCT output | |
unsigned | hwPhi () const |
phi value as encoded in hardware at the GCT output | |
bool | isCentralJet () const |
test whether this jet candidate is a (non-tau) central jet | |
bool | isForwardJet () const |
test whether this jet candidate is a forward jet | |
bool | isNullJet () const |
test whether this jet candidate has been filled | |
bool | isTauJet () const |
test whether this jet candidate is a valid tau jet | |
L1GctJetCand | jetCand (const std::vector< lutPtr > luts) const |
Function to convert from internal format to external jet candidates at the output of the jetFinder. | |
L1GctJetCand | jetCand (const lutPtr lut) const |
Functions to convert from internal format to external jet candidates at the output of the jetFinder. | |
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 | |
bool | operator== (const L1GctJet &cand) const |
test whether two jets are the same | |
bool | overFlow () const |
get overflow | |
uint16_t | rank (const lutPtr lut) const |
The two separate Lut outputs. | |
uint16_t | rawsum () const |
unsigned | rctEta () const |
eta value in global CMS coordinates | |
unsigned | rctPhi () const |
phi value in global CMS coordinates | |
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. | |
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 | |
bool | m_overFlow |
uint16_t | m_rawsum |
bool | m_tauVeto |
Friends | |
std::ostream & | operator<< (std::ostream &os, const L1GctJet &cand) |
Definition at line 27 of file L1GctJet.h.
typedef boost::shared_ptr<L1GctJetEtCalibrationLut> L1GctJet::lutPtr |
Definition at line 38 of file L1GctJet.h.
Definition at line 32 of file L1GctJet.h.
00032 { 00033 kRawsumBitWidth = 10, 00034 kRawsumMaxValue = (1<<kRawsumBitWidth) - 1 00035 };
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.
00009 : 00010 m_rawsum(rawsum & kRawsumMaxValue), 00011 m_id(eta, phi), 00012 m_overFlow(overFlow || (rawsum>kRawsumMaxValue)), 00013 m_forwardJet(forwardJet), 00014 m_tauVeto(tauVeto || forwardJet), 00015 m_bx(bx) 00016 { 00017 }
L1GctJet::~L1GctJet | ( | ) |
int16_t L1GctJet::bx | ( | ) | const [inline] |
the bunch crossing number
Definition at line 103 of file L1GctJet.h.
References m_bx.
00103 { return m_bx; }
unsigned L1GctJet::calibratedEt | ( | const lutPtr | lut | ) | const |
Definition at line 113 of file L1GctJet.cc.
References L1GctJetEtCalibrationLut::JET_ENERGY_BITWIDTH, and lutValue().
00114 { 00115 return lutValue(lut) & ((1 << L1GctJetEtCalibrationLut::JET_ENERGY_BITWIDTH) - 1); 00116 }
unsigned L1GctJet::globalEta | ( | ) | const [inline] |
eta value in global CMS coordinates
Definition at line 85 of file L1GctJet.h.
References L1CaloRegionDetId::ieta(), and m_id.
Referenced by isNullJet(), operator!=(), operator<<(), and operator==().
unsigned L1GctJet::globalPhi | ( | ) | const [inline] |
phi value in global CMS coordinates
Definition at line 88 of file L1GctJet.h.
References L1CaloRegionDetId::iphi(), and m_id.
Referenced by isNullJet(), operator!=(), operator<<(), and operator==().
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().
00080 { 00081 // Force into 4 bits. 00082 // Count eta bins separately for central and forward jets. Set MSB to indicate the Wheel 00083 return (((m_id.rctEta() % 7) & 0x7) | (m_id.ieta()<11 ? 0x8 : 0)); 00084 }
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().
bool L1GctJet::isCentralJet | ( | ) | const [inline] |
test whether this jet candidate is a (non-tau) central jet
Definition at line 64 of file L1GctJet.h.
References m_forwardJet, and m_tauVeto.
Referenced by operator<<().
00064 { return (!m_forwardJet && m_tauVeto); }
bool L1GctJet::isForwardJet | ( | ) | const [inline] |
test whether this jet candidate is a forward jet
Definition at line 67 of file L1GctJet.h.
References m_forwardJet.
Referenced by jetCand(), operator!=(), operator<<(), and operator==().
00067 { return m_forwardJet; }
bool L1GctJet::isNullJet | ( | ) | const [inline] |
test whether this jet candidate has been filled
Definition at line 70 of file L1GctJet.h.
References globalEta(), globalPhi(), and m_rawsum.
Referenced by operator!=(), operator<<(), and operator==().
bool L1GctJet::isTauJet | ( | ) | const [inline] |
test whether this jet candidate is a valid tau jet
Definition at line 61 of file L1GctJet.h.
References m_forwardJet, and m_tauVeto.
Referenced by jetCand(), and operator<<().
00061 { return (!m_forwardJet && !m_tauVeto); }
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 HLT_VtxMuL3::result.
00101 { 00102 L1GctJetCand result; 00103 if (rctEta() < luts.size()) result = jetCand(luts.at(rctEta())); 00104 return result; 00105 }
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().
00095 { 00096 return L1GctJetCand(rank(lut), hwPhi(), hwEta(), isTauJet(), isForwardJet(), (uint16_t) 0, (uint16_t) 0, m_bx); 00097 }
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 HLT_VtxMuL3::result.
Referenced by calibratedEt(), and rank().
00120 { 00121 uint16_t result; 00122 if (m_overFlow) { 00123 // Set output values to maximum 00124 result = 0xffff; 00125 } else { 00126 unsigned addrBits = m_rawsum; 00127 // Set the MSB for tau jets 00128 if (!m_tauVeto && !m_forwardJet) { 00129 addrBits |= 1 << (L1GctJetEtCalibrationLut::JET_ENERGY_BITWIDTH); 00130 } 00131 uint16_t address = static_cast<uint16_t>(addrBits); 00132 result = lut->lutValue(address); 00133 } 00134 return result; 00135 }
test whether two jets are different
Definition at line 53 of file L1GctJet.cc.
References globalEta(), globalPhi(), isForwardJet(), isNullJet(), overFlow(), rawsum(), HLT_VtxMuL3::result, and tauVeto().
00054 { 00055 bool result=false; 00056 result |= !(this->rawsum()==cand.rawsum()); 00057 result |= !(this->overFlow()==cand.overFlow()); 00058 result |= !(this->isForwardJet()==cand.isForwardJet()); 00059 result |= !(this->tauVeto()==cand.tauVeto()); 00060 result |= !(this->globalEta()==cand.globalEta()); 00061 result |= !(this->globalPhi()==cand.globalPhi()); 00062 result &= !(this->isNullJet() && cand.isNullJet()); 00063 return result; 00064 }
test whether two jets are the same
Definition at line 39 of file L1GctJet.cc.
References globalEta(), globalPhi(), isForwardJet(), isNullJet(), overFlow(), rawsum(), HLT_VtxMuL3::result, and tauVeto().
00040 { 00041 bool result=true; 00042 result &= (this->rawsum()==cand.rawsum()); 00043 result &= (this->overFlow()==cand.overFlow()); 00044 result &= (this->isForwardJet()==cand.isForwardJet()); 00045 result &= (this->tauVeto()==cand.tauVeto()); 00046 result &= (this->globalEta()==cand.globalEta()); 00047 result &= (this->globalPhi()==cand.globalPhi()); 00048 result |= (this->isNullJet() && cand.isNullJet()); 00049 return result; 00050 }
bool L1GctJet::overFlow | ( | ) | const [inline] |
get overflow
Definition at line 58 of file L1GctJet.h.
References m_overFlow.
Referenced by operator!=(), operator<<(), and operator==().
00058 { return m_overFlow; }
uint16_t L1GctJet::rank | ( | const lutPtr | lut | ) | const |
The two separate Lut outputs.
Definition at line 108 of file L1GctJet.cc.
References L1GctJetEtCalibrationLut::JET_ENERGY_BITWIDTH, and lutValue().
Referenced by jetCand().
00109 { 00110 return lutValue(lut) >> L1GctJetEtCalibrationLut::JET_ENERGY_BITWIDTH; 00111 }
uint16_t L1GctJet::rawsum | ( | ) | const [inline] |
Definition at line 54 of file L1GctJet.h.
References m_rawsum.
Referenced by operator!=(), and operator==().
00054 { return m_rawsum; }
unsigned L1GctJet::rctEta | ( | ) | const [inline] |
eta value in global CMS coordinates
Definition at line 91 of file L1GctJet.h.
References m_id, and L1CaloRegionDetId::rctEta().
Referenced by jetCand().
unsigned L1GctJet::rctPhi | ( | ) | const [inline] |
phi value in global CMS coordinates
Definition at line 94 of file L1GctJet.h.
References m_id, and L1CaloRegionDetId::rctPhi().
void L1GctJet::setBx | ( | const int16_t | bx | ) | [inline] |
Definition at line 51 of file L1GctJet.h.
References m_bx.
Referenced by L1GctJetFinderBase::setupObjects().
void L1GctJet::setDetId | ( | const L1CaloRegionDetId | detId | ) | [inline] |
Definition at line 50 of file L1GctJet.h.
References m_forwardJet.
00050 { m_forwardJet = forward; }
void L1GctJet::setRawsum | ( | const uint16_t | rawsum | ) | [inline] |
Definition at line 46 of file L1GctJet.h.
References kRawsumMaxValue, m_overFlow, and m_rawsum.
00046 { m_rawsum = rawsum & kRawsumMaxValue; m_overFlow |= (rawsum > kRawsumMaxValue); }
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 kRawsumMaxValue, m_bx, m_forwardJet, m_id, m_overFlow, m_rawsum, m_tauVeto, and pyDBSRunClass::temp.
00068 { 00069 L1CaloRegionDetId temp(eta, phi); 00070 m_rawsum = rawsum & kRawsumMaxValue; 00071 m_id = temp; 00072 m_overFlow = (overFlow || rawsum>kRawsumMaxValue); 00073 m_forwardJet = forwardJet; 00074 m_tauVeto = tauVeto || forwardJet; 00075 m_bx = bx; 00076 }
bool L1GctJet::tauVeto | ( | ) | const [inline] |
Definition at line 55 of file L1GctJet.h.
References m_tauVeto.
Referenced by operator!=(), and operator==().
00055 { return m_tauVeto; }
std::ostream& operator<< | ( | std::ostream & | os, | |
const L1GctJet & | cand | |||
) | [friend] |
Definition at line 23 of file L1GctJet.cc.
00024 { 00025 os << "L1 Gct jet"; 00026 os << " energy sum " << cand.m_rawsum; 00027 if (cand.overFlow()) { os << ", overflow bit set;"; } 00028 os << " Eta " << cand.globalEta(); 00029 os << " Phi " << cand.globalPhi(); 00030 if (cand.isForwardJet()) { os << ", Forward jet"; } 00031 if (cand.isCentralJet()) { os << ", Central jet"; } 00032 if (cand.isTauJet()) { os << ", Tau jet"; } 00033 if (cand.isNullJet()) { os << ", Null jet"; } 00034 00035 return os; 00036 }
int16_t L1GctJet::m_bx [private] |
bool L1GctJet::m_forwardJet [private] |
Definition at line 120 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 118 of file L1GctJet.h.
Referenced by globalEta(), globalPhi(), hwEta(), hwPhi(), rctEta(), rctPhi(), setDetId(), and setupJet().
bool L1GctJet::m_overFlow [private] |
Definition at line 119 of file L1GctJet.h.
Referenced by lutValue(), overFlow(), setOverFlow(), setRawsum(), and setupJet().
uint16_t L1GctJet::m_rawsum [private] |
Definition at line 116 of file L1GctJet.h.
Referenced by isNullJet(), lutValue(), operator<<(), rawsum(), setRawsum(), and setupJet().
bool L1GctJet::m_tauVeto [private] |
Definition at line 121 of file L1GctJet.h.
Referenced by isCentralJet(), isTauJet(), lutValue(), setTauVeto(), setupJet(), and tauVeto().