CMS 3D CMS Logo

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

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

Public Member Functions

double et (const uint16_t rank) const
 convert from rank to physically meaningful quantity More...
 
const std::vector< double > & getThresholds () const
 get thresholds More...
 
 L1CaloEtScale ()
 default constructor, for testing (out = in) More...
 
 L1CaloEtScale (const double linearLsbInGeV, const std::vector< double > thresholdsInGeV)
 
 L1CaloEtScale (const unsigned linScaleMax, const unsigned rankScaleMax, const double linearLsbInGeV, const std::vector< double > thresholdsInGeV)
 general case ctor that sets scale max values More...
 
double linearLsb () const
 get LSB of linear input scale More...
 
unsigned linScaleMax () const
 
void print (std::ostream &s) const
 
uint16_t rank (const uint16_t linear) const
 convert from linear Et scale to rank scale More...
 
uint16_t rank (const double EtInGeV) const
 convert from physical Et in GeV to rank scale More...
 
unsigned rankScaleMax () const
 
 ~L1CaloEtScale ()
 

Private Attributes

double m_linearLsb
 LSB of linear scale in GeV. More...
 
uint16_t m_linScaleMax
 linear scale maximum More...
 
uint16_t m_rankScaleMax
 rank scale maximum More...
 
std::vector< double > m_thresholds
 thresholds associated with rank scale in GeV More...
 

Detailed Description

Description: Class to handle non-linear scales in L1 calo trigger hardware, including, e/gamma rank, jet rank, Htmiss

Usage: <usage>

Definition at line 27 of file L1CaloEtScale.h.

Constructor & Destructor Documentation

L1CaloEtScale::L1CaloEtScale ( )

default constructor, for testing (out = in)

Definition at line 23 of file L1CaloEtScale.cc.

References i, m_linearLsb, m_rankScaleMax, and m_thresholds.

23  :
24  m_linScaleMax(0x3ff),
25  m_rankScaleMax(0x3f),
26  m_linearLsb(1.0)
27 {
28  for (unsigned i=0; i<m_rankScaleMax; i++) {
29  m_thresholds.push_back(m_linearLsb * i);
30  }
31 }
int i
Definition: DBlmapReader.cc:9
uint16_t m_linScaleMax
linear scale maximum
Definition: L1CaloEtScale.h:70
uint16_t m_rankScaleMax
rank scale maximum
Definition: L1CaloEtScale.h:73
double m_linearLsb
LSB of linear scale in GeV.
Definition: L1CaloEtScale.h:77
std::vector< double > m_thresholds
thresholds associated with rank scale in GeV
Definition: L1CaloEtScale.h:80
L1CaloEtScale::L1CaloEtScale ( const double  linearLsbInGeV,
const std::vector< double >  thresholdsInGeV 
)

ctor that provides backwards compatibility with fixed scale max values OK to use this with e/gamma and jet rank scales

Definition at line 35 of file L1CaloEtScale.cc.

35  :
36  m_linScaleMax(0x3ff),
37  m_rankScaleMax(0x3f),
38  m_linearLsb(linearLsbInGeV),
39  m_thresholds(thresholdsInGeV) {
40 
41  // protect against too many thresholds!
42  // while ( m_threshold.size() > (L1GctJetScale::maxRank+1) ) {
43  // m_thresholds.pop_back();
44  // }
45 
46 }
uint16_t m_linScaleMax
linear scale maximum
Definition: L1CaloEtScale.h:70
uint16_t m_rankScaleMax
rank scale maximum
Definition: L1CaloEtScale.h:73
double m_linearLsb
LSB of linear scale in GeV.
Definition: L1CaloEtScale.h:77
std::vector< double > m_thresholds
thresholds associated with rank scale in GeV
Definition: L1CaloEtScale.h:80
L1CaloEtScale::L1CaloEtScale ( const unsigned  linScaleMax,
const unsigned  rankScaleMax,
const double  linearLsbInGeV,
const std::vector< double >  thresholdsInGeV 
)

general case ctor that sets scale max values

Definition at line 50 of file L1CaloEtScale.cc.

50  :
53  m_linearLsb(linearLsbInGeV),
54  m_thresholds(thresholdsInGeV) {
55 
56 }
uint16_t m_linScaleMax
linear scale maximum
Definition: L1CaloEtScale.h:70
uint16_t m_rankScaleMax
rank scale maximum
Definition: L1CaloEtScale.h:73
double m_linearLsb
LSB of linear scale in GeV.
Definition: L1CaloEtScale.h:77
std::vector< double > m_thresholds
thresholds associated with rank scale in GeV
Definition: L1CaloEtScale.h:80
unsigned linScaleMax() const
Definition: L1CaloEtScale.h:45
unsigned rankScaleMax() const
Definition: L1CaloEtScale.h:48
L1CaloEtScale::~L1CaloEtScale ( )

Definition at line 59 of file L1CaloEtScale.cc.

59  {
60 
61 }

Member Function Documentation

double L1CaloEtScale::et ( const uint16_t  rank) const

convert from rank to physically meaningful quantity

Definition at line 83 of file L1CaloEtScale.cc.

References edm::hlt::Exception, and m_thresholds.

83  {
84 
85  // return bin centre, except for highest bin
86 // if (rank < m_thresholds.size()-1) {
87 // return (m_thresholds[rank+1]+m_thresholds[rank]) / 2;
88 // }
89 // else {
90 // return m_thresholds.back();
91 // }
92 
93 // return bin lower edge
94  try {
95  return m_thresholds.at(rank);
96  }
97  catch(std::out_of_range) {
98  throw cms::Exception("OutOfRange") << "Index out of range in L1CaloEtScale::et(rank)" << std::endl;
99  }
100 
101 }
uint16_t rank(const uint16_t linear) const
convert from linear Et scale to rank scale
std::vector< double > m_thresholds
thresholds associated with rank scale in GeV
Definition: L1CaloEtScale.h:80
const std::vector<double>& L1CaloEtScale::getThresholds ( ) const
inline

get thresholds

Definition at line 63 of file L1CaloEtScale.h.

References m_thresholds.

Referenced by L1GctGlobalHfSumAlgos::getThresholds(), L1GctHtMissLut::getThresholdsGct(), L1GctHfEtSumsLut::getThresholdsGct(), L1GctHtMissLut::getThresholdsGeV(), L1GctHfEtSumsLut::getThresholdsGeV(), and operator<<().

63 { return m_thresholds; }
std::vector< double > m_thresholds
thresholds associated with rank scale in GeV
Definition: L1CaloEtScale.h:80
double L1CaloEtScale::linearLsb ( ) const
inline

get LSB of linear input scale

Definition at line 51 of file L1CaloEtScale.h.

References m_linearLsb.

Referenced by L1GctHfEtSumsLut::getThresholdsGct(), operator<<(), and L1GctJetEtCalibrationLut::value().

51 { return m_linearLsb; }
double m_linearLsb
LSB of linear scale in GeV.
Definition: L1CaloEtScale.h:77
unsigned L1CaloEtScale::linScaleMax ( ) const
inline

Definition at line 45 of file L1CaloEtScale.h.

References m_linScaleMax.

Referenced by operator<<().

45 { return m_linScaleMax; }
uint16_t m_linScaleMax
linear scale maximum
Definition: L1CaloEtScale.h:70
void L1CaloEtScale::print ( std::ostream &  s) const

Definition at line 103 of file L1CaloEtScale.cc.

References i, m_linearLsb, m_linScaleMax, m_rankScaleMax, and m_thresholds.

103  {
104  s << "L1CaloEtScale :" << endl;
105  s << " Input scale max = " << m_linScaleMax << endl;
106  s << " Input LSB = " << m_linearLsb << " GeV" << endl;
107  s << " Rank scale max = " << m_rankScaleMax << endl;
108  for (unsigned i=0; i<m_thresholds.size(); i++) {
109  s << " Threshold " << i << " = " << m_thresholds[i] << " GeV" << endl;
110  }
111 }
int i
Definition: DBlmapReader.cc:9
uint16_t m_linScaleMax
linear scale maximum
Definition: L1CaloEtScale.h:70
uint16_t m_rankScaleMax
rank scale maximum
Definition: L1CaloEtScale.h:73
double m_linearLsb
LSB of linear scale in GeV.
Definition: L1CaloEtScale.h:77
std::vector< double > m_thresholds
thresholds associated with rank scale in GeV
Definition: L1CaloEtScale.h:80
uint16_t L1CaloEtScale::rank ( const uint16_t  linear) const

convert from linear Et scale to rank scale

Definition at line 64 of file L1CaloEtScale.cc.

References m_linearLsb, and m_linScaleMax.

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

64  {
65 
66  return rank( (linear & m_linScaleMax) * m_linearLsb);
67 
68 }
uint16_t m_linScaleMax
linear scale maximum
Definition: L1CaloEtScale.h:70
double m_linearLsb
LSB of linear scale in GeV.
Definition: L1CaloEtScale.h:77
uint16_t rank(const uint16_t linear) const
convert from linear Et scale to rank scale
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 71 of file L1CaloEtScale.cc.

References i, m_rankScaleMax, m_thresholds, and dbtoconf::out.

71  {
72 
73  uint16_t out = 0;
74 
75  for (unsigned i=0; i<m_thresholds.size() && i<(unsigned)(m_rankScaleMax+1); i++) {
76  if ( EtInGeV >= m_thresholds.at(i) ) { out = i; }
77  }
78 
79  return out & m_rankScaleMax;
80 }
int i
Definition: DBlmapReader.cc:9
uint16_t m_rankScaleMax
rank scale maximum
Definition: L1CaloEtScale.h:73
std::vector< double > m_thresholds
thresholds associated with rank scale in GeV
Definition: L1CaloEtScale.h:80
tuple out
Definition: dbtoconf.py:99
unsigned L1CaloEtScale::rankScaleMax ( ) const
inline

Definition at line 48 of file L1CaloEtScale.h.

References m_rankScaleMax.

Referenced by operator<<().

48 { return m_rankScaleMax; }
uint16_t m_rankScaleMax
rank scale maximum
Definition: L1CaloEtScale.h:73

Member Data Documentation

double L1CaloEtScale::m_linearLsb
private

LSB of linear scale in GeV.

Definition at line 77 of file L1CaloEtScale.h.

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

uint16_t L1CaloEtScale::m_linScaleMax
private

linear scale maximum

Definition at line 70 of file L1CaloEtScale.h.

Referenced by linScaleMax(), print(), and rank().

uint16_t L1CaloEtScale::m_rankScaleMax
private

rank scale maximum

Definition at line 73 of file L1CaloEtScale.h.

Referenced by L1CaloEtScale(), print(), rank(), and rankScaleMax().

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

thresholds associated with rank scale in GeV

Definition at line 80 of file L1CaloEtScale.h.

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