CMS 3D CMS Logo

Public Member Functions | Static Public Attributes | Private Attributes

L1CaloHcalScale Class Reference

#include <CondFormats/L1TObjects/interface/L1CaloHcalScale.h>

List of all members.

Public Member Functions

double et (unsigned short rank, unsigned short eta, short etaSign) const
 convert from rank to physically meaningful quantity
 L1CaloHcalScale (double lsb=1.0)
 constructor (creates a linear scale with an LSB - no LSB gives identity)
void print (std::ostream &s) const
uint16_t rank (double et, unsigned short eta, short etaSign) const
 convert from physical Et in GeV to rank scale
void setBin (unsigned short rank, unsigned short eta, short etaSign, double et)
 set scale element; use this to create non-linear scales
 ~L1CaloHcalScale ()
 destructor

Static Public Attributes

static const unsigned short nBinEta = 32
static const unsigned short nBinRank = 1<<8

Private Attributes

double m_scale [nBinRank][2 *nBinEta]
 thresholds associated with rank scale in GeV

Detailed Description

Description: Class to handle conversion between Et scales in L1 hardware

Usage: <usage>

Definition at line 26 of file L1CaloHcalScale.h.


Constructor & Destructor Documentation

L1CaloHcalScale::L1CaloHcalScale ( double  lsb = 1.0)

constructor (creates a linear scale with an LSB - no LSB gives identity)

construct a linear scale with a particular LSB

Definition at line 20 of file L1CaloHcalScale.cc.

References eta(), i, m_scale, nBinEta, and nBinRank.

{
  for (unsigned i=0; i<nBinRank; i++) {
    for (unsigned eta=0; eta<nBinEta; eta++) {
      m_scale[i][eta] = lsb * i;
      m_scale[i][eta+nBinEta] = lsb * i;
    }
  }
}
L1CaloHcalScale::~L1CaloHcalScale ( )

destructor

dtor

Definition at line 31 of file L1CaloHcalScale.cc.

                                  {

}

Member Function Documentation

double L1CaloHcalScale::et ( unsigned short  rank,
unsigned short  eta,
short  etaSign 
) const

convert from rank to physically meaningful quantity

Definition at line 70 of file L1CaloHcalScale.cc.

References eta(), m_scale, nBinEta, nBinRank, and rank().

Referenced by L1RCTLookupTables::convertHcal(), and setBin().

                                                {
  --eta ; // input eta index starts at 1
  if (rank < nBinRank && eta < nBinEta) {
    if( etaSign < 0 ) eta += nBinEta ;
    return m_scale[rank][eta];
  }
  else return -1.;
}
void L1CaloHcalScale::print ( std::ostream &  s) const
unsigned short L1CaloHcalScale::rank ( double  et,
unsigned short  eta,
short  etaSign 
) const

convert from physical Et in GeV to rank scale

convert from Et in GeV to rank

Definition at line 51 of file L1CaloHcalScale.cc.

References eta(), i, m_scale, nBinEta, nBinRank, and dbtoconf::out.

Referenced by et(), and setBin().

                                                          {
  --eta ; // input eta index starts at 1
  if (eta < nBinEta) {
    unsigned short out = 0;
    if( etaSign < 0 ) eta += nBinEta ;
    for (unsigned i=0; i<nBinRank; i++) {
      if ( et >= m_scale[i][eta] ) { out = i; }
    }
    return out & (nBinRank-1);
  }
  else {
    // throw
  }
  return nBinRank ;
}
void L1CaloHcalScale::setBin ( unsigned short  rank,
unsigned short  eta,
short  etaSign,
double  et 
)

set scale element; use this to create non-linear scales

set scale bin

Definition at line 36 of file L1CaloHcalScale.cc.

References et(), eta(), m_scale, nBinEta, nBinRank, and rank().

Referenced by L1RCTLutWriter::analyze(), L1RCTSaveInput::analyze(), and L1CaloHcalScaleConfigOnlineProd::newObject().

                                        {
  --eta ; // input eta index starts at 1
  if (rank < nBinRank && eta < nBinEta) {
    if( etaSign < 0 ) eta += nBinEta ;
    m_scale[rank][eta] = et;
  }
  else {
    // throw
  }
}

Member Data Documentation

double L1CaloHcalScale::m_scale[nBinRank][2 *nBinEta] [private]

thresholds associated with rank scale in GeV

Definition at line 65 of file L1CaloHcalScale.h.

Referenced by et(), L1CaloHcalScale(), rank(), and setBin().

const unsigned short L1CaloHcalScale::nBinEta = 32 [static]
const unsigned short L1CaloHcalScale::nBinRank = 1<<8 [static]