CMS 3D CMS Logo

L1CaloHcalScale Class Reference

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

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

00021 {
00022   for (unsigned i=0; i<nBinRank; i++) {
00023     for (unsigned eta=0; eta<nBinEta; eta++) {
00024       m_scale[i][eta] = lsb * i;
00025       m_scale[i][eta+nBinEta] = lsb * i;
00026     }
00027   }
00028 }

L1CaloHcalScale::~L1CaloHcalScale (  ) 

destructor

dtor

Definition at line 31 of file L1CaloHcalScale.cc.

00031                                   {
00032 
00033 }


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 m_scale, nBinEta, and nBinRank.

Referenced by L1RCTLookupTables::convertHcal().

00072                                                 {
00073   --eta ; // input eta index starts at 1
00074   if (rank < nBinRank && eta < nBinEta) {
00075     if( etaSign < 0 ) eta += nBinEta ;
00076     return m_scale[rank][eta];
00077   }
00078   else return -1.;
00079 }

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 i, m_scale, nBinEta, nBinRank, and out.

00053                                                           {
00054   --eta ; // input eta index starts at 1
00055   if (eta < nBinEta) {
00056     unsigned short out = 0;
00057     if( etaSign < 0 ) eta += nBinEta ;
00058     for (unsigned i=0; i<nBinRank; i++) {
00059       if ( et >= m_scale[i][eta] ) { out = i; }
00060     }
00061     return out & (nBinRank-1);
00062   }
00063   else {
00064     // throw
00065   }
00066   return nBinRank ;
00067 }

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 m_scale, nBinEta, and nBinRank.

Referenced by L1RCTLutWriter::analyze(), L1RCTSaveInput::analyze(), and L1RCTProducer::produce().

00039                                         {
00040   --eta ; // input eta index starts at 1
00041   if (rank < nBinRank && eta < nBinEta) {
00042     if( etaSign < 0 ) eta += nBinEta ;
00043     m_scale[rank][eta] = et;
00044   }
00045   else {
00046     // throw
00047   }
00048 }


Member Data Documentation

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

thresholds associated with rank scale in GeV

Definition at line 64 of file L1CaloHcalScale.h.

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

const unsigned short L1CaloHcalScale::nBinEta = 32 [static]

Definition at line 31 of file L1CaloHcalScale.h.

Referenced by L1RCTLutWriter::analyze(), L1RCTSaveInput::analyze(), et(), L1CaloHcalScale(), L1RCTProducer::produce(), L1CaloInputScalesProducer::produceHcalScale(), rank(), and setBin().

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

Definition at line 30 of file L1CaloHcalScale.h.

Referenced by L1RCTLutWriter::analyze(), L1RCTSaveInput::analyze(), et(), L1CaloHcalScale(), L1RCTProducer::produce(), L1CaloInputScalesProducer::produceHcalScale(), rank(), and setBin().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:26:24 2009 for CMSSW by  doxygen 1.5.4