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.

9  this->setEt(et);
10  this->setOflow(oflow);
11 }

References setEt(), and setOflow().

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

77 { return capBlock_; }

References capBlock_.

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

◆ capIndex()

uint16_t L1GctInternEtSum::capIndex ( ) const
inline

get index within capture block

Definition at line 80 of file L1GctInternEtSum.h.

80 { return capIndex_; }

References capIndex_.

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

◆ count()

uint32_t L1GctInternEtSum::count ( void  ) const
inline

get count

Definition at line 100 of file L1GctInternEtSum.h.

100 { return value(); }

References value().

Referenced by setCount().

◆ empty()

bool L1GctInternEtSum::empty ( ) const
inline

is the sum non-zero

Definition at line 86 of file L1GctInternEtSum.h.

86 { return (data_ == 0); }

References data_.

◆ et()

uint32_t L1GctInternEtSum::et ( ) const
inline

get et

Definition at line 97 of file L1GctInternEtSum.h.

97 { return value(); }

References value().

Referenced by setEt().

◆ fromEmulatorJetMissEt()

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

Definition at line 109 of file L1GctInternEtSum.cc.

109  {
111  s.setEt(missEtxOrEty & kJetMissEtMaxValue);
112  if (overFlow || (missEtxOrEty >= kJetMissEtOFlowBit / 2) || (missEtxOrEty < -kJetMissEtOFlowBit / 2))
113  s.setOflow(0x1);
114  s.setBx(bx);
115  s.setType(jet_miss_et);
116  return s;
117 }

References bx(), jet_miss_et, kJetMissEtMaxValue, kJetMissEtOFlowBit, alignCSCRings::s, and testProducerWithPsetDescEmpty_cfi::x1.

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

◆ fromEmulatorJetTotEt()

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

Emulator constructors.

Definition at line 89 of file L1GctInternEtSum.cc.

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 }

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

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

◆ fromEmulatorJetTotHt()

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

Definition at line 99 of file L1GctInternEtSum.cc.

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 }

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

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

◆ fromEmulatorMissEtxOrEty()

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

Definition at line 129 of file L1GctInternEtSum.cc.

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 }

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

Referenced by L1GctWheelEnergyFpga::getInternalEtSums().

◆ fromEmulatorTotalEtOrHt()

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

Definition at line 119 of file L1GctInternEtSum.cc.

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 }

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

Referenced by L1GctWheelEnergyFpga::getInternalEtSums().

◆ fromJetMissEt()

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

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

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 }

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

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

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

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 }

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

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

◆ fromMissEtxOrEty()

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

◆ fromTotalEtOrHt()

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

◆ oflow()

uint8_t L1GctInternEtSum::oflow ( ) const
inline

get oflow

Definition at line 103 of file L1GctInternEtSum.h.

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

References data_.

Referenced by setOflow().

◆ operator!=()

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

inequality operator

Definition at line 137 of file L1GctInternEtSum.h.

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

References c.

◆ operator==()

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

operators

equality operator

Definition at line 140 of file L1GctInternEtSum.cc.

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

References bx_, c, and data_.

◆ raw()

uint32_t L1GctInternEtSum::raw ( ) const
inline

get the actual bits

get the raw data

Definition at line 91 of file L1GctInternEtSum.h.

91 { return data_; }

References data_.

◆ setBx()

void L1GctInternEtSum::setBx ( uint16_t  bx)
inline

set bx

Definition at line 114 of file L1GctInternEtSum.h.

114 { bx_ = bx; }

References bx(), and bx_.

◆ setCapBlock()

void L1GctInternEtSum::setCapBlock ( uint16_t  capBlock)
inline

set cap block

Definition at line 108 of file L1GctInternEtSum.h.

108 { capBlock_ = capBlock; }

References capBlock(), and capBlock_.

◆ setCapIndex()

void L1GctInternEtSum::setCapIndex ( uint16_t  capIndex)
inline

set cap index

Definition at line 111 of file L1GctInternEtSum.h.

111 { capIndex_ = capIndex; }

References capIndex(), and capIndex_.

◆ setCount()

void L1GctInternEtSum::setCount ( uint32_t  count)

set count

Definition at line 152 of file L1GctInternEtSum.cc.

152 { setValue(count); }

References count(), and setValue().

◆ setEt()

void L1GctInternEtSum::setEt ( uint32_t  et)

set Et sum

set et

Definition at line 149 of file L1GctInternEtSum.cc.

149 { setValue(et); }

References et(), and setValue().

Referenced by L1GctInternEtSum().

◆ setOflow()

void L1GctInternEtSum::setOflow ( uint8_t  oflow)

set overflow bit

Definition at line 155 of file L1GctInternEtSum.cc.

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

References data_, and oflow().

Referenced by L1GctInternEtSum().

◆ setType()

void L1GctInternEtSum::setType ( L1GctInternEtSumType  type)
inline

set type

Definition at line 117 of file L1GctInternEtSum.h.

117 { type_ = type; }

References type(), and type_.

◆ setValue()

void L1GctInternEtSum::setValue ( uint32_t  val)

set value

Definition at line 143 of file L1GctInternEtSum.cc.

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

References data_, and heppy_batch::val.

Referenced by setCount(), and setEt().

◆ type()

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

metadata

'type' of object - not required?

Definition at line 74 of file L1GctInternEtSum.h.

74 { return type_; }

References type_.

Referenced by setType().

◆ 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
L1GctInternEtSum::setValue
void setValue(uint32_t val)
set value
Definition: L1GctInternEtSum.cc:143
L1GctInternEtSum::kMissExOrEyNBits
Definition: L1GctInternEtSum.h:29
L1GctInternEtSum::capBlock
uint16_t capBlock() const
get capture block
Definition: L1GctInternEtSum.h:77
L1GctInternEtSum::et
uint32_t et() const
get et
Definition: L1GctInternEtSum.h:97
L1GctInternEtSum::type
L1GctInternEtSum::L1GctInternEtSumType type() const
metadata
Definition: L1GctInternEtSum.h:74
L1GctInternEtSum::miss_etx_or_ety
Definition: L1GctInternEtSum.h:23
L1GctInternEtSum::setEt
void setEt(uint32_t et)
set Et sum
Definition: L1GctInternEtSum.cc:149
L1GctInternEtSum::kTotEtOrHtMaxValue
Definition: L1GctInternEtSum.h:33
L1GctInternEtSum::capIndex
uint16_t capIndex() const
get index within capture block
Definition: L1GctInternEtSum.h:80
word
uint64_t word
Definition: CTPPSTotemDataFormatter.cc:29
L1GctInternEtSum::kTotEtOrHtOFlowBit
Definition: L1GctInternEtSum.h:30
L1GctInternEtSum::jet_tot_et
Definition: L1GctInternEtSum.h:19
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
alignCSCRings.s
s
Definition: alignCSCRings.py:92
L1GctInternEtSum::type_
L1GctInternEtSumType type_
Definition: L1GctInternEtSum.h:141
L1GctInternEtSum::count
uint32_t count() const
get count
Definition: L1GctInternEtSum.h:100
L1GctInternEtSum::kJetMissEtRawCtorMask
Definition: L1GctInternEtSum.h:37
L1GctInternEtSum::kMissExOrEyMaxValue
Definition: L1GctInternEtSum.h:35
L1GctInternEtSum::kMissExOrEyRawCtorMask
Definition: L1GctInternEtSum.h:38
L1GctInternEtSum::jet_tot_ht
Definition: L1GctInternEtSum.h:20
L1GctInternEtSum::jet_miss_et
Definition: L1GctInternEtSum.h:21
L1GctInternEtSum::kJetMissEtMaxValue
Definition: L1GctInternEtSum.h:34
L1GctInternEtSum::value
uint32_t value() const
get value
Definition: L1GctInternEtSum.h:94
heppy_batch.val
val
Definition: heppy_batch.py:351
L1GctInternEtSum::kMissExOrEyOFlowBit
Definition: L1GctInternEtSum.h:32
L1GctInternEtSum::kTotEtOrHtRawCtorMask
Definition: L1GctInternEtSum.h:36
L1GctInternEtSum
L1 GCT internal energy sum.
Definition: L1GctInternEtSum.h:14
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
L1GctInternEtSum::capIndex_
uint16_t capIndex_
Definition: L1GctInternEtSum.h:145
L1GctInternEtSum::bx_
int16_t bx_
Definition: L1GctInternEtSum.h:146
L1GctInternEtSum::kJetMissEtOFlowBit
Definition: L1GctInternEtSum.h:31
L1GctInternEtSum::kJetMissEtNBits
Definition: L1GctInternEtSum.h:28
L1GctInternEtSum::total_et_or_ht
Definition: L1GctInternEtSum.h:22
L1GctInternEtSum::data_
uint32_t data_
Definition: L1GctInternEtSum.h:149
L1GctInternEtSum::oflow
uint8_t oflow() const
get oflow
Definition: L1GctInternEtSum.h:103
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46
L1GctInternEtSum::kTotEtOrHtNBits
Definition: L1GctInternEtSum.h:27
L1GctInternEtSum::capBlock_
uint16_t capBlock_
Definition: L1GctInternEtSum.h:144
L1GctInternEtSum::bx
int16_t bx() const
get BX number
Definition: L1GctInternEtSum.h:83
L1GctInternEtSum::setOflow
void setOflow(uint8_t oflow)
set overflow bit
Definition: L1GctInternEtSum.cc:155