CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
L1CaloEmCand Class Reference

Level-1 Region Calorimeter Trigger EM candidate. More...

#include <L1CaloEmCand.h>

Public Member Functions

int16_t bx () const
 get bunch-crossing index More...
 
bool empty () const
 is there any information in the candidate More...
 
unsigned index () const
 get index on cable More...
 
bool isolated () const
 which stream did this come from More...
 
 L1CaloEmCand ()
 default constructor (for vector initialisation etc.) More...
 
 L1CaloEmCand (uint16_t data, unsigned crate, bool iso)
 construct from raw data, no source - used by TextToDigi More...
 
 L1CaloEmCand (uint16_t data, unsigned crate, bool iso, uint16_t index, int16_t bx, bool dummy)
 
 L1CaloEmCand (unsigned rank, unsigned region, unsigned card, unsigned crate, bool iso)
 construct from components for emulation More...
 
 L1CaloEmCand (unsigned rank, unsigned region, unsigned card, unsigned crate, bool iso, uint16_t index, int16_t bx)
 construct from components for emulation (including index) More...
 
int operator!= (const L1CaloEmCand &c) const
 inequality operator More...
 
int operator== (const L1CaloEmCand &c) const
 equality operator, including rank, isolation, position More...
 
unsigned rank () const
 get rank bits More...
 
uint16_t raw () const
 get the raw data More...
 
unsigned rctCard () const
 get RCT receiver card More...
 
unsigned rctCrate () const
 get RCT crate More...
 
unsigned rctRegion () const
 get RCT region ID More...
 
L1CaloRegionDetId regionId () const
 get DetID object More...
 
void setBx (int16_t bx)
 set BX More...
 
 ~L1CaloEmCand ()
 destructor More...
 

Private Attributes

int16_t m_bx
 
uint16_t m_data
 
uint16_t m_index
 
bool m_iso
 
uint16_t m_rctCrate
 

Detailed Description

Level-1 Region Calorimeter Trigger EM candidate.

Author
Jim Brooke
Date
June 2006

Definition at line 17 of file L1CaloEmCand.h.

Constructor & Destructor Documentation

◆ L1CaloEmCand() [1/5]

L1CaloEmCand::L1CaloEmCand ( )

default constructor (for vector initialisation etc.)

Definition at line 11 of file L1CaloEmCand.cc.

11 : m_data(0), m_rctCrate(0), m_iso(false), m_index(0), m_bx(0) {}
uint16_t m_index
Definition: L1CaloEmCand.h:89
int16_t m_bx
Definition: L1CaloEmCand.h:90
uint16_t m_rctCrate
Definition: L1CaloEmCand.h:87
uint16_t m_data
Definition: L1CaloEmCand.h:83

◆ L1CaloEmCand() [2/5]

L1CaloEmCand::L1CaloEmCand ( uint16_t  data,
unsigned  crate,
bool  iso 
)

construct from raw data, no source - used by TextToDigi

Definition at line 15 of file L1CaloEmCand.cc.

16  : m_data(data), m_rctCrate(crate), m_iso(iso), m_index(0), m_bx(0) {}
uint16_t m_index
Definition: L1CaloEmCand.h:89
int16_t m_bx
Definition: L1CaloEmCand.h:90
uint16_t m_rctCrate
Definition: L1CaloEmCand.h:87
uint16_t m_data
Definition: L1CaloEmCand.h:83
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79

◆ L1CaloEmCand() [3/5]

L1CaloEmCand::L1CaloEmCand ( uint16_t  data,
unsigned  crate,
bool  iso,
uint16_t  index,
int16_t  bx,
bool  dummy 
)

construct from raw data with source - used by GCT unpacker last bool argument is a hack to distinguish this constructor from the next one!

Definition at line 20 of file L1CaloEmCand.cc.

21  : m_data(data), m_rctCrate(crate), m_iso(iso), m_index(index), m_bx(bx) {}
int16_t bx() const
get bunch-crossing index
Definition: L1CaloEmCand.h:60
uint16_t m_index
Definition: L1CaloEmCand.h:89
int16_t m_bx
Definition: L1CaloEmCand.h:90
uint16_t m_rctCrate
Definition: L1CaloEmCand.h:87
uint16_t m_data
Definition: L1CaloEmCand.h:83
unsigned index() const
get index on cable
Definition: L1CaloEmCand.h:57
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79

◆ L1CaloEmCand() [4/5]

L1CaloEmCand::L1CaloEmCand ( unsigned  rank,
unsigned  region,
unsigned  card,
unsigned  crate,
bool  iso 
)

construct from components for emulation

Definition at line 24 of file L1CaloEmCand.cc.

References m_data, rank(), HLT_2023v11_cff::region, and testProducerWithPsetDescEmpty_cfi::x1.

25  : m_data(0), // over-ridden below
26  m_rctCrate(crate),
27  m_iso(iso),
28  m_index(0),
29  m_bx(0)
30 
31 {
32  m_data = (rank & 0x3f) + ((region & 0x1) << 6) + ((card & 0x7) << 7);
33 }
uint16_t m_index
Definition: L1CaloEmCand.h:89
int16_t m_bx
Definition: L1CaloEmCand.h:90
uint16_t m_rctCrate
Definition: L1CaloEmCand.h:87
uint16_t m_data
Definition: L1CaloEmCand.h:83
unsigned rank() const
get rank bits
Definition: L1CaloEmCand.h:42

◆ L1CaloEmCand() [5/5]

L1CaloEmCand::L1CaloEmCand ( unsigned  rank,
unsigned  region,
unsigned  card,
unsigned  crate,
bool  iso,
uint16_t  index,
int16_t  bx 
)

construct from components for emulation (including index)

Definition at line 36 of file L1CaloEmCand.cc.

References m_data, rank(), HLT_2023v11_cff::region, and testProducerWithPsetDescEmpty_cfi::x1.

38  : m_data(0), // over-ridden below
39  m_rctCrate(crate),
40  m_iso(iso),
41  m_index(index),
42  m_bx(bx) {
43  m_data = (rank & 0x3f) + ((region & 0x1) << 6) + ((card & 0x7) << 7);
44 }
int16_t bx() const
get bunch-crossing index
Definition: L1CaloEmCand.h:60
uint16_t m_index
Definition: L1CaloEmCand.h:89
int16_t m_bx
Definition: L1CaloEmCand.h:90
uint16_t m_rctCrate
Definition: L1CaloEmCand.h:87
uint16_t m_data
Definition: L1CaloEmCand.h:83
unsigned rank() const
get rank bits
Definition: L1CaloEmCand.h:42
unsigned index() const
get index on cable
Definition: L1CaloEmCand.h:57

◆ ~L1CaloEmCand()

L1CaloEmCand::~L1CaloEmCand ( )

destructor

Definition at line 47 of file L1CaloEmCand.cc.

47 {}

Member Function Documentation

◆ bx()

int16_t L1CaloEmCand::bx ( ) const
inline

get bunch-crossing index

Definition at line 60 of file L1CaloEmCand.h.

References m_bx.

Referenced by setBx().

60 { return m_bx; }
int16_t m_bx
Definition: L1CaloEmCand.h:90

◆ empty()

bool L1CaloEmCand::empty ( ) const
inline

is there any information in the candidate

Definition at line 79 of file L1CaloEmCand.h.

References rank().

Referenced by operator==().

79 { return (rank() == 0); }
unsigned rank() const
get rank bits
Definition: L1CaloEmCand.h:42

◆ index()

unsigned L1CaloEmCand::index ( ) const
inline

get index on cable

Definition at line 57 of file L1CaloEmCand.h.

References m_index.

57 { return m_index; }
uint16_t m_index
Definition: L1CaloEmCand.h:89

◆ isolated()

bool L1CaloEmCand::isolated ( ) const
inline

which stream did this come from

Definition at line 54 of file L1CaloEmCand.h.

References m_iso.

54 { return m_iso; }

◆ operator!=()

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

inequality operator

Definition at line 76 of file L1CaloEmCand.h.

References HltBtagPostValidation_cff::c.

76 { return !(*this == c); }

◆ operator==()

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

equality operator, including rank, isolation, position

Definition at line 69 of file L1CaloEmCand.h.

References HltBtagPostValidation_cff::c, empty(), m_data, m_iso, m_rctCrate, and regionId().

69  {
70  return ((m_data == c.raw() && m_iso == c.isolated() && m_rctCrate == c.rctCrate() &&
71  this->regionId() == c.regionId()) ||
72  (this->empty() && c.empty()));
73  }
L1CaloRegionDetId regionId() const
get DetID object
Definition: L1CaloEmCand.h:63
uint16_t m_rctCrate
Definition: L1CaloEmCand.h:87
uint16_t m_data
Definition: L1CaloEmCand.h:83
bool empty() const
is there any information in the candidate
Definition: L1CaloEmCand.h:79

◆ rank()

unsigned L1CaloEmCand::rank ( ) const
inline

get rank bits

Definition at line 42 of file L1CaloEmCand.h.

References m_data.

Referenced by L1RCTTestAnalyzer::compareEmCands(), empty(), and L1CaloEmCand().

42 { return m_data & 0x3f; }
uint16_t m_data
Definition: L1CaloEmCand.h:83

◆ raw()

uint16_t L1CaloEmCand::raw ( ) const
inline

get the raw data

Definition at line 39 of file L1CaloEmCand.h.

References m_data.

39 { return m_data; }
uint16_t m_data
Definition: L1CaloEmCand.h:83

◆ rctCard()

unsigned L1CaloEmCand::rctCard ( ) const
inline

get RCT receiver card

Definition at line 45 of file L1CaloEmCand.h.

References m_data.

Referenced by regionId().

45 { return (m_data >> 7) & 0x7; }
uint16_t m_data
Definition: L1CaloEmCand.h:83

◆ rctCrate()

unsigned L1CaloEmCand::rctCrate ( ) const
inline

get RCT crate

Definition at line 51 of file L1CaloEmCand.h.

References m_rctCrate.

Referenced by regionId(), L1GlobalCaloTrigger::setIsoEm(), L1GlobalCaloTrigger::setNonIsoEm(), and L1GlobalCaloTrigger::sorterNo().

51 { return m_rctCrate; }
uint16_t m_rctCrate
Definition: L1CaloEmCand.h:87

◆ rctRegion()

unsigned L1CaloEmCand::rctRegion ( ) const
inline

get RCT region ID

Definition at line 48 of file L1CaloEmCand.h.

References m_data.

Referenced by regionId().

48 { return (m_data >> 6) & 0x1; }
uint16_t m_data
Definition: L1CaloEmCand.h:83

◆ regionId()

L1CaloRegionDetId L1CaloEmCand::regionId ( ) const
inline

get DetID object

Definition at line 63 of file L1CaloEmCand.h.

References rctCard(), rctCrate(), and rctRegion().

Referenced by operator==().

63 { return L1CaloRegionDetId(rctCrate(), rctCard(), rctRegion()); }
unsigned rctRegion() const
get RCT region ID
Definition: L1CaloEmCand.h:48
unsigned rctCrate() const
get RCT crate
Definition: L1CaloEmCand.h:51
unsigned rctCard() const
get RCT receiver card
Definition: L1CaloEmCand.h:45

◆ setBx()

void L1CaloEmCand::setBx ( int16_t  bx)

set BX

Definition at line 49 of file L1CaloEmCand.cc.

References bx(), and m_bx.

Referenced by RctRawToDigi::unpackCTP7().

49 { m_bx = bx; }
int16_t bx() const
get bunch-crossing index
Definition: L1CaloEmCand.h:60
int16_t m_bx
Definition: L1CaloEmCand.h:90

Member Data Documentation

◆ m_bx

int16_t L1CaloEmCand::m_bx
private

Definition at line 90 of file L1CaloEmCand.h.

Referenced by bx(), and setBx().

◆ m_data

uint16_t L1CaloEmCand::m_data
private

Definition at line 83 of file L1CaloEmCand.h.

Referenced by L1CaloEmCand(), operator==(), rank(), raw(), rctCard(), and rctRegion().

◆ m_index

uint16_t L1CaloEmCand::m_index
private

Definition at line 89 of file L1CaloEmCand.h.

Referenced by index().

◆ m_iso

bool L1CaloEmCand::m_iso
private

Definition at line 88 of file L1CaloEmCand.h.

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

◆ m_rctCrate

uint16_t L1CaloEmCand::m_rctCrate
private

Definition at line 87 of file L1CaloEmCand.h.

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