Skip to content

Commit

Permalink
Merge pull request #32856 from abdoulline/hardcode_condPhase2
Browse files Browse the repository at this point in the history
HCAL (HB):  propagate RECO updates from Run3 to Phase2
  • Loading branch information
cmsbuild committed Feb 11, 2021
2 parents d81422e + 49edf0a commit 82b006d
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 11 deletions.
Expand Up @@ -22,7 +22,8 @@ class HcalHardcodeParameters {
int mcShape,
int recoShape,
double photoelectronsToAnalog,
const std::vector<double>& darkCurrent);
const std::vector<double>& darkCurrent,
const std::vector<double>& noiseCorrelation);
//construct from pset
HcalHardcodeParameters(const edm::ParameterSet& p);

Expand All @@ -43,6 +44,7 @@ class HcalHardcodeParameters {
const int recoShape() const { return recoShape_; }
const double photoelectronsToAnalog() const { return photoelectronsToAnalog_; }
const double darkCurrent(unsigned index, double intlumi) const;
const double noiseCorrelation(unsigned index) const;

private:
//member variables
Expand All @@ -54,6 +56,7 @@ class HcalHardcodeParameters {
int mcShape_, recoShape_;
double photoelectronsToAnalog_;
std::vector<double> darkCurrent_;
std::vector<double> noiseCorrelation_;
bool doSipmRadiationDamage_;
HcalSiPMRadiationDamage sipmRadiationDamage_;
};
Expand Down
11 changes: 9 additions & 2 deletions CalibCalorimetry/HcalAlgos/src/HcalDbHardcode.cc
Expand Up @@ -28,7 +28,8 @@ HcalDbHardcode::HcalDbHardcode()
125, //MC shape
105, //Reco shape
0.0, //photoelectronsToAnalog
{0.0} //dark current
{0.0}, //dark current
{0.0} //noise correlation
),
setHB_(false),
setHE_(false),
Expand Down Expand Up @@ -644,21 +645,25 @@ HcalSiPMParameter HcalDbHardcode::makeHardcodeSiPMParameter(HcalGenericDetId fId
double intlumi) {
// SiPMParameter defined for each DetId the following quantities:
// SiPM type, PhotoElectronToAnalog, Dark Current, two auxiliary words
// (the second of those containing float noise correlation coefficient
// These numbers come from some measurements done with SiPMs
// rule for type: cells with >4 layers use larger device (3.3mm diameter), otherwise 2.8mm
HcalSiPMType theType = HcalNoSiPM;
double thePe2fC = getParameters(fId).photoelectronsToAnalog();
double theDC = getParameters(fId).darkCurrent(0, intlumi);
double theNoiseCN = getParameters(fId).noiseCorrelation(0);
if (fId.genericSubdet() == HcalGenericDetId::HcalGenBarrel) {
if (useHBUpgrade_) {
HcalDetId hid(fId);
int nLayersInDepth = getLayersInDepth(hid.ietaAbs(), hid.depth(), topo);
if (nLayersInDepth > 4) {
theType = HcalHBHamamatsu2;
theDC = getParameters(fId).darkCurrent(1, intlumi);
theNoiseCN = getParameters(fId).noiseCorrelation(1);
} else {
theType = HcalHBHamamatsu1;
theDC = getParameters(fId).darkCurrent(0, intlumi);
theNoiseCN = getParameters(fId).noiseCorrelation(0);
}
} else
theType = HcalHPD;
Expand All @@ -669,9 +674,11 @@ HcalSiPMParameter HcalDbHardcode::makeHardcodeSiPMParameter(HcalGenericDetId fId
if (nLayersInDepth > 4) {
theType = HcalHEHamamatsu2;
theDC = getParameters(fId).darkCurrent(1, intlumi);
theNoiseCN = getParameters(fId).noiseCorrelation(1);
} else {
theType = HcalHEHamamatsu1;
theDC = getParameters(fId).darkCurrent(0, intlumi);
theNoiseCN = getParameters(fId).noiseCorrelation(0);
}
} else
theType = HcalHPD;
Expand All @@ -682,7 +689,7 @@ HcalSiPMParameter HcalDbHardcode::makeHardcodeSiPMParameter(HcalGenericDetId fId
theType = HcalHPD;
}

return HcalSiPMParameter(fId.rawId(), theType, thePe2fC, theDC, 0, 0);
return HcalSiPMParameter(fId.rawId(), theType, thePe2fC, theDC, 0, (float)theNoiseCN);
}

std::unique_ptr<HcalSiPMCharacteristics> HcalDbHardcode::makeHardcodeSiPMCharacteristics() const {
Expand Down
7 changes: 6 additions & 1 deletion CalibCalorimetry/HcalAlgos/src/HcalHardcodeParameters.cc
Expand Up @@ -11,7 +11,8 @@ HcalHardcodeParameters::HcalHardcodeParameters(double pedestal,
int mcShape,
int recoShape,
double photoelectronsToAnalog,
const std::vector<double>& darkCurrent)
const std::vector<double>& darkCurrent,
const std::vector<double>& noiseCorrelation)
: pedestal_(pedestal),
pedestalWidth_(pedestalWidth),
gain_(gain),
Expand All @@ -24,6 +25,7 @@ HcalHardcodeParameters::HcalHardcodeParameters(double pedestal,
recoShape_(recoShape),
photoelectronsToAnalog_(photoelectronsToAnalog),
darkCurrent_(darkCurrent),
noiseCorrelation_(noiseCorrelation),
doSipmRadiationDamage_(false) {}

HcalHardcodeParameters::HcalHardcodeParameters(const edm::ParameterSet& p)
Expand All @@ -39,6 +41,7 @@ HcalHardcodeParameters::HcalHardcodeParameters(const edm::ParameterSet& p)
recoShape_(p.getParameter<int>("recoShape")),
photoelectronsToAnalog_(p.getParameter<double>("photoelectronsToAnalog")),
darkCurrent_(p.getParameter<std::vector<double>>("darkCurrent")),
noiseCorrelation_(p.getParameter<std::vector<double>>("noiseCorrelation")),
doSipmRadiationDamage_(p.getParameter<bool>("doRadiationDamage")) {
if (doSipmRadiationDamage_)
sipmRadiationDamage_ = HcalSiPMRadiationDamage(darkCurrent_, p.getParameter<edm::ParameterSet>("radiationDamage"));
Expand All @@ -49,3 +52,5 @@ const double HcalHardcodeParameters::darkCurrent(unsigned index, double intlumi)
return sipmRadiationDamage_.getDarkCurrent(intlumi, index);
return darkCurrent_.at(index);
}

const double HcalHardcodeParameters::noiseCorrelation(unsigned index) const { return noiseCorrelation_.at(index); }
Expand Up @@ -47,7 +47,8 @@
recoShape = cms.int32(105),
photoelectronsToAnalog = cms.double(0.3305),
darkCurrent = cms.vdouble(0.0),
doRadiationDamage = cms.bool(False),
noiseCorrelation = cms.vdouble(0.0),
doRadiationDamage = cms.bool(False)
),
he = cms.PSet(
pedestal = cms.double(3.163),
Expand All @@ -62,7 +63,8 @@
recoShape = cms.int32(105),
photoelectronsToAnalog = cms.double(0.3305),
darkCurrent = cms.vdouble(0.0),
doRadiationDamage = cms.bool(False),
noiseCorrelation = cms.vdouble(0.0),
doRadiationDamage = cms.bool(False)
),
hf = cms.PSet(
pedestal = cms.double(9.354),
Expand All @@ -77,7 +79,8 @@
recoShape = cms.int32(301),
photoelectronsToAnalog = cms.double(0.0),
darkCurrent = cms.vdouble(0.0),
doRadiationDamage = cms.bool(False),
noiseCorrelation = cms.vdouble(0.0),
doRadiationDamage = cms.bool(False)
),
ho = cms.PSet(
pedestal = cms.double(12.06),
Expand All @@ -92,7 +95,8 @@
recoShape = cms.int32(201),
photoelectronsToAnalog = cms.double(4.0),
darkCurrent = cms.vdouble(0.0),
doRadiationDamage = cms.bool(False),
noiseCorrelation = cms.vdouble(0.0),
doRadiationDamage = cms.bool(False)
),
hbUpgrade = cms.PSet(
pedestal = cms.double(17.3),
Expand All @@ -104,9 +108,10 @@
qieOffset = cms.vdouble(0.,0.,0.,0.),
qieSlope = cms.vdouble(0.05376,0.05376,0.05376,0.05376), #1/(3.1*6) where 6 is shunt factor
mcShape = cms.int32(206),
recoShape = cms.int32(206),
recoShape = cms.int32(208),
photoelectronsToAnalog = cms.double(40.0),
darkCurrent = cms.vdouble(0.01,0.015),
noiseCorrelation = cms.vdouble(0.26,0.254),
doRadiationDamage = cms.bool(True),
radiationDamage = cms.PSet(
temperatureBase = cms.double(20),
Expand All @@ -130,9 +135,10 @@
qieOffset = cms.vdouble(0.,0.,0.,0.),
qieSlope = cms.vdouble(0.05376,0.05376,0.05376,0.05376), #1/(3.1*6) where 6 is shunt factor
mcShape = cms.int32(206),
recoShape = cms.int32(206),
recoShape = cms.int32(208),
photoelectronsToAnalog = cms.double(40.0),
darkCurrent = cms.vdouble(0.01,0.015),
noiseCorrelation = cms.vdouble(0.26,0.254),
doRadiationDamage = cms.bool(True),
radiationDamage = cms.PSet(
temperatureBase = cms.double(20),
Expand All @@ -159,7 +165,8 @@
recoShape = cms.int32(301),
photoelectronsToAnalog = cms.double(0.0),
darkCurrent = cms.vdouble(0.0),
doRadiationDamage = cms.bool(False),
noiseCorrelation = cms.vdouble(0.0),
doRadiationDamage = cms.bool(False)
),
# types (in order): HcalHOZecotek, HcalHOHamamatsu, HcalHEHamamatsu1, HcalHEHamamatsu2, HcalHBHamamatsu1, HcalHBHamamatsu2, HcalHPD
SiPMCharacteristics = cms.VPSet(
Expand Down
7 changes: 7 additions & 0 deletions CalibCalorimetry/HcalPlugins/src/HcalHardcodeCalibrations.cc
Expand Up @@ -884,6 +884,7 @@ void HcalHardcodeCalibrations::fillDescriptions(edm::ConfigurationDescriptions&
desc_hb.add<int>("recoShape", 105);
desc_hb.add<double>("photoelectronsToAnalog", 0.0);
desc_hb.add<std::vector<double>>("darkCurrent", std::vector<double>({0.0}));
desc_hb.add<std::vector<double>>("noiseCorrelation", std::vector<double>({0.0}));
desc_hb.add<bool>("doRadiationDamage", false);
desc.add<edm::ParameterSetDescription>("hb", desc_hb);

Expand All @@ -908,6 +909,7 @@ void HcalHardcodeCalibrations::fillDescriptions(edm::ConfigurationDescriptions&
desc_hbUpgrade.add<int>("recoShape", 206);
desc_hbUpgrade.add<double>("photoelectronsToAnalog", 57.5);
desc_hbUpgrade.add<std::vector<double>>("darkCurrent", std::vector<double>({0.055}));
desc_hbUpgrade.add<std::vector<double>>("noiseCorrelation", std::vector<double>({0.26}));
desc_hbUpgrade.add<bool>("doRadiationDamage", true);
desc_hbUpgrade.add<edm::ParameterSetDescription>("radiationDamage", desc_hbRaddam);
desc.add<edm::ParameterSetDescription>("hbUpgrade", desc_hbUpgrade);
Expand All @@ -925,6 +927,7 @@ void HcalHardcodeCalibrations::fillDescriptions(edm::ConfigurationDescriptions&
desc_he.add<int>("recoShape", 105);
desc_he.add<double>("photoelectronsToAnalog", 0.0);
desc_he.add<std::vector<double>>("darkCurrent", std::vector<double>({0.0}));
desc_he.add<std::vector<double>>("noiseCorrelation", std::vector<double>({0.0}));
desc_he.add<bool>("doRadiationDamage", false);
desc.add<edm::ParameterSetDescription>("he", desc_he);

Expand All @@ -949,6 +952,7 @@ void HcalHardcodeCalibrations::fillDescriptions(edm::ConfigurationDescriptions&
desc_heUpgrade.add<int>("recoShape", 206);
desc_heUpgrade.add<double>("photoelectronsToAnalog", 57.5);
desc_heUpgrade.add<std::vector<double>>("darkCurrent", std::vector<double>({0.055}));
desc_heUpgrade.add<std::vector<double>>("noiseCorrelation", std::vector<double>({0.26}));
desc_heUpgrade.add<bool>("doRadiationDamage", true);
desc_heUpgrade.add<edm::ParameterSetDescription>("radiationDamage", desc_heRaddam);
desc.add<edm::ParameterSetDescription>("heUpgrade", desc_heUpgrade);
Expand All @@ -966,6 +970,7 @@ void HcalHardcodeCalibrations::fillDescriptions(edm::ConfigurationDescriptions&
desc_hf.add<int>("recoShape", 301);
desc_hf.add<double>("photoelectronsToAnalog", 0.0);
desc_hf.add<std::vector<double>>("darkCurrent", std::vector<double>({0.0}));
desc_hf.add<std::vector<double>>("noiseCorrelation", std::vector<double>({0.0}));
desc_hf.add<bool>("doRadiationDamage", false);
desc.add<edm::ParameterSetDescription>("hf", desc_hf);

Expand All @@ -982,6 +987,7 @@ void HcalHardcodeCalibrations::fillDescriptions(edm::ConfigurationDescriptions&
desc_hfUpgrade.add<int>("recoShape", 301);
desc_hfUpgrade.add<double>("photoelectronsToAnalog", 0.0);
desc_hfUpgrade.add<std::vector<double>>("darkCurrent", std::vector<double>({0.0}));
desc_hfUpgrade.add<std::vector<double>>("noiseCorrelation", std::vector<double>({0.0}));
desc_hfUpgrade.add<bool>("doRadiationDamage", false);
desc.add<edm::ParameterSetDescription>("hfUpgrade", desc_hfUpgrade);

Expand All @@ -1005,6 +1011,7 @@ void HcalHardcodeCalibrations::fillDescriptions(edm::ConfigurationDescriptions&
desc_ho.add<int>("recoShape", 201);
desc_ho.add<double>("photoelectronsToAnalog", 4.0);
desc_ho.add<std::vector<double>>("darkCurrent", std::vector<double>({0.0}));
desc_ho.add<std::vector<double>>("noiseCorrelation", std::vector<double>({0.0}));
desc_ho.add<bool>("doRadiationDamage", false);
desc.add<edm::ParameterSetDescription>("ho", desc_ho);

Expand Down

0 comments on commit 82b006d

Please sign in to comment.