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;
129 return nominal - 0.365*
lsb;
double getThreshold(const HcalGenericDetId &detId) const
void setRandomEngine(CLHEP::HepRandomEngine &engine)
const HcalDbService * theDbService
double pedestal(int fCapId) const
get pedestal for capid=0..3
int preciseSize() const
get the size
float preciseAt(int i) const
const function to access precise samples
double getHysteresisThreshold(double nominal) const
double pedestal(int fCapId) const
get pedestal width for capid=0..3
CLHEP::RandGaussQ * theRandGaussQ
int noTransitionCode() const
int alreadyTransitionCode() const
const HcalCalibrationWidths & getHcalCalibrationWidths(const HcalGenericDetId &fId) const
void timing(const CaloSamples &lf, HcalUpgradeDataFrame &digi) const
adds timing information to the digi
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
const HcalCalibrations & getHcalCalibrations(const HcalGenericDetId &fId) const
HcalTDC(unsigned int thresholdDAC=12)
void setDbService(const HcalDbService *service)
the Producer will probably update this every event
HcalTDCParameters theTDCParameters