CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

L1GctEmCand Class Reference

Level-1 Trigger EM candidate at output of GCT. More...

#include <L1GctEmCand.h>

Inheritance diagram for L1GctEmCand:
L1GctCand

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
 was an object really found?
unsigned etaIndex () const
 get eta index -6 to -0, +0 to +6 (bit 3 is sign, 1 for -ve Z, 0 for +ve Z)
unsigned etaSign () const
 get eta sign (1 for -ve Z, 0 for +ve Z)
bool isolated () const
 which stream did this come from
 L1GctEmCand ()
 default constructor (for vector initialisation etc.)
 L1GctEmCand (unsigned rank, unsigned phi, unsigned eta, bool iso)
 L1GctEmCand (uint16_t rawData, bool iso)
 construct from raw data, no source - used in GT
 L1GctEmCand (unsigned rank, unsigned phi, unsigned eta, bool iso, uint16_t block, uint16_t index, int16_t bx)
 L1GctEmCand (uint16_t rawData, bool iso, uint16_t block, uint16_t index, int16_t bx)
 construct from raw data with source - used in GCT unpacker
 L1GctEmCand (L1CaloEmCand &c)
 construct from RCT output candidate
std::string name () const
 name of object
int operator!= (const L1GctEmCand &c) const
 inequality operator
int operator== (const L1GctEmCand &c) const
 equality operator
unsigned phiIndex () const
 get phi index (0-17)
unsigned rank () const
 get rank bits
uint16_t raw () const
 get the raw data
L1CaloRegionDetId regionId () const
 region associated with the candidate
virtual ~L1GctEmCand ()
 destructor (virtual to prevent compiler warnings)

Private Member Functions

void construct (unsigned rank, unsigned eta, unsigned phi)

Private Attributes

int16_t m_bx
uint16_t m_captureBlock
uint8_t m_captureIndex
uint16_t m_data
bool m_iso

Detailed Description

Level-1 Trigger EM candidate at output of GCT.

Level-1 Trigger EM candidate within GCT processing.

Author:
Jim Brooke
Date:
June 2006

Definition at line 22 of file L1GctEmCand.h.


Constructor & Destructor Documentation

L1GctEmCand::L1GctEmCand ( )

default constructor (for vector initialisation etc.)

Definition at line 12 of file L1GctEmCand.cc.

                         :
  m_data(0),
  m_iso(false),
  m_captureBlock(0),
  m_captureIndex(0),
  m_bx(0)
{ 

}
L1GctEmCand::L1GctEmCand ( uint16_t  rawData,
bool  iso 
)

construct from raw data, no source - used in GT

Definition at line 23 of file L1GctEmCand.cc.

                                                   :
  m_data(rawData & 0x7fff), // 0x7fff is to mask off bit 15, which is not data that needs to be stored
  m_iso(iso),
  m_captureBlock(0),
  m_captureIndex(0),
  m_bx(0)
{

}
L1GctEmCand::L1GctEmCand ( uint16_t  rawData,
bool  iso,
uint16_t  block,
uint16_t  index,
int16_t  bx 
)

construct from raw data with source - used in GCT unpacker

Definition at line 34 of file L1GctEmCand.cc.

                                                                                                :
   m_data(rawData & 0x7fff), // 0x7fff is to mask off bit 15, which is not data that needs to be stored
   m_iso(iso),
   m_captureBlock(block&0xfff),
   m_captureIndex(index&0xff),
   m_bx(bx)
{

}
L1GctEmCand::L1GctEmCand ( unsigned  rank,
unsigned  phi,
unsigned  eta,
bool  iso 
)

construct from rank, eta, phi, isolation - used in GCT emulator eta = -6 to -0, +0 to +6. Sign is bit 3, 1 means -ve Z, 0 means +ve Z

Definition at line 46 of file L1GctEmCand.cc.

References construct().

                                                                            : 
  m_data(0), // override below
  m_iso(iso),
  m_captureBlock(0),
  m_captureIndex(0),
  m_bx(0)
 
{
  construct(rank, eta, phi);
}
L1GctEmCand::L1GctEmCand ( unsigned  rank,
unsigned  phi,
unsigned  eta,
bool  iso,
uint16_t  block,
uint16_t  index,
int16_t  bx 
)

construct from rank, eta, phi, isolation - could be used in GCT emulator? eta = -6 to -0, +0 to +6. Sign is bit 3, 1 means -ve Z, 0 means +ve Z

Definition at line 59 of file L1GctEmCand.cc.

References construct().

                                                                                                                        : 
  m_data(0), // override below
  m_iso(iso),
  m_captureBlock(block&0xfff),
  m_captureIndex(index&0xff),
  m_bx(bx)
{
  construct(rank, eta, phi);
}
L1GctEmCand::L1GctEmCand ( L1CaloEmCand c)

construct from RCT output candidate

Definition at line 70 of file L1GctEmCand.cc.

References construct(), eta(), L1CaloRegionDetId::ieta(), L1CaloRegionDetId::iphi(), L1CaloEmCand::rank(), L1CaloRegionDetId::rctEta(), and L1CaloEmCand::regionId().

                                        :
  m_data(0), // override below
  m_iso(c.isolated()),
  m_captureBlock(0),
  m_captureIndex(0),
  m_bx(c.bx())
{
  unsigned eta=((c.regionId().rctEta() & 0x7) | (c.regionId().ieta()<11 ? 0x8 : 0x0));
  construct(c.rank(), eta, c.regionId().iphi());
}
L1GctEmCand::~L1GctEmCand ( ) [virtual]

destructor (virtual to prevent compiler warnings)

Definition at line 82 of file L1GctEmCand.cc.

{ } 

Member Function Documentation

int16_t L1GctEmCand::bx ( ) const [inline]

get bunch-crossing index

Definition at line 82 of file L1GctEmCand.h.

References m_bx.

Referenced by operator<<(), and L1GctElectronFinalSort::setInputEmCand().

{ return m_bx; }
unsigned L1GctEmCand::capBlock ( ) const [inline]

which capture block did this come from

Definition at line 76 of file L1GctEmCand.h.

References m_captureBlock.

Referenced by operator<<().

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

what index within capture block

Definition at line 79 of file L1GctEmCand.h.

References m_captureIndex.

Referenced by operator<<().

{ return m_captureIndex; }
void L1GctEmCand::construct ( unsigned  rank,
unsigned  eta,
unsigned  phi 
) [private]

Definition at line 102 of file L1GctEmCand.cc.

References m_data.

Referenced by L1GctEmCand().

                                                                     {
  if (rank>0) {
    m_data = (rank & 0x3f) + ((eta & 0xf)<<6) + ((phi & 0x1f)<<10);
  } else {
    // Default values for zero rank electrons,
    // different in hardware for positive and negative eta
    if ((eta & 0x8)==0) { m_data = 0x7000; } else { m_data = 0x7400; }
  }
}
bool L1GctEmCand::empty ( ) const [virtual]

was an object really found?

Implements L1GctCand.

Definition at line 90 of file L1GctEmCand.cc.

References rank().

Referenced by operator==().

                              { 
  return (rank() == 0); 
}
unsigned L1GctEmCand::etaIndex ( ) const [virtual]

get eta index -6 to -0, +0 to +6 (bit 3 is sign, 1 for -ve Z, 0 for +ve Z)

Implements L1GctCand.

Definition at line 123 of file L1GctEmCand.cc.

References m_data.

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

{ return (m_data>>6) & 0xf; } 
unsigned L1GctEmCand::etaSign ( ) const [inline, virtual]

get eta sign (1 for -ve Z, 0 for +ve Z)

Implements L1GctCand.

Definition at line 67 of file L1GctEmCand.h.

References m_data.

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

{ return (m_data>>9) & 0x1; } 
bool L1GctEmCand::isolated ( ) const [inline]

which stream did this come from

Definition at line 73 of file L1GctEmCand.h.

References m_iso.

Referenced by l1extra::L1EmParticle::L1EmParticle(), name(), operator<<(), and operator==().

{ return m_iso; }
string L1GctEmCand::name ( ) const

name of object

Definition at line 85 of file L1GctEmCand.cc.

References isolated().

                               {
  return (isolated() ? "iso EM" : "non iso EM" ); 
}
int L1GctEmCand::operator!= ( const L1GctEmCand c) const [inline]

inequality operator

Definition at line 89 of file L1GctEmCand.h.

References trackerHits::c.

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

equality operator

Definition at line 85 of file L1GctEmCand.h.

References empty(), isolated(), m_data, m_iso, and raw().

                                             { return ((m_data==c.raw() && m_iso==c.isolated())
                                                      || (this->empty() && c.empty())); }
unsigned L1GctEmCand::phiIndex ( ) const [virtual]

get phi index (0-17)

Implements L1GctCand.

Definition at line 122 of file L1GctEmCand.cc.

References m_data.

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

{ return (m_data>>10) & 0x1f; } 
unsigned L1GctEmCand::rank ( ) const [virtual]

get rank bits

Implements L1GctCand.

Definition at line 124 of file L1GctEmCand.cc.

References m_data.

Referenced by empty(), operator<<(), and L1GctElectronSorter::prioritisedEmCand::rank().

{ return m_data & 0x3f; }
uint16_t L1GctEmCand::raw ( ) const [inline]

get the raw data

Definition at line 58 of file L1GctEmCand.h.

References m_data.

Referenced by operator==().

{ return m_data; }
L1CaloRegionDetId L1GctEmCand::regionId ( ) const [virtual]

region associated with the candidate

Implements L1GctCand.

Definition at line 95 of file L1GctEmCand.cc.

References eta(), etaIndex(), etaSign(), and phiIndex().

                                              {
  // get global eta
  unsigned eta = ( etaSign()==1 ? 10-(etaIndex()&0x7) : 11+(etaIndex()&0x7) );
  return L1CaloRegionDetId(eta, phiIndex());
}

Member Data Documentation

int16_t L1GctEmCand::m_bx [private]

Definition at line 102 of file L1GctEmCand.h.

Referenced by bx().

uint16_t L1GctEmCand::m_captureBlock [private]

Definition at line 100 of file L1GctEmCand.h.

Referenced by capBlock().

uint8_t L1GctEmCand::m_captureIndex [private]

Definition at line 101 of file L1GctEmCand.h.

Referenced by capIndex().

uint16_t L1GctEmCand::m_data [private]

Definition at line 98 of file L1GctEmCand.h.

Referenced by construct(), etaIndex(), etaSign(), operator==(), phiIndex(), rank(), and raw().

bool L1GctEmCand::m_iso [private]

Definition at line 99 of file L1GctEmCand.h.

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