Skip to content

Commit fe2df40

Browse files
authored
Merge pull request cms-sw#31730 from apsallid/cluetweaksforregemfactors
[HGCAL] CLUE and regional factors
2 parents a484140 + bcd1577 commit fe2df40

File tree

4 files changed

+35
-13
lines changed

4 files changed

+35
-13
lines changed

RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.cc

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,12 @@ void HGCalCLUEAlgoT<T>::populate(const HGCRecHitCollection& hits) {
4444
if (dependSensor_) {
4545
int thickness_index = rhtools_.getSiThickIndex(detid);
4646
if (thickness_index == -1)
47-
thickness_index = 3;
47+
thickness_index = maxNumberOfThickIndices_;
48+
4849
double storedThreshold = thresholds_[layerOnSide][thickness_index];
50+
if (detid.det() == DetId::HGCalHSi || detid.subdetId() == HGCHEF) {
51+
storedThreshold = thresholds_[layerOnSide][thickness_index + deltasi_index_regemfac_];
52+
}
4953
sigmaNoise = v_sigmaNoise_[layerOnSide][thickness_index];
5054

5155
if (hgrh.energy() < storedThreshold)
@@ -507,8 +511,9 @@ void HGCalCLUEAlgoT<T>::computeThreshold() {
507511
// To support the TDR geometry and also the post-TDR one (v9 onwards), we
508512
// need to change the logic of the vectors containing signal to noise and
509513
// thresholds. The first 3 indices will keep on addressing the different
510-
// thicknesses of the Silicon detectors, while the last one, number 3 (the
511-
// fourth) will address the Scintillators. This change will support both
514+
// thicknesses of the Silicon detectors in CE_E , the next 3 indices will address
515+
// the thicknesses of the Silicon detectors in CE_H, while the last one, number 6 (the
516+
// seventh) will address the Scintillators. This change will support both
512517
// geometries at the same time.
513518

514519
if (initialized_)
@@ -517,13 +522,13 @@ void HGCalCLUEAlgoT<T>::computeThreshold() {
517522
initialized_ = true;
518523

519524
std::vector<double> dummy;
520-
const unsigned maxNumberOfThickIndices = 3;
521-
dummy.resize(maxNumberOfThickIndices + !isNose_, 0); // +1 to accomodate for the Scintillators
525+
526+
dummy.resize(maxNumberOfThickIndices_ + !isNose_, 0); // +1 to accomodate for the Scintillators
522527
thresholds_.resize(maxlayer_, dummy);
523528
v_sigmaNoise_.resize(maxlayer_, dummy);
524529

525530
for (unsigned ilayer = 1; ilayer <= maxlayer_; ++ilayer) {
526-
for (unsigned ithick = 0; ithick < maxNumberOfThickIndices; ++ithick) {
531+
for (unsigned ithick = 0; ithick < maxNumberOfThickIndices_; ++ithick) {
527532
float sigmaNoise = 0.001f * fcPerEle_ * nonAgedNoises_[ithick] * dEdXweights_[ilayer] /
528533
(fcPerMip_[ithick] * thicknessCorrection_[ithick]);
529534
thresholds_[ilayer - 1][ithick] = sigmaNoise * ecut_;
@@ -535,9 +540,9 @@ void HGCalCLUEAlgoT<T>::computeThreshold() {
535540
}
536541

537542
if (!isNose_) {
538-
float scintillators_sigmaNoise = 0.001f * noiseMip_ * dEdXweights_[ilayer];
539-
thresholds_[ilayer - 1][maxNumberOfThickIndices] = ecut_ * scintillators_sigmaNoise;
540-
v_sigmaNoise_[ilayer - 1][maxNumberOfThickIndices] = scintillators_sigmaNoise;
543+
float scintillators_sigmaNoise = 0.001f * noiseMip_ * dEdXweights_[ilayer] / sciThicknessCorrection_;
544+
thresholds_[ilayer - 1][maxNumberOfThickIndices_] = ecut_ * scintillators_sigmaNoise;
545+
v_sigmaNoise_[ilayer - 1][maxNumberOfThickIndices_] = scintillators_sigmaNoise;
541546
LogDebug("HGCalCLUEAlgo") << "ilayer: " << ilayer << " noiseMip: " << noiseMip_
542547
<< " scintillators_sigmaNoise: " << scintillators_sigmaNoise << "\n";
543548
}

RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.h

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,20 @@ class HGCalCLUEAlgoT : public HGCalClusteringAlgoBase {
4040
dependSensor_(ps.getParameter<bool>("dependSensor")),
4141
dEdXweights_(ps.getParameter<std::vector<double>>("dEdXweights")),
4242
thicknessCorrection_(ps.getParameter<std::vector<double>>("thicknessCorrection")),
43+
sciThicknessCorrection_(ps.getParameter<double>("sciThicknessCorrection")),
44+
deltasi_index_regemfac_(ps.getParameter<int>("deltasi_index_regemfac")),
45+
maxNumberOfThickIndices_(ps.getParameter<unsigned>("maxNumberOfThickIndices")),
4346
fcPerMip_(ps.getParameter<std::vector<double>>("fcPerMip")),
4447
fcPerEle_(ps.getParameter<double>("fcPerEle")),
4548
nonAgedNoises_(ps.getParameter<edm::ParameterSet>("noises").getParameter<std::vector<double>>("values")),
4649
noiseMip_(ps.getParameter<edm::ParameterSet>("noiseMip").getParameter<double>("noise_MIP")),
4750
use2x2_(ps.getParameter<bool>("use2x2")),
48-
initialized_(false) {}
51+
initialized_(false) {
52+
// repeat same noises for CE-H as well
53+
if (!isNose_) {
54+
nonAgedNoises_.insert(std::end(nonAgedNoises_), std::begin(nonAgedNoises_), std::end(nonAgedNoises_));
55+
}
56+
}
4957

5058
~HGCalCLUEAlgoT() override {}
5159

@@ -94,6 +102,9 @@ class HGCalCLUEAlgoT : public HGCalClusteringAlgoBase {
94102
iDesc.addUntracked<unsigned int>("verbosity", 3);
95103
iDesc.add<std::vector<double>>("dEdXweights", {});
96104
iDesc.add<std::vector<double>>("thicknessCorrection", {});
105+
iDesc.add<double>("sciThicknessCorrection", 0.9);
106+
iDesc.add<int>("deltasi_index_regemfac", 3);
107+
iDesc.add<unsigned>("maxNumberOfThickIndices", 6);
97108
iDesc.add<std::vector<double>>("fcPerMip", {});
98109
iDesc.add<double>("fcPerEle", 0.0);
99110
edm::ParameterSetDescription descNestedNoises;
@@ -131,6 +142,9 @@ class HGCalCLUEAlgoT : public HGCalClusteringAlgoBase {
131142
bool dependSensor_;
132143
std::vector<double> dEdXweights_;
133144
std::vector<double> thicknessCorrection_;
145+
double sciThicknessCorrection_;
146+
int deltasi_index_regemfac_;
147+
unsigned maxNumberOfThickIndices_;
134148
std::vector<double> fcPerMip_;
135149
double fcPerEle_;
136150
std::vector<double> nonAgedNoises_;

RecoLocalCalo/HGCalRecProducers/plugins/HGCalRecHitWorkerSimple.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ HGCalRecHitWorkerSimple::HGCalRecHitWorkerSimple(const edm::ParameterSet& ps) :
5959
rcorr_.push_back(1.0 / corr);
6060
}
6161
// here for scintillator
62-
rcorrscint_ = ps.getParameter<double>("sciThicknessCorrection");
62+
rcorrscint_ = 1.0 / ps.getParameter<double>("sciThicknessCorrection");
63+
6364
//This is for the index position in CE_H silicon thickness cases
6465
deltasi_index_regemfac_ = ps.getParameter<int>("deltasi_index_regemfac");
6566
const auto& rcorrnose = ps.getParameter<std::vector<double> >("thicknessNoseCorrection");
@@ -185,7 +186,7 @@ bool HGCalRecHitWorkerSimple::run(const edm::Event& evt,
185186
break;
186187
case hgcbh:
187188
rechitMaker_->setADCToGeVConstant(float(hgchebUncalib2GeV_));
188-
sigmaNoiseGeV = 1e-3 * hgcHEB_noise_MIP_ * weights_[layer];
189+
sigmaNoiseGeV = 1e-3 * hgcHEB_noise_MIP_ * weights_[layer] * rcorrscint_;
189190
break;
190191
case hgchfnose:
191192
rechitMaker_->setADCToGeVConstant(float(hgchfnoseUncalib2GeV_));

RecoLocalCalo/HGCalRecProducers/python/hgcalLayerClusters_cff.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@
1212

1313
hgcalLayerClusters.timeOffset = hgceeDigitizer.tofDelay
1414
hgcalLayerClusters.plugin.dEdXweights = cms.vdouble(dEdX.weights)
15-
hgcalLayerClusters.plugin.fcPerMip = cms.vdouble(HGCalUncalibRecHit.HGCEEConfig.fCPerMIP)
15+
hgcalLayerClusters.plugin.fcPerMip = cms.vdouble(HGCalUncalibRecHit.HGCEEConfig.fCPerMIP + HGCalUncalibRecHit.HGCHEFConfig.fCPerMIP)
1616
hgcalLayerClusters.plugin.thicknessCorrection = cms.vdouble(HGCalRecHit.thicknessCorrection)
17+
hgcalLayerClusters.plugin.sciThicknessCorrection = HGCalRecHit.sciThicknessCorrection
18+
hgcalLayerClusters.plugin.deltasi_index_regemfac = HGCalRecHit.deltasi_index_regemfac
1719
hgcalLayerClusters.plugin.fcPerEle = cms.double(fC_per_ele)
1820
hgcalLayerClusters.plugin.noises = cms.PSet(refToPSet_ = cms.string('HGCAL_noises'))
1921
hgcalLayerClusters.plugin.noiseMip = hgchebackDigitizer.digiCfg.noise

0 commit comments

Comments
 (0)