 |
Belle II Software
release-05-01-25
|
11 #include <top/dbobjects/TOPNominalTDC.h>
12 #include <framework/logging/Logger.h>
13 #include <framework/gearbox/Unit.h>
24 TOPNominalTDC::TOPNominalTDC(
int numWindows,
30 double doubleHitResolution,
33 const std::string& name):
35 m_numWindows(numWindows), m_subBits(subBits), m_syncTimeBase(syncTimeBase),
36 m_numofBunches(numofBunches),
37 m_offset(offset), m_pileupTime(pileupTime), m_doubleHitResolution(doubleHitResolution),
38 m_timeJitter(timeJitter), m_efficiency(efficiency)
41 B2FATAL(
"TOPNominalTDC: numWindows must be > 0");
43 B2FATAL(
"TOPNominalTDC: subBits must be >= 0");
46 int numBits = subBits - 1;
52 if (numSamples > (1 << (numBits - subBits))) numBits++;
64 if (time < 0)
return overflow;
65 if (time > overflow *
m_binWidth)
return overflow;
81 if (sample < 0)
return false;
91 if (m_efficiency <= 0 or m_efficiency > 1)
return false;
99 cout <<
" offset: " <<
getOffset() <<
" ns" << endl;
100 cout <<
" number of bits: " <<
getNumBits() << endl;
102 cout <<
" number of ASIC windows: " <<
getNumWindows() << endl;
103 cout <<
" number of bits per sample: " <<
getSubBits() << endl;
104 cout <<
" synchonization time base: " <<
getSyncTimeBase() <<
" ns" << endl;
105 cout <<
" pile-up time: " <<
getPileupTime() <<
" ns" << endl;
108 cout <<
" electronic efficiency: " <<
getEfficiency() << endl;
@ c_WindowSize
number of samples per ASIC window
unsigned m_numBits
number of bits
static const double ps
[picosecond]
unsigned m_numWindows
number of ASIC windows per waveform
Base class for geometry parameters.
float m_sampleWidth
time between two samples
unsigned getNumBits() const
Returns number of bits.
float m_pileupTime
pile-up time
float m_doubleHitResolution
double hit resolution time
void print(const std::string &title="Nominal time-to-digit conversion parameters") const override
Print the content of the class.
bool isSampleValid(int sample) const
Check for the validity of sample number.
int getSample(double time) const
Converts time to sample number.
double getPileupTime() const
Returns pile-up time.
float m_offset
time offset
Abstract base class for different kinds of events.
void printUnderlined(const std::string &title) const
Print the content of the class.
double getDoubleHitResolution() const
Returns double hit resolution time.
int getOverflowValue() const
Returns TDC overflow value.
bool isConsistent() const override
Check for consistency of data members.
double getEfficiency() const
Returns electronic efficiency.
unsigned getSubBits() const
Returns number of bits per sample.
double getTimeMin() const
Returns time range lower limit.
float m_binWidth
time width of a TDC bin
double getTimeMax() const
Returns time range upper limit.
double getOffset() const
Returns time offset.
double getSyncTimeBase() const
Returns synchonization time base (time width of c_syncWindows)
unsigned getNumWindows() const
Returns number of ASIC windows per waveform.
double getBinWidth() const
Returns time width of a TDC bin.
@ c_syncWindows
number of windows corresponding to syncTimeBase
double getTimeJitter() const
Returns r.m.s.
int getTDCcount(double time) const
Converts time to TDC count.