CMS 3D CMS Logo

Functions
FFTJetESParameterParser.h File Reference
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Utilities/interface/Exception.h"
#include "JetMETCorrections/FFTJetObjects/interface/FFTJetAdjusters.h"
#include "JetMETCorrections/FFTJetObjects/interface/FFTJetScaleCalculators.h"
#include "JetMETCorrections/FFTJetObjects/interface/FFTJetCorrectionsTypemap.h"
#include "JetMETCorrections/FFTJetObjects/interface/loadFFTJetInterpolationTable.h"
#include "JetMETCorrections/InterpolationTables/interface/CoordinateSelector.h"

Go to the source code of this file.

Functions

template<class Jet , class Adjustable >
std::shared_ptr< AbsFFTJetAdjuster< Jet, Adjustable > > parseFFTJetAdjuster (const edm::ParameterSet &ps, const bool)
 
template<class Corrector >
Corrector parseFFTJetCorrector (const edm::ParameterSet &ps, gs::StringArchive &ar, const bool verbose)
 
template<class Jet , class Adjustable >
std::shared_ptr< AbsFFTJetScaleCalculator< Jet, Adjustable > > parseFFTJetScaleCalculator (const edm::ParameterSet &ps, gs::StringArchive &ar, const bool verbose)
 

Function Documentation

◆ parseFFTJetAdjuster()

template<class Jet , class Adjustable >
std::shared_ptr<AbsFFTJetAdjuster<Jet, Adjustable> > parseFFTJetAdjuster ( const edm::ParameterSet ps,
const bool   
)

Definition at line 17 of file FFTJetESParameterParser.h.

References Exception, edm::ParameterSet::getParameter(), and AlCaHLTBitMon_QueryRunRegistry::string.

18  {
19  typedef std::shared_ptr<AbsFFTJetAdjuster<Jet, Adjustable> > Result;
20 
21  const std::string& adjuster_type = ps.getParameter<std::string>("Class");
22 
23  if (!adjuster_type.compare("FFTSimpleScalingAdjuster"))
24  return Result(new FFTSimpleScalingAdjuster<Jet, Adjustable>());
25 
26  else if (!adjuster_type.compare("FFTUncertaintyAdjuster"))
27  return Result(new FFTUncertaintyAdjuster<Jet, Adjustable>());
28 
29  else if (!adjuster_type.compare("FFTScalingAdjusterWithUncertainty"))
31 
32  else
33  throw cms::Exception("FFTJetBadConfig")
34  << "In parseFFTJetAdjuster: unknown adjuster type \"" << adjuster_type << "\"\n";
35 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307

◆ parseFFTJetCorrector()

template<class Corrector >
Corrector parseFFTJetCorrector ( const edm::ParameterSet ps,
gs::StringArchive &  ar,
const bool  verbose 
)

Definition at line 79 of file FFTJetESParameterParser.h.

References edm::ParameterSet::getParameter(), mps_fire::i, personalPlayback::level, parseFFTJetCorrectorApp(), alignCSCRings::s, DQMOffline_LumiMonitoring_cff::scalers, AlCaHLTBitMon_QueryRunRegistry::string, and verbose.

79  {
80  typedef typename Corrector::jet_type MyJet;
81  typedef typename Corrector::adjustable_type Adjustable;
82 
83  // "level" is an unsigned
84  const unsigned level(ps.getParameter<unsigned>("level"));
85 
86  // "applyTo" is a string
87  const std::string& applyTo(ps.getParameter<std::string>("applyTo"));
88 
89  // "adjuster" is a PSet
90  const edm::ParameterSet& adjuster = ps.getParameter<edm::ParameterSet>("adjuster");
91  std::shared_ptr<const AbsFFTJetAdjuster<MyJet, Adjustable> > adj =
92  parseFFTJetAdjuster<MyJet, Adjustable>(adjuster, verbose);
93 
94  // "scalers" is a VPSet
95  const std::vector<edm::ParameterSet>& scalers = ps.getParameter<std::vector<edm::ParameterSet> >("scalers");
96  const unsigned nScalers = scalers.size();
97  std::vector<std::shared_ptr<const AbsFFTJetScaleCalculator<MyJet, Adjustable> > > sVec;
98  sVec.reserve(nScalers);
99  for (unsigned i = 0; i < nScalers; ++i) {
100  std::shared_ptr<AbsFFTJetScaleCalculator<MyJet, Adjustable> > s =
101  parseFFTJetScaleCalculator<MyJet, Adjustable>(scalers[i], ar, verbose);
102  sVec.push_back(s);
103  }
104  return Corrector(adj, sVec, level, parseFFTJetCorrectorApp(applyTo));
105 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
bool verbose
FFTJetCorrectorApp parseFFTJetCorrectorApp(const std::string &config)

◆ parseFFTJetScaleCalculator()

template<class Jet , class Adjustable >
std::shared_ptr<AbsFFTJetScaleCalculator<Jet, Adjustable> > parseFFTJetScaleCalculator ( const edm::ParameterSet ps,
gs::StringArchive &  ar,
const bool  verbose 
)

Definition at line 39 of file FFTJetESParameterParser.h.

References Exception, f, edm::ParameterSet::getParameter(), loadFFTJetInterpolationTable(), AlCaHLTBitMon_ParallelJobs::p, parseFFTSpecificScaleCalculator(), AlCaHLTBitMon_QueryRunRegistry::string, and verbose.

41  {
42  typedef std::shared_ptr<AbsFFTJetScaleCalculator<Jet, Adjustable> > Result;
43 
44  std::string mapper_type(ps.getParameter<std::string>("Class"));
45 
46  // Initially, check for mappers which do not need to load
47  // a data table from the archive
48  // if (!mapper_type.compare("SomeClass"))
49  // {
50  // Do something ....
51  // return Result(...);
52  // }
53 
54  // Load the table from the archive
55  std::unique_ptr<npstat::StorableMultivariateFunctor> autof = loadFFTJetInterpolationTable(ps, ar, verbose);
56  std::shared_ptr<npstat::StorableMultivariateFunctor> f(autof.release());
57 
58  // Swap the class name if it is supposed to be determined
59  // from the table description
60  if (!mapper_type.compare("auto"))
61  mapper_type = f->description();
62 
63  if (!mapper_type.compare("FFTEtaLogPtConeRadiusMapper"))
65 
66  else if (!mapper_type.compare("FFTSpecificScaleCalculator")) {
67  const edm::ParameterSet& subclass = ps.getParameter<edm::ParameterSet>("Subclass");
69  return Result(new FFTSpecificScaleCalculator<Jet, Adjustable>(f, p));
70  }
71 
72  else
73  throw cms::Exception("FFTJetBadConfig")
74  << "In parseFFTJetScaleCalculator: unknown mapper type \"" << mapper_type << '"' << std::endl;
75 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
bool verbose
double f[11][100]
AbsFFTSpecificScaleCalculator * parseFFTSpecificScaleCalculator(const edm::ParameterSet &ps, const std::string &tableDescription)
std::unique_ptr< npstat::StorableMultivariateFunctor > loadFFTJetInterpolationTable(const edm::ParameterSet &ps, gs::StringArchive &ar, bool verbose)