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.

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

◆ 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) {}

◆ 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.

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 }

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

◆ ~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.

67 { return m_bx; }

References m_bx.

◆ capBlock()

unsigned L1GctInternEmCand::capBlock ( ) const
inline

which capture block did this come from

Definition at line 61 of file L1GctInternEmCand.h.

61 { return m_captureBlock; }

References m_captureBlock.

◆ capIndex()

unsigned L1GctInternEmCand::capIndex ( ) const
inline

what index within capture block

Definition at line 64 of file L1GctInternEmCand.h.

64 { return m_captureIndex; }

References m_captureIndex.

◆ construct()

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

Definition at line 58 of file L1GctInternEmCand.cc.

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

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

Referenced by L1GctInternEmCand().

◆ empty()

bool L1GctInternEmCand::empty ( ) const

was an object really found?

Definition at line 37 of file L1GctInternEmCand.cc.

37 { return (rank() == 0); }

References rank().

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

◆ 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.

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

References m_data.

Referenced by regionId().

◆ 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.

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

References m_data.

Referenced by regionId().

◆ isolated()

bool L1GctInternEmCand::isolated ( ) const
inline

which stream did this come from

Definition at line 58 of file L1GctInternEmCand.h.

58 { return m_iso; }

References m_iso.

Referenced by name().

◆ name()

string L1GctInternEmCand::name ( ) const

name of object

Definition at line 34 of file L1GctInternEmCand.cc.

34 { return (isolated() ? "iso EM" : "non iso EM"); }

References isolated().

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

◆ operator!=()

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

inequality operator

Definition at line 75 of file L1GctInternEmCand.h.

75  {
76  return ((m_data != c.raw() || m_iso != c.isolated()) && (!this->empty() || !c.empty()));
77  }

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

◆ operator==()

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

equality operator

Definition at line 70 of file L1GctInternEmCand.h.

70  {
71  return ((m_data == c.raw() && m_iso == c.isolated()) || (this->empty() && c.empty()));
72  }

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

◆ phiIndex()

unsigned L1GctInternEmCand::phiIndex ( ) const
inline

get phi index (0-17)

Definition at line 55 of file L1GctInternEmCand.h.

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

References m_data.

Referenced by regionId().

◆ rank()

unsigned L1GctInternEmCand::rank ( ) const
inline

get rank bits

Definition at line 46 of file L1GctInternEmCand.h.

46 { return m_data & 0x3f; }

References m_data.

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

◆ raw()

uint16_t L1GctInternEmCand::raw ( ) const
inline

get the raw data

Definition at line 43 of file L1GctInternEmCand.h.

43 { return m_data; }

References m_data.

◆ regionId()

L1CaloRegionDetId L1GctInternEmCand::regionId ( ) const

region associated with the candidate

Definition at line 51 of file L1GctInternEmCand.cc.

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

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

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

L1GctInternEmCand::bx
int16_t bx() const
get bunch-crossing index
Definition: L1GctInternEmCand.h:67
L1GctInternEmCand::m_captureBlock
uint16_t m_captureBlock
Definition: L1GctInternEmCand.h:85
L1GctInternEmCand::m_captureIndex
uint8_t m_captureIndex
Definition: L1GctInternEmCand.h:86
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
L1CaloRegionDetId
Definition: L1CaloRegionDetId.h:18
PVValHelper::eta
Definition: PVValidationHelpers.h:70
L1GctInternEmCand::isolated
bool isolated() const
which stream did this come from
Definition: L1GctInternEmCand.h:58
L1GctInternEmCand::construct
void construct(unsigned rank, unsigned eta, unsigned etaSgn, unsigned phi)
Definition: L1GctInternEmCand.cc:58
L1GctInternEmCand::rank
unsigned rank() const
get rank bits
Definition: L1GctInternEmCand.h:46
L1GctInternEmCand::m_iso
bool m_iso
Definition: L1GctInternEmCand.h:87
L1GctInternEmCand::empty
bool empty() const
was an object really found?
Definition: L1GctInternEmCand.cc:37
groupFilesInBlocks.block
block
Definition: groupFilesInBlocks.py:150
L1GctInternEmCand::phiIndex
unsigned phiIndex() const
get phi index (0-17)
Definition: L1GctInternEmCand.h:55
L1GctInternEmCand::etaSign
unsigned etaSign() const
get eta sign (1 for -ve Z, 0 for +ve Z)
Definition: L1GctInternEmCand.h:52
DDAxes::phi
L1GctInternEmCand::etaIndex
unsigned etaIndex() const
get eta index - Barrel 1:4, Endcap 5:7, HF 8:11
Definition: L1GctInternEmCand.h:49
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:56
L1GctInternEmCand::m_data
uint16_t m_data
Definition: L1GctInternEmCand.h:84
L1GctInternEmCand::m_bx
int16_t m_bx
Definition: L1GctInternEmCand.h:88