CMS 3D CMS Logo

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< AbsHBHEPhase1AlgoparseHBHEPhase1AlgoDescription (const edm::ParameterSet &ps, edm::ConsumesCollector iC)
 

Function Documentation

◆ fillDescriptionForParseHBHEPhase1Algo()

edm::ParameterSetDescription fillDescriptionForParseHBHEPhase1Algo ( )

Definition at line 151 of file parseHBHEPhase1AlgoDescription.cc.

References submitPVResolutionJobs::desc, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by HBHEPhase1Reconstructor::fillDescriptions().

151  {
153 
154  desc.setAllowAnything();
155  desc.add<std::string>("Class", "SimpleHBHEPhase1Algo");
156  desc.add<bool>("useM2", false);
157  desc.add<bool>("useM3", true);
158  desc.add<bool>("useMahi", true);
159  desc.add<int>("firstSampleShift", 0);
160  desc.add<int>("samplesToAdd", 2);
161  desc.add<double>("correctionPhaseNS", 6.0);
162  desc.add<double>("tdcTimeShift", 0.0);
163  desc.add<bool>("correctForPhaseContainment", true);
164  desc.add<bool>("applyLegacyHBMCorrection", true);
165  desc.add<bool>("calculateArrivalTime", false);
166  desc.add<int>("timeAlgo", 1);
167  desc.add<double>("thEnergeticPulses", 5.);
168  desc.add<bool>("applyFixPCC", false);
169 
170  return desc;
171 }

◆ parseHBHEPhase1AlgoDescription()

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

Definition at line 112 of file parseHBHEPhase1AlgoDescription.cc.

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

113  {
114  std::unique_ptr<AbsHBHEPhase1Algo> algo;
115 
116  const std::string& className = ps.getParameter<std::string>("Class");
117 
118  if (className == "SimpleHBHEPhase1Algo") {
119  std::unique_ptr<MahiFit> mahi;
120  std::unique_ptr<PulseShapeFitOOTPileupCorrection> m2;
121  std::unique_ptr<HcalDeterministicFit> detFit;
122 
123  // only run Mahi OR Method 2 but not both
124  if (ps.getParameter<bool>("useMahi") && ps.getParameter<bool>("useM2")) {
125  throw cms::Exception("ConfigurationError")
126  << "SimpleHBHEPhase1Algo does not allow both Mahi and Method 2 to be turned on together.";
127  }
128  if (ps.getParameter<bool>("useMahi"))
129  mahi = parseHBHEMahiDescription(ps);
130  if (ps.getParameter<bool>("useM2"))
132  if (ps.getParameter<bool>("useM3"))
133  detFit = parseHBHEMethod3Description(ps);
134 
135  algo = std::make_unique<SimpleHBHEPhase1Algo>(ps.getParameter<int>("firstSampleShift"),
136  ps.getParameter<int>("samplesToAdd"),
137  ps.getParameter<double>("correctionPhaseNS"),
138  ps.getParameter<double>("tdcTimeShift"),
139  ps.getParameter<bool>("correctForPhaseContainment"),
140  ps.getParameter<bool>("applyLegacyHBMCorrection"),
141  ps.getParameter<bool>("applyFixPCC"),
142  std::move(m2),
143  std::move(detFit),
144  std::move(mahi),
145  iC);
146  }
147 
148  return algo;
149 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
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:31