CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes | Friends
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 Member Functions

template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

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

Friends

class boost::serialization::access
 
template<typename CondSerializationT , typename Enabled >
struct cond::serialization::access
 

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 29 of file L1CaloEtScale.h.

Constructor & Destructor Documentation

L1CaloEtScale::L1CaloEtScale ( )

default constructor, for testing (out = in)

Definition at line 23 of file L1CaloEtScale.cc.

References mps_fire::i, m_linearLsb, m_rankScaleMax, and m_thresholds.

23  : m_linScaleMax(0x3ff), m_rankScaleMax(0x3f), m_linearLsb(1.0) {
24  for (unsigned i = 0; i < m_rankScaleMax; i++) {
25  m_thresholds.push_back(m_linearLsb * i);
26  }
27 }
uint16_t m_linScaleMax
linear scale maximum
Definition: L1CaloEtScale.h:72
uint16_t m_rankScaleMax
rank scale maximum
Definition: L1CaloEtScale.h:75
double m_linearLsb
LSB of linear scale in GeV.
Definition: L1CaloEtScale.h:78
std::vector< double > m_thresholds
thresholds associated with rank scale in GeV
Definition: L1CaloEtScale.h:81
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 31 of file L1CaloEtScale.cc.

32  : m_linScaleMax(0x3ff), m_rankScaleMax(0x3f), m_linearLsb(linearLsbInGeV), m_thresholds(thresholdsInGeV) {
33  // protect against too many thresholds!
34  // while ( m_threshold.size() > (L1GctJetScale::maxRank+1) ) {
35  // m_thresholds.pop_back();
36  // }
37 }
uint16_t m_linScaleMax
linear scale maximum
Definition: L1CaloEtScale.h:72
uint16_t m_rankScaleMax
rank scale maximum
Definition: L1CaloEtScale.h:75
double m_linearLsb
LSB of linear scale in GeV.
Definition: L1CaloEtScale.h:78
std::vector< double > m_thresholds
thresholds associated with rank scale in GeV
Definition: L1CaloEtScale.h:81
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 40 of file L1CaloEtScale.cc.

46  m_linearLsb(linearLsbInGeV),
47  m_thresholds(thresholdsInGeV) {}
uint16_t m_linScaleMax
linear scale maximum
Definition: L1CaloEtScale.h:72
uint16_t m_rankScaleMax
rank scale maximum
Definition: L1CaloEtScale.h:75
double m_linearLsb
LSB of linear scale in GeV.
Definition: L1CaloEtScale.h:78
std::vector< double > m_thresholds
thresholds associated with rank scale in GeV
Definition: L1CaloEtScale.h:81
unsigned linScaleMax() const
Definition: L1CaloEtScale.h:48
unsigned rankScaleMax() const
Definition: L1CaloEtScale.h:51
L1CaloEtScale::~L1CaloEtScale ( )

Definition at line 49 of file L1CaloEtScale.cc.

49 {}

Member Function Documentation

double L1CaloEtScale::et ( const uint16_t  rank) const

convert from rank to physically meaningful quantity

Definition at line 68 of file L1CaloEtScale.cc.

References Exception, and m_thresholds.

68  {
69  // return bin centre, except for highest bin
70  // if (rank < m_thresholds.size()-1) {
71  // return (m_thresholds[rank+1]+m_thresholds[rank]) / 2;
72  // }
73  // else {
74  // return m_thresholds.back();
75  // }
76 
77  // return bin lower edge
78  try {
79  return m_thresholds.at(rank);
80  } catch (std::out_of_range const&) {
81  throw cms::Exception("OutOfRange") << "Index out of range in L1CaloEtScale::et(rank)" << std::endl;
82  }
83 }
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:81
const std::vector<double>& L1CaloEtScale::getThresholds ( ) const
inline
double L1CaloEtScale::linearLsb ( ) const
inline

get LSB of linear input scale

Definition at line 54 of file L1CaloEtScale.h.

References m_linearLsb.

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

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

Definition at line 48 of file L1CaloEtScale.h.

References m_linScaleMax.

Referenced by l1t::JetToGtPtScales(), operator<<(), and l1t::TauToGtPtScales().

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

Definition at line 85 of file L1CaloEtScale.cc.

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

85  {
86  s << "L1CaloEtScale :" << endl;
87  s << " Input scale max = " << m_linScaleMax << endl;
88  s << " Input LSB = " << m_linearLsb << " GeV" << endl;
89  s << " Rank scale max = " << m_rankScaleMax << endl;
90  for (unsigned i = 0; i < m_thresholds.size(); i++) {
91  s << " Threshold " << i << " = " << m_thresholds[i] << " GeV" << endl;
92  }
93 }
uint16_t m_linScaleMax
linear scale maximum
Definition: L1CaloEtScale.h:72
uint16_t m_rankScaleMax
rank scale maximum
Definition: L1CaloEtScale.h:75
double m_linearLsb
LSB of linear scale in GeV.
Definition: L1CaloEtScale.h:78
std::vector< double > m_thresholds
thresholds associated with rank scale in GeV
Definition: L1CaloEtScale.h:81
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 m_linearLsb, and m_linScaleMax.

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

52 { return rank((linear & m_linScaleMax) * m_linearLsb); }
uint16_t m_linScaleMax
linear scale maximum
Definition: L1CaloEtScale.h:72
double m_linearLsb
LSB of linear scale in GeV.
Definition: L1CaloEtScale.h:78
uint16_t rank(const uint16_t linear) const
convert from linear Et scale to rank scale
float linear(float x)
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 55 of file L1CaloEtScale.cc.

References mps_fire::i, m_rankScaleMax, m_thresholds, and submitPVResolutionJobs::out.

55  {
56  uint16_t out = 0;
57 
58  for (unsigned i = 0; i < m_thresholds.size() && i < (unsigned)(m_rankScaleMax + 1); i++) {
59  if (EtInGeV >= m_thresholds.at(i)) {
60  out = i;
61  }
62  }
63 
64  return out & m_rankScaleMax;
65 }
uint16_t m_rankScaleMax
rank scale maximum
Definition: L1CaloEtScale.h:75
std::vector< double > m_thresholds
thresholds associated with rank scale in GeV
Definition: L1CaloEtScale.h:81
unsigned L1CaloEtScale::rankScaleMax ( ) const
inline

Definition at line 51 of file L1CaloEtScale.h.

References m_rankScaleMax.

Referenced by operator<<().

51 { return m_rankScaleMax; }
uint16_t m_rankScaleMax
rank scale maximum
Definition: L1CaloEtScale.h:75
template<class Archive >
void L1CaloEtScale::serialize ( Archive &  ar,
const unsigned int  version 
)
private

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Definition at line 83 of file L1CaloEtScale.h.

template<typename CondSerializationT , typename Enabled >
friend struct cond::serialization::access
friend

Definition at line 83 of file L1CaloEtScale.h.

Member Data Documentation

double L1CaloEtScale::m_linearLsb
private

LSB of linear scale in GeV.

Definition at line 78 of file L1CaloEtScale.h.

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

uint16_t L1CaloEtScale::m_linScaleMax
private

linear scale maximum

Definition at line 72 of file L1CaloEtScale.h.

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

uint16_t L1CaloEtScale::m_rankScaleMax
private

rank scale maximum

Definition at line 75 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 81 of file L1CaloEtScale.h.

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