CMS 3D CMS Logo

Functions
parseHBHEPhase1AlgoDescription.cc File Reference
#include <cassert>
#include "RecoLocalCalo/HcalRecAlgos/interface/parseHBHEPhase1AlgoDescription.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/MessageLogger/interface/MessageLogger.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< MahiFitparseHBHEMahiDescription (const edm::ParameterSet &conf)
 
static std::unique_ptr< PulseShapeFitOOTPileupCorrectionparseHBHEMethod2Description (const edm::ParameterSet &conf)
 
static std::unique_ptr< HcalDeterministicFitparseHBHEMethod3Description (const edm::ParameterSet &conf)
 
std::unique_ptr< AbsHBHEPhase1AlgoparseHBHEPhase1AlgoDescription (const edm::ParameterSet &ps)
 

Function Documentation

static std::unique_ptr<MahiFit> parseHBHEMahiDescription ( const edm::ParameterSet conf)
static

Definition at line 14 of file parseHBHEPhase1AlgoDescription.cc.

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

Referenced by parseHBHEPhase1AlgoDescription().

15 {
16 
17  const bool iDynamicPed = conf.getParameter<bool> ("dynamicPed");
18  const double iTS4Thresh = conf.getParameter<double> ("ts4Thresh");
19  const double chiSqSwitch = conf.getParameter<double> ("chiSqSwitch");
20 
21  const bool iApplyTimeSlew = conf.getParameter<bool> ("applyTimeSlew");
22 
23  const double iMeanTime = conf.getParameter<double> ("meanTime");
24  const double iTimeSigmaHPD = conf.getParameter<double> ("timeSigmaHPD");
25  const double iTimeSigmaSiPM = conf.getParameter<double> ("timeSigmaSiPM");
26 
27  const std::vector<int> iActiveBXs = conf.getParameter<std::vector<int>> ("activeBXs");
28  const int iNMaxItersMin = conf.getParameter<int> ("nMaxItersMin");
29  const int iNMaxItersNNLS = conf.getParameter<int> ("nMaxItersNNLS");
30  const double iDeltaChiSqThresh = conf.getParameter<double> ("deltaChiSqThresh");
31  const double iNnlsThresh = conf.getParameter<double> ("nnlsThresh");
32 
33  std::unique_ptr<MahiFit> corr = std::make_unique<MahiFit>();
34 
35  corr->setParameters(iDynamicPed, iTS4Thresh, chiSqSwitch, iApplyTimeSlew, HcalTimeSlew::Medium,
36  iMeanTime, iTimeSigmaHPD, iTimeSigmaSiPM,
37  iActiveBXs, iNMaxItersMin, iNMaxItersNNLS,
38  iDeltaChiSqThresh, iNnlsThresh);
39 
40  return corr;
41 }
T getParameter(std::string const &) const
JetCorrectorParameters corr
Definition: classes.h:5
static std::unique_ptr<PulseShapeFitOOTPileupCorrection> parseHBHEMethod2Description ( const edm::ParameterSet conf)
static

Definition at line 45 of file parseHBHEPhase1AlgoDescription.cc.

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

Referenced by parseHBHEPhase1AlgoDescription().

46 {
47  const bool iPedestalConstraint = conf.getParameter<bool> ("applyPedConstraint");
48  const bool iTimeConstraint = conf.getParameter<bool> ("applyTimeConstraint");
49  const bool iAddPulseJitter = conf.getParameter<bool> ("applyPulseJitter");
50  const bool iApplyTimeSlew = conf.getParameter<bool> ("applyTimeSlew");
51  const double iTS4Min = conf.getParameter<double>("ts4Min");
52  const std::vector<double> iTS4Max = conf.getParameter<std::vector<double>>("ts4Max");
53  const double iPulseJitter = conf.getParameter<double>("pulseJitter");
54  const double iTimeMean = conf.getParameter<double>("meanTime");
55  const double iTimeSigHPD = conf.getParameter<double>("timeSigmaHPD");
56  const double iTimeSigSiPM = conf.getParameter<double>("timeSigmaSiPM");
57  const double iPedMean = conf.getParameter<double>("meanPed");
58  const double iTMin = conf.getParameter<double>("timeMin");
59  const double iTMax = conf.getParameter<double>("timeMax");
60  const std::vector<double> its4Chi2 = conf.getParameter<std::vector<double>>("ts4chi2");
61  const int iFitTimes = conf.getParameter<int> ("fitTimes");
62 
63  if (iTimeConstraint) assert(iTimeSigHPD);
64  if (iTimeConstraint) assert(iTimeSigSiPM);
65 
66  std::unique_ptr<PulseShapeFitOOTPileupCorrection> corr =
67  std::make_unique<PulseShapeFitOOTPileupCorrection>();
68 
69  corr->setPUParams(iPedestalConstraint, iTimeConstraint, iAddPulseJitter,
70  iApplyTimeSlew, iTS4Min, iTS4Max,
71  iPulseJitter,
72  iTimeMean,iTimeSigHPD, iTimeSigSiPM, iPedMean,
73  iTMin, iTMax, its4Chi2,
74  HcalTimeSlew::Medium, iFitTimes);
75 
76  return corr;
77 }
T getParameter(std::string const &) const
JetCorrectorParameters corr
Definition: classes.h:5
static std::unique_ptr<HcalDeterministicFit> parseHBHEMethod3Description ( const edm::ParameterSet conf)
static

Definition at line 81 of file parseHBHEPhase1AlgoDescription.cc.

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

Referenced by parseHBHEPhase1AlgoDescription().

82 {
83  const bool iApplyTimeSlew = conf.getParameter<bool> ("applyTimeSlewM3");
84  const float iPedSubThreshold = conf.getParameter<double>("pedestalUpperLimit");
85  const int iTimeSlewParsType = conf.getParameter<int> ("timeSlewParsType");
86  const double irespCorrM3 = conf.getParameter<double>("respCorrM3");
87 
88  PedestalSub pedSubFxn;
89  pedSubFxn.init(0, iPedSubThreshold, 0.0);
90 
91  std::unique_ptr<HcalDeterministicFit> fit = std::make_unique<HcalDeterministicFit>();
92  fit->init( (HcalTimeSlew::ParaSource)iTimeSlewParsType,
93  HcalTimeSlew::Medium, iApplyTimeSlew,
94  pedSubFxn, irespCorrM3);
95  return fit;
96 }
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 100 of file parseHBHEPhase1AlgoDescription.cc.

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

101 {
102  std::unique_ptr<AbsHBHEPhase1Algo> algo;
103 
104  const std::string& className = ps.getParameter<std::string>("Class");
105 
106  if (className == "SimpleHBHEPhase1Algo")
107  {
108  std::unique_ptr<MahiFit> mahi;
109  std::unique_ptr<PulseShapeFitOOTPileupCorrection> m2;
110  std::unique_ptr<HcalDeterministicFit> detFit;
111 
112  // only run Mahi OR Method 2 but not both
113  if (ps.getParameter<bool>("useMahi") && ps.getParameter<bool>("useM2")) {
114  throw cms::Exception("ConfigurationError") <<
115  "SimpleHBHEPhase1Algo does not allow both Mahi and Method 2 to be turned on together.";
116  }
117  if (ps.getParameter<bool>("useMahi"))
118  mahi = parseHBHEMahiDescription(ps);
119  if (ps.getParameter<bool>("useM2"))
121  if (ps.getParameter<bool>("useM3"))
122  detFit = parseHBHEMethod3Description(ps);
123 
124  algo = std::unique_ptr<AbsHBHEPhase1Algo>(
125  new SimpleHBHEPhase1Algo(ps.getParameter<int> ("firstSampleShift"),
126  ps.getParameter<int> ("samplesToAdd"),
127  ps.getParameter<double>("correctionPhaseNS"),
128  ps.getParameter<double>("tdcTimeShift"),
129  ps.getParameter<bool> ("correctForPhaseContainment"),
130  std::move(m2), std::move(detFit), std::move(mahi))
131  );
132  }
133 
134  return algo;
135 }
T getParameter(std::string const &) const
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:510
std::string className(const T &t)
Definition: ClassName.h:30