@@ -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 }
0 commit comments