From 943c2c3fc3d77cc4b54e67b1f78af9ac6b66bd3c Mon Sep 17 00:00:00 2001 From: Salavat Date: Sat, 6 Feb 2021 17:58:55 +0100 Subject: [PATCH 1/2] HCAL Phase2 hardcode conditions update --- .../interface/HcalHardcodeParameters.h | 5 ++++- .../HcalAlgos/src/HcalDbHardcode.cc | 11 ++++++++-- .../HcalAlgos/src/HcalHardcodeParameters.cc | 7 ++++++- .../Hcal_Conditions_forGlobalTag_cff.py | 21 ++++++++++++------- .../src/HcalHardcodeCalibrations.cc | 7 +++++++ 5 files changed, 40 insertions(+), 11 deletions(-) diff --git a/CalibCalorimetry/HcalAlgos/interface/HcalHardcodeParameters.h b/CalibCalorimetry/HcalAlgos/interface/HcalHardcodeParameters.h index 167586bce1123..67e0e3075bd2f 100644 --- a/CalibCalorimetry/HcalAlgos/interface/HcalHardcodeParameters.h +++ b/CalibCalorimetry/HcalAlgos/interface/HcalHardcodeParameters.h @@ -22,7 +22,8 @@ class HcalHardcodeParameters { int mcShape, int recoShape, double photoelectronsToAnalog, - const std::vector& darkCurrent); + const std::vector& darkCurrent, + const std::vector& noiseCorrelation); //construct from pset HcalHardcodeParameters(const edm::ParameterSet& p); @@ -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 @@ -54,6 +56,7 @@ class HcalHardcodeParameters { int mcShape_, recoShape_; double photoelectronsToAnalog_; std::vector darkCurrent_; + std::vector noiseCorrelation_; bool doSipmRadiationDamage_; HcalSiPMRadiationDamage sipmRadiationDamage_; }; diff --git a/CalibCalorimetry/HcalAlgos/src/HcalDbHardcode.cc b/CalibCalorimetry/HcalAlgos/src/HcalDbHardcode.cc index bfad74393a0bb..e33d4ad5bc358 100644 --- a/CalibCalorimetry/HcalAlgos/src/HcalDbHardcode.cc +++ b/CalibCalorimetry/HcalAlgos/src/HcalDbHardcode.cc @@ -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), @@ -644,11 +645,13 @@ 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); + float theNoiseCN = (float)getParameters(fId).noiseCorrelation(0); if (fId.genericSubdet() == HcalGenericDetId::HcalGenBarrel) { if (useHBUpgrade_) { HcalDetId hid(fId); @@ -656,9 +659,11 @@ HcalSiPMParameter HcalDbHardcode::makeHardcodeSiPMParameter(HcalGenericDetId fId if (nLayersInDepth > 4) { theType = HcalHBHamamatsu2; theDC = getParameters(fId).darkCurrent(1, intlumi); + theNoiseCN = (float)getParameters(fId).noiseCorrelation(1); } else { theType = HcalHBHamamatsu1; theDC = getParameters(fId).darkCurrent(0, intlumi); + theNoiseCN = (float)getParameters(fId).noiseCorrelation(0); } } else theType = HcalHPD; @@ -669,9 +674,11 @@ HcalSiPMParameter HcalDbHardcode::makeHardcodeSiPMParameter(HcalGenericDetId fId if (nLayersInDepth > 4) { theType = HcalHEHamamatsu2; theDC = getParameters(fId).darkCurrent(1, intlumi); + theNoiseCN = (float)getParameters(fId).noiseCorrelation(1); } else { theType = HcalHEHamamatsu1; theDC = getParameters(fId).darkCurrent(0, intlumi); + theNoiseCN = (float)getParameters(fId).noiseCorrelation(0); } } else theType = HcalHPD; @@ -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, theNoiseCN); } std::unique_ptr HcalDbHardcode::makeHardcodeSiPMCharacteristics() const { diff --git a/CalibCalorimetry/HcalAlgos/src/HcalHardcodeParameters.cc b/CalibCalorimetry/HcalAlgos/src/HcalHardcodeParameters.cc index fd868f2f36da4..ecc5937be7209 100644 --- a/CalibCalorimetry/HcalAlgos/src/HcalHardcodeParameters.cc +++ b/CalibCalorimetry/HcalAlgos/src/HcalHardcodeParameters.cc @@ -11,7 +11,8 @@ HcalHardcodeParameters::HcalHardcodeParameters(double pedestal, int mcShape, int recoShape, double photoelectronsToAnalog, - const std::vector& darkCurrent) + const std::vector& darkCurrent, + const std::vector& noiseCorrelation) : pedestal_(pedestal), pedestalWidth_(pedestalWidth), gain_(gain), @@ -24,6 +25,7 @@ HcalHardcodeParameters::HcalHardcodeParameters(double pedestal, recoShape_(recoShape), photoelectronsToAnalog_(photoelectronsToAnalog), darkCurrent_(darkCurrent), + noiseCorrelation_(noiseCorrelation), doSipmRadiationDamage_(false) {} HcalHardcodeParameters::HcalHardcodeParameters(const edm::ParameterSet& p) @@ -39,6 +41,7 @@ HcalHardcodeParameters::HcalHardcodeParameters(const edm::ParameterSet& p) recoShape_(p.getParameter("recoShape")), photoelectronsToAnalog_(p.getParameter("photoelectronsToAnalog")), darkCurrent_(p.getParameter>("darkCurrent")), + noiseCorrelation_(p.getParameter>("noiseCorrelation")), doSipmRadiationDamage_(p.getParameter("doRadiationDamage")) { if (doSipmRadiationDamage_) sipmRadiationDamage_ = HcalSiPMRadiationDamage(darkCurrent_, p.getParameter("radiationDamage")); @@ -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); } diff --git a/CalibCalorimetry/HcalPlugins/python/Hcal_Conditions_forGlobalTag_cff.py b/CalibCalorimetry/HcalPlugins/python/Hcal_Conditions_forGlobalTag_cff.py index 328c10f97a69b..f84d1d06275f3 100644 --- a/CalibCalorimetry/HcalPlugins/python/Hcal_Conditions_forGlobalTag_cff.py +++ b/CalibCalorimetry/HcalPlugins/python/Hcal_Conditions_forGlobalTag_cff.py @@ -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), @@ -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), @@ -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), @@ -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), @@ -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), @@ -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), @@ -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( diff --git a/CalibCalorimetry/HcalPlugins/src/HcalHardcodeCalibrations.cc b/CalibCalorimetry/HcalPlugins/src/HcalHardcodeCalibrations.cc index 5a10ba17aa31a..7ec9989e7f8d4 100644 --- a/CalibCalorimetry/HcalPlugins/src/HcalHardcodeCalibrations.cc +++ b/CalibCalorimetry/HcalPlugins/src/HcalHardcodeCalibrations.cc @@ -884,6 +884,7 @@ void HcalHardcodeCalibrations::fillDescriptions(edm::ConfigurationDescriptions& desc_hb.add("recoShape", 105); desc_hb.add("photoelectronsToAnalog", 0.0); desc_hb.add>("darkCurrent", std::vector({0.0})); + desc_hb.add>("noiseCorrelation", std::vector({0.0})); desc_hb.add("doRadiationDamage", false); desc.add("hb", desc_hb); @@ -908,6 +909,7 @@ void HcalHardcodeCalibrations::fillDescriptions(edm::ConfigurationDescriptions& desc_hbUpgrade.add("recoShape", 206); desc_hbUpgrade.add("photoelectronsToAnalog", 57.5); desc_hbUpgrade.add>("darkCurrent", std::vector({0.055})); + desc_hbUpgrade.add>("noiseCorrelation", std::vector({0.26})); desc_hbUpgrade.add("doRadiationDamage", true); desc_hbUpgrade.add("radiationDamage", desc_hbRaddam); desc.add("hbUpgrade", desc_hbUpgrade); @@ -925,6 +927,7 @@ void HcalHardcodeCalibrations::fillDescriptions(edm::ConfigurationDescriptions& desc_he.add("recoShape", 105); desc_he.add("photoelectronsToAnalog", 0.0); desc_he.add>("darkCurrent", std::vector({0.0})); + desc_he.add>("noiseCorrelation", std::vector({0.0})); desc_he.add("doRadiationDamage", false); desc.add("he", desc_he); @@ -949,6 +952,7 @@ void HcalHardcodeCalibrations::fillDescriptions(edm::ConfigurationDescriptions& desc_heUpgrade.add("recoShape", 206); desc_heUpgrade.add("photoelectronsToAnalog", 57.5); desc_heUpgrade.add>("darkCurrent", std::vector({0.055})); + desc_heUpgrade.add>("noiseCorrelation", std::vector({0.26})); desc_heUpgrade.add("doRadiationDamage", true); desc_heUpgrade.add("radiationDamage", desc_heRaddam); desc.add("heUpgrade", desc_heUpgrade); @@ -966,6 +970,7 @@ void HcalHardcodeCalibrations::fillDescriptions(edm::ConfigurationDescriptions& desc_hf.add("recoShape", 301); desc_hf.add("photoelectronsToAnalog", 0.0); desc_hf.add>("darkCurrent", std::vector({0.0})); + desc_hf.add>("noiseCorrelation", std::vector({0.0})); desc_hf.add("doRadiationDamage", false); desc.add("hf", desc_hf); @@ -982,6 +987,7 @@ void HcalHardcodeCalibrations::fillDescriptions(edm::ConfigurationDescriptions& desc_hfUpgrade.add("recoShape", 301); desc_hfUpgrade.add("photoelectronsToAnalog", 0.0); desc_hfUpgrade.add>("darkCurrent", std::vector({0.0})); + desc_hfUpgrade.add>("noiseCorrelation", std::vector({0.0})); desc_hfUpgrade.add("doRadiationDamage", false); desc.add("hfUpgrade", desc_hfUpgrade); @@ -1005,6 +1011,7 @@ void HcalHardcodeCalibrations::fillDescriptions(edm::ConfigurationDescriptions& desc_ho.add("recoShape", 201); desc_ho.add("photoelectronsToAnalog", 4.0); desc_ho.add>("darkCurrent", std::vector({0.0})); + desc_ho.add>("noiseCorrelation", std::vector({0.0})); desc_ho.add("doRadiationDamage", false); desc.add("ho", desc_ho); From 49edf0a754c86e4ccf687d39bcf32c50e1de4ec9 Mon Sep 17 00:00:00 2001 From: Salavat Date: Sat, 6 Feb 2021 18:03:48 +0100 Subject: [PATCH 2/2] minor simplification --- CalibCalorimetry/HcalAlgos/src/HcalDbHardcode.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/CalibCalorimetry/HcalAlgos/src/HcalDbHardcode.cc b/CalibCalorimetry/HcalAlgos/src/HcalDbHardcode.cc index e33d4ad5bc358..f9ad603674683 100644 --- a/CalibCalorimetry/HcalAlgos/src/HcalDbHardcode.cc +++ b/CalibCalorimetry/HcalAlgos/src/HcalDbHardcode.cc @@ -651,7 +651,7 @@ HcalSiPMParameter HcalDbHardcode::makeHardcodeSiPMParameter(HcalGenericDetId fId HcalSiPMType theType = HcalNoSiPM; double thePe2fC = getParameters(fId).photoelectronsToAnalog(); double theDC = getParameters(fId).darkCurrent(0, intlumi); - float theNoiseCN = (float)getParameters(fId).noiseCorrelation(0); + double theNoiseCN = getParameters(fId).noiseCorrelation(0); if (fId.genericSubdet() == HcalGenericDetId::HcalGenBarrel) { if (useHBUpgrade_) { HcalDetId hid(fId); @@ -659,11 +659,11 @@ HcalSiPMParameter HcalDbHardcode::makeHardcodeSiPMParameter(HcalGenericDetId fId if (nLayersInDepth > 4) { theType = HcalHBHamamatsu2; theDC = getParameters(fId).darkCurrent(1, intlumi); - theNoiseCN = (float)getParameters(fId).noiseCorrelation(1); + theNoiseCN = getParameters(fId).noiseCorrelation(1); } else { theType = HcalHBHamamatsu1; theDC = getParameters(fId).darkCurrent(0, intlumi); - theNoiseCN = (float)getParameters(fId).noiseCorrelation(0); + theNoiseCN = getParameters(fId).noiseCorrelation(0); } } else theType = HcalHPD; @@ -674,11 +674,11 @@ HcalSiPMParameter HcalDbHardcode::makeHardcodeSiPMParameter(HcalGenericDetId fId if (nLayersInDepth > 4) { theType = HcalHEHamamatsu2; theDC = getParameters(fId).darkCurrent(1, intlumi); - theNoiseCN = (float)getParameters(fId).noiseCorrelation(1); + theNoiseCN = getParameters(fId).noiseCorrelation(1); } else { theType = HcalHEHamamatsu1; theDC = getParameters(fId).darkCurrent(0, intlumi); - theNoiseCN = (float)getParameters(fId).noiseCorrelation(0); + theNoiseCN = getParameters(fId).noiseCorrelation(0); } } else theType = HcalHPD; @@ -689,7 +689,7 @@ HcalSiPMParameter HcalDbHardcode::makeHardcodeSiPMParameter(HcalGenericDetId fId theType = HcalHPD; } - return HcalSiPMParameter(fId.rawId(), theType, thePe2fC, theDC, 0, theNoiseCN); + return HcalSiPMParameter(fId.rawId(), theType, thePe2fC, theDC, 0, (float)theNoiseCN); } std::unique_ptr HcalDbHardcode::makeHardcodeSiPMCharacteristics() const {