CMS 3D CMS Logo

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 18 of file L1GctInternEmCand.h.

Constructor & Destructor Documentation

◆ L1GctInternEmCand() [1/3]

L1GctInternEmCand::L1GctInternEmCand ( )

default constructor (for vector initialisation etc.)

Definition at line 13 of file L1GctInternEmCand.cc.

◆ L1GctInternEmCand() [2/3]

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

construct from raw data

Definition at line 16 of file L1GctInternEmCand.cc.

17  : m_data(data), m_captureBlock(block & 0xfff), m_captureIndex(index & 0xff), m_iso(iso), m_bx(bx) {}
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
int16_t bx() const
get bunch-crossing index

◆ L1GctInternEmCand() [3/3]

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

Definition at line 20 of file L1GctInternEmCand.cc.

References construct(), PVValHelper::eta, phi, and rank().

22  : m_data(0), // Over-ridden in construct()
23  m_captureBlock(block & 0xfff),
24  m_captureIndex(index & 0xff),
25  m_iso(iso),
26  m_bx(bx) {
27  construct(rank, eta, etaSgn, phi);
28 }
void construct(unsigned rank, unsigned eta, unsigned etaSgn, unsigned phi)
unsigned rank() const
get rank bits
int16_t bx() const
get bunch-crossing index

◆ ~L1GctInternEmCand()

L1GctInternEmCand::~L1GctInternEmCand ( )
virtual

destructor (virtual to prevent compiler warnings)

Definition at line 31 of file L1GctInternEmCand.cc.

31 {}

Member Function Documentation

◆ bx()

int16_t L1GctInternEmCand::bx ( ) const
inline

get bunch-crossing index

Definition at line 67 of file L1GctInternEmCand.h.

References m_bx.

67 { return m_bx; }

◆ capBlock()

unsigned L1GctInternEmCand::capBlock ( ) const
inline

which capture block did this come from

Definition at line 61 of file L1GctInternEmCand.h.

References m_captureBlock.

61 { return m_captureBlock; }

◆ capIndex()

unsigned L1GctInternEmCand::capIndex ( ) const
inline

what index within capture block

Definition at line 64 of file L1GctInternEmCand.h.

References m_captureIndex.

64 { return m_captureIndex; }

◆ construct()

void L1GctInternEmCand::construct ( unsigned  rank,
unsigned  eta,
unsigned  etaSgn,
unsigned  phi 
)
private

Definition at line 58 of file L1GctInternEmCand.cc.

References PVValHelper::eta, m_data, phi, rank(), and testProducerWithPsetDescEmpty_cfi::x1.

Referenced by L1GctInternEmCand().

58  {
59  m_data = (rank & 0x3f) + ((eta & 0xf) << 6) + ((etaSgn & 0x1) << 10) + ((phi & 0x1f) << 11);
60 }
unsigned rank() const
get rank bits

◆ empty()

bool L1GctInternEmCand::empty ( ) const

was an object really found?

Definition at line 37 of file L1GctInternEmCand.cc.

References rank().

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

37 { return (rank() == 0); }
unsigned rank() const
get rank bits

◆ etaIndex()

unsigned L1GctInternEmCand::etaIndex ( ) const
inline

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

Definition at line 49 of file L1GctInternEmCand.h.

References m_data.

Referenced by regionId().

49 { return (m_data >> 6) & 0x1f; }

◆ etaSign()

unsigned L1GctInternEmCand::etaSign ( ) const
inline

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

Definition at line 52 of file L1GctInternEmCand.h.

References m_data.

Referenced by regionId().

52 { return (m_data >> 10) & 0x1; }

◆ isolated()

bool L1GctInternEmCand::isolated ( ) const
inline

which stream did this come from

Definition at line 58 of file L1GctInternEmCand.h.

References m_iso.

Referenced by name().

58 { return m_iso; }

◆ name()

string L1GctInternEmCand::name ( ) const

name of object

Definition at line 34 of file L1GctInternEmCand.cc.

References isolated().

Referenced by config.CFG::__str__(), validation.Sample::digest(), and VIDSelectorBase.VIDSelectorBase::initialize().

34 { return (isolated() ? "iso EM" : "non iso EM"); }
bool isolated() const
which stream did this come from

◆ operator!=()

int L1GctInternEmCand::operator!= ( const L1GctInternEmCand c) const
inline

inequality operator

Definition at line 75 of file L1GctInternEmCand.h.

References c, empty(), m_data, and m_iso.

75  {
76  return ((m_data != c.raw() || m_iso != c.isolated()) && (!this->empty() || !c.empty()));
77  }
bool empty() const
was an object really found?

◆ operator==()

int L1GctInternEmCand::operator== ( const L1GctInternEmCand c) const
inline

equality operator

Definition at line 70 of file L1GctInternEmCand.h.

References c, empty(), m_data, and m_iso.

70  {
71  return ((m_data == c.raw() && m_iso == c.isolated()) || (this->empty() && c.empty()));
72  }
bool empty() const
was an object really found?

◆ phiIndex()

unsigned L1GctInternEmCand::phiIndex ( ) const
inline

get phi index (0-17)

Definition at line 55 of file L1GctInternEmCand.h.

References m_data.

Referenced by regionId().

55 { return (m_data >> 11) & 0x1f; }

◆ rank()

unsigned L1GctInternEmCand::rank ( ) const
inline

get rank bits

Definition at line 46 of file L1GctInternEmCand.h.

References m_data.

Referenced by construct(), empty(), and L1GctInternEmCand().

46 { return m_data & 0x3f; }

◆ raw()

uint16_t L1GctInternEmCand::raw ( ) const
inline

get the raw data

Definition at line 43 of file L1GctInternEmCand.h.

References m_data.

43 { return m_data; }

◆ regionId()

L1CaloRegionDetId L1GctInternEmCand::regionId ( ) const

region associated with the candidate

Definition at line 51 of file L1GctInternEmCand.cc.

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

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

Member Data Documentation

◆ m_bx

int16_t L1GctInternEmCand::m_bx
private

Definition at line 88 of file L1GctInternEmCand.h.

Referenced by bx().

◆ m_captureBlock

uint16_t L1GctInternEmCand::m_captureBlock
private

Definition at line 85 of file L1GctInternEmCand.h.

Referenced by capBlock().

◆ m_captureIndex

uint8_t L1GctInternEmCand::m_captureIndex
private

Definition at line 86 of file L1GctInternEmCand.h.

Referenced by capIndex().

◆ m_data

uint16_t L1GctInternEmCand::m_data
private

Definition at line 84 of file L1GctInternEmCand.h.

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

◆ m_iso

bool L1GctInternEmCand::m_iso
private

Definition at line 87 of file L1GctInternEmCand.h.

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