Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avoiding overflow in TDC regime #29186

Merged
merged 2 commits into from
Mar 12, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions SimCalorimetry/HGCalSimProducers/src/HGCFEElectronics.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,12 @@ HGCFEElectronics<DFr>::HGCFEElectronics(const edm::ParameterSet& ps)
uint32_t tdcNbits = ps.getParameter<uint32_t>("tdcNbits");
tdcSaturation_fC_ = ps.getParameter<double>("tdcSaturation_fC");
tdcLSB_fC_ = tdcSaturation_fC_ / pow(2., tdcNbits);
// lower tdcSaturation_fC_ by one part in a million
// to ensure largest charge converted in bits is 0xfff and not 0x000
tdcSaturation_fC_ *= (1. - 1e-6);
edm::LogVerbatim("HGCFE") << "[HGCFEElectronics] " << tdcNbits << " bit TDC defined with LSB=" << tdcLSB_fC_
<< " saturation to occur @ " << tdcSaturation_fC_ << std::endl;
<< " saturation to occur @ " << tdcSaturation_fC_
<< " (NB lowered by 1 part in a million)" << std::endl;
}
if (ps.exists("targetMIPvalue_ADC"))
targetMIPvalue_ADC_ = ps.getParameter<uint32_t>("targetMIPvalue_ADC");
Expand Down Expand Up @@ -119,7 +123,7 @@ void HGCFEElectronics<DFr>::runTrivialShaper(
lsbADC = adcLSB_fC_;
if (maxADC < 0)
// lower adcSaturation_fC_ by one part in a million
// to esure largest charge convertred in bits is 0xfff==4095, not 0x1000
// to ensure largest charge converted in bits is 0xfff==4095, not 0x1000
// no effect on charges loewer than; no impact on cpu time, only done once
maxADC = adcSaturation_fC_ * (1 - 1e-6);
for (int it = 0; it < (int)(chargeColl.size()); it++) {
Expand Down