CMS 3D CMS Logo

List of all members | Public Member Functions
JME::JetScaleFactorVsPt< ii > Class Template Reference
Inheritance diagram for JME::JetScaleFactorVsPt< ii >:
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
 
 JetScaleFactorVsPt ()
 
- 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

template<index ii>
class JME::JetScaleFactorVsPt< ii >

Definition at line 636 of file JetResolution_PayloadInspector.cc.

Constructor & Destructor Documentation

◆ JetScaleFactorVsPt()

template<index ii>
JME::JetScaleFactorVsPt< ii >::JetScaleFactorVsPt ( )
inline

Member Function Documentation

◆ fill()

template<index ii>
bool JME::JetScaleFactorVsPt< ii >::fill ( )
inlineoverridevirtual

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

Definition at line 645 of file JetResolution_PayloadInspector.cc.

References cuy::ii, cond::payloadInspector::PlotBase::inputParamValues(), MAX_PT, MIN_PT, NBIN_PT, jetsAK4_Puppi_cff::payload, AlCaHarvesting_cff::record, and makeGlobalPositionRcd_cfg::tag.

645  {
646  double par_Pt = 100.;
647  double par_Eta = 1.;
648 
650  auto ip = paramValues.find("Jet_Pt");
651  if (ip != paramValues.end()) {
652  par_Pt = std::stod(ip->second);
653  edm::LogPrint("JER_PI") << "Jet Pt: " << par_Pt;
654  }
655  ip = paramValues.find("Jet_Eta");
656  if (ip != paramValues.end()) {
657  par_Eta = std::stod(ip->second);
658  edm::LogPrint("JER_PI") << "Jet Eta: " << par_Eta;
659  }
660 
661  auto tag = PlotBase::getTag<0>();
662  for (auto const& iov : tag.iovs) {
663  std::shared_ptr<JetResolutionObject> payload = Base::fetchPayload(std::get<1>(iov));
664  if (payload.get()) {
665  if (!payload->getRecords().empty() && // No formula for SF
666  payload->getDefinition().getFormulaString().compare("") != 0)
667  return false;
668 
669  for (const auto& record : payload->getRecords()) {
670  if (record.getBinsRange().size() > 1 && payload->getDefinition().getBinName(0) == "JetEta" &&
671  record.getBinsRange()[0].is_inside(par_Eta) && // take jeteta=2.5
672  payload->getDefinition().getBinName(1) == "JetPt" && // 2-bin
673  record.getParametersValues().size() == 3) { // norm, down, up
674 
675  for (size_t it = 0; it <= NBIN_PT; it++) {
676  par_Pt = (it + 0.5) * (MAX_PT - MIN_PT) / NBIN_PT + MIN_PT;
677  if (record.getBinsRange()[1].is_inside(par_Pt)) {
678  double sf = 0.;
679  sf = record.getParametersValues()[ii];
680  fillWithBinAndValue(it, sf);
681  }
682  }
683  }
684  } // records
685  return true;
686  } else
687  return false;
688  } // for
689  return false;
690  } // fill
Log< level::Warning, true > LogPrint
ii
Definition: cuy.py:589
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)