test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
parseHBHEPhase1AlgoDescription.cc File Reference
#include <cassert>
#include "RecoLocalCalo/HcalRecAlgos/interface/parseHBHEPhase1AlgoDescription.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "RecoLocalCalo/HcalRecAlgos/interface/PulseShapeFitOOTPileupCorrection.h"
#include "RecoLocalCalo/HcalRecAlgos/interface/HcalDeterministicFit.h"
#include "RecoLocalCalo/HcalRecAlgos/interface/SimpleHBHEPhase1Algo.h"

Go to the source code of this file.

Functions

static std::unique_ptr
< PulseShapeFitOOTPileupCorrection
parseHBHEMethod2Description (const edm::ParameterSet &conf)
 
static std::unique_ptr
< HcalDeterministicFit
parseHBHEMethod3Description (const edm::ParameterSet &conf)
 
std::unique_ptr
< AbsHBHEPhase1Algo
parseHBHEPhase1AlgoDescription (const edm::ParameterSet &ps)
 

Function Documentation

static std::unique_ptr<PulseShapeFitOOTPileupCorrection> parseHBHEMethod2Description ( const edm::ParameterSet conf)
static

Definition at line 14 of file parseHBHEPhase1AlgoDescription.cc.

References assert(), corr, edm::ParameterSet::getParameter(), and HcalTimeSlew::Medium.

Referenced by parseHBHEPhase1AlgoDescription().

15 {
16  const bool iPedestalConstraint = conf.getParameter<bool> ("applyPedConstraint");
17  const bool iTimeConstraint = conf.getParameter<bool> ("applyTimeConstraint");
18  const bool iAddPulseJitter = conf.getParameter<bool> ("applyPulseJitter");
19  const bool iApplyTimeSlew = conf.getParameter<bool> ("applyTimeSlew");
20  const double iTS4Min = conf.getParameter<double>("ts4Min");
21  const std::vector<double> iTS4Max = conf.getParameter<std::vector<double>>("ts4Max");
22  const double iPulseJitter = conf.getParameter<double>("pulseJitter");
23  const double iTimeMean = conf.getParameter<double>("meanTime");
24  const double iTimeSigHPD = conf.getParameter<double>("timeSigmaHPD");
25  const double iTimeSigSiPM = conf.getParameter<double>("timeSigmaSiPM");
26  const double iPedMean = conf.getParameter<double>("meanPed");
27  const double iPedSigHPD = conf.getParameter<double>("pedSigmaHPD");
28  const double iPedSigSiPM = conf.getParameter<double>("pedSigmaSiPM");
29  const double iNoiseHPD = conf.getParameter<double>("noiseHPD");
30  const double iNoiseSiPM = conf.getParameter<double>("noiseSiPM");
31  const double iTMin = conf.getParameter<double>("timeMin");
32  const double iTMax = conf.getParameter<double>("timeMax");
33  const std::vector<double> its4Chi2 = conf.getParameter<std::vector<double>>("ts4chi2");
34  const int iFitTimes = conf.getParameter<int> ("fitTimes");
35 
36  if (iPedestalConstraint) assert(iPedSigHPD);
37  if (iPedestalConstraint) assert(iPedSigSiPM);
38  if (iTimeConstraint) assert(iTimeSigHPD);
39  if (iTimeConstraint) assert(iTimeSigSiPM);
40 
41  std::unique_ptr<PulseShapeFitOOTPileupCorrection> corr =
42  std::make_unique<PulseShapeFitOOTPileupCorrection>();
43 
44  corr->setPUParams(iPedestalConstraint, iTimeConstraint, iAddPulseJitter,
45  iApplyTimeSlew, iTS4Min, iTS4Max,
46  iPulseJitter,
47  iTimeMean, iTimeSigHPD, iTimeSigSiPM,
48  iPedMean, iPedSigHPD, iPedSigSiPM,
49  iNoiseHPD, iNoiseSiPM,
50  iTMin, iTMax, its4Chi2,
51  HcalTimeSlew::Medium, iFitTimes);
52 
53  return corr;
54 }
T getParameter(std::string const &) const
assert(m_qm.get())
JetCorrectorParameters corr
Definition: classes.h:5
static std::unique_ptr<HcalDeterministicFit> parseHBHEMethod3Description ( const edm::ParameterSet conf)
static

Definition at line 58 of file parseHBHEPhase1AlgoDescription.cc.

References edm::ParameterSet::getParameter(), PedestalSub::init(), and HcalTimeSlew::Medium.

Referenced by parseHBHEPhase1AlgoDescription().

59 {
60  const bool iApplyTimeSlew = conf.getParameter<bool> ("applyTimeSlewM3");
61  const float iPedSubThreshold = conf.getParameter<double>("pedestalUpperLimit");
62  const int iTimeSlewParsType = conf.getParameter<int> ("timeSlewParsType");
63  const double irespCorrM3 = conf.getParameter<double>("respCorrM3");
64  const std::vector<double>& iTimeSlewPars =
65  conf.getParameter<std::vector<double> >("timeSlewPars");
66 
67  PedestalSub pedSubFxn;
68  pedSubFxn.init(0, iPedSubThreshold, 0.0);
69 
70  std::unique_ptr<HcalDeterministicFit> fit = std::make_unique<HcalDeterministicFit>();
71  fit->init( (HcalTimeSlew::ParaSource)iTimeSlewParsType,
72  HcalTimeSlew::Medium, iApplyTimeSlew,
73  pedSubFxn, iTimeSlewPars, irespCorrM3);
74  return fit;
75 }
T getParameter(std::string const &) const
void init(int runCond, float threshold, float quantile)
Definition: PedestalSub.cc:14
std::unique_ptr<AbsHBHEPhase1Algo> parseHBHEPhase1AlgoDescription ( const edm::ParameterSet ps)

Definition at line 79 of file parseHBHEPhase1AlgoDescription.cc.

References ecalcalib_dqm_sourceclient-live_cfg::algo, className(), edm::ParameterSet::getParameter(), eostools::move(), parseHBHEMethod2Description(), parseHBHEMethod3Description(), and AlCaHLTBitMon_QueryRunRegistry::string.

80 {
81  std::unique_ptr<AbsHBHEPhase1Algo> algo;
82 
83  const std::string& className = ps.getParameter<std::string>("Class");
84 
85  if (className == "SimpleHBHEPhase1Algo")
86  {
87  std::unique_ptr<PulseShapeFitOOTPileupCorrection> m2;
88  if (ps.getParameter<bool>("useM2"))
90 
91  std::unique_ptr<HcalDeterministicFit> detFit;
92  if (ps.getParameter<bool>("useM3"))
93  detFit = parseHBHEMethod3Description(ps);
94 
95  algo = std::unique_ptr<AbsHBHEPhase1Algo>(
96  new SimpleHBHEPhase1Algo(ps.getParameter<int> ("firstSampleShift"),
97  ps.getParameter<int> ("samplesToAdd"),
98  ps.getParameter<double>("correctionPhaseNS"),
99  ps.getParameter<double>("tdcTimeShift"),
100  ps.getParameter<bool> ("correctForPhaseContainment"),
101  std::move(m2), std::move(detFit))
102  );
103  }
104 
105  return algo;
106 }
T getParameter(std::string const &) const
static std::unique_ptr< PulseShapeFitOOTPileupCorrection > parseHBHEMethod2Description(const edm::ParameterSet &conf)
def move
Definition: eostools.py:510
static std::unique_ptr< HcalDeterministicFit > parseHBHEMethod3Description(const edm::ParameterSet &conf)
std::string className(const T &t)
Definition: ClassName.h:30