CMS 3D CMS Logo

List of all members | Public Member Functions
JME::JetResolutionVsEta Class Reference
Inheritance diagram for JME::JetResolutionVsEta:
cond::payloadInspector::Histogram1< AxisType, PayloadType, IOV_M > cond::payloadInspector::Plot2D< PayloadType, AxisType, AxisType, IOV_M, 1 > cond::payloadInspector::PlotImpl< IOV_M, NTAGS > cond::payloadInspector::PlotBase

Public Member Functions

bool fill () override
 
 JetResolutionVsEta ()
 
- Public Member Functions inherited from cond::payloadInspector::Histogram1< AxisType, PayloadType, IOV_M >
bool fill () override
 
void fillWithBinAndValue (size_t bin, AxisType weight=1)
 
void fillWithValue (AxisType value, AxisType weight=1)
 
virtual AxisType getFromPayload (PayloadType &payload)
 
 Histogram1 (const std::string &title, const std::string &xLabel, size_t nbins, float min, float max, const std::string &yLabel="entries")
 
void init () override
 
- Public Member Functions inherited from cond::payloadInspector::Plot2D< PayloadType, AxisType, AxisType, IOV_M, 1 >
std::shared_ptr< PayloadType > fetchPayload (const cond::Hash &payloadHash)
 
 Plot2D (const std::string &type, const std::string &title, const std::string xLabel, const std::string &yLabel)
 
std::string serializeData () override
 
 ~Plot2D () override=default
 
- Public Member Functions inherited from cond::payloadInspector::PlotImpl< IOV_M, NTAGS >
 PlotImpl (const std::string &type, const std::string &title)
 
std::string processData () override
 
 ~PlotImpl () override=default
 
- Public Member Functions inherited from cond::payloadInspector::PlotBase
void addInputParam (const std::string &paramName)
 
cond::persistency::Session dbSession ()
 
template<typename PayloadType >
std::shared_ptr< PayloadType > fetchPayload (const cond::Hash &payloadHash)
 
template<int index>
TagReference getTag ()
 
cond::Tag_t getTagInfo (const std::string &tag)
 
const std::map< std::string, std::string > & inputParamValues () const
 
bool isSingleIov () const
 
bool isTwoTags () const
 
unsigned int ntags () const
 
std::string payloadType () const
 
 PlotBase ()
 
std::string title () const
 
std::string type () const
 
virtual ~PlotBase ()=default
 

Additional Inherited Members

- Public Types inherited from cond::payloadInspector::Histogram1< AxisType, PayloadType, IOV_M >
typedef Plot2D< PayloadType, AxisType, AxisType, IOV_M, 1 > Base
 
- Public Types inherited from cond::payloadInspector::Plot2D< PayloadType, AxisType, AxisType, IOV_M, 1 >
typedef PlotImpl< IOV_M, NTAGS > Base
 
- Protected Attributes inherited from cond::payloadInspector::Plot2D< PayloadType, AxisType, AxisType, IOV_M, 1 >
std::vector< std::tuple< AxisType, AxisType > > m_plotData
 
- Protected Attributes inherited from cond::payloadInspector::PlotBase
std::set< std::string > m_inputParams
 
std::map< std::string, std::string > m_inputParamValues
 
PlotAnnotations m_plotAnnotations
 
std::vector< std::pair< cond::Time_t, cond::Time_t > > m_tagBoundaries
 
std::vector< std::vector< std::tuple< cond::Time_t, cond::Hash > > > m_tagIovs
 
std::vector< std::string > m_tagNames
 

Detailed Description

Definition at line 48 of file JetResolution_PayloadInspector.cc.

Constructor & Destructor Documentation

◆ JetResolutionVsEta()

JME::JetResolutionVsEta::JetResolutionVsEta ( )
inline

Member Function Documentation

◆ fill()

bool JME::JetResolutionVsEta::fill ( )
inlineoverridevirtual

Implements cond::payloadInspector::PlotImpl< IOV_M, NTAGS >.

Definition at line 57 of file JetResolution_PayloadInspector.cc.

References heavyIonCSV_trainingSettings::idx, cond::payloadInspector::PlotBase::inputParamValues(), MAX_ETA, MIN_ETA, NBIN_ETA, jetsAK4_Puppi_cff::payload, AlCaHarvesting_cff::record, JME::JetParameters::setJetEta(), JME::JetParameters::setJetPt(), JME::JetParameters::setRho(), and makeGlobalPositionRcd_cfg::tag.

57  {
58  double par_Pt = 100.;
59  double par_Eta = 1.;
60  double par_Rho = 20.;
61 
62  // Default values will be used if no input parameters
64  auto ip = paramValues.find("Jet_Pt");
65  if (ip != paramValues.end()) {
66  par_Pt = std::stod(ip->second);
67  edm::LogPrint("JER_PI") << "Jet Pt: " << par_Pt;
68  }
69  ip = paramValues.find("Jet_Rho");
70  if (ip != paramValues.end()) {
71  par_Rho = std::stod(ip->second);
72  edm::LogPrint("JER_PI") << "Jet Rho: " << par_Rho;
73  }
74 
75  auto tag = PlotBase::getTag<0>();
76  for (auto const& iov : tag.iovs) {
77  std::shared_ptr<JetResolutionObject> payload = Base::fetchPayload(std::get<1>(iov));
78  if (payload.get()) {
79  if (!payload->getRecords().empty() && // No formula for SF
80  payload->getDefinition().getFormulaString().compare("") == 0)
81  return false;
82 
83  for (size_t idx = 0; idx <= NBIN_ETA; idx++) {
84  par_Eta = (idx + 0.5) * (MAX_ETA - MIN_ETA) / NBIN_ETA + MIN_ETA;
85 
86  JetParameters j_param;
87  j_param.setJetPt(par_Pt);
88  j_param.setRho(par_Rho);
89  j_param.setJetEta(par_Eta);
90 
91  if (payload->getRecord(j_param) == nullptr) {
92  continue;
93  }
94 
95  const JetResolutionObject::Record record = *(payload->getRecord(j_param));
96  float res = payload->evaluateFormula(record, j_param);
98  } // x-axis
99  } else
100  return false;
101  }
102  return true;
103  }
Definition: Electron.h:6
Log< level::Warning, true > LogPrint
const std::map< std::string, std::string > & inputParamValues() const
std::shared_ptr< PayloadType > fetchPayload(const cond::Hash &payloadHash)
void fillWithBinAndValue(size_t bin, AxisType weight=1)