9#include <top/dbobjects/TOPNominalTDC.h>
10#include <framework/logging/Logger.h>
11#include <framework/gearbox/Unit.h>
28 double doubleHitResolution,
31 const std::string& name):
33 m_numWindows(numWindows), m_subBits(subBits), m_syncTimeBase(syncTimeBase),
34 m_numofBunches(numofBunches),
35 m_offset(offset), m_pileupTime(pileupTime), m_doubleHitResolution(doubleHitResolution),
36 m_timeJitter(timeJitter), m_efficiency(efficiency)
39 B2FATAL(
"TOPNominalTDC: numWindows must be > 0");
41 B2FATAL(
"TOPNominalTDC: subBits must be >= 0");
44 int numBits = subBits - 1;
50 if (numSamples > (1 << (numBits - subBits))) numBits++;
62 if (time < 0)
return overflow;
63 if (time > overflow *
m_binWidth)
return overflow;
79 if (sample < 0)
return false;
89 if (m_efficiency <= 0 or m_efficiency > 1)
return false;
97 cout <<
" offset: " <<
getOffset() <<
" ns" << endl;
98 cout <<
" number of bits: " <<
getNumBits() << endl;
100 cout <<
" number of ASIC windows: " <<
getNumWindows() << endl;
101 cout <<
" number of bits per sample: " <<
getSubBits() << endl;
102 cout <<
" synchonization time base: " <<
getSyncTimeBase() <<
" ns" << endl;
103 cout <<
" pile-up time: " <<
getPileupTime() <<
" ns" << endl;
106 cout <<
" electronic efficiency: " <<
getEfficiency() << endl;
Base class for geometry parameters.
unsigned m_numBits
number of bits
double getTimeJitter() const
Returns r.m.s.
float m_offset
time offset
@ c_syncWindows
number of windows corresponding to syncTimeBase
@ c_WindowSize
number of samples per ASIC window
float m_pileupTime
pile-up time
int getOverflowValue() const
Returns TDC overflow value.
TOPNominalTDC()
Default constructor.
double getPileupTime() const
Returns pile-up time.
float m_doubleHitResolution
double hit resolution time
double getTimeMin() const
Returns time range lower limit.
double getTimeMax() const
Returns time range upper limit.
double getSyncTimeBase() const
Returns synchonization time base (time width of c_syncWindows)
double getOffset() const
Returns time offset.
double getDoubleHitResolution() const
Returns double hit resolution time.
double getEfficiency() const
Returns electronic efficiency.
unsigned getSubBits() const
Returns number of bits per sample.
float m_sampleWidth
time between two samples
double getBinWidth() const
Returns time width of a TDC bin.
float m_binWidth
time width of a TDC bin
unsigned m_numWindows
number of ASIC windows per waveform
unsigned getNumWindows() const
Returns number of ASIC windows per waveform.
unsigned getNumBits() const
Returns number of bits.
static const double ps
[picosecond]
bool isConsistent() const override
Check for consistency of data members.
void printUnderlined(const std::string &title) const
Print the content of the class.
int getTDCcount(double time) const
Converts time to TDC count.
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.
Abstract base class for different kinds of events.