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

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  };
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::L1GctInternEtSum ( )

default constructor (for vector initialisation etc.)

Definition at line 4 of file L1GctInternEtSum.cc.

4 {}
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 }
uint16_t capIndex() const
get index within capture block
uint16_t capBlock() const
get capture block
void setOflow(uint8_t oflow)
set overflow bit
L1GctInternEtSumType type_
uint8_t oflow() const
get oflow
uint32_t et() const
get et
void setEt(uint32_t et)
set Et sum
int16_t bx() const
get BX number
L1GctInternEtSum::~L1GctInternEtSum ( )

destructor

Definition at line 14 of file L1GctInternEtSum.cc.

14 {}

Member Function Documentation

int16_t L1GctInternEtSum::bx ( ) const
inline

get BX number

Definition at line 83 of file L1GctInternEtSum.h.

References bx_.

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

83 { return bx_; }
uint16_t L1GctInternEtSum::capBlock ( ) const
inline

get capture block

Definition at line 77 of file L1GctInternEtSum.h.

References capBlock_.

Referenced by operator<<(), and setCapBlock().

77 { return capBlock_; }
uint16_t L1GctInternEtSum::capIndex ( ) const
inline

get index within capture block

Definition at line 80 of file L1GctInternEtSum.h.

References capIndex_.

Referenced by operator<<(), and setCapIndex().

80 { return capIndex_; }
uint32_t L1GctInternEtSum::count ( void  ) const
inline

get count

Definition at line 100 of file L1GctInternEtSum.h.

References value().

Referenced by setType().

100 { return value(); }
uint32_t value() const
get value
bool L1GctInternEtSum::empty ( ) const
inline

is the sum non-zero

Definition at line 86 of file L1GctInternEtSum.h.

References data_.

Referenced by operator<<(), Vispa.Gui.VispaWidget.TextField::setAutosizeFont(), and Vispa.Gui.VispaWidget.TextField::setAutotruncate().

86 { return (data_ == 0); }
uint32_t L1GctInternEtSum::et ( ) const
inline

get et

Definition at line 97 of file L1GctInternEtSum.h.

References value().

Referenced by operator<<(), and setType().

97 { return value(); }
uint32_t value() const
get value
L1GctInternEtSum L1GctInternEtSum::fromEmulatorJetMissEt ( int  missEtxOrEty,
bool  overFlow,
int16_t  bx 
)
static

Definition at line 109 of file L1GctInternEtSum.cc.

References jet_miss_et, kJetMissEtMaxValue, kJetMissEtOFlowBit, alignCSCRings::s, setBx(), setEt(), setOflow(), setType(), and testProducerWithPsetDescEmpty_cfi::x1.

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

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 }
L1 GCT internal energy sum.
void setOflow(uint8_t oflow)
set overflow bit
void setBx(uint16_t bx)
set bx
void setType(L1GctInternEtSumType type)
set type
void setEt(uint32_t et)
set Et sum
int16_t bx() const
get BX number
L1GctInternEtSum L1GctInternEtSum::fromEmulatorJetTotEt ( unsigned  totEt,
bool  overFlow,
int16_t  bx 
)
static

Emulator constructors.

Definition at line 89 of file L1GctInternEtSum.cc.

References jet_tot_et, kTotEtOrHtMaxValue, alignCSCRings::s, setBx(), setEt(), setOflow(), setType(), 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);
96  return s;
97 }
L1 GCT internal energy sum.
void setOflow(uint8_t oflow)
set overflow bit
void setBx(uint16_t bx)
set bx
void setType(L1GctInternEtSumType type)
set type
void setEt(uint32_t et)
set Et sum
int16_t bx() const
get BX number
L1GctInternEtSum L1GctInternEtSum::fromEmulatorJetTotHt ( unsigned  totHt,
bool  overFlow,
int16_t  bx 
)
static

Definition at line 99 of file L1GctInternEtSum.cc.

References jet_tot_ht, kTotEtOrHtMaxValue, alignCSCRings::s, setBx(), setEt(), setOflow(), setType(), 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.
void setOflow(uint8_t oflow)
set overflow bit
void setBx(uint16_t bx)
set bx
void setType(L1GctInternEtSumType type)
set type
void setEt(uint32_t et)
set Et sum
int16_t bx() const
get BX number
L1GctInternEtSum L1GctInternEtSum::fromEmulatorMissEtxOrEty ( int  missEtxOrEty,
bool  overFlow,
int16_t  bx 
)
static

Definition at line 129 of file L1GctInternEtSum.cc.

References kMissExOrEyMaxValue, kMissExOrEyOFlowBit, miss_etx_or_ety, alignCSCRings::s, setBx(), setEt(), setOflow(), setType(), 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);
136  return s;
137 }
L1 GCT internal energy sum.
void setOflow(uint8_t oflow)
set overflow bit
void setBx(uint16_t bx)
set bx
void setType(L1GctInternEtSumType type)
set type
void setEt(uint32_t et)
set Et sum
int16_t bx() const
get BX number
L1GctInternEtSum L1GctInternEtSum::fromEmulatorTotalEtOrHt ( unsigned  totEtOrHt,
bool  overFlow,
int16_t  bx 
)
static

Definition at line 119 of file L1GctInternEtSum.cc.

References kTotEtOrHtMaxValue, alignCSCRings::s, setBx(), setEt(), setOflow(), setType(), 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);
126  return s;
127 }
L1 GCT internal energy sum.
void setOflow(uint8_t oflow)
set overflow bit
void setBx(uint16_t bx)
set bx
void setType(L1GctInternEtSumType type)
set type
void setEt(uint32_t et)
set Et sum
int16_t bx() const
get BX number
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 jet_miss_et, kJetMissEtMaxValue, kJetMissEtNBits, alignCSCRings::s, setBx(), setCapBlock(), setCapIndex(), setEt(), setOflow(), setType(), and testProducerWithPsetDescEmpty_cfi::x1.

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

48  {
51  s.setOflow((data >> kJetMissEtNBits) & 0x1);
54  s.setBx(bx);
56  return s;
57 }
L1 GCT internal energy sum.
uint16_t capIndex() const
get index within capture block
uint16_t capBlock() const
get capture block
void setOflow(uint8_t oflow)
set overflow bit
void setCapBlock(uint16_t capBlock)
set cap block
void setBx(uint16_t bx)
set bx
void setType(L1GctInternEtSumType type)
set type
void setEt(uint32_t et)
set Et sum
int16_t bx() const
get BX number
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
void setCapIndex(uint16_t capIndex)
set cap index
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 jet_tot_et, kTotEtOrHtMaxValue, kTotEtOrHtNBits, alignCSCRings::s, setBx(), setCapBlock(), setCapIndex(), setEt(), setOflow(), setType(), and testProducerWithPsetDescEmpty_cfi::x1.

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

19  {
22  s.setOflow((data >> kTotEtOrHtNBits) & 0x1);
25  s.setBx(bx);
27  return s;
28 }
L1 GCT internal energy sum.
uint16_t capIndex() const
get index within capture block
uint16_t capBlock() const
get capture block
void setOflow(uint8_t oflow)
set overflow bit
void setCapBlock(uint16_t capBlock)
set cap block
void setBx(uint16_t bx)
set bx
void setType(L1GctInternEtSumType type)
set type
void setEt(uint32_t et)
set Et sum
int16_t bx() const
get BX number
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
void setCapIndex(uint16_t capIndex)
set cap index
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 jet_tot_ht, kTotEtOrHtMaxValue, kTotEtOrHtNBits, alignCSCRings::s, setBx(), setCapBlock(), setCapIndex(), setEt(), setOflow(), setType(), 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);
40  s.setBx(bx);
42  return s;
43 }
L1 GCT internal energy sum.
uint16_t capIndex() const
get index within capture block
uint16_t capBlock() const
get capture block
void setOflow(uint8_t oflow)
set overflow bit
void setCapBlock(uint16_t capBlock)
set cap block
void setBx(uint16_t bx)
set bx
uint64_t word
void setType(L1GctInternEtSumType type)
set type
void setEt(uint32_t et)
set Et sum
int16_t bx() const
get BX number
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
void setCapIndex(uint16_t capIndex)
set cap index
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 kMissExOrEyNBits, miss_etx_or_ety, alignCSCRings::s, setBx(), setCapBlock(), setCapIndex(), setEt(), setOflow(), and setType().

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

76  {
79  s.setOflow(0); // No over flow bit at the moment
82  s.setBx(bx);
84  return s;
85 }
L1 GCT internal energy sum.
uint16_t capIndex() const
get index within capture block
uint16_t capBlock() const
get capture block
void setOflow(uint8_t oflow)
set overflow bit
void setCapBlock(uint16_t capBlock)
set cap block
void setBx(uint16_t bx)
set bx
void setType(L1GctInternEtSumType type)
set type
void setEt(uint32_t et)
set Et sum
int16_t bx() const
get BX number
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
void setCapIndex(uint16_t capIndex)
set cap index
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 kTotEtOrHtMaxValue, kTotEtOrHtNBits, alignCSCRings::s, setBx(), setCapBlock(), setCapIndex(), setEt(), setOflow(), setType(), total_et_or_ht, and testProducerWithPsetDescEmpty_cfi::x1.

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

62  {
65  s.setOflow((data >> kTotEtOrHtNBits) & 0x1);
68  s.setBx(bx);
70  return s;
71 }
L1 GCT internal energy sum.
uint16_t capIndex() const
get index within capture block
uint16_t capBlock() const
get capture block
void setOflow(uint8_t oflow)
set overflow bit
void setCapBlock(uint16_t capBlock)
set cap block
void setBx(uint16_t bx)
set bx
void setType(L1GctInternEtSumType type)
set type
void setEt(uint32_t et)
set Et sum
int16_t bx() const
get BX number
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
void setCapIndex(uint16_t capIndex)
set cap index
uint8_t L1GctInternEtSum::oflow ( ) const
inline

get oflow

Definition at line 103 of file L1GctInternEtSum.h.

References data_.

Referenced by operator<<(), and setType().

103 { return (data_ >> 31) & 0x1; }
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); }
bool L1GctInternEtSum::operator== ( const L1GctInternEtSum c) const

operators

equality operator

Definition at line 140 of file L1GctInternEtSum.cc.

References bx(), bx_, data_, and raw().

Referenced by setType().

140 { return (data_ == c.raw() && bx_ == c.bx()); }
uint32_t raw() const
get the actual bits
int16_t bx() const
get BX number
uint32_t L1GctInternEtSum::raw ( ) const
inline

get the actual bits

get the raw data

Definition at line 91 of file L1GctInternEtSum.h.

References data_.

Referenced by operator==().

91 { return data_; }
void L1GctInternEtSum::setBx ( uint16_t  bx)
inline
void L1GctInternEtSum::setCapBlock ( uint16_t  capBlock)
inline

set cap block

Definition at line 108 of file L1GctInternEtSum.h.

References capBlock(), and capBlock_.

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

108 { capBlock_ = capBlock; }
uint16_t capBlock() const
get capture block
void L1GctInternEtSum::setCapIndex ( uint16_t  capIndex)
inline

set cap index

Definition at line 111 of file L1GctInternEtSum.h.

References capIndex(), and capIndex_.

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

111 { capIndex_ = capIndex; }
uint16_t capIndex() const
get index within capture block
void L1GctInternEtSum::setCount ( uint32_t  count)

set count

Definition at line 152 of file L1GctInternEtSum.cc.

References setValue().

Referenced by setType().

152 { setValue(count); }
uint32_t count() const
get count
void setValue(uint32_t val)
set value
void L1GctInternEtSum::setEt ( uint32_t  et)
void L1GctInternEtSum::setOflow ( uint8_t  oflow)
void L1GctInternEtSum::setType ( L1GctInternEtSumType  type)
inline
void L1GctInternEtSum::setValue ( uint32_t  val)
L1GctInternEtSum::L1GctInternEtSumType L1GctInternEtSum::type ( ) const
inline
uint32_t L1GctInternEtSum::value ( ) const
inline

Member Data Documentation

int16_t L1GctInternEtSum::bx_
private

Definition at line 146 of file L1GctInternEtSum.h.

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

uint16_t L1GctInternEtSum::capBlock_
private

Definition at line 144 of file L1GctInternEtSum.h.

Referenced by capBlock(), and setCapBlock().

uint16_t L1GctInternEtSum::capIndex_
private

Definition at line 145 of file L1GctInternEtSum.h.

Referenced by capIndex(), and setCapIndex().

uint32_t L1GctInternEtSum::data_
private

Definition at line 149 of file L1GctInternEtSum.h.

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

L1GctInternEtSumType L1GctInternEtSum::type_
private