CMS 3D CMS Logo

Namespaces | Functions
parseHBHEPhase1AlgoDescription.h File Reference
#include <memory>
#include "RecoLocalCalo/HcalRecAlgos/interface/AbsHBHEPhase1Algo.h"

Go to the source code of this file.

Namespaces

 edm
 HLT enums.
 

Functions

std::unique_ptr< AbsHBHEPhase1AlgoparseHBHEPhase1AlgoDescription (const edm::ParameterSet &ps)
 

Function Documentation

std::unique_ptr<AbsHBHEPhase1Algo> parseHBHEPhase1AlgoDescription ( const edm::ParameterSet ps)

Definition at line 98 of file parseHBHEPhase1AlgoDescription.cc.

References patPFMETCorrections_cff::algo, className(), Exception, edm::ParameterSet::getParameter(), eostools::move(), parseHBHEMahiDescription(), parseHBHEMethod2Description(), parseHBHEMethod3Description(), and AlCaHLTBitMon_QueryRunRegistry::string.

99 {
100  std::unique_ptr<AbsHBHEPhase1Algo> algo;
101 
102  const std::string& className = ps.getParameter<std::string>("Class");
103 
104  if (className == "SimpleHBHEPhase1Algo")
105  {
106  std::unique_ptr<MahiFit> mahi;
107  std::unique_ptr<PulseShapeFitOOTPileupCorrection> m2;
108  std::unique_ptr<HcalDeterministicFit> detFit;
109 
110  // only run Mahi OR Method 2 but not both
111  if (ps.getParameter<bool>("useMahi") && ps.getParameter<bool>("useM2")) {
112  throw cms::Exception("ConfigurationError") <<
113  "SimpleHBHEPhase1Algo does not allow both Mahi and Method 2 to be turned on together.";
114  }
115  if (ps.getParameter<bool>("useMahi"))
116  mahi = parseHBHEMahiDescription(ps);
117  if (ps.getParameter<bool>("useM2"))
119  if (ps.getParameter<bool>("useM3"))
120  detFit = parseHBHEMethod3Description(ps);
121 
122  algo = std::unique_ptr<AbsHBHEPhase1Algo>(
123  new SimpleHBHEPhase1Algo(ps.getParameter<int> ("firstSampleShift"),
124  ps.getParameter<int> ("samplesToAdd"),
125  ps.getParameter<double>("correctionPhaseNS"),
126  ps.getParameter<double>("tdcTimeShift"),
127  ps.getParameter<bool> ("correctForPhaseContainment"),
128  std::move(m2), std::move(detFit), std::move(mahi))
129  );
130  }
131 
132  return algo;
133 }
T getParameter(std::string const &) const
static std::unique_ptr< PulseShapeFitOOTPileupCorrection > parseHBHEMethod2Description(const edm::ParameterSet &conf)
static std::unique_ptr< MahiFit > parseHBHEMahiDescription(const edm::ParameterSet &conf)
static std::unique_ptr< HcalDeterministicFit > parseHBHEMethod3Description(const edm::ParameterSet &conf)
def move(src, dest)
Definition: eostools.py:510
std::string className(const T &t)
Definition: ClassName.h:30