CMS 3D CMS Logo

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>

List of all members.

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
L1CaloRegionDetId id () const
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 lutPtr lut) const
 Functions to convert from internal format to external jet candidates at the output of the jetFinder.
L1GctJetCand jetCand (const std::vector< lutPtr > luts) const
 Function 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)

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.

L1GctJet::~L1GctJet ( )

Definition at line 19 of file L1GctJet.cc.

{
}

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

{ return m_bx; }
unsigned L1GctJet::calibratedEt ( const lutPtr  lut) const

Definition at line 113 of file L1GctJet.cc.

References m_rawsum.

{
  return m_rawsum;
}
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==().

{ return m_id.ieta(); } 
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==().

{ return m_id.iphi(); } 
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().

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

{
  // Force into 5 bits.
  return m_id.iphi() & 0x1f;
}
L1CaloRegionDetId L1GctJet::id ( void  ) const [inline]

Definition at line 55 of file L1GctJet.h.

References m_id.

{ return m_id(); }
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<<().

{ return (!m_forwardJet && m_tauVeto); } 
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==().

{ return m_forwardJet; } 
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==().

{ return ((m_rawsum==0) && (globalEta()==0) && (globalPhi()==0)); } 
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<<().

{ return (!m_forwardJet && !m_tauVeto); } 
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().

{
  return L1GctJetCand(rank(lut), hwPhi(), hwEta(), isTauJet(), isForwardJet(), (uint16_t) 0, (uint16_t) 0, m_bx);
}
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 query::result.

{
  L1GctJetCand result;
  if (rctEta() < luts.size()) result = jetCand(luts.at(rctEta()));
  return result;
}
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 query::result.

Referenced by rank().

{
  uint16_t result; 
  if (m_overFlow) { 
    // Set output values to maximum 
    result = 0x3f; 
  } else { 
    unsigned addrBits = m_rawsum;
    // Set the MSB for tau jets
    if (!m_tauVeto && !m_forwardJet) {
      addrBits |= 1 << (L1GctJetEtCalibrationLut::JET_ENERGY_BITWIDTH);
    }
    uint16_t address = static_cast<uint16_t>(addrBits);
    result = lut->lutValue(address);
  }
  return result;
}
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(), query::result, and tauVeto().

{
  bool result=false;
  result |= !(this->rawsum()==cand.rawsum());
  result |= !(this->overFlow()==cand.overFlow());
  result |= !(this->isForwardJet()==cand.isForwardJet());
  result |= !(this->tauVeto()==cand.tauVeto());
  result |= !(this->globalEta()==cand.globalEta());
  result |= !(this->globalPhi()==cand.globalPhi());
  result &= !(this->isNullJet() && cand.isNullJet());
  return result;
}
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(), query::result, and tauVeto().

{
  bool result=true;
  result &= (this->rawsum()==cand.rawsum());
  result &= (this->overFlow()==cand.overFlow());
  result &= (this->isForwardJet()==cand.isForwardJet());
  result &= (this->tauVeto()==cand.tauVeto());
  result &= (this->globalEta()==cand.globalEta());
  result &= (this->globalPhi()==cand.globalPhi());
  result |= (this->isNullJet() && cand.isNullJet());
  return result;
}
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().

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

Referenced by jetCand().

{
  return lutValue(lut); 
}
uint16_t L1GctJet::rawsum ( ) const [inline]

Definition at line 54 of file L1GctJet.h.

References m_rawsum.

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

{ return m_rawsum; }
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().

{ return m_id.rctEta(); } 
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().

{ return m_id.rctPhi(); } 
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().

{ m_bx = bx; }
void L1GctJet::setDetId ( const L1CaloRegionDetId  detId) [inline]

Definition at line 47 of file L1GctJet.h.

References m_id.

{ m_id = detId; }
void L1GctJet::setForward ( const bool  forward) [inline]

Definition at line 50 of file L1GctJet.h.

References m_forwardJet.

{ m_forwardJet = forward; }
void L1GctJet::setOverFlow ( const bool  overFlow) [inline]

Definition at line 48 of file L1GctJet.h.

References m_overFlow, and overFlow().

void L1GctJet::setRawsum ( const uint16_t  rawsum) [inline]

Definition at line 46 of file L1GctJet.h.

References kRawsumMaxValue, m_overFlow, and m_rawsum.

void L1GctJet::setTauVeto ( const bool  tauVeto) [inline]

Definition at line 49 of file L1GctJet.h.

References m_tauVeto, and tauVeto().

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 cond::rpcobtemp::temp.

bool L1GctJet::tauVeto ( ) const [inline]

Definition at line 56 of file L1GctJet.h.

References m_tauVeto.

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

{ return m_tauVeto; }

Friends And Related Function Documentation

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

Definition at line 23 of file L1GctJet.cc.

{
  os << "L1 Gct jet";
  os << " energy sum " << cand.m_rawsum;
  if (cand.overFlow()) { os << ", overflow bit set;"; }
  os << " Eta " << cand.globalEta();
  os << " Phi " << cand.globalPhi();
  if (cand.isForwardJet()) { os << ", Forward jet"; }
  if (cand.isCentralJet()) { os << ", Central jet"; }
  if (cand.isTauJet()) { os << ", Tau jet"; }
  if (cand.isNullJet()) { os << ", Null jet"; }

  return os;
}       

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

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