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 15 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 20 of file L1GctInternEtSum.h.

20  { null,
21  jet_tot_et, // from jet_tot_et_and_ht in leaf output
22  jet_tot_ht, // from jet_tot_et_and_ht in leaf output
23  jet_miss_et, // leaf output
24  total_et_or_ht, // conc input, wheel input and output
25  miss_etx_or_ety // conc input, wheel input and output
26  };
Enumerator
kTotEtOrHtNBits 
kJetMissEtNBits 
kMissExOrEyNBits 
kTotEtOrHtOFlowBit 
kJetMissEtOFlowBit 
kMissExOrEyOFlowBit 
kTotEtOrHtMaxValue 
kJetMissEtMaxValue 
kMissExOrEyMaxValue 
kTotEtOrHtRawCtorMask 
kJetMissEtRawCtorMask 
kMissExOrEyRawCtorMask 

Definition at line 28 of file L1GctInternEtSum.h.

Constructor & Destructor Documentation

L1GctInternEtSum::L1GctInternEtSum ( )

default constructor (for vector initialisation etc.)

Definition at line 5 of file L1GctInternEtSum.cc.

5  {
6 
7 }
L1GctInternEtSum::L1GctInternEtSum ( uint16_t  capBlock,
uint16_t  capIndex,
int16_t  bx,
uint32_t  et,
uint8_t  oflow 
)

construct from individual quantities

Definition at line 11 of file L1GctInternEtSum.cc.

References setEt(), and setOflow().

15  :
16  type_(null),
19  bx_(bx),
20  data_(0)
21 {
22  this->setEt(et);
23  this->setOflow(oflow);
24 }
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 28 of file L1GctInternEtSum.cc.

28  {
29 
30 }

Member Function Documentation

int16_t L1GctInternEtSum::bx ( ) const
inline

get BX number

Definition at line 105 of file L1GctInternEtSum.h.

References bx_.

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

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

get capture block

Definition at line 99 of file L1GctInternEtSum.h.

References capBlock_.

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

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

get index within capture block

Definition at line 102 of file L1GctInternEtSum.h.

References capIndex_.

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

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

get count

Definition at line 123 of file L1GctInternEtSum.h.

References value().

Referenced by setType().

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

is the sum non-zero

Definition at line 108 of file L1GctInternEtSum.h.

References data_.

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

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

get et

Definition at line 120 of file L1GctInternEtSum.h.

References value().

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

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

Definition at line 125 of file L1GctInternEtSum.cc.

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

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

125  {
127  s.setEt(missEtxOrEty & kJetMissEtMaxValue);
128  if (overFlow || (missEtxOrEty >= kJetMissEtOFlowBit/2) || (missEtxOrEty < -kJetMissEtOFlowBit/2)) s.setOflow(0x1);
129  s.setBx(bx);
130  s.setType(jet_miss_et);
131  return s;
132 }
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 107 of file L1GctInternEtSum.cc.

References jet_tot_et, kTotEtOrHtMaxValue, alignCSCRings::s, setBx(), setEt(), setOflow(), and setType().

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

107  {
109  s.setEt(totEt & kTotEtOrHtMaxValue);
110  if (overFlow || (totEt > kTotEtOrHtMaxValue)) s.setOflow(0x1);
111  s.setBx(bx);
112  s.setType(jet_tot_et);
113  return s;
114 }
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 116 of file L1GctInternEtSum.cc.

References jet_tot_ht, kTotEtOrHtMaxValue, alignCSCRings::s, setBx(), setEt(), setOflow(), and setType().

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

116  {
118  s.setEt(totHt & kTotEtOrHtMaxValue);
119  if (overFlow || (totHt > kTotEtOrHtMaxValue)) s.setOflow(0x1);
120  s.setBx(bx);
121  s.setType(jet_tot_ht);
122  return s;
123 }
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 143 of file L1GctInternEtSum.cc.

References kMissExOrEyMaxValue, kMissExOrEyOFlowBit, miss_etx_or_ety, alignCSCRings::s, setBx(), setEt(), setOflow(), and setType().

Referenced by L1GctWheelEnergyFpga::getInternalEtSums().

143  {
145  s.setEt(missEtxOrEty & kMissExOrEyMaxValue);
146  if (overFlow || (missEtxOrEty >= kMissExOrEyOFlowBit/2) || (missEtxOrEty < -kMissExOrEyOFlowBit/2)) s.setOflow(0x1);
147  s.setBx(bx);
149  return s;
150 }
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 134 of file L1GctInternEtSum.cc.

References kTotEtOrHtMaxValue, alignCSCRings::s, setBx(), setEt(), setOflow(), setType(), and total_et_or_ht.

Referenced by L1GctWheelEnergyFpga::getInternalEtSums().

134  {
136  s.setEt(totEtOrHt & kTotEtOrHtMaxValue);
137  if (overFlow || (totEtOrHt > kTotEtOrHtMaxValue)) s.setOflow(0x1);
138  s.setBx(bx);
140  return s;
141 }
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 61 of file L1GctInternEtSum.cc.

References jet_miss_et, kJetMissEtMaxValue, kJetMissEtNBits, alignCSCRings::s, setBx(), setCapBlock(), setCapIndex(), setEt(), setOflow(), and setType().

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

64  {
67  s.setOflow((data>>kJetMissEtNBits) & 0x1);
70  s.setBx(bx);
72  return s;
73 }
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:82
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 32 of file L1GctInternEtSum.cc.

References jet_tot_et, kTotEtOrHtMaxValue, kTotEtOrHtNBits, alignCSCRings::s, setBx(), setCapBlock(), setCapIndex(), setEt(), setOflow(), and setType().

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

35  {
38  s.setOflow((data>>kTotEtOrHtNBits)&0x1);
41  s.setBx(bx);
43  return s;
44 }
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:82
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 46 of file L1GctInternEtSum.cc.

References jet_tot_ht, kTotEtOrHtMaxValue, kTotEtOrHtNBits, alignCSCRings::s, setBx(), setCapBlock(), setCapIndex(), setEt(), setOflow(), and setType().

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

49  {
51  uint32_t word=data>>16;
52  s.setEt(word & kTotEtOrHtMaxValue);
53  s.setOflow((word>>kTotEtOrHtNBits)&0x1);
56  s.setBx(bx);
58  return s;
59 }
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:82
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 90 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().

93  {
96  s.setOflow(0); // No over flow bit at the moment
99  s.setBx(bx);
101  return s;
102 }
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:82
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 76 of file L1GctInternEtSum.cc.

References kTotEtOrHtMaxValue, kTotEtOrHtNBits, alignCSCRings::s, setBx(), setCapBlock(), setCapIndex(), setEt(), setOflow(), setType(), and total_et_or_ht.

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

79  {
82  s.setOflow((data>>kTotEtOrHtNBits) & 0x1);
85  s.setBx(bx);
87  return s;
88 }
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:82
void setCapIndex(uint16_t capIndex)
set cap index
uint8_t L1GctInternEtSum::oflow ( ) const
inline

get oflow

Definition at line 126 of file L1GctInternEtSum.h.

References data_.

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

126 { return (data_>>31) & 0x1; }
bool L1GctInternEtSum::operator!= ( const L1GctInternEtSum c) const
inline

inequality operator

Definition at line 162 of file L1GctInternEtSum.h.

References EnergyCorrector::c.

162 { return !(*this == c); }
bool L1GctInternEtSum::operator== ( const L1GctInternEtSum c) const

operators

equality operator

Definition at line 153 of file L1GctInternEtSum.cc.

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

Referenced by setType().

153  {
154  return ( data_ == c.raw() && bx_ == c.bx() );
155 }
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 114 of file L1GctInternEtSum.h.

References data_.

Referenced by operator==().

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

set cap block

Definition at line 132 of file L1GctInternEtSum.h.

References capBlock(), and capBlock_.

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

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

set cap index

Definition at line 135 of file L1GctInternEtSum.h.

References capIndex(), and capIndex_.

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

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

set count

Definition at line 170 of file L1GctInternEtSum.cc.

References setValue().

Referenced by setType().

170  {
171  setValue(count);
172 }
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 173 of file L1GctInternEtSum.h.

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

uint16_t L1GctInternEtSum::capBlock_
private

Definition at line 171 of file L1GctInternEtSum.h.

Referenced by capBlock(), and setCapBlock().

uint16_t L1GctInternEtSum::capIndex_
private

Definition at line 172 of file L1GctInternEtSum.h.

Referenced by capIndex(), and setCapIndex().

uint32_t L1GctInternEtSum::data_
private

Definition at line 176 of file L1GctInternEtSum.h.

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

L1GctInternEtSumType L1GctInternEtSum::type_
private