CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Attributes | Private Attributes
L1CaloEcalScale Class Reference

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

Public Member Functions

double et (unsigned short rank, unsigned short eta, short etaSign) const
 convert from rank to physically meaningful quantity More...
 
 L1CaloEcalScale (double lsb=1.0)
 constructor (creates a linear scale with an LSB - no LSB gives identity) More...
 
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 More...
 
void setBin (unsigned short rank, unsigned short eta, short etaSign, double et)
 set scale element; use this to create non-linear scales More...
 
 ~L1CaloEcalScale ()
 destructor More...
 

Static Public Attributes

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

Private Attributes

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

Detailed Description

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

Usage: <usage>

Definition at line 28 of file L1CaloEcalScale.h.

Constructor & Destructor Documentation

L1CaloEcalScale::L1CaloEcalScale ( 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 L1CaloEcalScale.cc.

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

21 {
22  for (unsigned i=0; i<nBinRank; i++) {
23  for (unsigned eta=0; eta<nBinEta; eta++) {
24  m_scale[i][eta] = lsb * i;
25  m_scale[i][eta+nBinEta] = lsb * i;
26  }
27  }
28 }
int i
Definition: DBlmapReader.cc:9
T eta() const
double m_scale[nBinRank][2 *nBinEta]
thresholds associated with rank scale in GeV
static const unsigned short nBinRank
static const unsigned short nBinEta
L1CaloEcalScale::~L1CaloEcalScale ( )

destructor

dtor

Definition at line 31 of file L1CaloEcalScale.cc.

31  {
32 
33 }

Member Function Documentation

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

convert from rank to physically meaningful quantity

Definition at line 70 of file L1CaloEcalScale.cc.

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

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

72  {
73  --eta ; // input eta index starts at 1
74  if (rank < nBinRank && eta < nBinEta) {
75  if( etaSign < 0 ) eta += nBinEta ;
76  return m_scale[rank][eta];
77  }
78  else return -1.;
79 }
T eta() const
double m_scale[nBinRank][2 *nBinEta]
thresholds associated with rank scale in GeV
uint16_t rank(double et, unsigned short eta, short etaSign) const
convert from physical Et in GeV to rank scale
static const unsigned short nBinRank
static const unsigned short nBinEta
void L1CaloEcalScale::print ( std::ostream &  s) const

Definition at line 82 of file L1CaloEcalScale.cc.

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

82  {
83  s << "L1CaloEcalScaleRcd" << endl;
84  s << "Energy for ECAL inputs into the RCT" <<endl;
85  s << "Each new row is for a given value of 8 bit output of ECAL. Each column is for the respective eta value " << endl;
86 
87  for (unsigned rank=0; rank<nBinRank; rank++) {
88  s << "rank = " <<rank << " ";
89  for (unsigned eta=0; eta<2*nBinEta; eta++) {
90  s << m_scale[rank][eta] << " " ;
91  }
92  s << endl;
93  }
94 }
T eta() const
double m_scale[nBinRank][2 *nBinEta]
thresholds associated with rank scale in GeV
uint16_t rank(double et, unsigned short eta, short etaSign) const
convert from physical Et in GeV to rank scale
static const unsigned short nBinRank
static const unsigned short nBinEta
unsigned short L1CaloEcalScale::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 L1CaloEcalScale.cc.

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

Referenced by et(), print(), and setBin().

53  {
54  --eta ; // input eta index starts at 1
55  if (eta < nBinEta) {
56  unsigned short out = 0;
57  if( etaSign < 0 ) eta += nBinEta ;
58  for (unsigned i=0; i<nBinRank; i++) {
59  if ( et >= m_scale[i][eta] ) { out = i; }
60  }
61  return out & (nBinRank-1);
62  }
63  else {
64  // throw
65  }
66  return nBinRank ;
67 }
int i
Definition: DBlmapReader.cc:9
T eta() const
double m_scale[nBinRank][2 *nBinEta]
thresholds associated with rank scale in GeV
double et(unsigned short rank, unsigned short eta, short etaSign) const
convert from rank to physically meaningful quantity
tuple out
Definition: dbtoconf.py:99
static const unsigned short nBinRank
static const unsigned short nBinEta
void L1CaloEcalScale::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 L1CaloEcalScale.cc.

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

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

39  {
40  --eta ; // input eta index starts at 1
41  if (rank < nBinRank && eta < nBinEta) {
42  if( etaSign < 0 ) eta += nBinEta ;
43  m_scale[rank][eta] = et;
44  }
45  else {
46  // throw
47  }
48 }
T eta() const
double m_scale[nBinRank][2 *nBinEta]
thresholds associated with rank scale in GeV
double et(unsigned short rank, unsigned short eta, short etaSign) const
convert from rank to physically meaningful quantity
uint16_t rank(double et, unsigned short eta, short etaSign) const
convert from physical Et in GeV to rank scale
static const unsigned short nBinRank
static const unsigned short nBinEta

Member Data Documentation

L1CaloEcalScale::COND_SERIALIZABLE
private

Definition at line 70 of file L1CaloEcalScale.h.

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

thresholds associated with rank scale in GeV

Definition at line 67 of file L1CaloEcalScale.h.

Referenced by et(), L1CaloEcalScale(), print(), rank(), and setBin().

const unsigned short L1CaloEcalScale::nBinEta = 28
static
const unsigned short L1CaloEcalScale::nBinRank = 1<<8
static