CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Functions
parseHBHEPhase1AlgoDescription.h File Reference
#include <memory>
#include "RecoLocalCalo/HcalRecAlgos/interface/AbsHBHEPhase1Algo.h"
#include "FWCore/Framework/interface/FrameworkfwdMostUsed.h"
#include "FWCore/ParameterSet/interface/ParameterSetDescription.h"

Go to the source code of this file.

Functions

edm::ParameterSetDescription fillDescriptionForParseHBHEPhase1Algo ()
 
std::unique_ptr
< AbsHBHEPhase1Algo
parseHBHEPhase1AlgoDescription (const edm::ParameterSet &ps, edm::ConsumesCollector iC)
 

Function Documentation

edm::ParameterSetDescription fillDescriptionForParseHBHEPhase1Algo ( )

Definition at line 147 of file parseHBHEPhase1AlgoDescription.cc.

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

Referenced by HBHEPhase1Reconstructor::fillDescriptions().

147  {
149 
150  desc.setAllowAnything();
151  desc.add<std::string>("Class", "SimpleHBHEPhase1Algo");
152  desc.add<bool>("useM2", false);
153  desc.add<bool>("useM3", true);
154  desc.add<bool>("useMahi", true);
155  desc.add<int>("firstSampleShift", 0);
156  desc.add<int>("samplesToAdd", 2);
157  desc.add<double>("correctionPhaseNS", 6.0);
158  desc.add<double>("tdcTimeShift", 0.0);
159  desc.add<bool>("correctForPhaseContainment", true);
160  desc.add<bool>("applyLegacyHBMCorrection", true);
161  desc.add<bool>("calculateArrivalTime", false);
162  desc.add<bool>("applyFixPCC", false);
163 
164  return desc;
165 }
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,
edm::ConsumesCollector  iC 
)

Definition at line 108 of file parseHBHEPhase1AlgoDescription.cc.

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

109  {
110  std::unique_ptr<AbsHBHEPhase1Algo> algo;
111 
112  const std::string& className = ps.getParameter<std::string>("Class");
113 
114  if (className == "SimpleHBHEPhase1Algo") {
115  std::unique_ptr<MahiFit> mahi;
116  std::unique_ptr<PulseShapeFitOOTPileupCorrection> m2;
117  std::unique_ptr<HcalDeterministicFit> detFit;
118 
119  // only run Mahi OR Method 2 but not both
120  if (ps.getParameter<bool>("useMahi") && ps.getParameter<bool>("useM2")) {
121  throw cms::Exception("ConfigurationError")
122  << "SimpleHBHEPhase1Algo does not allow both Mahi and Method 2 to be turned on together.";
123  }
124  if (ps.getParameter<bool>("useMahi"))
125  mahi = parseHBHEMahiDescription(ps);
126  if (ps.getParameter<bool>("useM2"))
128  if (ps.getParameter<bool>("useM3"))
129  detFit = parseHBHEMethod3Description(ps);
130 
131  algo = std::make_unique<SimpleHBHEPhase1Algo>(ps.getParameter<int>("firstSampleShift"),
132  ps.getParameter<int>("samplesToAdd"),
133  ps.getParameter<double>("correctionPhaseNS"),
134  ps.getParameter<double>("tdcTimeShift"),
135  ps.getParameter<bool>("correctForPhaseContainment"),
136  ps.getParameter<bool>("applyLegacyHBMCorrection"),
137  ps.getParameter<bool>("applyFixPCC"),
138  std::move(m2),
139  std::move(detFit),
140  std::move(mahi),
141  iC);
142  }
143 
144  return algo;
145 }
tuple m2
Definition: callgraph.py:57
static std::unique_ptr< PulseShapeFitOOTPileupCorrection > parseHBHEMethod2Description(const edm::ParameterSet &conf)
def move
Definition: eostools.py:511
static std::unique_ptr< MahiFit > parseHBHEMahiDescription(const edm::ParameterSet &conf)
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
static std::unique_ptr< HcalDeterministicFit > parseHBHEMethod3Description(const edm::ParameterSet &conf)
std::string className(const T &t)
Definition: ClassName.h:31