test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
L1GctInternEmCand Class Reference

#include <L1GctInternEmCand.h>

Public Member Functions

int16_t bx () const
 get bunch-crossing index More...
 
unsigned capBlock () const
 which capture block did this come from More...
 
unsigned capIndex () const
 what index within capture block More...
 
bool empty () const
 was an object really found? More...
 
unsigned etaIndex () const
 get eta index - Barrel 1:4, Endcap 5:7, HF 8:11 More...
 
unsigned etaSign () const
 get eta sign (1 for -ve Z, 0 for +ve Z) More...
 
bool isolated () const
 which stream did this come from More...
 
 L1GctInternEmCand ()
 default constructor (for vector initialisation etc.) More...
 
 L1GctInternEmCand (uint16_t data, bool iso, unsigned block, unsigned index, int16_t bx)
 construct from raw data More...
 
 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 More...
 
int operator!= (const L1GctInternEmCand &c) const
 inequality operator More...
 
int operator== (const L1GctInternEmCand &c) const
 equality operator More...
 
unsigned phiIndex () const
 get phi index (0-17) More...
 
unsigned rank () const
 get rank bits More...
 
uint16_t raw () const
 get the raw data More...
 
L1CaloRegionDetId regionId () const
 region associated with the candidate More...
 
virtual ~L1GctInternEmCand ()
 destructor (virtual to prevent compiler warnings) More...
 

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.

13  :
14  m_data(0),
15  m_captureBlock(0),
16  m_captureIndex(0),
17  m_iso(false),
18  m_bx(0)
19 {
20 
21 }
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.

24  :
25  m_data(data),
26  m_captureBlock(block&0xfff),
27  m_captureIndex(index&0xff),
28  m_iso(iso),
29  m_bx(bx)
30  {
31 
32  }
int16_t bx() const
get bunch-crossing index
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().

35  :
36  m_data(0), // Over-ridden in construct()
37  m_captureBlock(block&0xfff),
38  m_captureIndex(index&0xff),
39  m_iso(iso),
40  m_bx(bx)
41 {
42  construct(rank, eta, etaSgn, phi);
43  }
int16_t bx() const
get bunch-crossing index
void construct(unsigned rank, unsigned eta, unsigned etaSgn, unsigned phi)
unsigned rank() const
get rank bits
L1GctInternEmCand::~L1GctInternEmCand ( )
virtual

destructor (virtual to prevent compiler warnings)

Definition at line 46 of file L1GctInternEmCand.cc.

46 { }

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

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

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

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

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

was an object really found?

Definition at line 54 of file L1GctInternEmCand.cc.

References rank().

Referenced by operator!=(), operator==(), Vispa.Gui.VispaWidget.TextField::setAutosizeFont(), and Vispa.Gui.VispaWidget.TextField::setAutotruncate().

54  {
55  return (rank() == 0);
56 }
unsigned rank() const
get rank bits
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().

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

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

60 { return m_iso; }
string L1GctInternEmCand::name ( ) const
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().

76  { return ((m_data!=c.raw() || m_iso!=c.isolated())
77  && (!this->empty() || !c.empty())); }
bool empty() const
was an object really found?
bool isolated() const
which stream did this come from
uint16_t raw() const
get the raw data
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().

72  { return ((m_data==c.raw() && m_iso==c.isolated())
73  || (this->empty() && c.empty())); }
bool empty() const
was an object really found?
bool isolated() const
which stream did this come from
uint16_t raw() const
get the raw data
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().

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

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

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

70  {
71  // get global eta
72  unsigned eta = ( etaSign()==1 ? 10-(etaIndex()&0xf) : 11+(etaIndex()&0xf) );
73  return L1CaloRegionDetId(eta, phiIndex());
74 }
unsigned etaIndex() const
get eta index - Barrel 1:4, Endcap 5:7, HF 8:11
unsigned phiIndex() const
get phi index (0-17)
unsigned etaSign() const
get eta sign (1 for -ve Z, 0 for +ve Z)

Member Data Documentation

int16_t L1GctInternEmCand::m_bx
private

Definition at line 90 of file L1GctInternEmCand.h.

Referenced by bx().

uint16_t L1GctInternEmCand::m_captureBlock
private

Definition at line 87 of file L1GctInternEmCand.h.

Referenced by capBlock().

uint8_t L1GctInternEmCand::m_captureIndex
private

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