CMS 3D CMS Logo

Public Types | Public Member Functions | Static Public Member Functions | Private Attributes

L1GctInternEtSum Class Reference

L1 GCT internal energy sum. More...

#include <L1GctInternEtSum.h>

List of all members.

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

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

                            { null,
                              jet_tot_et,      // from jet_tot_et_and_ht in leaf output
                              jet_tot_ht,      // from jet_tot_et_and_ht in leaf output
                              jet_miss_et,     // leaf output
                              total_et_or_ht,  // conc input, wheel input and output
                              miss_etx_or_ety  // conc input, wheel input and output
  };
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.

                                   {

}
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().

L1GctInternEtSum::~L1GctInternEtSum ( )

destructor

Definition at line 28 of file L1GctInternEtSum.cc.

                                    {

}

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().

{ 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().

{ 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().

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

get count

Definition at line 123 of file L1GctInternEtSum.h.

References value().

{ return value(); }
bool L1GctInternEtSum::empty ( ) const [inline]

is the sum non-zero

Definition at line 108 of file L1GctInternEtSum.h.

References data_.

Referenced by operator<<().

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

get et

Definition at line 120 of file L1GctInternEtSum.h.

References value().

Referenced by operator<<().

{ return 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, asciidump::s, setBx(), setEt(), setOflow(), and setType().

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

                                                                                                    {
  L1GctInternEtSum s;
  s.setEt(missEtxOrEty & kJetMissEtMaxValue);
  if (overFlow || (missEtxOrEty >= kJetMissEtOFlowBit/2) || (missEtxOrEty < -kJetMissEtOFlowBit/2)) s.setOflow(0x1);
  s.setBx(bx);
  s.setType(jet_miss_et);
  return s;
}
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, asciidump::s, setBx(), setEt(), setOflow(), and setType().

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

                                                                                                 {
  L1GctInternEtSum s;
  s.setEt(totEt & kTotEtOrHtMaxValue);
  if (overFlow || (totEt > kTotEtOrHtMaxValue)) s.setOflow(0x1);
  s.setBx(bx);
  s.setType(jet_tot_et);
  return s;
}
L1GctInternEtSum L1GctInternEtSum::fromEmulatorJetTotHt ( unsigned  totHt,
bool  overFlow,
int16_t  bx 
) [static]

Definition at line 116 of file L1GctInternEtSum.cc.

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

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

                                                                                                 {
  L1GctInternEtSum s;
  s.setEt(totHt & kTotEtOrHtMaxValue);
  if (overFlow || (totHt > kTotEtOrHtMaxValue)) s.setOflow(0x1);
  s.setBx(bx);
  s.setType(jet_tot_ht);
  return s;
}
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, asciidump::s, setBx(), setEt(), setOflow(), and setType().

Referenced by L1GctWheelEnergyFpga::getInternalEtSums().

                                                                                                       {
  L1GctInternEtSum s;
  s.setEt(missEtxOrEty & kMissExOrEyMaxValue);
  if (overFlow || (missEtxOrEty >= kMissExOrEyOFlowBit/2) || (missEtxOrEty < -kMissExOrEyOFlowBit/2)) s.setOflow(0x1);
  s.setBx(bx);
  s.setType(miss_etx_or_ety);
  return s;
}
L1GctInternEtSum L1GctInternEtSum::fromEmulatorTotalEtOrHt ( unsigned  totEtOrHt,
bool  overFlow,
int16_t  bx 
) [static]

Definition at line 134 of file L1GctInternEtSum.cc.

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

Referenced by L1GctWheelEnergyFpga::getInternalEtSums().

                                                                                                        {
  L1GctInternEtSum s;
  s.setEt(totEtOrHt & kTotEtOrHtMaxValue);
  if (overFlow || (totEtOrHt > kTotEtOrHtMaxValue)) s.setOflow(0x1);
  s.setBx(bx);
  s.setType(total_et_or_ht);
  return s;
}
L1GctInternEtSum L1GctInternEtSum::fromJetMissEt ( uint16_t  capBlock,
uint16_t  capIndex,
int16_t  bx,
uint32_t  data 
) [static]
L1GctInternEtSum L1GctInternEtSum::fromJetTotEt ( uint16_t  capBlock,
uint16_t  capIndex,
int16_t  bx,
uint32_t  data 
) [static]
L1GctInternEtSum L1GctInternEtSum::fromJetTotHt ( uint16_t  capBlock,
uint16_t  capIndex,
int16_t  bx,
uint32_t  data 
) [static]
L1GctInternEtSum L1GctInternEtSum::fromMissEtxOrEty ( uint16_t  capBlock,
uint16_t  capIndex,
int16_t  bx,
uint32_t  data 
) [static]
L1GctInternEtSum L1GctInternEtSum::fromTotalEtOrHt ( uint16_t  capBlock,
uint16_t  capIndex,
int16_t  bx,
uint32_t  data 
) [static]
uint8_t L1GctInternEtSum::oflow ( ) const [inline]

get oflow

Definition at line 126 of file L1GctInternEtSum.h.

References data_.

Referenced by operator<<().

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

inequality operator

Definition at line 162 of file L1GctInternEtSum.h.

References trackerHits::c.

{ 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().

                                                                 {
  return ( data_ == c.raw() && bx_ == c.bx() );
}
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==().

{ 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().

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().

void L1GctInternEtSum::setCount ( uint32_t  count)

set count

Definition at line 170 of file L1GctInternEtSum.cc.

References setValue().

                                              {
  setValue(count);
}
void L1GctInternEtSum::setEt ( uint32_t  et)
void L1GctInternEtSum::setOflow ( uint8_t  oflow)
void L1GctInternEtSum::setType ( L1GctInternEtSumType  type) [inline]
void L1GctInternEtSum::setValue ( uint32_t  val)

set value

Definition at line 159 of file L1GctInternEtSum.cc.

References data_.

Referenced by setCount(), and setEt().

                                            {
  data_ &= 0x80000000;
  data_ |= val & 0x7ffffff;
}
L1GctInternEtSum::L1GctInternEtSumType L1GctInternEtSum::type ( ) const [inline]

metadata

'type' of object - not required?

Definition at line 96 of file L1GctInternEtSum.h.

References type_.

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

{ return type_; }
uint32_t L1GctInternEtSum::value ( ) const [inline]

get value

Definition at line 117 of file L1GctInternEtSum.h.

References data_.

Referenced by count(), and et().

{ return data_ & 0x7fffffff; }

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().

Definition at line 168 of file L1GctInternEtSum.h.

Referenced by setType(), and type().