Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:58:06

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