From ad4acdaa808a89fbb5eac0ce346a7319f57ee7a7 Mon Sep 17 00:00:00 2001 From: Andreas Psallidas Date: Mon, 2 Nov 2020 16:23:10 +0100 Subject: [PATCH 1/7] access noise same as the other vectors --- .../HGCalRecProducers/plugins/HGCalCLUEAlgo.h | 14 ++++---------- .../python/hgcalLayerClusters_cff.py | 6 +++--- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.h b/RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.h index aa8814b8c7dfd..c2462c142a512 100644 --- a/RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.h +++ b/RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.h @@ -45,15 +45,11 @@ class HGCalCLUEAlgoT : public HGCalClusteringAlgoBase { maxNumberOfThickIndices_(ps.getParameter("maxNumberOfThickIndices")), fcPerMip_(ps.getParameter>("fcPerMip")), fcPerEle_(ps.getParameter("fcPerEle")), - nonAgedNoises_(ps.getParameter("noises").getParameter>("values")), + nonAgedNoises_(ps.getParameter>("noises")), noiseMip_(ps.getParameter("noiseMip").getParameter("noise_MIP")), use2x2_(ps.getParameter("use2x2")), - initialized_(false) { - // repeat same noises for CE-H as well - if (!isNose_) { - nonAgedNoises_.insert(std::end(nonAgedNoises_), std::begin(nonAgedNoises_), std::end(nonAgedNoises_)); - } - } + initialized_(false) + {} ~HGCalCLUEAlgoT() override {} @@ -107,9 +103,7 @@ class HGCalCLUEAlgoT : public HGCalClusteringAlgoBase { iDesc.add("maxNumberOfThickIndices", 6); iDesc.add>("fcPerMip", {}); iDesc.add("fcPerEle", 0.0); - edm::ParameterSetDescription descNestedNoises; - descNestedNoises.add>("values", {}); - iDesc.add("noises", descNestedNoises); + iDesc.add>("noises", {}); edm::ParameterSetDescription descNestedNoiseMIP; descNestedNoiseMIP.add("scaleByDose", false); descNestedNoiseMIP.add("scaleByDoseAlgo", 0); diff --git a/RecoLocalCalo/HGCalRecProducers/python/hgcalLayerClusters_cff.py b/RecoLocalCalo/HGCalRecProducers/python/hgcalLayerClusters_cff.py index 1411009d483aa..7f3d60eea2e21 100644 --- a/RecoLocalCalo/HGCalRecProducers/python/hgcalLayerClusters_cff.py +++ b/RecoLocalCalo/HGCalRecProducers/python/hgcalLayerClusters_cff.py @@ -6,7 +6,7 @@ from RecoLocalCalo.HGCalRecProducers.HGCalUncalibRecHit_cfi import HGCalUncalibRecHit -from SimCalorimetry.HGCalSimProducers.hgcalDigitizer_cfi import fC_per_ele, hgceeDigitizer, hgchebackDigitizer, hfnoseDigitizer +from SimCalorimetry.HGCalSimProducers.hgcalDigitizer_cfi import fC_per_ele, HGCAL_noises, hgceeDigitizer, hgchebackDigitizer, hfnoseDigitizer hgcalLayerClusters = hgcalLayerClusters_.clone() @@ -17,7 +17,7 @@ hgcalLayerClusters.plugin.sciThicknessCorrection = HGCalRecHit.sciThicknessCorrection hgcalLayerClusters.plugin.deltasi_index_regemfac = HGCalRecHit.deltasi_index_regemfac hgcalLayerClusters.plugin.fcPerEle = cms.double(fC_per_ele) -hgcalLayerClusters.plugin.noises = cms.PSet(refToPSet_ = cms.string('HGCAL_noises')) +hgcalLayerClusters.plugin.noises = cms.vdouble(HGCAL_noises.values + HGCAL_noises.values) hgcalLayerClusters.plugin.noiseMip = hgchebackDigitizer.digiCfg.noise hgcalLayerClustersHFNose = hgcalLayerClusters_.clone( @@ -29,7 +29,7 @@ fcPerMip = HGCalUncalibRecHit.HGCHFNoseConfig.fCPerMIP, thicknessCorrection = HGCalRecHit.thicknessNoseCorrection, fcPerEle = fC_per_ele, - noises = dict(refToPSet_ = cms.string('HGCAL_noises')), + noises = cms.vdouble(HGCAL_noises.values), noiseMip = hgchebackDigitizer.digiCfg.noise ) ) From 49c1fc0a365609fdcd4fe45f1258e8620618c6c9 Mon Sep 17 00:00:00 2001 From: Andreas Psallidas Date: Tue, 3 Nov 2020 10:05:31 +0100 Subject: [PATCH 2/7] a comment to remember the extension --- .../HGCalRecProducers/python/hgcalLayerClusters_cff.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/RecoLocalCalo/HGCalRecProducers/python/hgcalLayerClusters_cff.py b/RecoLocalCalo/HGCalRecProducers/python/hgcalLayerClusters_cff.py index 7f3d60eea2e21..2699c3a3ae85c 100644 --- a/RecoLocalCalo/HGCalRecProducers/python/hgcalLayerClusters_cff.py +++ b/RecoLocalCalo/HGCalRecProducers/python/hgcalLayerClusters_cff.py @@ -12,11 +12,14 @@ hgcalLayerClusters.timeOffset = hgceeDigitizer.tofDelay hgcalLayerClusters.plugin.dEdXweights = cms.vdouble(dEdX.weights) +#With the introduction of 7 regional factors (6 for silicon plus 1 for scintillator), +#we extend fcPerMip (along with noises below) so that it is guaranteed that they have 6 entries. hgcalLayerClusters.plugin.fcPerMip = cms.vdouble(HGCalUncalibRecHit.HGCEEConfig.fCPerMIP + HGCalUncalibRecHit.HGCHEFConfig.fCPerMIP) hgcalLayerClusters.plugin.thicknessCorrection = cms.vdouble(HGCalRecHit.thicknessCorrection) hgcalLayerClusters.plugin.sciThicknessCorrection = HGCalRecHit.sciThicknessCorrection hgcalLayerClusters.plugin.deltasi_index_regemfac = HGCalRecHit.deltasi_index_regemfac hgcalLayerClusters.plugin.fcPerEle = cms.double(fC_per_ele) +#Extending noises as fcPerMip, see comment above. hgcalLayerClusters.plugin.noises = cms.vdouble(HGCAL_noises.values + HGCAL_noises.values) hgcalLayerClusters.plugin.noiseMip = hgchebackDigitizer.digiCfg.noise From 9555756c7eae4be8c7936830a9fbf242ced35a02 Mon Sep 17 00:00:00 2001 From: Andreas Psallidas Date: Wed, 4 Nov 2020 11:08:20 +0100 Subject: [PATCH 3/7] code checks --- RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.h b/RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.h index c2462c142a512..022c29d1d0c6e 100644 --- a/RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.h +++ b/RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.h @@ -48,8 +48,7 @@ class HGCalCLUEAlgoT : public HGCalClusteringAlgoBase { nonAgedNoises_(ps.getParameter>("noises")), noiseMip_(ps.getParameter("noiseMip").getParameter("noise_MIP")), use2x2_(ps.getParameter("use2x2")), - initialized_(false) - {} + initialized_(false) {} ~HGCalCLUEAlgoT() override {} From feb70d522ce037986304d98a1e35ad0d482e881d Mon Sep 17 00:00:00 2001 From: Andreas Psallidas Date: Wed, 4 Nov 2020 15:40:40 +0100 Subject: [PATCH 4/7] correcting HFNose out of range --- RecoLocalCalo/HGCalRecProducers/python/hgcalLayerClusters_cff.py | 1 + 1 file changed, 1 insertion(+) diff --git a/RecoLocalCalo/HGCalRecProducers/python/hgcalLayerClusters_cff.py b/RecoLocalCalo/HGCalRecProducers/python/hgcalLayerClusters_cff.py index 2699c3a3ae85c..5adc16dee5916 100644 --- a/RecoLocalCalo/HGCalRecProducers/python/hgcalLayerClusters_cff.py +++ b/RecoLocalCalo/HGCalRecProducers/python/hgcalLayerClusters_cff.py @@ -29,6 +29,7 @@ nHitsTime = cms.uint32(3), plugin = dict( dEdXweights = dEdX.weightsNose, + maxNumberOfThickIndices = cms.uint32(3), fcPerMip = HGCalUncalibRecHit.HGCHFNoseConfig.fCPerMIP, thicknessCorrection = HGCalRecHit.thicknessNoseCorrection, fcPerEle = fC_per_ele, From 7d64f803c33a10cc8c35a2e8b36f4313771c34af Mon Sep 17 00:00:00 2001 From: Andreas Psallidas Date: Thu, 5 Nov 2020 11:07:53 +0100 Subject: [PATCH 5/7] droping type specifications --- .../python/hgcalLayerClusters_cff.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/RecoLocalCalo/HGCalRecProducers/python/hgcalLayerClusters_cff.py b/RecoLocalCalo/HGCalRecProducers/python/hgcalLayerClusters_cff.py index 5adc16dee5916..2f751c468ed93 100644 --- a/RecoLocalCalo/HGCalRecProducers/python/hgcalLayerClusters_cff.py +++ b/RecoLocalCalo/HGCalRecProducers/python/hgcalLayerClusters_cff.py @@ -11,29 +11,29 @@ hgcalLayerClusters = hgcalLayerClusters_.clone() hgcalLayerClusters.timeOffset = hgceeDigitizer.tofDelay -hgcalLayerClusters.plugin.dEdXweights = cms.vdouble(dEdX.weights) +hgcalLayerClusters.plugin.dEdXweights = dEdX.weights #With the introduction of 7 regional factors (6 for silicon plus 1 for scintillator), #we extend fcPerMip (along with noises below) so that it is guaranteed that they have 6 entries. -hgcalLayerClusters.plugin.fcPerMip = cms.vdouble(HGCalUncalibRecHit.HGCEEConfig.fCPerMIP + HGCalUncalibRecHit.HGCHEFConfig.fCPerMIP) -hgcalLayerClusters.plugin.thicknessCorrection = cms.vdouble(HGCalRecHit.thicknessCorrection) +hgcalLayerClusters.plugin.fcPerMip = HGCalUncalibRecHit.HGCEEConfig.fCPerMIP + HGCalUncalibRecHit.HGCHEFConfig.fCPerMIP +hgcalLayerClusters.plugin.thicknessCorrection = HGCalRecHit.thicknessCorrection hgcalLayerClusters.plugin.sciThicknessCorrection = HGCalRecHit.sciThicknessCorrection hgcalLayerClusters.plugin.deltasi_index_regemfac = HGCalRecHit.deltasi_index_regemfac -hgcalLayerClusters.plugin.fcPerEle = cms.double(fC_per_ele) +hgcalLayerClusters.plugin.fcPerEle = fC_per_ele #Extending noises as fcPerMip, see comment above. -hgcalLayerClusters.plugin.noises = cms.vdouble(HGCAL_noises.values + HGCAL_noises.values) +hgcalLayerClusters.plugin.noises = HGCAL_noises.values + HGCAL_noises.values hgcalLayerClusters.plugin.noiseMip = hgchebackDigitizer.digiCfg.noise hgcalLayerClustersHFNose = hgcalLayerClusters_.clone( detector = 'HFNose', timeOffset = hfnoseDigitizer.tofDelay, - nHitsTime = cms.uint32(3), + nHitsTime = 3, plugin = dict( dEdXweights = dEdX.weightsNose, - maxNumberOfThickIndices = cms.uint32(3), + maxNumberOfThickIndices = 3, fcPerMip = HGCalUncalibRecHit.HGCHFNoseConfig.fCPerMIP, thicknessCorrection = HGCalRecHit.thicknessNoseCorrection, fcPerEle = fC_per_ele, - noises = cms.vdouble(HGCAL_noises.values), + noises = HGCAL_noises.values, noiseMip = hgchebackDigitizer.digiCfg.noise ) ) From 35d775c7cb956408c34c81955270d477b1bd4fde Mon Sep 17 00:00:00 2001 From: Andreas Psallidas Date: Thu, 5 Nov 2020 13:53:02 +0100 Subject: [PATCH 6/7] use a cleaner syntax for the python config file --- .../python/hgcalLayerClusters_cff.py | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/RecoLocalCalo/HGCalRecProducers/python/hgcalLayerClusters_cff.py b/RecoLocalCalo/HGCalRecProducers/python/hgcalLayerClusters_cff.py index 2f751c468ed93..3c31690aac8c9 100644 --- a/RecoLocalCalo/HGCalRecProducers/python/hgcalLayerClusters_cff.py +++ b/RecoLocalCalo/HGCalRecProducers/python/hgcalLayerClusters_cff.py @@ -8,20 +8,22 @@ from SimCalorimetry.HGCalSimProducers.hgcalDigitizer_cfi import fC_per_ele, HGCAL_noises, hgceeDigitizer, hgchebackDigitizer, hfnoseDigitizer -hgcalLayerClusters = hgcalLayerClusters_.clone() - -hgcalLayerClusters.timeOffset = hgceeDigitizer.tofDelay -hgcalLayerClusters.plugin.dEdXweights = dEdX.weights -#With the introduction of 7 regional factors (6 for silicon plus 1 for scintillator), -#we extend fcPerMip (along with noises below) so that it is guaranteed that they have 6 entries. -hgcalLayerClusters.plugin.fcPerMip = HGCalUncalibRecHit.HGCEEConfig.fCPerMIP + HGCalUncalibRecHit.HGCHEFConfig.fCPerMIP -hgcalLayerClusters.plugin.thicknessCorrection = HGCalRecHit.thicknessCorrection -hgcalLayerClusters.plugin.sciThicknessCorrection = HGCalRecHit.sciThicknessCorrection -hgcalLayerClusters.plugin.deltasi_index_regemfac = HGCalRecHit.deltasi_index_regemfac -hgcalLayerClusters.plugin.fcPerEle = fC_per_ele -#Extending noises as fcPerMip, see comment above. -hgcalLayerClusters.plugin.noises = HGCAL_noises.values + HGCAL_noises.values -hgcalLayerClusters.plugin.noiseMip = hgchebackDigitizer.digiCfg.noise +hgcalLayerClusters = hgcalLayerClusters_.clone( + timeOffset = hgceeDigitizer.tofDelay, + plugin = dict( + dEdXweights = dEdX.weights, + #With the introduction of 7 regional factors (6 for silicon plus 1 for scintillator), + #we extend fcPerMip (along with noises below) so that it is guaranteed that they have 6 entries. + fcPerMip = HGCalUncalibRecHit.HGCEEConfig.fCPerMIP + HGCalUncalibRecHit.HGCHEFConfig.fCPerMIP, + thicknessCorrection = HGCalRecHit.thicknessCorrection, + sciThicknessCorrection = HGCalRecHit.sciThicknessCorrection, + deltasi_index_regemfac = HGCalRecHit.deltasi_index_regemfac, + fcPerEle = fC_per_ele, + #Extending noises as fcPerMip, see comment above. + noises = HGCAL_noises.values + HGCAL_noises.values, + noiseMip = hgchebackDigitizer.digiCfg.noise + ) +) hgcalLayerClustersHFNose = hgcalLayerClusters_.clone( detector = 'HFNose', From ed0b9b633d38dcab36e5ca6516deebd5d209a7c0 Mon Sep 17 00:00:00 2001 From: Andreas Psallidas Date: Fri, 6 Nov 2020 11:59:15 +0100 Subject: [PATCH 7/7] assign value of the object avoiding bindings --- .../python/hgcalLayerClusters_cff.py | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/RecoLocalCalo/HGCalRecProducers/python/hgcalLayerClusters_cff.py b/RecoLocalCalo/HGCalRecProducers/python/hgcalLayerClusters_cff.py index 3c31690aac8c9..3046688363a57 100644 --- a/RecoLocalCalo/HGCalRecProducers/python/hgcalLayerClusters_cff.py +++ b/RecoLocalCalo/HGCalRecProducers/python/hgcalLayerClusters_cff.py @@ -11,31 +11,31 @@ hgcalLayerClusters = hgcalLayerClusters_.clone( timeOffset = hgceeDigitizer.tofDelay, plugin = dict( - dEdXweights = dEdX.weights, + dEdXweights = dEdX.weights.value(), #With the introduction of 7 regional factors (6 for silicon plus 1 for scintillator), #we extend fcPerMip (along with noises below) so that it is guaranteed that they have 6 entries. - fcPerMip = HGCalUncalibRecHit.HGCEEConfig.fCPerMIP + HGCalUncalibRecHit.HGCHEFConfig.fCPerMIP, - thicknessCorrection = HGCalRecHit.thicknessCorrection, - sciThicknessCorrection = HGCalRecHit.sciThicknessCorrection, - deltasi_index_regemfac = HGCalRecHit.deltasi_index_regemfac, + fcPerMip = HGCalUncalibRecHit.HGCEEConfig.fCPerMIP.value() + HGCalUncalibRecHit.HGCHEFConfig.fCPerMIP.value(), + thicknessCorrection = HGCalRecHit.thicknessCorrection.value(), + sciThicknessCorrection = HGCalRecHit.sciThicknessCorrection.value(), + deltasi_index_regemfac = HGCalRecHit.deltasi_index_regemfac.value(), fcPerEle = fC_per_ele, #Extending noises as fcPerMip, see comment above. - noises = HGCAL_noises.values + HGCAL_noises.values, - noiseMip = hgchebackDigitizer.digiCfg.noise + noises = HGCAL_noises.values.value() + HGCAL_noises.values.value(), + noiseMip = hgchebackDigitizer.digiCfg.noise.value() ) ) hgcalLayerClustersHFNose = hgcalLayerClusters_.clone( detector = 'HFNose', - timeOffset = hfnoseDigitizer.tofDelay, + timeOffset = hfnoseDigitizer.tofDelay.value(), nHitsTime = 3, plugin = dict( - dEdXweights = dEdX.weightsNose, + dEdXweights = dEdX.weightsNose.value(), maxNumberOfThickIndices = 3, - fcPerMip = HGCalUncalibRecHit.HGCHFNoseConfig.fCPerMIP, - thicknessCorrection = HGCalRecHit.thicknessNoseCorrection, + fcPerMip = HGCalUncalibRecHit.HGCHFNoseConfig.fCPerMIP.value(), + thicknessCorrection = HGCalRecHit.thicknessNoseCorrection.value(), fcPerEle = fC_per_ele, - noises = HGCAL_noises.values, - noiseMip = hgchebackDigitizer.digiCfg.noise + noises = HGCAL_noises.values.value(), + noiseMip = hgchebackDigitizer.digiCfg.noise.value() ) )