Definition at line 16 of file HcalTDC.h.
adds timing information to the digi
Definition at line 16 of file HcalTDC.cc.
References HcalUpgradeDataFrame::adc(), HcalTDCParameters::alreadyTransitionCode(), getThreshold(), i, HcalUpgradeDataFrame::id(), HcalTDCParameters::nbins(), HcalTDCParameters::noTransitionCode(), CaloSamples::preciseAt(), CaloSamples::preciseSize(), HcalUpgradeDataFrame::setSample(), CaloSamples::size(), and theTDCParameters.
Referenced by HcalElectronicsSim::analogToDigital().
19 float const TDC_Threshold_hyst(TDC_Threshold);
20 bool risingReady(
true), fallingReady(
false);
23 bool hasTDCValues=
true;
28 int const rising_ac_hysteresis(5);
29 int lastRisingEdge(0);
35 for (
int ibin = 0; ibin < lf.
size(); ++ibin) {
50 int TDC_RisingEdge = (risingReady) ?
53 int TDC_FallingEdge = (fallingReady) ?
56 int preciseBegin = ibin * tdcBins;
57 int preciseEnd = preciseBegin + tdcBins;
60 for(
int i = preciseBegin;
i < preciseEnd; ++
i) {
63 if( (fallingReady) && (
i%3 == 0) && (lf.
preciseAt(
i) < TDC_Threshold)) {
65 TDC_FallingEdge =
i-preciseBegin;
68 if ((risingReady) && (lf.
preciseAt(
i) > TDC_Threshold)) {
70 TDC_RisingEdge =
i-preciseBegin;
79 if ((!fallingReady) && (lf.
preciseAt(
i) > TDC_Threshold)) {
84 if ((!risingReady) && (lastRisingEdge > rising_ac_hysteresis) &&
94 int packedTDC = TDC_RisingEdge + (tdcBins*2) * TDC_FallingEdge;
int preciseSize() const
get the size
float preciseAt(int i) const
const function to access precise samples
int noTransitionCode() const
int alreadyTransitionCode() const
void setSample(int iSample, uint16_t adc, uint16_t tdc, bool dv)
int size() const
get the size
const HcalDetId & id() const
uint16_t adc(int iSample=0) const
double getThreshold(const HcalGenericDetId &detId, CLHEP::HepRandomEngine *) const
HcalTDCParameters theTDCParameters