CMS 3D CMS Logo

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 90 of file JetResolutionObject.h.

Member Typedef Documentation

◆ value_type

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

Definition at line 92 of file JetResolutionObject.h.

Constructor & Destructor Documentation

◆ JetParameters() [1/3]

JME::JetParameters::JetParameters ( )
default

◆ JetParameters() [2/3]

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

Definition at line 56 of file JetResolutionObject.cc.

56 { m_values = std::move(rhs.m_values); }

References m_values, and eostools::move().

◆ JetParameters() [3/3]

JME::JetParameters::JetParameters ( std::initializer_list< typename value_type::value_type >  init)

Definition at line 58 of file JetResolutionObject.cc.

58  {
59  for (auto& i : init) {
60  set(i.first, i.second);
61  }
62  }

References mps_fire::i, and set().

Member Function Documentation

◆ createVector()

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

Definition at line 116 of file JetResolutionObject.cc.

116  {
117  std::vector<float> values;
118  for (const auto& bin : binning) {
119  const auto& it = m_values.find(bin);
120  if (it == m_values.cend()) {
122  "JER parametrisation depends on '" + JetParameters::binning_to_string.left.at(bin) +
123  "' but no value for this parameter has been specified. Please call the appropriate 'set' "
124  "function of the JME::JetParameters object");
125  }
126 
127  values.push_back(it->second);
128  }
129 
130  return values;
131  }

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

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

◆ set() [1/2]

JetParameters & JME::JetParameters::set ( const Binning bin,
float  value 
)

Definition at line 100 of file JetResolutionObject.cc.

100  {
101  m_values.emplace(bin, value);
102 
103  // Special case for eta
104  if (bin == Binning::JetEta) {
105  m_values.emplace(Binning::JetAbsEta, fabs(value));
106  }
107 
108  return *this;
109  }

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

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

◆ set() [2/2]

JetParameters & JME::JetParameters::set ( const typename value_type::value_type &  value)

Definition at line 111 of file JetResolutionObject.cc.

111  {
112  set(value.first, value.second);
113  return *this;
114  }

References set().

◆ setJetArea()

JetParameters & JME::JetParameters::setJetArea ( float  area)

Definition at line 80 of file JetResolutionObject.cc.

80  {
82  return *this;
83  }

References custom_jme_cff::area, JME::JetArea, and m_values.

◆ setJetE()

JetParameters & JME::JetParameters::setJetE ( float  e)

Definition at line 75 of file JetResolutionObject.cc.

75  {
77  return *this;
78  }

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

◆ setJetEta()

JetParameters & JME::JetParameters::setJetEta ( float  eta)

Definition at line 69 of file JetResolutionObject.cc.

69  {
72  return *this;
73  }

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

Referenced by JetResolutionDemo::analyze().

◆ setJetPt()

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

Definition at line 64 of file JetResolutionObject.cc.

64  {
66  return *this;
67  }

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

Referenced by JetResolutionDemo::analyze().

◆ setMu()

JetParameters & JME::JetParameters::setMu ( float  mu)

Definition at line 85 of file JetResolutionObject.cc.

85  {
87  return *this;
88  }

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

◆ setNPV()

JetParameters & JME::JetParameters::setNPV ( float  npv)

Definition at line 90 of file JetResolutionObject.cc.

90  {
91  m_values[Binning::NPV] = npv;
92  return *this;
93  }

References m_values, and JME::NPV.

◆ setRho()

JetParameters & JME::JetParameters::setRho ( float  rho)

Definition at line 95 of file JetResolutionObject.cc.

95  {
97  return *this;
98  }

References m_values, and JME::Rho.

Referenced by JetResolutionDemo::analyze().

Member Data Documentation

◆ binning_to_string

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 108 of file JetResolutionObject.h.

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

◆ m_values

value_type JME::JetParameters::m_values
private
mps_fire.i
i
Definition: mps_fire.py:428
JME::Binning::NPV
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
amptDefaultParameters_cff.mu
mu
Definition: amptDefaultParameters_cff.py:16
JME::Binning::JetEta
JME::Binning::JetArea
edm::errors::NotFound
Definition: EDMException.h:57
JME::JetParameters::m_values
value_type m_values
Definition: JetResolutionObject.h:113
JME::JetParameters::set
JetParameters & set(const Binning &bin, float value)
Definition: JetResolutionObject.cc:100
JME::throwException
void throwException(uint32_t code, const std::string &message)
Definition: JetResolutionObject.cc:36
PVValHelper::eta
Definition: PVValidationHelpers.h:69
contentValuesCheck.values
values
Definition: contentValuesCheck.py:38
JME::JetParameters::binning_to_string
static const bimap< Binning, std::string > binning_to_string
Definition: JetResolutionObject.h:108
DDAxes::rho
JME::Binning::JetE
listHistos.binning
binning
Definition: listHistos.py:43
value
Definition: value.py:1
JME::Binning::JetAbsEta
JME::Binning::Mu
newFWLiteAna.bin
bin
Definition: newFWLiteAna.py:161
JME::Binning::Rho
eostools.move
def move(src, dest)
Definition: eostools.py:511
init
Definition: init.py:1
JME::Binning::JetPt
custom_jme_cff.area
area
Definition: custom_jme_cff.py:140
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37