CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

L1GctInternEmCand Class Reference

#include <L1GctInternEmCand.h>

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 - Barrel 1:4, Endcap 5:7, HF 8:11
unsigned etaSign () const
 get eta sign (1 for -ve Z, 0 for +ve Z)
bool isolated () const
 which stream did this come from
 L1GctInternEmCand (uint16_t data, bool iso, unsigned block, unsigned index, int16_t bx)
 construct from raw data
 L1GctInternEmCand ()
 default constructor (for vector initialisation etc.)
 L1GctInternEmCand (unsigned rank, unsigned eta, unsigned etaSgn, unsigned phi, bool iso, unsigned block, unsigned index, int16_t bx)
std::string name () const
 name of object
int operator!= (const L1GctInternEmCand &c) const
 inequality operator
int operator== (const L1GctInternEmCand &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 ~L1GctInternEmCand ()
 destructor (virtual to prevent compiler warnings)

Private Member Functions

void construct (unsigned rank, unsigned eta, unsigned etaSgn, 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

Author:
Jim Brooke
Date:
June 2006

Definition at line 20 of file L1GctInternEmCand.h.


Constructor & Destructor Documentation

L1GctInternEmCand::L1GctInternEmCand ( )

default constructor (for vector initialisation etc.)

Definition at line 13 of file L1GctInternEmCand.cc.

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

}
L1GctInternEmCand::L1GctInternEmCand ( uint16_t  data,
bool  iso,
unsigned  block,
unsigned  index,
int16_t  bx 
)

construct from raw data

Definition at line 24 of file L1GctInternEmCand.cc.

                                                                                                        :
   m_data(data),
   m_captureBlock(block&0xfff),
   m_captureIndex(index&0xff),
   m_iso(iso),
   m_bx(bx)
 {

 }
L1GctInternEmCand::L1GctInternEmCand ( unsigned  rank,
unsigned  eta,
unsigned  etaSgn,
unsigned  phi,
bool  iso,
unsigned  block,
unsigned  index,
int16_t  bx 
)

Definition at line 35 of file L1GctInternEmCand.cc.

References construct().

                                                                                                                                                     :
  m_data(0), // Over-ridden in construct()
   m_captureBlock(block&0xfff),
   m_captureIndex(index&0xff),
  m_iso(iso),
  m_bx(bx)
{
   construct(rank, eta, etaSgn, phi);
 }
L1GctInternEmCand::~L1GctInternEmCand ( ) [virtual]

destructor (virtual to prevent compiler warnings)

Definition at line 46 of file L1GctInternEmCand.cc.

{ } 

Member Function Documentation

int16_t L1GctInternEmCand::bx ( ) const [inline]

get bunch-crossing index

Definition at line 69 of file L1GctInternEmCand.h.

References m_bx.

Referenced by operator<<().

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

which capture block did this come from

Definition at line 63 of file L1GctInternEmCand.h.

References m_captureBlock.

Referenced by operator<<().

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

what index within capture block

Definition at line 66 of file L1GctInternEmCand.h.

References m_captureIndex.

Referenced by operator<<().

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

Definition at line 77 of file L1GctInternEmCand.cc.

References m_data.

Referenced by L1GctInternEmCand().

                                                                                            {
  m_data = (rank & 0x3f) + ((eta & 0xf)<<6) + ((etaSgn & 0x1)<<10) + ((phi & 0x1f)<<11);
}
bool L1GctInternEmCand::empty ( ) const

was an object really found?

Definition at line 54 of file L1GctInternEmCand.cc.

References rank().

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

                                    { 
  return (rank() == 0); 
}
unsigned L1GctInternEmCand::etaIndex ( ) const [inline]

get eta index - Barrel 1:4, Endcap 5:7, HF 8:11

Definition at line 51 of file L1GctInternEmCand.h.

References m_data.

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

{ return (m_data>>6) & 0x1f; }
unsigned L1GctInternEmCand::etaSign ( ) const [inline]

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

Definition at line 54 of file L1GctInternEmCand.h.

References m_data.

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

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

which stream did this come from

Definition at line 60 of file L1GctInternEmCand.h.

References m_iso.

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

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

name of object

Definition at line 49 of file L1GctInternEmCand.cc.

References isolated().

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

inequality operator

Definition at line 76 of file L1GctInternEmCand.h.

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

                                                   { return ((m_data!=c.raw() || m_iso!=c.isolated())
                                                     && (!this->empty() || !c.empty())); }
int L1GctInternEmCand::operator== ( const L1GctInternEmCand c) const [inline]

equality operator

Definition at line 72 of file L1GctInternEmCand.h.

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

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

get phi index (0-17)

Definition at line 57 of file L1GctInternEmCand.h.

References m_data.

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

{ return (m_data>>11) & 0x1f; }
unsigned L1GctInternEmCand::rank ( ) const [inline]

get rank bits

Definition at line 48 of file L1GctInternEmCand.h.

References m_data.

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

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

get the raw data

Definition at line 45 of file L1GctInternEmCand.h.

References m_data.

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

{ return m_data; }
L1CaloRegionDetId L1GctInternEmCand::regionId ( ) const

region associated with the candidate

Definition at line 70 of file L1GctInternEmCand.cc.

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

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

Member Data Documentation

int16_t L1GctInternEmCand::m_bx [private]

Definition at line 90 of file L1GctInternEmCand.h.

Referenced by bx().

Definition at line 87 of file L1GctInternEmCand.h.

Referenced by capBlock().

Definition at line 88 of file L1GctInternEmCand.h.

Referenced by capIndex().

uint16_t L1GctInternEmCand::m_data [private]

Definition at line 86 of file L1GctInternEmCand.h.

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

bool L1GctInternEmCand::m_iso [private]

Definition at line 89 of file L1GctInternEmCand.h.

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