CMS 3D CMS Logo

Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Friends

L1CaloRegion Class Reference

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

#include <L1CaloRegion.h>

Inheritance diagram for L1CaloRegion:
L1GctRegion

List of all members.

Public Member Functions

int16_t bx () const
 get bunch-crossing index
unsigned capBlock () const
 which capture block did this come from
unsigned capIndex () const
 what index within capture block
bool empty () const
 is there any information in the candidate
unsigned et () const
 get Et
unsigned etFullScale () const
 get Et for internal GCT use
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 (unsigned et, bool overFlow, bool tauVeto, bool mip, bool quiet, unsigned crate, unsigned card, unsigned rgn)
 constructor for RCT emulator (HB/HE regions) - to be removed!
 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! - to be removed!
 L1CaloRegion (uint16_t data, unsigned ieta, unsigned iphi, int16_t bx)
 constructor from raw data and GCT indices for unpacking - to be removed!
 L1CaloRegion ()
 default constructor
 L1CaloRegion (unsigned et, bool fineGrain, unsigned crate, unsigned rgn)
 constructor for RCT emulator (HF regions) - to be removed!
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
void setCaptureBlock (uint16_t capBlock)
 set cap block
void setCaptureIndex (uint16_t capIndex)
 set cap index
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)
void setRawData (uint32_t data)
 set data
bool tauVeto () const
 get tau veto bit
 ~L1CaloRegion ()
 destructor

Static Public Member Functions

static L1CaloRegion makeGctJetRegion (const unsigned et, const bool overFlow, const bool fineGrain, const unsigned ieta, const unsigned iphi, const int16_t bx)
 construct region for use in GCT internal jet-finding
static L1CaloRegion makeHBHERegion (const unsigned et, const bool overFlow, const bool tauVeto, const bool mip, const bool quiet, const unsigned crate, const unsigned card, const unsigned rgn)
 constructor HB/HE region from components
static L1CaloRegion makeHFRegion (const unsigned et, const bool fineGrain, const unsigned crate, const unsigned rgn)
 construct HF region from components
static L1CaloRegion makeRegionFromGctIndices (const unsigned et, const bool overFlow, const bool fineGrain, const bool mip, const bool quiet, const unsigned ieta, const unsigned iphi)
 construct region from GCT indices
static L1CaloRegion makeRegionFromUnpacker (const uint16_t data, const unsigned ieta, const unsigned iphi, const uint16_t block, const uint16_t index, const int16_t bx)
 constructor from raw data and GCT indices for unpacking

Private Member Functions

void pack (unsigned et, bool overFlow, bool fineGrain, bool mip, bool quiet)
 pack the raw data from arguments (used in constructors)
void pack12BitsEt (unsigned et, bool overFlow, bool fineGrain, bool mip, bool quiet)
 pack the raw data from arguments (used in constructors)
void setRegionId (L1CaloRegionDetId id)
 set region ID

Private Attributes

int16_t m_bx
uint16_t m_captureBlock
uint8_t m_captureIndex
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.

: 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) - to be removed!

Definition at line 15 of file L1CaloRegion.cc.

References pack().

                                                                                                                                      :
  m_id(crate, card, rgn),
  m_data(0), // over-ridden below
  m_bx(0)
{
  pack(et, overFlow, tauVeto, mip, quiet);
}
L1CaloRegion::L1CaloRegion ( unsigned  et,
bool  fineGrain,
unsigned  crate,
unsigned  rgn 
)

constructor for RCT emulator (HF regions) - to be removed!

Definition at line 24 of file L1CaloRegion.cc.

References pack().

                                                                                    :
  m_id(crate, 999, rgn),
  m_data(0), // over-ridden below
  m_bx(0)
{
  pack((et & 0xff), (et >= 0xff), fineGrain, false, false);
}
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! - to be removed!

Definition at line 33 of file L1CaloRegion.cc.

References pack().

                                          :
  m_id(ieta, iphi),
  m_data(0), // over-ridden below
  m_bx(0)
{
  pack(et, overFlow, fineGrain, mip, quiet);
}
L1CaloRegion::L1CaloRegion ( uint16_t  data,
unsigned  ieta,
unsigned  iphi,
int16_t  bx 
)

constructor from raw data and GCT indices for unpacking - to be removed!

Definition at line 48 of file L1CaloRegion.cc.

                                                                                  :
  m_id(ieta, iphi),
  m_data(data),
  m_bx(bx)
{

}
L1CaloRegion::~L1CaloRegion ( )

destructor

Definition at line 57 of file L1CaloRegion.cc.

{ }

Member Function Documentation

int16_t L1CaloRegion::bx ( ) const [inline]
unsigned L1CaloRegion::capBlock ( ) const [inline]

which capture block did this come from

Definition at line 186 of file L1CaloRegion.h.

References m_captureBlock.

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

{ return m_captureBlock; }
unsigned L1CaloRegion::capIndex ( ) const [inline]

what index within capture block

Definition at line 189 of file L1CaloRegion.h.

References m_captureIndex.

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

{ return m_captureIndex; }
bool L1CaloRegion::empty ( ) const [inline]

is there any information in the candidate

Definition at line 201 of file L1CaloRegion.h.

References m_data.

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

{ return (m_data == 0); }
unsigned L1CaloRegion::et ( ) const [inline]

get Et

Reimplemented in L1GctRegion.

Definition at line 116 of file L1CaloRegion.h.

References isHf(), and m_data.

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

{ return (isHf() ? m_data&0xff : m_data&0x3ff); }
unsigned L1CaloRegion::etFullScale ( ) const [inline]

get Et for internal GCT use

Definition at line 119 of file L1CaloRegion.h.

References m_data.

{ return m_data&0xfff; }
bool L1CaloRegion::fineGrain ( ) const [inline]

get fine grain bit

Definition at line 128 of file L1CaloRegion.h.

References m_data.

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

{ return ((m_data>>11) & 0x1)!=0; }
unsigned L1CaloRegion::gctEta ( ) const [inline]
unsigned L1CaloRegion::gctPhi ( ) const [inline]
L1CaloRegionDetId L1CaloRegion::id ( void  ) const [inline]

get global region ID

Definition at line 158 of file L1CaloRegion.h.

References m_id.

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

{ return m_id; }
bool L1CaloRegion::isHbHe ( ) const [inline]

Definition at line 162 of file L1CaloRegion.h.

References L1CaloRegionDetId::isHf(), and m_id.

Referenced by GctFormatTranslateMCLegacy::writeAllRctCaloRegionBlock().

{ return !m_id.isHf(); }
bool L1CaloRegion::isHf ( ) const [inline]

forward or central region

Definition at line 161 of file L1CaloRegion.h.

References L1CaloRegionDetId::isHf(), and m_id.

Referenced by et(), L1GctRegion::makeJfInputRegion(), and tauVeto().

{ return m_id.isHf(); }
L1CaloRegion L1CaloRegion::makeGctJetRegion ( const unsigned  et,
const bool  overFlow,
const bool  fineGrain,
const unsigned  ieta,
const unsigned  iphi,
const int16_t  bx 
) [static]

construct region for use in GCT internal jet-finding

Definition at line 121 of file L1CaloRegion.cc.

References pack12BitsEt(), csvReporter::r, setBx(), and setRegionId().

                                                              {
  L1CaloRegion r;
  r.setRegionId( L1CaloRegionDetId(ieta, iphi) );
  r.setBx(bx);
  r.pack12BitsEt(et, overFlow, fineGrain, false, false);
  return r;

}
L1CaloRegion L1CaloRegion::makeHBHERegion ( const unsigned  et,
const bool  overFlow,
const bool  tauVeto,
const bool  mip,
const bool  quiet,
const unsigned  crate,
const unsigned  card,
const unsigned  rgn 
) [static]

constructor HB/HE region from components

Definition at line 62 of file L1CaloRegion.cc.

References pack(), csvReporter::r, setBx(), and setRegionId().

Referenced by SourceCardTextToRctDigi::produce().

                                                        {
  L1CaloRegion r;
  r.setRegionId( L1CaloRegionDetId(crate, card, rgn) );
  r.setBx(0);
  r.pack(et, overFlow, tauVeto, mip, quiet);
  return r;
}
L1CaloRegion L1CaloRegion::makeHFRegion ( const unsigned  et,
const bool  fineGrain,
const unsigned  crate,
const unsigned  rgn 
) [static]

construct HF region from components

Definition at line 78 of file L1CaloRegion.cc.

References pack(), csvReporter::r, setBx(), and setRegionId().

Referenced by SourceCardTextToRctDigi::produce().

                                                       {
  L1CaloRegion r;
  r.setRegionId( L1CaloRegionDetId(crate, 999, rgn) );
  r.setBx(0);
  r.pack((et & 0xff), (et >= 0xff), fineGrain, false, false);
  return r;
}
L1CaloRegion L1CaloRegion::makeRegionFromGctIndices ( const unsigned  et,
const bool  overFlow,
const bool  fineGrain,
const bool  mip,
const bool  quiet,
const unsigned  ieta,
const unsigned  iphi 
) [static]

construct region from GCT indices

Definition at line 90 of file L1CaloRegion.cc.

References pack(), csvReporter::r, setBx(), and setRegionId().

                                                                   {
  L1CaloRegion r;
  r.setRegionId( L1CaloRegionDetId(ieta, iphi) );
  r.setBx(0);
  r.pack(et, overFlow, fineGrain, mip, quiet);
  return r;
}
L1CaloRegion L1CaloRegion::makeRegionFromUnpacker ( const uint16_t  data,
const unsigned  ieta,
const unsigned  iphi,
const uint16_t  block,
const uint16_t  index,
const int16_t  bx 
) [static]
bool L1CaloRegion::mip ( ) const [inline]

get MIP bit

Definition at line 131 of file L1CaloRegion.h.

References m_data.

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

{ return ((m_data>>12) & 0x1)!=0; }
int L1CaloRegion::operator!= ( const L1CaloRegion c) const [inline]

inequality operator

Definition at line 198 of file L1CaloRegion.h.

References trackerHits::c.

{ return !(*this == c); }
int L1CaloRegion::operator== ( const L1CaloRegion c) const [inline]

equality operator, including rank, feature bits, and position

Definition at line 195 of file L1CaloRegion.h.

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

{ return ((m_data==c.raw() && m_id==c.id()) || (this->empty() && c.empty())); }
bool L1CaloRegion::overFlow ( ) const [inline]

get overflow

Definition at line 122 of file L1CaloRegion.h.

References m_data.

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

{ 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 152 of file L1CaloRegion.cc.

References m_data.

Referenced by L1CaloRegion(), makeHBHERegion(), makeHFRegion(), and makeRegionFromGctIndices().

                                                                                        {
  bool checkOvF = overFlow || (et>=0x400);
  m_data = 
    (et & 0x3ff) | 
    ((checkOvF)  ? 0x400  : 0x0) |
    ((fineGrain) ? 0x800  : 0x0) |
    ((mip)       ? 0x1000 : 0x0) |
    ((quiet)     ? 0x2000 : 0x0);
}
void L1CaloRegion::pack12BitsEt ( unsigned  et,
bool  overFlow,
bool  fineGrain,
bool  mip,
bool  quiet 
) [private]

pack the raw data from arguments (used in constructors)

Definition at line 162 of file L1CaloRegion.cc.

References m_data.

Referenced by makeGctJetRegion().

                                                                                                {
  bool checkOvF = overFlow || (et>=0x400);
  m_data = 
    (et & 0xfff) | 
    ((checkOvF)  ? 0x400  : 0x0) |
    ((fineGrain) ? 0x800  : 0x0) |
    ((mip)       ? 0x1000 : 0x0) |
    ((quiet)     ? 0x2000 : 0x0);
}
bool L1CaloRegion::quiet ( ) const [inline]

get quiet bit

Definition at line 134 of file L1CaloRegion.h.

References m_data.

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

{ return ((m_data>>13) & 0x1)!=0; }
uint16_t L1CaloRegion::raw ( ) const [inline]

get raw data

Definition at line 113 of file L1CaloRegion.h.

References m_data.

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

{ return m_data; }
unsigned L1CaloRegion::rctCard ( ) const [inline]

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

Definition at line 168 of file L1CaloRegion.h.

References m_id, and L1CaloRegionDetId::rctCard().

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

{ return m_id.rctCard(); }
unsigned L1CaloRegion::rctCrate ( ) const [inline]
unsigned L1CaloRegion::rctEta ( ) const [inline]

get local eta index (within RCT crate)

Reimplemented in L1GctRegion.

Definition at line 174 of file L1CaloRegion.h.

References m_id, and L1CaloRegionDetId::rctEta().

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

{ return m_id.rctEta(); }
unsigned L1CaloRegion::rctPhi ( ) const [inline]

get local phi index (within RCT crate)

Definition at line 177 of file L1CaloRegion.h.

References m_id, and L1CaloRegionDetId::rctPhi().

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

{ return m_id.rctPhi(); } 
unsigned L1CaloRegion::rctRegionIndex ( ) const [inline]

get RCT region index

Definition at line 171 of file L1CaloRegion.h.

References m_id, and L1CaloRegionDetId::rctRegion().

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

{ return m_id.rctRegion(); }
void L1CaloRegion::reset ( void  ) [inline]

reset the data content (not position id!)

Definition at line 110 of file L1CaloRegion.h.

References m_data.

{ m_data = 0; }
void L1CaloRegion::setBx ( int16_t  bx)
void L1CaloRegion::setCaptureBlock ( uint16_t  capBlock) [inline]

set cap block

Definition at line 137 of file L1CaloRegion.h.

References capBlock(), and m_captureBlock.

Referenced by makeRegionFromUnpacker().

void L1CaloRegion::setCaptureIndex ( uint16_t  capIndex) [inline]

set cap index

Definition at line 140 of file L1CaloRegion.h.

References capIndex(), and m_captureIndex.

Referenced by makeRegionFromUnpacker().

void L1CaloRegion::setMip ( bool  mip)

set MIP bit (required for GCT emulator standalone operation)

Reimplemented in L1GctRegion.

Definition at line 141 of file L1CaloRegion.cc.

References m_data.

                                  {
  if (mip) { m_data |= 0x1000; }
  else { m_data &= 0xefff; }
}
void L1CaloRegion::setQuiet ( bool  quiet)

set quiet bit (required for GCT emulator standalone operation)

Reimplemented in L1GctRegion.

Definition at line 147 of file L1CaloRegion.cc.

References m_data.

                                      {
  if (quiet) { m_data |= 0x2000; }
  else { m_data &= 0xdfff; }
}
void L1CaloRegion::setRawData ( uint32_t  data) [inline]

set data

Definition at line 146 of file L1CaloRegion.h.

References AlCaHLTBitMon_QueryRunRegistry::data, and m_data.

Referenced by makeRegionFromUnpacker(), and L1GctRegion::setBit().

{ m_data = data; }
void L1CaloRegion::setRegionId ( L1CaloRegionDetId  id) [inline, private]

set region ID

Definition at line 209 of file L1CaloRegion.h.

References id(), and m_id.

Referenced by makeGctJetRegion(), makeHBHERegion(), makeHFRegion(), makeRegionFromGctIndices(), and makeRegionFromUnpacker().

{ m_id = id; }
bool L1CaloRegion::tauVeto ( ) const [inline]

get tau veto bit

Definition at line 125 of file L1CaloRegion.h.

References fineGrain(), and isHf().

Referenced by operator<<().

{ 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 224 of file L1CaloRegion.h.

Referenced by bx(), and setBx().

uint16_t L1CaloRegion::m_captureBlock [private]

Definition at line 222 of file L1CaloRegion.h.

Referenced by capBlock(), and setCaptureBlock().

uint8_t L1CaloRegion::m_captureIndex [private]

Definition at line 223 of file L1CaloRegion.h.

Referenced by capIndex(), and setCaptureIndex().

uint16_t L1CaloRegion::m_data [private]

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

Definition at line 221 of file L1CaloRegion.h.

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