CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Attributes
L1GctInternEtSum Class Reference

L1 GCT internal energy sum. More...

#include <L1GctInternEtSum.h>

Public Types

enum  L1GctInternEtSumType {
  null, jet_tot_et, jet_tot_ht, jet_miss_et,
  total_et_or_ht, miss_etx_or_ety
}
 et sum type - not clear this is required More...
 
enum  numberOfBits {
  kTotEtOrHtNBits = 12, kJetMissEtNBits = 17, kMissExOrEyNBits = 20, kTotEtOrHtOFlowBit = 1 << kTotEtOrHtNBits,
  kJetMissEtOFlowBit = 1 << kJetMissEtNBits, kMissExOrEyOFlowBit = 1 << kMissExOrEyNBits, kTotEtOrHtMaxValue = kTotEtOrHtOFlowBit - 1, kJetMissEtMaxValue = kJetMissEtOFlowBit - 1,
  kMissExOrEyMaxValue = kMissExOrEyOFlowBit - 1, kTotEtOrHtRawCtorMask = kTotEtOrHtOFlowBit | kTotEtOrHtMaxValue, kJetMissEtRawCtorMask = kJetMissEtOFlowBit | kJetMissEtMaxValue, kMissExOrEyRawCtorMask = kMissExOrEyOFlowBit | kMissExOrEyMaxValue
}
 

Public Member Functions

int16_t bx () const
 get BX number More...
 
uint16_t capBlock () const
 get capture block More...
 
uint16_t capIndex () const
 get index within capture block More...
 
uint32_t count () const
 get count More...
 
bool empty () const
 is the sum non-zero More...
 
uint32_t et () const
 get et More...
 
 L1GctInternEtSum ()
 default constructor (for vector initialisation etc.) More...
 
 L1GctInternEtSum (uint16_t capBlock, uint16_t capIndex, int16_t bx, uint32_t et, uint8_t oflow)
 construct from individual quantities More...
 
uint8_t oflow () const
 get oflow More...
 
bool operator!= (const L1GctInternEtSum &c) const
 inequality operator More...
 
bool operator== (const L1GctInternEtSum &c) const
 operators More...
 
uint32_t raw () const
 get the actual bits More...
 
void setBx (uint16_t bx)
 set bx More...
 
void setCapBlock (uint16_t capBlock)
 set cap block More...
 
void setCapIndex (uint16_t capIndex)
 set cap index More...
 
void setCount (uint32_t count)
 set count More...
 
void setEt (uint32_t et)
 set Et sum More...
 
void setOflow (uint8_t oflow)
 set overflow bit More...
 
void setType (L1GctInternEtSumType type)
 set type More...
 
void setValue (uint32_t val)
 set value More...
 
L1GctInternEtSum::L1GctInternEtSumType type () const
 metadata More...
 
uint32_t value () const
 get value More...
 
 ~L1GctInternEtSum ()
 destructor More...
 

Static Public Member Functions

static L1GctInternEtSum fromEmulatorJetMissEt (int missEtxOrEty, bool overFlow, int16_t bx)
 
static L1GctInternEtSum fromEmulatorJetTotEt (unsigned totEt, bool overFlow, int16_t bx)
 Emulator constructors. More...
 
static L1GctInternEtSum fromEmulatorJetTotHt (unsigned totHt, bool overFlow, int16_t bx)
 
static L1GctInternEtSum fromEmulatorMissEtxOrEty (int missEtxOrEty, bool overFlow, int16_t bx)
 
static L1GctInternEtSum fromEmulatorTotalEtOrHt (unsigned totEtOrHt, bool overFlow, int16_t bx)
 
static L1GctInternEtSum fromJetMissEt (uint16_t capBlock, uint16_t capIndex, int16_t bx, uint32_t data)
 
static L1GctInternEtSum fromJetTotEt (uint16_t capBlock, uint16_t capIndex, int16_t bx, uint32_t data)
 
static L1GctInternEtSum fromJetTotHt (uint16_t capBlock, uint16_t capIndex, int16_t bx, uint32_t data)
 
static L1GctInternEtSum fromMissEtxOrEty (uint16_t capBlock, uint16_t capIndex, int16_t bx, uint32_t data)
 
static L1GctInternEtSum fromTotalEtOrHt (uint16_t capBlock, uint16_t capIndex, int16_t bx, uint32_t data)
 

Private Attributes

int16_t bx_
 
uint16_t capBlock_
 
uint16_t capIndex_
 
uint32_t data_
 
L1GctInternEtSumType type_
 

Detailed Description

L1 GCT internal energy sum.

Author
Jim Brooke
Date
June 2008

Definition at line 14 of file L1GctInternEtSum.h.

Member Enumeration Documentation

◆ L1GctInternEtSumType

et sum type - not clear this is required

Enumerator
null 
jet_tot_et 
jet_tot_ht 
jet_miss_et 
total_et_or_ht 
miss_etx_or_ety 

Definition at line 17 of file L1GctInternEtSum.h.

17  {
18  null,
19  jet_tot_et, // from jet_tot_et_and_ht in leaf output
20  jet_tot_ht, // from jet_tot_et_and_ht in leaf output
21  jet_miss_et, // leaf output
22  total_et_or_ht, // conc input, wheel input and output
23  miss_etx_or_ety // conc input, wheel input and output
24  };

◆ numberOfBits

Enumerator
kTotEtOrHtNBits 
kJetMissEtNBits 
kMissExOrEyNBits 
kTotEtOrHtOFlowBit 
kJetMissEtOFlowBit 
kMissExOrEyOFlowBit 
kTotEtOrHtMaxValue 
kJetMissEtMaxValue 
kMissExOrEyMaxValue 
kTotEtOrHtRawCtorMask 
kJetMissEtRawCtorMask 
kMissExOrEyRawCtorMask 

Definition at line 26 of file L1GctInternEtSum.h.

Constructor & Destructor Documentation

◆ L1GctInternEtSum() [1/2]

L1GctInternEtSum::L1GctInternEtSum ( )

default constructor (for vector initialisation etc.)

Definition at line 4 of file L1GctInternEtSum.cc.

4 {}

◆ L1GctInternEtSum() [2/2]

L1GctInternEtSum::L1GctInternEtSum ( uint16_t  capBlock,
uint16_t  capIndex,
int16_t  bx,
uint32_t  et,
uint8_t  oflow 
)

construct from individual quantities

Definition at line 7 of file L1GctInternEtSum.cc.

References setEt(), and setOflow().

9  this->setEt(et);
10  this->setOflow(oflow);
11 }
uint8_t oflow() const
get oflow
void setOflow(uint8_t oflow)
set overflow bit
uint16_t capIndex() const
get index within capture block
L1GctInternEtSumType type_
int16_t bx() const
get BX number
void setEt(uint32_t et)
set Et sum
uint32_t et() const
get et
uint16_t capBlock() const
get capture block

◆ ~L1GctInternEtSum()

L1GctInternEtSum::~L1GctInternEtSum ( )

destructor

Definition at line 14 of file L1GctInternEtSum.cc.

14 {}

Member Function Documentation

◆ bx()

int16_t L1GctInternEtSum::bx ( ) const
inline

◆ capBlock()

uint16_t L1GctInternEtSum::capBlock ( ) const
inline

get capture block

Definition at line 77 of file L1GctInternEtSum.h.

References capBlock_.

Referenced by fromJetMissEt(), fromJetTotEt(), fromJetTotHt(), fromMissEtxOrEty(), fromTotalEtOrHt(), and setCapBlock().

77 { return capBlock_; }

◆ capIndex()

uint16_t L1GctInternEtSum::capIndex ( ) const
inline

get index within capture block

Definition at line 80 of file L1GctInternEtSum.h.

References capIndex_.

Referenced by fromJetMissEt(), fromJetTotEt(), fromJetTotHt(), fromMissEtxOrEty(), fromTotalEtOrHt(), and setCapIndex().

80 { return capIndex_; }

◆ count()

uint32_t L1GctInternEtSum::count ( void  ) const
inline

get count

Definition at line 100 of file L1GctInternEtSum.h.

References value().

Referenced by setCount().

100 { return value(); }
uint32_t value() const
get value

◆ empty()

bool L1GctInternEtSum::empty ( ) const
inline

is the sum non-zero

Definition at line 86 of file L1GctInternEtSum.h.

References data_.

86 { return (data_ == 0); }

◆ et()

uint32_t L1GctInternEtSum::et ( ) const
inline

get et

Definition at line 97 of file L1GctInternEtSum.h.

References value().

Referenced by setEt().

97 { return value(); }
uint32_t value() const
get value

◆ fromEmulatorJetMissEt()

L1GctInternEtSum L1GctInternEtSum::fromEmulatorJetMissEt ( int  missEtxOrEty,
bool  overFlow,
int16_t  bx 
)
static

◆ fromEmulatorJetTotEt()

L1GctInternEtSum L1GctInternEtSum::fromEmulatorJetTotEt ( unsigned  totEt,
bool  overFlow,
int16_t  bx 
)
static

Emulator constructors.

Definition at line 89 of file L1GctInternEtSum.cc.

References bx(), jet_tot_et, kTotEtOrHtMaxValue, alignCSCRings::s, and testProducerWithPsetDescEmpty_cfi::x1.

Referenced by L1GctJetLeafCard::getInternalEtSums(), and L1GctJetFinderBase::getInternalEtSums().

89  {
91  s.setEt(totEt & kTotEtOrHtMaxValue);
92  if (overFlow || (totEt > kTotEtOrHtMaxValue))
93  s.setOflow(0x1);
94  s.setBx(bx);
95  s.setType(jet_tot_et);
96  return s;
97 }
L1 GCT internal energy sum.
int16_t bx() const
get BX number

◆ fromEmulatorJetTotHt()

L1GctInternEtSum L1GctInternEtSum::fromEmulatorJetTotHt ( unsigned  totHt,
bool  overFlow,
int16_t  bx 
)
static

Definition at line 99 of file L1GctInternEtSum.cc.

References bx(), jet_tot_ht, kTotEtOrHtMaxValue, alignCSCRings::s, and testProducerWithPsetDescEmpty_cfi::x1.

Referenced by L1GctJetLeafCard::getInternalEtSums(), and L1GctJetFinderBase::getInternalEtSums().

99  {
101  s.setEt(totHt & kTotEtOrHtMaxValue);
102  if (overFlow || (totHt > kTotEtOrHtMaxValue))
103  s.setOflow(0x1);
104  s.setBx(bx);
105  s.setType(jet_tot_ht);
106  return s;
107 }
L1 GCT internal energy sum.
int16_t bx() const
get BX number

◆ fromEmulatorMissEtxOrEty()

L1GctInternEtSum L1GctInternEtSum::fromEmulatorMissEtxOrEty ( int  missEtxOrEty,
bool  overFlow,
int16_t  bx 
)
static

Definition at line 129 of file L1GctInternEtSum.cc.

References bx(), kMissExOrEyMaxValue, kMissExOrEyOFlowBit, miss_etx_or_ety, alignCSCRings::s, and testProducerWithPsetDescEmpty_cfi::x1.

Referenced by L1GctWheelEnergyFpga::getInternalEtSums().

129  {
131  s.setEt(missEtxOrEty & kMissExOrEyMaxValue);
132  if (overFlow || (missEtxOrEty >= kMissExOrEyOFlowBit / 2) || (missEtxOrEty < -kMissExOrEyOFlowBit / 2))
133  s.setOflow(0x1);
134  s.setBx(bx);
135  s.setType(miss_etx_or_ety);
136  return s;
137 }
L1 GCT internal energy sum.
int16_t bx() const
get BX number

◆ fromEmulatorTotalEtOrHt()

L1GctInternEtSum L1GctInternEtSum::fromEmulatorTotalEtOrHt ( unsigned  totEtOrHt,
bool  overFlow,
int16_t  bx 
)
static

Definition at line 119 of file L1GctInternEtSum.cc.

References bx(), kTotEtOrHtMaxValue, alignCSCRings::s, total_et_or_ht, and testProducerWithPsetDescEmpty_cfi::x1.

Referenced by L1GctWheelEnergyFpga::getInternalEtSums().

119  {
121  s.setEt(totEtOrHt & kTotEtOrHtMaxValue);
122  if (overFlow || (totEtOrHt > kTotEtOrHtMaxValue))
123  s.setOflow(0x1);
124  s.setBx(bx);
125  s.setType(total_et_or_ht);
126  return s;
127 }
L1 GCT internal energy sum.
int16_t bx() const
get BX number

◆ fromJetMissEt()

L1GctInternEtSum L1GctInternEtSum::fromJetMissEt ( uint16_t  capBlock,
uint16_t  capIndex,
int16_t  bx,
uint32_t  data 
)
static

Definition at line 45 of file L1GctInternEtSum.cc.

References bx(), capBlock(), capIndex(), data, jet_miss_et, kJetMissEtMaxValue, kJetMissEtNBits, alignCSCRings::s, and testProducerWithPsetDescEmpty_cfi::x1.

Referenced by GctFormatTranslateV35::blockToGctInternEtSumsAndJetCluster(), and GctFormatTranslateV38::blockToGctInternEtSumsAndJetCluster().

48  {
50  s.setEt(data & kJetMissEtMaxValue);
51  s.setOflow((data >> kJetMissEtNBits) & 0x1);
52  s.setCapBlock(capBlock);
53  s.setCapIndex(capIndex);
54  s.setBx(bx);
55  s.setType(jet_miss_et);
56  return s;
57 }
L1 GCT internal energy sum.
uint16_t capIndex() const
get index within capture block
int16_t bx() const
get BX number
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
uint16_t capBlock() const
get capture block

◆ fromJetTotEt()

L1GctInternEtSum L1GctInternEtSum::fromJetTotEt ( uint16_t  capBlock,
uint16_t  capIndex,
int16_t  bx,
uint32_t  data 
)
static

Definition at line 16 of file L1GctInternEtSum.cc.

References bx(), capBlock(), capIndex(), data, jet_tot_et, kTotEtOrHtMaxValue, kTotEtOrHtNBits, alignCSCRings::s, and testProducerWithPsetDescEmpty_cfi::x1.

Referenced by GctFormatTranslateV35::blockToGctInternEtSumsAndJetCluster(), and GctFormatTranslateV38::blockToGctInternEtSumsAndJetCluster().

19  {
21  s.setEt(data & kTotEtOrHtMaxValue);
22  s.setOflow((data >> kTotEtOrHtNBits) & 0x1);
23  s.setCapBlock(capBlock);
24  s.setCapIndex(capIndex);
25  s.setBx(bx);
26  s.setType(jet_tot_et);
27  return s;
28 }
L1 GCT internal energy sum.
uint16_t capIndex() const
get index within capture block
int16_t bx() const
get BX number
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
uint16_t capBlock() const
get capture block

◆ fromJetTotHt()

L1GctInternEtSum L1GctInternEtSum::fromJetTotHt ( uint16_t  capBlock,
uint16_t  capIndex,
int16_t  bx,
uint32_t  data 
)
static

Definition at line 30 of file L1GctInternEtSum.cc.

References bx(), capBlock(), capIndex(), data, jet_tot_ht, kTotEtOrHtMaxValue, kTotEtOrHtNBits, alignCSCRings::s, and testProducerWithPsetDescEmpty_cfi::x1.

Referenced by GctFormatTranslateV35::blockToGctInternEtSumsAndJetCluster(), and GctFormatTranslateV38::blockToGctInternEtSumsAndJetCluster().

33  {
35  uint32_t word = data >> 16;
36  s.setEt(word & kTotEtOrHtMaxValue);
37  s.setOflow((word >> kTotEtOrHtNBits) & 0x1);
38  s.setCapBlock(capBlock);
39  s.setCapIndex(capIndex);
40  s.setBx(bx);
41  s.setType(jet_tot_ht);
42  return s;
43 }
L1 GCT internal energy sum.
uint16_t capIndex() const
get index within capture block
uint64_t word
int16_t bx() const
get BX number
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
uint16_t capBlock() const
get capture block

◆ fromMissEtxOrEty()

L1GctInternEtSum L1GctInternEtSum::fromMissEtxOrEty ( uint16_t  capBlock,
uint16_t  capIndex,
int16_t  bx,
uint32_t  data 
)
static

Definition at line 73 of file L1GctInternEtSum.cc.

References bx(), capBlock(), capIndex(), data, kMissExOrEyNBits, miss_etx_or_ety, and alignCSCRings::s.

Referenced by GctFormatTranslateV35::blockToGctWheelInputInternEtAndRingSums(), GctFormatTranslateV38::blockToGctWheelInputInternEtAndRingSums(), GctFormatTranslateV35::blockToGctWheelOutputInternEtAndRingSums(), and GctFormatTranslateV38::blockToGctWheelOutputInternEtAndRingSums().

76  {
78  s.setEt(data & kMissExOrEyNBits);
79  s.setOflow(0); // No over flow bit at the moment
80  s.setCapBlock(capBlock);
81  s.setCapIndex(capIndex);
82  s.setBx(bx);
83  s.setType(miss_etx_or_ety);
84  return s;
85 }
L1 GCT internal energy sum.
uint16_t capIndex() const
get index within capture block
int16_t bx() const
get BX number
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
uint16_t capBlock() const
get capture block

◆ fromTotalEtOrHt()

L1GctInternEtSum L1GctInternEtSum::fromTotalEtOrHt ( uint16_t  capBlock,
uint16_t  capIndex,
int16_t  bx,
uint32_t  data 
)
static

Definition at line 59 of file L1GctInternEtSum.cc.

References bx(), capBlock(), capIndex(), data, kTotEtOrHtMaxValue, kTotEtOrHtNBits, alignCSCRings::s, total_et_or_ht, and testProducerWithPsetDescEmpty_cfi::x1.

Referenced by GctFormatTranslateV35::blockToGctInternEtSums(), GctFormatTranslateV38::blockToGctInternEtSums(), GctFormatTranslateV35::blockToGctWheelInputInternEtAndRingSums(), GctFormatTranslateV38::blockToGctWheelInputInternEtAndRingSums(), GctFormatTranslateV35::blockToGctWheelOutputInternEtAndRingSums(), and GctFormatTranslateV38::blockToGctWheelOutputInternEtAndRingSums().

62  {
64  s.setEt(data & kTotEtOrHtMaxValue);
65  s.setOflow((data >> kTotEtOrHtNBits) & 0x1);
66  s.setCapBlock(capBlock);
67  s.setCapIndex(capIndex);
68  s.setBx(bx);
69  s.setType(total_et_or_ht);
70  return s;
71 }
L1 GCT internal energy sum.
uint16_t capIndex() const
get index within capture block
int16_t bx() const
get BX number
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
uint16_t capBlock() const
get capture block

◆ oflow()

uint8_t L1GctInternEtSum::oflow ( ) const
inline

get oflow

Definition at line 103 of file L1GctInternEtSum.h.

References data_.

Referenced by setOflow().

103 { return (data_ >> 31) & 0x1; }

◆ operator!=()

bool L1GctInternEtSum::operator!= ( const L1GctInternEtSum c) const
inline

inequality operator

Definition at line 137 of file L1GctInternEtSum.h.

References HltBtagPostValidation_cff::c.

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

◆ operator==()

bool L1GctInternEtSum::operator== ( const L1GctInternEtSum c) const

operators

equality operator

Definition at line 140 of file L1GctInternEtSum.cc.

References bx_, HltBtagPostValidation_cff::c, and data_.

140 { return (data_ == c.raw() && bx_ == c.bx()); }

◆ raw()

uint32_t L1GctInternEtSum::raw ( ) const
inline

get the actual bits

get the raw data

Definition at line 91 of file L1GctInternEtSum.h.

References data_.

91 { return data_; }

◆ setBx()

void L1GctInternEtSum::setBx ( uint16_t  bx)
inline

set bx

Definition at line 114 of file L1GctInternEtSum.h.

References bx(), and bx_.

114 { bx_ = bx; }
int16_t bx() const
get BX number

◆ setCapBlock()

void L1GctInternEtSum::setCapBlock ( uint16_t  capBlock)
inline

set cap block

Definition at line 108 of file L1GctInternEtSum.h.

References capBlock(), and capBlock_.

108 { capBlock_ = capBlock; }
uint16_t capBlock() const
get capture block

◆ setCapIndex()

void L1GctInternEtSum::setCapIndex ( uint16_t  capIndex)
inline

set cap index

Definition at line 111 of file L1GctInternEtSum.h.

References capIndex(), and capIndex_.

111 { capIndex_ = capIndex; }
uint16_t capIndex() const
get index within capture block

◆ setCount()

void L1GctInternEtSum::setCount ( uint32_t  count)

set count

Definition at line 152 of file L1GctInternEtSum.cc.

References count(), and setValue().

152 { setValue(count); }
uint32_t count() const
get count
void setValue(uint32_t val)
set value

◆ setEt()

void L1GctInternEtSum::setEt ( uint32_t  et)

set Et sum

set et

Definition at line 149 of file L1GctInternEtSum.cc.

References et(), and setValue().

Referenced by L1GctInternEtSum().

149 { setValue(et); }
uint32_t et() const
get et
void setValue(uint32_t val)
set value

◆ setOflow()

void L1GctInternEtSum::setOflow ( uint8_t  oflow)

set overflow bit

Definition at line 155 of file L1GctInternEtSum.cc.

References data_, and oflow().

Referenced by L1GctInternEtSum().

155  {
156  data_ &= 0x7ffffff;
157  data_ |= (oflow & 0x1) << 31;
158 }
uint8_t oflow() const
get oflow

◆ setType()

void L1GctInternEtSum::setType ( L1GctInternEtSumType  type)
inline

set type

Definition at line 117 of file L1GctInternEtSum.h.

References type(), and type_.

117 { type_ = type; }
L1GctInternEtSum::L1GctInternEtSumType type() const
metadata
L1GctInternEtSumType type_

◆ setValue()

void L1GctInternEtSum::setValue ( uint32_t  val)

set value

Definition at line 143 of file L1GctInternEtSum.cc.

References data_, and heppy_batch::val.

Referenced by setCount(), and setEt().

143  {
144  data_ &= 0x80000000;
145  data_ |= val & 0x7ffffff;
146 }

◆ type()

L1GctInternEtSum::L1GctInternEtSumType L1GctInternEtSum::type ( ) const
inline

metadata

'type' of object - not required?

Definition at line 74 of file L1GctInternEtSum.h.

References type_.

Referenced by setType().

74 { return type_; }
L1GctInternEtSumType type_

◆ value()

uint32_t L1GctInternEtSum::value ( ) const
inline

Member Data Documentation

◆ bx_

int16_t L1GctInternEtSum::bx_
private

Definition at line 146 of file L1GctInternEtSum.h.

Referenced by bx(), operator==(), and setBx().

◆ capBlock_

uint16_t L1GctInternEtSum::capBlock_
private

Definition at line 144 of file L1GctInternEtSum.h.

Referenced by capBlock(), and setCapBlock().

◆ capIndex_

uint16_t L1GctInternEtSum::capIndex_
private

Definition at line 145 of file L1GctInternEtSum.h.

Referenced by capIndex(), and setCapIndex().

◆ data_

uint32_t L1GctInternEtSum::data_
private

Definition at line 149 of file L1GctInternEtSum.h.

Referenced by empty(), oflow(), operator==(), raw(), setOflow(), setValue(), and value().

◆ type_

L1GctInternEtSumType L1GctInternEtSum::type_
private