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

◆ fillDescriptionForParseHBHEPhase1Algo()

edm::ParameterSetDescription fillDescriptionForParseHBHEPhase1Algo ( )

Definition at line 144 of file parseHBHEPhase1AlgoDescription.cc.

144  {
146 
147  desc.setAllowAnything();
148  desc.add<std::string>("Class", "SimpleHBHEPhase1Algo");
149  desc.add<bool>("useM2", false);
150  desc.add<bool>("useM3", true);
151  desc.add<bool>("useMahi", true);
152  desc.add<int>("firstSampleShift", 0);
153  desc.add<int>("samplesToAdd", 2);
154  desc.add<double>("correctionPhaseNS", 6.0);
155  desc.add<double>("tdcTimeShift", 0.0);
156  desc.add<bool>("correctForPhaseContainment", true);
157  desc.add<bool>("applyLegacyHBMCorrection", true);
158  desc.add<bool>("calculateArrivalTime", false);
159 
160  return desc;
161 }

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

Referenced by HBHEPhase1Reconstructor::fillDescriptions().

◆ parseHBHEPhase1AlgoDescription()

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

Definition at line 107 of file parseHBHEPhase1AlgoDescription.cc.

107  {
108  std::unique_ptr<AbsHBHEPhase1Algo> algo;
109 
110  const std::string& className = ps.getParameter<std::string>("Class");
111 
112  if (className == "SimpleHBHEPhase1Algo") {
113  std::unique_ptr<MahiFit> mahi;
114  std::unique_ptr<PulseShapeFitOOTPileupCorrection> m2;
115  std::unique_ptr<HcalDeterministicFit> detFit;
116 
117  // only run Mahi OR Method 2 but not both
118  if (ps.getParameter<bool>("useMahi") && ps.getParameter<bool>("useM2")) {
119  throw cms::Exception("ConfigurationError")
120  << "SimpleHBHEPhase1Algo does not allow both Mahi and Method 2 to be turned on together.";
121  }
122  if (ps.getParameter<bool>("useMahi"))
123  mahi = parseHBHEMahiDescription(ps);
124  if (ps.getParameter<bool>("useM2"))
126  if (ps.getParameter<bool>("useM3"))
127  detFit = parseHBHEMethod3Description(ps);
128 
129  algo =
130  std::unique_ptr<AbsHBHEPhase1Algo>(new SimpleHBHEPhase1Algo(ps.getParameter<int>("firstSampleShift"),
131  ps.getParameter<int>("samplesToAdd"),
132  ps.getParameter<double>("correctionPhaseNS"),
133  ps.getParameter<double>("tdcTimeShift"),
134  ps.getParameter<bool>("correctForPhaseContainment"),
135  ps.getParameter<bool>("applyLegacyHBMCorrection"),
136  std::move(m2),
137  std::move(detFit),
138  std::move(mahi)));
139  }
140 
141  return algo;
142 }

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

parseHBHEMethod3Description
static std::unique_ptr< HcalDeterministicFit > parseHBHEMethod3Description(const edm::ParameterSet &conf)
Definition: parseHBHEPhase1AlgoDescription.cc:95
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
cmsdt::algo
algo
Definition: constants.h:164
SimpleHBHEPhase1Algo
Definition: SimpleHBHEPhase1Algo.h:18
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
parseHBHEMethod2Description
static std::unique_ptr< PulseShapeFitOOTPileupCorrection > parseHBHEMethod2Description(const edm::ParameterSet &conf)
Definition: parseHBHEPhase1AlgoDescription.cc:51
edm::ParameterSetDescription::setAllowAnything
void setAllowAnything()
allow any parameter label/value pairs
Definition: ParameterSetDescription.cc:37
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
eostools.move
def move(src, dest)
Definition: eostools.py:511
parseHBHEMahiDescription
static std::unique_ptr< MahiFit > parseHBHEMahiDescription(const edm::ParameterSet &conf)
Definition: parseHBHEPhase1AlgoDescription.cc:13
Exception
Definition: hltDiff.cc:246
className
std::string className(const T &t)
Definition: ClassName.h:31