|
|
models the behavior of the front-end electronics
More...
#include <HGCFEElectronics.h>
|
float | getADClsb () |
| returns the LSB in MIP currently configured More...
|
|
float | getADCThreshold () |
|
hgc_digi::FEADCPulseShape & | getDefaultADCPulse () |
| getter for the default ADC pulse configured by python More...
|
|
int | getTargetMipValue () |
|
std::array< float, 3 > | getTDCForToAOnset () |
|
float | getTDClsb () |
|
float | getTDCOnset () |
|
float | getTimeJitter (float totalCharge, int thickness) |
|
| HGCFEElectronics (const edm::ParameterSet &ps) |
| CTOR. More...
|
|
void | runShaper (DFr &dataFrame, hgc::HGCSimHitData &chargeColl, hgc::HGCSimHitData &toa, CLHEP::HepRandomEngine *engine, uint32_t thrADC=0, float lsbADC=-1, uint32_t gainIdx=0, float maxADC=-1, int thickness=1) |
|
void | runShaper (DFr &dataFrame, hgc::HGCSimHitData &chargeColl, hgc::HGCSimHitData &toa, const hgc_digi::FEADCPulseShape &adcPulse, CLHEP::HepRandomEngine *engine, uint32_t thrADC=0, float lsbADC=-1, uint32_t gainIdx=0, float maxADC=-1, int thickness=1) |
| switches according to the firmware version More...
|
|
void | runShaperWithToT (DFr &dataFrame, hgc::HGCSimHitData &chargeColl, hgc::HGCSimHitData &toa, CLHEP::HepRandomEngine *engine, uint32_t thrADC, float lsbADC, uint32_t gainIdx, float maxADC, int thickness) |
|
void | runShaperWithToT (DFr &dataFrame, hgc::HGCSimHitData &chargeColl, hgc::HGCSimHitData &toa, CLHEP::HepRandomEngine *engine, uint32_t thrADC, float lsbADC, uint32_t gainIdx, float maxADC, int thickness, const hgc_digi::FEADCPulseShape &adcPulse) |
| implements pulse shape and switch to time over threshold including deadtime More...
|
|
void | runSimpleShaper (DFr &dataFrame, hgc::HGCSimHitData &chargeColl, uint32_t thrADC, float lsbADC, uint32_t gainIdx, float maxADC) |
|
void | runSimpleShaper (DFr &dataFrame, hgc::HGCSimHitData &chargeColl, uint32_t thrADC, float lsbADC, uint32_t gainIdx, float maxADC, const hgc_digi::FEADCPulseShape &adcPulse) |
| applies a shape to each time sample and propagates the tails to the subsequent time samples More...
|
|
void | runTrivialShaper (DFr &dataFrame, hgc::HGCSimHitData &chargeColl, uint32_t thrADC, float lsbADC, uint32_t gainIdx, float maxADC) |
| converts charge to digis without pulse shape More...
|
|
void | setADClsb (float newLSB) |
|
void | SetNoiseValues (const std::vector< float > &noise_fC) |
|
uint32_t | toaMode () const |
| returns how ToT will be computed More...
|
|
| ~HGCFEElectronics () |
| DTOR. More...
|
|
template<class DFr>
class HGCFEElectronics< DFr >
models the behavior of the front-end electronics
Definition at line 24 of file HGCFEElectronics.h.
◆ HGCFEElectronicsFirmwareVersion
◆ HGCFEElectronicsTOTMode
◆ HGCFEElectronics()
CTOR.
Definition at line 11 of file HGCFEElectronics.cc.
30 if (ps.
exists(
"adcPulse")) {
32 for (
unsigned i = 0;
i <
temp.size(); ++
i) {
40 for (
unsigned i = 0;
i <
temp.size(); ++
i) {
44 if (ps.
exists(
"adcNbits")) {
53 if (ps.
exists(
"tdcNbits")) {
62 <<
" (NB lowered by 1 part in a million)" << std::endl;
64 if (ps.
exists(
"targetMIPvalue_ADC"))
66 if (ps.
exists(
"adcThreshold_fC"))
68 if (ps.
exists(
"tdcOnset_fC"))
70 if (ps.
exists(
"tdcForToAOnset_fC")) {
75 throw cms::Exception(
"BadConfiguration") <<
" HGCFEElectronics wrong size for ToA thresholds ";
78 if (ps.
exists(
"toaLSB_ns"))
80 if (ps.
exists(
"tdcChargeDrainParameterisation")) {
81 for (
auto val : ps.
getParameter<std::vector<double> >(
"tdcChargeDrainParameterisation")) {
85 if (ps.
exists(
"tdcResolutionInPs"))
90 if (ps.
exists(
"jitterNoise_ns")) {
95 throw cms::Exception(
"BadConfiguration") <<
" HGCFEElectronics wrong size for ToA jitterNoise ";
98 if (ps.
exists(
"jitterConstant_ns")) {
103 throw cms::Exception(
"BadConfiguration") <<
" HGCFEElectronics wrong size for ToA jitterConstant ";
References edm::ParameterSet::getParameter().
◆ ~HGCFEElectronics()
◆ getADClsb()
◆ getADCThreshold()
◆ getDefaultADCPulse()
◆ getTargetMipValue()
◆ getTDCForToAOnset()
◆ getTDClsb()
◆ getTDCOnset()
◆ getTimeJitter()
template<class DFr >
float HGCFEElectronics< DFr >::getTimeJitter |
( |
float |
totalCharge, |
|
|
int |
thickness |
|
) |
| |
|
inline |
◆ runShaper() [1/2]
◆ runShaper() [2/2]
◆ runShaperWithToT() [1/2]
◆ runShaperWithToT() [2/2]
implements pulse shape and switch to time over threshold including deadtime
Definition at line 207 of file HGCFEElectronics.cc.
224 constexpr
bool debug_state(
true);
226 constexpr
bool debug_state(
false);
229 bool debug = debug_state;
239 if (toaColl[fireBX] != 0.
f) {
240 timeToA = toaColl[fireBX];
243 timeToA = CLHEP::RandGaussQ::shoot(engine, timeToA, jitter);
246 if (timeToA >= 0.
f && timeToA <= 25.
f)
253 for (
int it = 0; it < (
int)(chargeColl.size()); ++it) {
260 float charge = chargeColl[it];
272 edm::LogVerbatim(
"HGCFE") <<
"\t q=" <<
charge <<
" fC with <toa>=" << toa <<
" ns, triggers ToT @ " << it
278 float totalCharge(
charge), finalToA(toa), integTime(0);
283 float charge_offset = 0.f;
284 const float charge_kfC(totalCharge * 1
e-3);
296 const float charge_mod = charge_kfC - charge_offset;
297 const float newIntegTime =
302 const int newBusyBxs = std::floor(newIntegTime / 25.
f) + 1;
306 integTime = newIntegTime;
307 if (newBusyBxs == busyBxs)
313 edm::LogVerbatim(
"HGCFE") <<
"\t Intial busy estimate=" << integTime <<
" ns = " << newBusyBxs <<
" bxs"
316 edm::LogVerbatim(
"HGCFE") <<
"\t ...integrated charge overflows initial busy estimate, interating again"
321 busyBxs = newBusyBxs;
329 for (
int jt = 0; jt < it; ++jt) {
330 const unsigned int deltaT = (it - jt);
334 const float leakCharge = chargeColl[jt] *
adcPulse[deltaT + 2];
335 totalCharge += leakCharge;
337 finalToA += leakCharge *
pulseAvgT_[deltaT + 2];
340 edm::LogVerbatim(
"HGCFE") <<
"\t\t leaking " << chargeColl[jt] <<
" fC @ deltaT=-" << deltaT <<
" -> +"
341 << leakCharge <<
" with avgT=" <<
pulseAvgT_[deltaT + 2] << std::endl;
345 for (
int jt = it + 1; jt < it + busyBxs && jt < dataFrame.size(); ++jt) {
350 const float extraCharge = chargeColl[jt];
351 if (extraCharge == 0.
f)
354 edm::LogVerbatim(
"HGCFE") <<
"\t\t adding " << extraCharge <<
" fC @ deltaT=+" << (jt - it) << std::endl;
356 totalCharge += extraCharge;
358 finalToA += extraCharge * toaColl[jt];
363 finalToA /= totalCharge;
368 edm::LogVerbatim(
"HGCFE") <<
"\t Final busy estimate=" << integTime <<
" ns = " << busyBxs <<
" bxs" << std::endl
369 <<
"\t Total integrated=" << totalCharge <<
" fC <toa>=" <<
toaFromToT[it]
370 <<
" (raw=" << finalToA <<
") ns " << std::endl;
373 if (it + busyBxs < (
int)(
newCharge.size())) {
374 const float deltaT2nextBx((busyBxs * 25 - integTime));
378 << deltaT2nextBx <<
" DeltaT/tau=" << deltaT2nextBx <<
" / "
380 << it + busyBxs <<
" bx (first free bx)" << std::endl;
381 newCharge[it + busyBxs] += tdcOnsetLeakage;
386 auto runChargeSharing = [&]() {
388 for (
int it = 0; it < (
int)(chargeColl.size()); ++it) {
394 for (ipulse =
start; ipulse < stop; ++ipulse) {
395 const int itoffset = it + ipulse - 2;
447 true,
true, gainIdx, (uint16_t)(timeToA /
toaLSB_ns_), (uint16_t)(std::floor(saturatedCharge /
tdcLSB_fC_)));
451 newSample.
set(
false,
true, gainIdx, 0, 0);
461 dataFrame.setSample(it, newSample);
465 std::ostringstream
msg;
466 dataFrame.print(
msg);
References gpuClustering::adc, hgcROCParameters_cfi::adcPulse, ALCARECOTkAlJpsiMuMu_cff::charge, debug, MillePedeFileConverter_cfg::e, f, myMath::fast_expf(), createfilelist::int, SiStripPI::max, min(), mps_check::msg, HGCSample::set(), HGCSample::setToAValid(), and Calorimetry_cff::thickness.
Referenced by HGCFEElectronics< DFr >::runShaper(), and HGCFEElectronics< DFr >::runShaperWithToT().
◆ runSimpleShaper() [1/2]
◆ runSimpleShaper() [2/2]
applies a shape to each time sample and propagates the tails to the subsequent time samples
Definition at line 149 of file HGCFEElectronics.cc.
159 for (
int it = 0; it < (
int)(chargeColl.size()); it++) {
160 const float charge(chargeColl[it]);
171 for (
int ipulse = -2; ipulse < (
int)(
adcPulse.size()) - 2; ipulse++) {
174 if (it + ipulse >= (
int)(dataFrame.size()))
191 newSample.
set(
adc > thrADC,
false, gainIdx, 0,
adc);
192 dataFrame.setSample(it, newSample);
199 std::ostringstream
msg;
200 dataFrame.print(
msg);
References gpuClustering::adc, hgcROCParameters_cfi::adcPulse, ALCARECOTkAlJpsiMuMu_cff::charge, debug, f, createfilelist::int, min(), mps_check::msg, and HGCSample::set().
Referenced by HGCFEElectronics< DFr >::runShaper(), and HGCFEElectronics< DFr >::runSimpleShaper().
◆ runTrivialShaper()
converts charge to digis without pulse shape
Definition at line 110 of file HGCFEElectronics.cc.
115 for (
int it = 0; it < (
int)(chargeColl.size()); it++)
129 for (
int it = 0; it < (
int)(chargeColl.size()); it++) {
131 const uint32_t
adc = std::floor(
std::min(chargeColl[it], maxADC) / lsbADC);
133 newSample.
set(
adc > thrADC,
false, gainIdx, 0,
adc);
134 dataFrame.setSample(it, newSample);
141 std::ostringstream
msg;
142 dataFrame.print(
msg);
References gpuClustering::adc, debug, MillePedeFileConverter_cfg::e, createfilelist::int, min(), mps_check::msg, and HGCSample::set().
Referenced by HGCFEElectronics< DFr >::runShaper().
◆ setADClsb()
◆ SetNoiseValues()
template<class DFr >
void HGCFEElectronics< DFr >::SetNoiseValues |
( |
const std::vector< float > & |
noise_fC | ) |
|
|
inline |
◆ toaMode()
◆ adcLSB_fC_
◆ adcPulse_
◆ adcSaturation_fC_
◆ adcThreshold_fC_
◆ busyFlags
◆ fwVersion_
◆ jitterConstant2_ns_
◆ jitterNoise2_ns_
◆ newCharge
◆ noise_fC_
◆ pulseAvgT_
◆ targetMIPvalue_ADC_
◆ tdcChargeDrainParameterisation_
◆ tdcForToAOnset_fC_
◆ tdcLSB_fC_
◆ tdcOnset_fC_
◆ tdcResolutionInNs_
◆ tdcSaturation_fC_
◆ thresholdFollowsMIP_
◆ toaFlags
◆ toaFromToT
◆ toaLSB_ns_
◆ toaMode_
◆ totFlags
std::array< float, 3 > jitterNoise2_ns_
hgc::HGCSimHitData toaFromToT
std::vector< float > tdcChargeDrainParameterisation_
uint16_t *__restrict__ uint16_t const *__restrict__ adc
void set(bool thr, bool mode, uint16_t gain, uint16_t toa, uint16_t data)
std::array< bool, hgc::nSamples > totFlags
void runShaper(DFr &dataFrame, hgc::HGCSimHitData &chargeColl, hgc::HGCSimHitData &toa, const hgc_digi::FEADCPulseShape &adcPulse, CLHEP::HepRandomEngine *engine, uint32_t thrADC=0, float lsbADC=-1, uint32_t gainIdx=0, float maxADC=-1, int thickness=1)
switches according to the firmware version
std::array< bool, hgc::nSamples > toaFlags
void runSimpleShaper(DFr &dataFrame, hgc::HGCSimHitData &chargeColl, uint32_t thrADC, float lsbADC, uint32_t gainIdx, float maxADC, const hgc_digi::FEADCPulseShape &adcPulse)
applies a shape to each time sample and propagates the tails to the subsequent time samples
float getTimeJitter(float totalCharge, int thickness)
void setToAValid(bool toaFired)
void runTrivialShaper(DFr &dataFrame, hgc::HGCSimHitData &chargeColl, uint32_t thrADC, float lsbADC, uint32_t gainIdx, float maxADC)
converts charge to digis without pulse shape
bool exists(std::string const ¶meterName) const
checks if a parameter exists
void runShaperWithToT(DFr &dataFrame, hgc::HGCSimHitData &chargeColl, hgc::HGCSimHitData &toa, CLHEP::HepRandomEngine *engine, uint32_t thrADC, float lsbADC, uint32_t gainIdx, float maxADC, int thickness, const hgc_digi::FEADCPulseShape &adcPulse)
implements pulse shape and switch to time over threshold including deadtime
std::vector< float > noise_fC_
hgc::HGCSimHitData newCharge
std::array< float, 3 > jitterConstant2_ns_
hgc_digi::FEADCPulseShape pulseAvgT_
uint32_t targetMIPvalue_ADC_
std::array< float, 3 > tdcForToAOnset_fC_
Log< level::Info, true > LogVerbatim
T getParameter(std::string const &) const
Power< A, B >::type pow(const A &a, const B &b)
std::array< bool, hgc::nSamples > busyFlags
hgc_digi::FEADCPulseShape adcPulse_