CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 >
boost::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 >
boost::shared_ptr
< AbsFFTJetScaleCalculator
< Jet, Adjustable > > 
parseFFTJetScaleCalculator (const edm::ParameterSet &ps, gs::StringArchive &ar, const bool verbose)
 

Function Documentation

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

Definition at line 18 of file FFTJetESParameterParser.h.

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

19 {
20  typedef boost::shared_ptr<AbsFFTJetAdjuster<Jet,Adjustable> > Result;
21 
22  const std::string& adjuster_type = ps.getParameter<std::string>("Class");
23 
24  if (!adjuster_type.compare("FFTSimpleScalingAdjuster"))
25  return Result(new FFTSimpleScalingAdjuster<Jet,Adjustable>());
26 
27  else if (!adjuster_type.compare("FFTUncertaintyAdjuster"))
28  return Result(new FFTUncertaintyAdjuster<Jet,Adjustable>());
29 
30  else if (!adjuster_type.compare("FFTScalingAdjusterWithUncertainty"))
32 
33  else
34  throw cms::Exception("FFTJetBadConfig")
35  << "In parseFFTJetAdjuster: unknown adjuster type \""
36  << adjuster_type << "\"\n";
37 }
T getParameter(std::string const &) const
template<class Corrector >
Corrector parseFFTJetCorrector ( const edm::ParameterSet ps,
gs::StringArchive &  ar,
const bool  verbose 
)

Definition at line 90 of file FFTJetESParameterParser.h.

References edm::ParameterSet::getParameter(), i, testEve_cfg::level, parseFFTJetCorrectorApp(), alignCSCRings::s, AlCaHLTBitMon_QueryRunRegistry::string, and verbose.

93 {
94  typedef typename Corrector::jet_type MyJet;
95  typedef typename Corrector::adjustable_type Adjustable;
96 
97  // "level" is an unsigned
98  const unsigned level(ps.getParameter<unsigned>("level"));
99 
100  // "applyTo" is a string
101  const std::string& applyTo(ps.getParameter<std::string>("applyTo"));
102 
103  // "adjuster" is a PSet
104  const edm::ParameterSet& adjuster = ps.getParameter<edm::ParameterSet>("adjuster");
105  boost::shared_ptr<const AbsFFTJetAdjuster<MyJet,Adjustable> > adj =
106  parseFFTJetAdjuster<MyJet,Adjustable>(adjuster, verbose);
107 
108  // "scalers" is a VPSet
109  const std::vector<edm::ParameterSet>& scalers =
110  ps.getParameter<std::vector<edm::ParameterSet> >("scalers");
111  const unsigned nScalers = scalers.size();
112  std::vector<boost::shared_ptr<const AbsFFTJetScaleCalculator<MyJet,Adjustable> > > sVec;
113  sVec.reserve(nScalers);
114  for (unsigned i=0; i<nScalers; ++i)
115  {
116  boost::shared_ptr<AbsFFTJetScaleCalculator<MyJet,Adjustable> > s =
117  parseFFTJetScaleCalculator<MyJet,Adjustable>(scalers[i], ar, verbose);
118  sVec.push_back(s);
119  }
120  return Corrector(adj, sVec, level, parseFFTJetCorrectorApp(applyTo));
121 }
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
bool verbose
FFTJetCorrectorApp parseFFTJetCorrectorApp(const std::string &config)
tuple level
Definition: testEve_cfg.py:34
template<class Jet , class Adjustable >
boost::shared_ptr<AbsFFTJetScaleCalculator<Jet, Adjustable> > parseFFTJetScaleCalculator ( const edm::ParameterSet ps,
gs::StringArchive &  ar,
const bool  verbose 
)

Definition at line 43 of file FFTJetESParameterParser.h.

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

46 {
47  typedef boost::shared_ptr<AbsFFTJetScaleCalculator<Jet,Adjustable> > Result;
48 
49  std::string mapper_type(ps.getParameter<std::string>("Class"));
50 
51  // Initially, check for mappers which do not need to load
52  // a data table from the archive
53 // if (!mapper_type.compare("SomeClass"))
54 // {
55 // Do something ....
56 // return Result(...);
57 // }
58 
59  // Load the table from the archive
60  CPP11_auto_ptr<npstat::StorableMultivariateFunctor> autof =
62  CPP11_shared_ptr<npstat::StorableMultivariateFunctor> f(autof.release());
63 
64  // Swap the class name if it is supposed to be determined
65  // from the table description
66  if (!mapper_type.compare("auto"))
67  mapper_type = f->description();
68 
69  if (!mapper_type.compare("FFTEtaLogPtConeRadiusMapper"))
71 
72  else if (!mapper_type.compare("FFTSpecificScaleCalculator"))
73  {
74  const edm::ParameterSet& subclass =
75  ps.getParameter<edm::ParameterSet>("Subclass");
77  subclass, f->description());
78  return Result(new FFTSpecificScaleCalculator<Jet,Adjustable>(f, p));
79  }
80 
81  else
82  throw cms::Exception("FFTJetBadConfig")
83  << "In parseFFTJetScaleCalculator: unknown mapper type \""
84  << mapper_type << '"' << std::endl;
85 }
T getParameter(std::string const &) const
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)