File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
SimCalorimetry/HGCalSimProducers/src Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -399,15 +399,19 @@ void HGCFEElectronics<DFr>::runShaperWithToT(DFr& dataFrame,
399399 << " (raw=" << finalToA << " ) ns " ;
400400
401401 // last fC (tdcOnset) are dissipated trough pulse
402- if (it + busyBxs < (int )(newCharge_.size ())) {
403- const float deltaT2nextBx ((busyBxs * 25 - integTime));
404- const float tdcOnsetLeakage (tdcOnset * vdt::fast_expf (-deltaT2nextBx / tdcChargeDrainParameterisation_[11 ]));
402+ int ft = it + busyBxs;
403+ constexpr size_t tdcLeakageTauIdx_ = 11 ;
404+ if (ft > it && ft < static_cast <int >(newCharge_.size ()) &&
405+ tdcChargeDrainParameterisation_.size () > tdcLeakageTauIdx_) {
406+ const float deltaT2nextBx ((busyBxs * 25 .0f - integTime));
407+ const float tdcOnsetLeakage (tdcOnset *
408+ vdt::fast_expf (-deltaT2nextBx / tdcChargeDrainParameterisation_[tdcLeakageTauIdx_]));
405409 if (debug)
406410 edm::LogVerbatim (" HGCFE" ) << " \t Leaking remainder of TDC onset " << tdcOnset << " fC, to be dissipated in "
407411 << deltaT2nextBx << " DeltaT/tau=" << deltaT2nextBx << " / "
408- << tdcChargeDrainParameterisation_[11 ] << " ns, adds " << tdcOnsetLeakage << " fC @ "
409- << it + busyBxs << " bx (first free bx)" ;
410- newCharge_[it + busyBxs ] += tdcOnsetLeakage;
412+ << tdcChargeDrainParameterisation_[tdcLeakageTauIdx_ ] << " ns, adds "
413+ << tdcOnsetLeakage << " fC @ " << it + busyBxs << " bx (first free bx)" ;
414+ newCharge_[ft ] += tdcOnsetLeakage;
411415 }
412416 }
413417
You can’t perform that action at this time.
0 commit comments