CMS 3D CMS Logo

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

Go to the source code of this file.

Namespaces

 edm
 HLT enums.
 

Functions

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

Function Documentation

edm::ParameterSetDescription fillDescriptionForParseHBHEPhase1Algo ( )

Definition at line 138 of file parseHBHEPhase1AlgoDescription.cc.

References edm::ParameterSetDescription::add(), edm::ParameterSetDescription::setAllowAnything(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by HBHEPhase1Reconstructor::fillDescriptions().

139 {
141 
142  desc.setAllowAnything();
143  desc.add<std::string>("Class", "SimpleHBHEPhase1Algo");
144  desc.add<bool>("useM2", false);
145  desc.add<bool>("useM3", true);
146  desc.add<bool>("useMahi", true);
147  desc.add<int>("firstSampleShift", 0);
148  desc.add<int>("samplesToAdd", 2);
149  desc.add<double>("correctionPhaseNS", 6.0);
150  desc.add<double>("tdcTimeShift", 0.0);
151  desc.add<bool>("correctForPhaseContainment", true);
152  desc.add<bool>("applyLegacyHBMCorrection", true);
153  desc.add<bool>("calculateArrivalTime", true);
154 
155  return desc;
156 }
void setAllowAnything()
allow any parameter label/value pairs
ParameterDescriptionBase * add(U const &iLabel, T const &value)
std::unique_ptr<AbsHBHEPhase1Algo> parseHBHEPhase1AlgoDescription ( const edm::ParameterSet ps)

Definition at line 99 of file parseHBHEPhase1AlgoDescription.cc.

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

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