test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
parseHBHEPhase1AlgoDescription.cc
Go to the documentation of this file.
1 #include <cassert>
2 
5 
8 
9 // Phase 1 HBHE reco algorithm headers
11 
12 
13 static std::unique_ptr<PulseShapeFitOOTPileupCorrection>
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 }
55 
56 
57 static std::unique_ptr<HcalDeterministicFit>
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 }
76 
77 
78 std::unique_ptr<AbsHBHEPhase1Algo>
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
assert(m_qm.get())
static std::unique_ptr< PulseShapeFitOOTPileupCorrection > parseHBHEMethod2Description(const edm::ParameterSet &conf)
void init(int runCond, float threshold, float quantile)
Definition: PedestalSub.cc:14
def move
Definition: eostools.py:510
std::unique_ptr< AbsHBHEPhase1Algo > parseHBHEPhase1AlgoDescription(const edm::ParameterSet &ps)
JetCorrectorParameters corr
Definition: classes.h:5
static std::unique_ptr< HcalDeterministicFit > parseHBHEMethod3Description(const edm::ParameterSet &conf)
std::string className(const T &t)
Definition: ClassName.h:30