CMS 3D CMS Logo

L1CaloEtScale Class Reference

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

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

List of all members.

Public Member Functions

double et (const uint16_t rank) const
 convert from rank to physically meaningful quantity
 L1CaloEtScale (const double linearLsbInGeV, const std::vector< double > thresholdsInGeV)
 constructor takes physically meaningful quantities
 L1CaloEtScale ()
 default constructor (out = in)
double linearLsb () const
 get LSB of linear input scale
void print (std::ostream &s) const
uint16_t rank (const double EtInGeV) const
 convert from physical Et in GeV to rank scale
uint16_t rank (const uint16_t linear) const
 convert from linear Et scale to rank scale
 ~L1CaloEtScale ()

Static Public Attributes

static uint16_t linScaleMax = 0x3ff
 linear scale maximum
static uint16_t rankScaleMax = 0x3f
 rank scale maximum

Private Attributes

double m_linearLsb
 LSB of linear scale in GeV.
std::vector< double > m_thresholds
 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 L1CaloEtScale.h.


Constructor & Destructor Documentation

L1CaloEtScale::L1CaloEtScale (  ) 

default constructor (out = in)

Definition at line 23 of file L1CaloEtScale.cc.

References i, m_linearLsb, m_thresholds, and rankScaleMax.

00023                              :
00024   m_linearLsb(1.0),
00025   m_thresholds(rankScaleMax)
00026 {
00027 
00028   for (unsigned i=0; i<rankScaleMax; i++) {
00029     m_thresholds[i] = m_linearLsb * i;
00030   }
00031 
00032 }

L1CaloEtScale::L1CaloEtScale ( const double  linearLsbInGeV,
const std::vector< double >  thresholdsInGeV 
)

constructor takes physically meaningful quantities

L1CaloEtScale::~L1CaloEtScale (  ) 

Definition at line 47 of file L1CaloEtScale.cc.

00047                               {
00048 
00049 }


Member Function Documentation

double L1CaloEtScale::et ( const uint16_t  rank  )  const

convert from rank to physically meaningful quantity

Definition at line 71 of file L1CaloEtScale.cc.

References m_thresholds.

00071                                                   {
00072 
00073   // return bin centre, except for highest bin
00074 //   if (rank < m_thresholds.size()-1) {
00075 //     return (m_thresholds[rank+1]+m_thresholds[rank]) / 2;
00076 //   }
00077 //   else {
00078 //     return m_thresholds.back();
00079 //   }
00080 
00081 // return bin lower edge
00082   return m_thresholds[rank];
00083 
00084 }

double L1CaloEtScale::linearLsb (  )  const [inline]

get LSB of linear input scale

Definition at line 46 of file L1CaloEtScale.h.

References m_linearLsb.

Referenced by L1GctJetEtCalibrationLut::value().

00046 { return m_linearLsb; }

void L1CaloEtScale::print ( std::ostream &  s  )  const

uint16_t L1CaloEtScale::rank ( const double  EtInGeV  )  const

convert from physical Et in GeV to rank scale

convert from Et in GeV to rank

Definition at line 59 of file L1CaloEtScale.cc.

References i, m_thresholds, out, and rankScaleMax.

00059                                                        {
00060 
00061   uint16_t out = 0;
00062 
00063   for (unsigned i=0; i<m_thresholds.size() && i<(unsigned)(rankScaleMax+1); i++) {
00064     if ( EtInGeV >= m_thresholds[i] ) { out = i; }
00065   }
00066 
00067   return out & rankScaleMax;
00068 }

uint16_t L1CaloEtScale::rank ( const uint16_t  linear  )  const

convert from linear Et scale to rank scale

Definition at line 52 of file L1CaloEtScale.cc.

References linScaleMax, and m_linearLsb.

Referenced by L1RCTLookupTables::emRank(), and L1GctJetEtCalibrationLut::value().

00052                                                         {
00053 
00054   return rank( (linear & linScaleMax) * m_linearLsb);
00055 
00056 }


Member Data Documentation

uint16_t L1CaloEtScale::linScaleMax = 0x3ff [static]

linear scale maximum

Definition at line 31 of file L1CaloEtScale.h.

Referenced by L1GctJetEtCalibrationFunction::calibratedEt(), and rank().

double L1CaloEtScale::m_linearLsb [private]

LSB of linear scale in GeV.

Definition at line 62 of file L1CaloEtScale.h.

Referenced by L1CaloEtScale(), linearLsb(), and rank().

std::vector<double> L1CaloEtScale::m_thresholds [private]

thresholds associated with rank scale in GeV

Definition at line 65 of file L1CaloEtScale.h.

Referenced by et(), L1CaloEtScale(), and rank().

uint16_t L1CaloEtScale::rankScaleMax = 0x3f [static]

rank scale maximum

Definition at line 34 of file L1CaloEtScale.h.

Referenced by L1CaloEtScale(), and rank().


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