CMS 3D CMS Logo

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

#include <JetResolutionObject.h>

Public Types

typedef std::unordered_map
< Binning, float > 
value_type
 

Public Member Functions

std::vector< float > createVector (const std::vector< Binning > &binning) const
 
 JetParameters ()=default
 
 JetParameters (JetParameters &&rhs)
 
 JetParameters (std::initializer_list< typename value_type::value_type > init)
 
JetParametersset (const Binning &bin, float value)
 
JetParametersset (const typename value_type::value_type &value)
 
JetParameterssetJetArea (float area)
 
JetParameterssetJetE (float e)
 
JetParameterssetJetEta (float eta)
 
JetParameterssetJetPt (float pt)
 
JetParameterssetMu (float mu)
 
JetParameterssetNPV (float npv)
 
JetParameterssetRho (float rho)
 

Static Public Attributes

static const bimap< Binning,
std::string > 
binning_to_string
 

Private Attributes

value_type m_values
 

Detailed Description

Definition at line 92 of file JetResolutionObject.h.

Member Typedef Documentation

typedef std::unordered_map<Binning, float> JME::JetParameters::value_type

Definition at line 94 of file JetResolutionObject.h.

Constructor & Destructor Documentation

JME::JetParameters::JetParameters ( )
default
JME::JetParameters::JetParameters ( JetParameters &&  rhs)

Definition at line 59 of file JetResolutionObject.cc.

References m_values, and eostools::move().

59  {
60  m_values = std::move(rhs.m_values);
61  }
def move
Definition: eostools.py:510
JME::JetParameters::JetParameters ( std::initializer_list< typename value_type::value_type >  init)

Definition at line 63 of file JetResolutionObject.cc.

References i, and set().

63  {
64  for (auto& i: init) {
65  set(i.first, i.second);
66  }
67  }
int i
Definition: DBlmapReader.cc:9
int init
Definition: HydjetWrapper.h:67
JetParameters & set(const Binning &bin, float value)

Member Function Documentation

std::vector< float > JME::JetParameters::createVector ( const std::vector< Binning > &  binning) const

Definition at line 121 of file JetResolutionObject.cc.

References newFWLiteAna::bin, binning_to_string, m_values, edm::errors::NotFound, JME::throwException(), and makeHLTPrescaleTable::values.

Referenced by JME::JetResolutionObject::evaluateFormula(), and JME::JetResolutionObject::getRecord().

121  {
122  std::vector<float> values;
123  for (const auto& bin: binning) {
124  const auto& it = m_values.find(bin);
125  if (it == m_values.cend()) {
126  throwException(edm::errors::NotFound, "JER parametrisation depends on '" +
128  "' but no value for this parameter has been specified. Please call the appropriate 'set' function of the JME::JetParameters object");
129  }
130 
131  values.push_back(it->second);
132  }
133 
134  return values;
135  }
void throwException(uint32_t code, const std::string &message)
static const bimap< Binning, std::string > binning_to_string
JetParameters & JME::JetParameters::set ( const Binning bin,
float  value 
)

Definition at line 105 of file JetResolutionObject.cc.

References JME::JetAbsEta, JME::JetEta, and m_values.

Referenced by JetResolutionDemo::analyze(), betterConfigParser.BetterConfigParser::getGeneral(), JetParameters(), and set().

105  {
106  m_values.emplace(bin, value);
107 
108  // Special case for eta
109  if (bin == Binning::JetEta) {
110  m_values.emplace(Binning::JetAbsEta, fabs(value));
111  }
112 
113  return *this;
114  }
JetParameters & JME::JetParameters::set ( const typename value_type::value_type &  value)

Definition at line 116 of file JetResolutionObject.cc.

References set().

Referenced by betterConfigParser.BetterConfigParser::getGeneral().

116  {
117  set(value.first, value.second);
118  return *this;
119  }
JetParameters & set(const Binning &bin, float value)
JetParameters & JME::JetParameters::setJetArea ( float  area)

Definition at line 85 of file JetResolutionObject.cc.

References JME::JetArea, and m_values.

85  {
86  m_values[Binning::JetArea] = area;
87  return *this;
88  }
JetParameters & JME::JetParameters::setJetE ( float  e)

Definition at line 80 of file JetResolutionObject.cc.

References alignCSCRings::e, JME::JetE, and m_values.

80  {
82  return *this;
83  }
JetParameters & JME::JetParameters::setJetEta ( float  eta)

Definition at line 74 of file JetResolutionObject.cc.

References eta, JME::JetAbsEta, JME::JetEta, and m_values.

Referenced by JetResolutionDemo::analyze().

JetParameters & JME::JetParameters::setJetPt ( float  pt)

Definition at line 69 of file JetResolutionObject.cc.

References JME::JetPt, m_values, and EnergyCorrector::pt.

Referenced by JetResolutionDemo::analyze().

69  {
71  return *this;
72  }
JetParameters & JME::JetParameters::setMu ( float  mu)

Definition at line 90 of file JetResolutionObject.cc.

References m_values, RPCpg::mu, and JME::Mu.

90  {
92  return *this;
93  }
const int mu
Definition: Constants.h:22
JetParameters & JME::JetParameters::setNPV ( float  npv)

Definition at line 95 of file JetResolutionObject.cc.

References m_values, and JME::NPV.

95  {
96  m_values[Binning::NPV] = npv;
97  return *this;
98  }
JetParameters & JME::JetParameters::setRho ( float  rho)

Definition at line 100 of file JetResolutionObject.cc.

References m_values, and JME::Rho.

Referenced by JetResolutionDemo::analyze().

100  {
102  return *this;
103  }

Member Data Documentation

const bimap< Binning, std::string > JME::JetParameters::binning_to_string
static
Initial value:
= {
{Binning::JetPt, "JetPt"}, {Binning::JetEta, "JetEta"},
{Binning::JetAbsEta, "JetAbsEta"}, {Binning::JetE, "JetE"},
{Binning::JetArea, "JetArea"}, {Binning::Mu, "Mu"},
{Binning::Rho, "Rho"}, {Binning::NPV, "NPV"}
}

Definition at line 111 of file JetResolutionObject.h.

Referenced by createVector(), and JME::JetResolutionObject::Definition::init().

value_type JME::JetParameters::m_values
private