CMS 3D CMS Logo

L1CaloRegion Class Reference

A calorimeter trigger region (sum of 4x4 trigger towers). More...

#include <DataFormats/L1CaloTrigger/interface/L1CaloRegion.h>

Inheritance diagram for L1CaloRegion:

L1GctRegion

List of all members.

Public Member Functions

int16_t bx () const
 get bunch-crossing index
bool empty () const
 is there any information in the candidate
unsigned et () const
 get Et
bool fineGrain () const
 get fine grain bit
unsigned gctEta () const
 get GCT eta index
unsigned gctPhi () const
 get GCT phi index
L1CaloRegionDetId id () const
 get global region ID
bool isHbHe () const
bool isHf () const
 forward or central region
 L1CaloRegion (uint16_t data, unsigned ieta, unsigned iphi, int16_t bx)
 constructor from raw data and GCT indices for unpacking
 L1CaloRegion (unsigned et, bool overFlow, bool fineGrain, bool mip, bool quiet, unsigned ieta, unsigned iphi)
 construct with GCT eta,phi indices, for testing GCT emulator - note argument ordering!
 L1CaloRegion (unsigned et, bool fineGrain, unsigned crate, unsigned rgn)
 constructor for RCT emulator (HF regions)
 L1CaloRegion (unsigned et, bool overFlow, bool tauVeto, bool mip, bool quiet, unsigned crate, unsigned card, unsigned rgn)
 constructor for RCT emulator (HB/HE regions)
 L1CaloRegion ()
 default constructor
bool mip () const
 get MIP bit
int operator!= (const L1CaloRegion &c) const
 inequality operator
int operator== (const L1CaloRegion &c) const
 equality operator, including rank, feature bits, and position
bool overFlow () const
 get overflow
bool quiet () const
 get quiet bit
uint16_t raw () const
 get raw data
unsigned rctCard () const
 get RCT reciever card ID (valid output for HB/HE)
unsigned rctCrate () const
 get RCT crate ID
unsigned rctEta () const
 get local eta index (within RCT crate)
unsigned rctPhi () const
 get local phi index (within RCT crate)
unsigned rctRegionIndex () const
 get RCT region index
void reset ()
 reset the data content (not position id!)
void setBx (int16_t bx)
 set BX (used in RCT emulator)
void setMip (bool mip)
 set MIP bit (required for GCT emulator standalone operation)
void setQuiet (bool quiet)
 set quiet bit (required for GCT emulator standalone operation)
bool tauVeto () const
 get tau veto bit
 ~L1CaloRegion ()
 destructor

Private Member Functions

void pack (unsigned et, bool overFlow, bool fineGrain, bool mip, bool quiet)
 pack the raw data from arguments (used in constructors)

Private Attributes

int16_t m_bx
uint16_t m_data
 region data : et, overflow, fine grain/tau veto, mip and quiet bits
L1CaloRegionDetId m_id
 region id

Friends

std::ostream & operator<< (std::ostream &os, const L1CaloRegion &reg)
 print to stream


Detailed Description

A calorimeter trigger region (sum of 4x4 trigger towers).

Author:
Jim Brooke
Date:
May 2006

Definition at line 22 of file L1CaloRegion.h.


Constructor & Destructor Documentation

L1CaloRegion::L1CaloRegion (  ) 

default constructor

Definition at line 11 of file L1CaloRegion.cc.

00011 : m_id(), m_data(0), m_bx(0) { }

L1CaloRegion::L1CaloRegion ( unsigned  et,
bool  overFlow,
bool  tauVeto,
bool  mip,
bool  quiet,
unsigned  crate,
unsigned  card,
unsigned  rgn 
)

constructor for RCT emulator (HB/HE regions)

Definition at line 15 of file L1CaloRegion.cc.

References pack().

00015                                                                                                                                       :
00016   m_id(crate, card, rgn),
00017   m_data(0), // over-ridden below
00018   m_bx(0)
00019 {
00020   pack(et, overFlow, tauVeto, mip, quiet);
00021 }

L1CaloRegion::L1CaloRegion ( unsigned  et,
bool  fineGrain,
unsigned  crate,
unsigned  rgn 
)

constructor for RCT emulator (HF regions)

Definition at line 24 of file L1CaloRegion.cc.

References pack().

00024                                                                                     :
00025   m_id(crate, 999, rgn),
00026   m_data(0), // over-ridden below
00027   m_bx(0)
00028 {
00029   pack((et & 0xff), (et >= 0xff), fineGrain, false, false);
00030 }

L1CaloRegion::L1CaloRegion ( unsigned  et,
bool  overFlow,
bool  fineGrain,
bool  mip,
bool  quiet,
unsigned  ieta,
unsigned  iphi 
)

construct with GCT eta,phi indices, for testing GCT emulator - note argument ordering!

Definition at line 33 of file L1CaloRegion.cc.

References pack().

00033                                                                                                                          :
00034   m_id(ieta, iphi),
00035   m_data(0), // over-ridden below
00036   m_bx(0)
00037 {
00038   pack(et, overFlow, fineGrain, mip, quiet);
00039 }

L1CaloRegion::L1CaloRegion ( uint16_t  data,
unsigned  ieta,
unsigned  iphi,
int16_t  bx 
)

constructor from raw data and GCT indices for unpacking

Definition at line 42 of file L1CaloRegion.cc.

00042                                                                                   :
00043   m_id(ieta, iphi),
00044   m_data(data),
00045   m_bx(bx)
00046 {
00047 
00048 }

L1CaloRegion::~L1CaloRegion (  ) 

destructor

Definition at line 51 of file L1CaloRegion.cc.

00051 { }


Member Function Documentation

int16_t L1CaloRegion::bx (  )  const [inline]

get bunch-crossing index

Definition at line 112 of file L1CaloRegion.h.

References m_bx.

Referenced by L1GctRegion::L1GctRegion(), and GctFormatTranslateMCLegacy::writeAllRctCaloRegionBlock().

00112 { return m_bx; }

bool L1CaloRegion::empty (  )  const [inline]

is there any information in the candidate

Definition at line 121 of file L1CaloRegion.h.

References m_data.

Referenced by operator==(), and L1GctRegion::rctEta().

00121 { return (m_data == 0); }

unsigned L1CaloRegion::et (  )  const [inline]

get Et

Reimplemented in L1GctRegion.

Definition at line 54 of file L1CaloRegion.h.

References isHf(), and m_data.

Referenced by operator<<(), and GctFormatTranslateMCLegacy::writeAllRctCaloRegionBlock().

00054 { return (isHf() ? m_data&0xff : m_data&0x3ff); }

bool L1CaloRegion::fineGrain (  )  const [inline]

get fine grain bit

Definition at line 63 of file L1CaloRegion.h.

References m_data.

Referenced by operator<<(), tauVeto(), and GctFormatTranslateMCLegacy::writeAllRctCaloRegionBlock().

00063 { return ((m_data>>11) & 0x1)!=0; }

unsigned L1CaloRegion::gctEta (  )  const [inline]

get GCT eta index

Definition at line 106 of file L1CaloRegion.h.

References L1CaloRegionDetId::ieta(), and m_id.

Referenced by operator<<(), and L1GlobalCaloTrigger::setRegion().

00106 { return m_id.ieta(); }

unsigned L1CaloRegion::gctPhi (  )  const [inline]

get GCT phi index

Definition at line 109 of file L1CaloRegion.h.

References L1CaloRegionDetId::iphi(), and m_id.

Referenced by operator<<(), and L1GlobalCaloTrigger::setRegion().

00109 { return m_id.iphi(); }

L1CaloRegionDetId L1CaloRegion::id ( void   )  const [inline]

get global region ID

Definition at line 84 of file L1CaloRegion.h.

References m_id.

Referenced by operator==().

00084 { return m_id; }

bool L1CaloRegion::isHbHe (  )  const [inline]

Definition at line 88 of file L1CaloRegion.h.

References L1CaloRegionDetId::isHf(), and m_id.

Referenced by GctFormatTranslateMCLegacy::writeAllRctCaloRegionBlock().

00088 { return !m_id.isHf(); }

bool L1CaloRegion::isHf (  )  const [inline]

forward or central region

Definition at line 87 of file L1CaloRegion.h.

References L1CaloRegionDetId::isHf(), and m_id.

Referenced by et(), and tauVeto().

00087 { return m_id.isHf(); }

bool L1CaloRegion::mip (  )  const [inline]

get MIP bit

Definition at line 66 of file L1CaloRegion.h.

References m_data.

Referenced by operator<<(), and GctFormatTranslateMCLegacy::writeAllRctCaloRegionBlock().

00066 { return ((m_data>>12) & 0x1)!=0; }

int L1CaloRegion::operator!= ( const L1CaloRegion c  )  const [inline]

inequality operator

Definition at line 118 of file L1CaloRegion.h.

00118 { return !(*this == c); }

int L1CaloRegion::operator== ( const L1CaloRegion c  )  const [inline]

equality operator, including rank, feature bits, and position

Definition at line 115 of file L1CaloRegion.h.

References empty(), id(), m_data, m_id, and raw().

00115 { return ((m_data==c.raw() && m_id==c.id()) || (this->empty() && c.empty())); }

bool L1CaloRegion::overFlow (  )  const [inline]

get overflow

Definition at line 57 of file L1CaloRegion.h.

References m_data.

Referenced by L1GctRegion::et(), operator<<(), and GctFormatTranslateMCLegacy::writeAllRctCaloRegionBlock().

00057 { return ((m_data>>10) & 0x1)!=0; }

void L1CaloRegion::pack ( unsigned  et,
bool  overFlow,
bool  fineGrain,
bool  mip,
bool  quiet 
) [private]

pack the raw data from arguments (used in constructors)

Definition at line 70 of file L1CaloRegion.cc.

References m_data.

Referenced by L1CaloRegion().

00070                                                                                         {
00071   bool checkOvF = overFlow || (et>=0x400);
00072   m_data = 
00073     (et & 0x3ff) | 
00074     ((checkOvF)  ? 0x400  : 0x0) |
00075     ((fineGrain) ? 0x800  : 0x0) |
00076     ((mip)       ? 0x1000 : 0x0) |
00077     ((quiet)     ? 0x2000 : 0x0);
00078 }

bool L1CaloRegion::quiet (  )  const [inline]

get quiet bit

Definition at line 69 of file L1CaloRegion.h.

References m_data.

Referenced by operator<<(), and GctFormatTranslateMCLegacy::writeAllRctCaloRegionBlock().

00069 { return ((m_data>>13) & 0x1)!=0; }

uint16_t L1CaloRegion::raw (  )  const [inline]

get raw data

Definition at line 51 of file L1CaloRegion.h.

References m_data.

Referenced by L1GctRegion::et(), and operator==().

00051 { return m_data; }

unsigned L1CaloRegion::rctCard (  )  const [inline]

get RCT reciever card ID (valid output for HB/HE)

Definition at line 94 of file L1CaloRegion.h.

References m_id, and L1CaloRegionDetId::rctCard().

Referenced by operator<<(), and GctFormatTranslateMCLegacy::writeAllRctCaloRegionBlock().

00094 { return m_id.rctCard(); }

unsigned L1CaloRegion::rctCrate (  )  const [inline]

get RCT crate ID

Definition at line 91 of file L1CaloRegion.h.

References m_id, and L1CaloRegionDetId::rctCrate().

Referenced by operator<<(), L1GctJetFinderBase::setInputRegion(), L1GlobalCaloTrigger::setRegion(), and GctFormatTranslateMCLegacy::writeAllRctCaloRegionBlock().

00091 { return m_id.rctCrate(); }

unsigned L1CaloRegion::rctEta (  )  const [inline]

get local eta index (within RCT crate)

Reimplemented in L1GctRegion.

Definition at line 100 of file L1CaloRegion.h.

References m_id, and L1CaloRegionDetId::rctEta().

Referenced by operator<<(), and L1GctJetFinderBase::setInputRegion().

00100 { return m_id.rctEta(); }

unsigned L1CaloRegion::rctPhi (  )  const [inline]

get local phi index (within RCT crate)

Definition at line 103 of file L1CaloRegion.h.

References m_id, and L1CaloRegionDetId::rctPhi().

Referenced by operator<<(), and L1GctJetFinderBase::setInputRegion().

00103 { return m_id.rctPhi(); } 

unsigned L1CaloRegion::rctRegionIndex (  )  const [inline]

get RCT region index

Definition at line 97 of file L1CaloRegion.h.

References m_id, and L1CaloRegionDetId::rctRegion().

Referenced by operator<<(), and GctFormatTranslateMCLegacy::writeAllRctCaloRegionBlock().

00097 { return m_id.rctRegion(); }

void L1CaloRegion::reset ( void   )  [inline]

reset the data content (not position id!)

Definition at line 48 of file L1CaloRegion.h.

References m_data.

00048 { m_data = 0; }

void L1CaloRegion::setBx ( int16_t  bx  ) 

set BX (used in RCT emulator)

Definition at line 54 of file L1CaloRegion.cc.

References m_bx.

Referenced by L1GctRegion::L1GctRegion(), GctFormatTranslateBase::makeL1CaloRegionBackPortHack(), and L1GctJetFinderBase::setupObjects().

00054                                    {
00055   m_bx = bx;
00056 }

void L1CaloRegion::setMip ( bool  mip  ) 

set MIP bit (required for GCT emulator standalone operation)

Reimplemented in L1GctRegion.

Definition at line 59 of file L1CaloRegion.cc.

References m_data.

00059                                   {
00060   if (mip) { m_data |= 0x1000; }
00061   else { m_data &= 0xefff; }
00062 }

void L1CaloRegion::setQuiet ( bool  quiet  ) 

set quiet bit (required for GCT emulator standalone operation)

Reimplemented in L1GctRegion.

Definition at line 65 of file L1CaloRegion.cc.

References m_data.

00065                                       {
00066   if (quiet) { m_data |= 0x2000; }
00067   else { m_data &= 0xdfff; }
00068 }

bool L1CaloRegion::tauVeto (  )  const [inline]

get tau veto bit

Definition at line 60 of file L1CaloRegion.h.

References fineGrain(), and isHf().

Referenced by operator<<().

00060 { return (isHf() ? false : fineGrain()); }


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const L1CaloRegion reg 
) [friend]

print to stream


Member Data Documentation

int16_t L1CaloRegion::m_bx [private]

Definition at line 136 of file L1CaloRegion.h.

Referenced by bx(), operator<<(), and setBx().

uint16_t L1CaloRegion::m_data [private]

region data : et, overflow, fine grain/tau veto, mip and quiet bits

Definition at line 135 of file L1CaloRegion.h.

Referenced by empty(), et(), fineGrain(), mip(), operator==(), overFlow(), pack(), quiet(), raw(), reset(), setMip(), and setQuiet().

L1CaloRegionDetId L1CaloRegion::m_id [private]

region id

Definition at line 132 of file L1CaloRegion.h.

Referenced by gctEta(), gctPhi(), id(), isHbHe(), isHf(), operator==(), rctCard(), rctCrate(), rctEta(), rctPhi(), and rctRegionIndex().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:26:24 2009 for CMSSW by  doxygen 1.5.4