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.

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 }

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

◆ parseFFTJetCorrector()

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

Definition at line 79 of file FFTJetESParameterParser.h.

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 }

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

◆ 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.

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  CPP11_auto_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 }

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

personalPlayback.level
level
Definition: personalPlayback.py:22
mps_fire.i
i
Definition: mps_fire.py:428
parseFFTSpecificScaleCalculator
AbsFFTSpecificScaleCalculator * parseFFTSpecificScaleCalculator(const edm::ParameterSet &ps, const std::string &tableDescription)
Definition: AbsFFTSpecificScaleCalculator.cc:23
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
FFTUncertaintyAdjuster
Definition: FFTJetAdjusters.h:26
LumiMonitor_cff.scalers
scalers
Definition: LumiMonitor_cff.py:11
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
parseFFTJetCorrectorApp
FFTJetCorrectorApp parseFFTJetCorrectorApp(const std::string &config)
Definition: FFTJetCorrectorApp.cc:4
alignCSCRings.s
s
Definition: alignCSCRings.py:92
loadFFTJetInterpolationTable
std::unique_ptr< npstat::StorableMultivariateFunctor > loadFFTJetInterpolationTable(const edm::ParameterSet &ps, gs::StringArchive &ar, bool verbose)
Definition: loadFFTJetInterpolationTable.cc:28
FFTEtaLogPtConeRadiusMapper
Definition: FFTJetScaleCalculators.h:12
verbose
static constexpr int verbose
Definition: HLTExoticaSubAnalysis.cc:25
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:47
FFTSimpleScalingAdjuster
Definition: FFTJetAdjusters.h:7
FFTScalingAdjusterWithUncertainty
Definition: FFTJetAdjusters.h:46
FFTSpecificScaleCalculator
Definition: FFTJetScaleCalculators.h:30
AbsFFTSpecificScaleCalculator
Definition: AbsFFTSpecificScaleCalculator.h:13
Exception
Definition: hltDiff.cc:245
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303