Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:47:13

0001 #include "CalibCalorimetry/HcalAlgos/interface/HcalHardcodeParameters.h"
0002 
0003 HcalHardcodeParameters::HcalHardcodeParameters(double pedestal,
0004                                                double pedestalWidth,
0005                                                const std::vector<double>& gain,
0006                                                const std::vector<double>& gainWidth,
0007                                                int zsThreshold,
0008                                                int qieType,
0009                                                const std::vector<double>& qieOffset,
0010                                                const std::vector<double>& qieSlope,
0011                                                int mcShape,
0012                                                int recoShape,
0013                                                double photoelectronsToAnalog,
0014                                                const std::vector<double>& darkCurrent,
0015                                                const std::vector<double>& noiseCorrelation)
0016     : pedestal_(pedestal),
0017       pedestalWidth_(pedestalWidth),
0018       gain_(gain),
0019       gainWidth_(gainWidth),
0020       zsThreshold_(zsThreshold),
0021       qieType_(qieType),
0022       qieOffset_(qieOffset),
0023       qieSlope_(qieSlope),
0024       mcShape_(mcShape),
0025       recoShape_(recoShape),
0026       photoelectronsToAnalog_(photoelectronsToAnalog),
0027       darkCurrent_(darkCurrent),
0028       noiseCorrelation_(noiseCorrelation),
0029       doSipmRadiationDamage_(false) {}
0030 
0031 HcalHardcodeParameters::HcalHardcodeParameters(const edm::ParameterSet& p)
0032     : pedestal_(p.getParameter<double>("pedestal")),
0033       pedestalWidth_(p.getParameter<double>("pedestalWidth")),
0034       gain_(p.getParameter<std::vector<double>>("gain")),
0035       gainWidth_(p.getParameter<std::vector<double>>("gainWidth")),
0036       zsThreshold_(p.getParameter<int>("zsThreshold")),
0037       qieType_(p.getParameter<int>("qieType")),
0038       qieOffset_(p.getParameter<std::vector<double>>("qieOffset")),
0039       qieSlope_(p.getParameter<std::vector<double>>("qieSlope")),
0040       mcShape_(p.getParameter<int>("mcShape")),
0041       recoShape_(p.getParameter<int>("recoShape")),
0042       photoelectronsToAnalog_(p.getParameter<double>("photoelectronsToAnalog")),
0043       darkCurrent_(p.getParameter<std::vector<double>>("darkCurrent")),
0044       noiseCorrelation_(p.getParameter<std::vector<double>>("noiseCorrelation")),
0045       doSipmRadiationDamage_(p.getParameter<bool>("doRadiationDamage")) {
0046   if (doSipmRadiationDamage_)
0047     sipmRadiationDamage_ = HcalSiPMRadiationDamage(darkCurrent_, p.getParameter<edm::ParameterSet>("radiationDamage"));
0048 }
0049 
0050 const double HcalHardcodeParameters::darkCurrent(unsigned index, double intlumi) const {
0051   if (doSipmRadiationDamage_ and intlumi > 0)
0052     return sipmRadiationDamage_.getDarkCurrent(intlumi, index);
0053   return darkCurrent_.at(index);
0054 }
0055 
0056 const double HcalHardcodeParameters::noiseCorrelation(unsigned index) const { return noiseCorrelation_.at(index); }