CMS 3D CMS Logo

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 iDCConstraint = conf.getParameter<bool> ("applyDCConstraint");
18  const bool iTimeConstraint = conf.getParameter<bool> ("applyTimeConstraint");
19  const bool iAddPulseJitter = conf.getParameter<bool> ("applyPulseJitter");
20  const bool iApplyTimeSlew = conf.getParameter<bool> ("applyTimeSlew");
21  const double iTS4Min = conf.getParameter<double>("ts4Min");
22  const std::vector<double> iTS4Max = conf.getParameter<std::vector<double>>("ts4Max");
23  const double iPulseJitter = conf.getParameter<double>("pulseJitter");
24  const double iTimeMean = conf.getParameter<double>("meanTime");
25  const double iTimeSigHPD = conf.getParameter<double>("timeSigmaHPD");
26  const double iTimeSigSiPM = conf.getParameter<double>("timeSigmaSiPM");
27  const double iPedMean = conf.getParameter<double>("meanPed");
28  const double iPedSigHPD = conf.getParameter<double>("pedSigmaHPD");
29  const double iPedSigSiPM = conf.getParameter<double>("pedSigmaSiPM");
30  const double iNoiseHPD = conf.getParameter<double>("noiseHPD");
31  const double iNoiseSiPM = conf.getParameter<double>("noiseSiPM");
32  const double iTMin = conf.getParameter<double>("timeMin");
33  const double iTMax = conf.getParameter<double>("timeMax");
34  const std::vector<double> its4Chi2 = conf.getParameter<std::vector<double>>("ts4chi2");
35  const int iFitTimes = conf.getParameter<int> ("fitTimes");
36 
37  if (iPedestalConstraint) assert(iPedSigHPD);
38  if (iPedestalConstraint) assert(iPedSigSiPM);
39  if (iTimeConstraint) assert(iTimeSigHPD);
40  if (iTimeConstraint) assert(iTimeSigSiPM);
41 
42  std::unique_ptr<PulseShapeFitOOTPileupCorrection> corr =
43  std::make_unique<PulseShapeFitOOTPileupCorrection>();
44 
45  corr->setPUParams(iPedestalConstraint, iTimeConstraint, iAddPulseJitter,
46  iApplyTimeSlew, iTS4Min, iTS4Max,
47  iPulseJitter,
48  iTimeMean, iTimeSigHPD, iTimeSigSiPM,
49  iPedMean, iPedSigHPD, iPedSigSiPM,
50  iNoiseHPD, iNoiseSiPM,
51  iTMin, iTMax, its4Chi2,
52  HcalTimeSlew::Medium, iFitTimes, iDCConstraint);
53 
54  return corr;
55 }
56 
57 
58 static std::unique_ptr<HcalDeterministicFit>
60 {
61  const bool iApplyTimeSlew = conf.getParameter<bool> ("applyTimeSlewM3");
62  const float iPedSubThreshold = conf.getParameter<double>("pedestalUpperLimit");
63  const int iTimeSlewParsType = conf.getParameter<int> ("timeSlewParsType");
64  const double irespCorrM3 = conf.getParameter<double>("respCorrM3");
65  const std::vector<double>& iTimeSlewPars =
66  conf.getParameter<std::vector<double> >("timeSlewPars");
67 
68  PedestalSub pedSubFxn;
69  pedSubFxn.init(0, iPedSubThreshold, 0.0);
70 
71  std::unique_ptr<HcalDeterministicFit> fit = std::make_unique<HcalDeterministicFit>();
72  fit->init( (HcalTimeSlew::ParaSource)iTimeSlewParsType,
73  HcalTimeSlew::Medium, iApplyTimeSlew,
74  pedSubFxn, iTimeSlewPars, irespCorrM3);
75  return fit;
76 }
77 
78 
79 std::unique_ptr<AbsHBHEPhase1Algo>
81 {
82  std::unique_ptr<AbsHBHEPhase1Algo> algo;
83 
84  const std::string& className = ps.getParameter<std::string>("Class");
85 
86  if (className == "SimpleHBHEPhase1Algo")
87  {
88  std::unique_ptr<PulseShapeFitOOTPileupCorrection> m2;
89  if (ps.getParameter<bool>("useM2"))
91 
92  std::unique_ptr<HcalDeterministicFit> detFit;
93  if (ps.getParameter<bool>("useM3"))
94  detFit = parseHBHEMethod3Description(ps);
95 
96  algo = std::unique_ptr<AbsHBHEPhase1Algo>(
97  new SimpleHBHEPhase1Algo(ps.getParameter<int> ("firstSampleShift"),
98  ps.getParameter<int> ("samplesToAdd"),
99  ps.getParameter<double>("correctionPhaseNS"),
100  ps.getParameter<double>("tdcTimeShift"),
101  ps.getParameter<bool> ("correctForPhaseContainment"),
102  std::move(m2), std::move(detFit))
103  );
104  }
105 
106  return algo;
107 }
T getParameter(std::string const &) const
std::unique_ptr< AbsHBHEPhase1Algo > parseHBHEPhase1AlgoDescription(const edm::ParameterSet &ps)
static std::unique_ptr< PulseShapeFitOOTPileupCorrection > parseHBHEMethod2Description(const edm::ParameterSet &conf)
void init(int runCond, float threshold, float quantile)
Definition: PedestalSub.cc:14
JetCorrectorParameters corr
Definition: classes.h:5
static std::unique_ptr< HcalDeterministicFit > parseHBHEMethod3Description(const edm::ParameterSet &conf)
def move(src, dest)
Definition: eostools.py:510
std::string className(const T &t)
Definition: ClassName.h:30