Belle II Software development
TOPSampleTimes Class Reference

Calibration constants of a singe ASIC channel: time axis (sample times) More...

#include <TOPSampleTimes.h>

Inheritance diagram for TOPSampleTimes:

Public Types

enum  EStatus {
  c_Default = 0 ,
  c_Calibrated = 1 ,
  c_Unusable = 2
}
 Calibration status values. More...
 
enum  {
  c_WindowSize = TOPASICPedestals::c_WindowSize ,
  c_TimeAxisSize = c_WindowSize * 4
}
 time axis size (time axis for 4 ASIC windows) More...
 

Public Member Functions

 TOPSampleTimes ()
 Default constructor.
 
 TOPSampleTimes (unsigned scrodID, unsigned channel, double syncTimeBase)
 Useful constructor, sets equidistant time base (uncalibrated)
 
 ~TOPSampleTimes ()
 Destructor.
 
void setTimeAxis (double syncTimeBase)
 Sets equidistant time axis (uncalibrated).
 
void setTimeAxis (const std::vector< double > &sampleTimes, double syncTimeBase)
 Sets time axis from calibration data and switches status to calibrated.
 
void setTimeError (double error)
 Sets uncertainty on time base calibration incl.
 
void setUnusable ()
 Switches calibration status to unusable to flag badly calibrated constant.
 
unsigned getScrodID () const
 Returns scrod ID.
 
unsigned getChannel () const
 Returns hardware channel number.
 
double getTimeRange () const
 Returns time axis range (time interval corresponding to 4 asic windows)
 
std::vector< double > getTimeAxis () const
 Returns time axis (sample times)
 
double getTimeError () const
 Returns uncertainty on time base calibration incl.
 
double getFullTime (int window, double sample) const
 Returns time with respect to sample 0 of window 0.
 
double getTime (int window, double sample) const
 Returns time w.r.t SSTin that corresponds to the window number.
 
double getDeltaTime (int window, double sample2, double sample1) const
 Returns time difference between sample2 and sample1.
 
double getTimeBin (int window, int sampleNumber) const
 Returns time bin of a given sample number and window (e.g.
 
double getSample (int window, double time) const
 Returns sample with respect to sample 0 of the specified ASIC window (inverse of getTime).
 
bool isCalibrated () const
 Returns calibration status.
 
bool isDefault () const
 Returns calibration status.
 
bool isUnusable () const
 Returns calibration status.
 

Private Member Functions

 ClassDef (TOPSampleTimes, 2)
 ClassDef.
 

Private Attributes

unsigned short m_scrodID = 0
 scrod ID
 
unsigned short m_channel = 0
 hardware channel number within SCROD
 
float m_timeAxis [c_TimeAxisSize+1] = {0}
 time axis + right border point
 
float m_timeError = 0
 uncertainty of time axis points incl.
 
EStatus m_calibrated = c_Default
 calibration status
 

Detailed Description

Calibration constants of a singe ASIC channel: time axis (sample times)

Definition at line 24 of file TOPSampleTimes.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

time axis size (time axis for 4 ASIC windows)

Definition at line 39 of file TOPSampleTimes.h.

39 {c_WindowSize = TOPASICPedestals::c_WindowSize,
40 c_TimeAxisSize = c_WindowSize * 4
41 };
@ c_WindowSize
number of samples

◆ EStatus

enum EStatus

Calibration status values.

Enumerator
c_Default 

uncalibrated default value

c_Calibrated 

good calibrated value

c_Unusable 

bad calibrated value

Definition at line 30 of file TOPSampleTimes.h.

30 {
31 c_Default = 0,
32 c_Calibrated = 1,
33 c_Unusable = 2
34 };
@ c_Calibrated
good calibrated value
@ c_Unusable
bad calibrated value
@ c_Default
uncalibrated default value

Constructor & Destructor Documentation

◆ TOPSampleTimes() [1/2]

TOPSampleTimes ( )
inline

Default constructor.

Definition at line 46 of file TOPSampleTimes.h.

47 {}

◆ TOPSampleTimes() [2/2]

TOPSampleTimes ( unsigned  scrodID,
unsigned  channel,
double  syncTimeBase 
)
inline

Useful constructor, sets equidistant time base (uncalibrated)

Parameters
scrodIDscrod ID
channelhardware channel number
syncTimeBasesinchronization time base (width of 2 ASIC windows)

Definition at line 55 of file TOPSampleTimes.h.

55 :
56 m_scrodID(scrodID), m_channel(channel)
57 {
58 setTimeAxis(syncTimeBase);
59 }
unsigned short m_scrodID
scrod ID
unsigned short m_channel
hardware channel number within SCROD
void setTimeAxis(double syncTimeBase)
Sets equidistant time axis (uncalibrated).

◆ ~TOPSampleTimes()

~TOPSampleTimes ( )
inline

Destructor.

Definition at line 64 of file TOPSampleTimes.h.

65 {
66 }

Member Function Documentation

◆ getChannel()

unsigned getChannel ( ) const
inline

Returns hardware channel number.

Returns
channel number

Definition at line 102 of file TOPSampleTimes.h.

102{return m_channel;}

◆ getDeltaTime()

double getDeltaTime ( int  window,
double  sample2,
double  sample1 
) const
inline

Returns time difference between sample2 and sample1.

Note: sample is float - digits that follow the decimal point are used to interpolate the time btw. two samples

Parameters
windowASIC window number
sample2sample counted from the first sample of the specified ASIC window
sample1sample counted from the first sample of the specified ASIC window
Returns
time difference in [ns]

Definition at line 157 of file TOPSampleTimes.h.

158 {
159 return getFullTime(window, sample2) - getFullTime(window, sample1);
160 }
double getFullTime(int window, double sample) const
Returns time with respect to sample 0 of window 0.

◆ getScrodID()

unsigned getScrodID ( ) const
inline

Returns scrod ID.

Returns
scrod ID

Definition at line 96 of file TOPSampleTimes.h.

96{return m_scrodID;}

◆ getTime()

double getTime ( int  window,
double  sample 
) const
inline

Returns time w.r.t SSTin that corresponds to the window number.

Note: sample is float - digits that follow the decimal point are used to interpolate the time btw. two samples

Parameters
windowASIC window number
samplesample counted from the first one in the specified ASIC window
Returns
time in [ns]

Definition at line 142 of file TOPSampleTimes.h.

143 {
144 return getFullTime(window, sample) - window * getTimeRange() / 4.0;
145 }
double getTimeRange() const
Returns time axis range (time interval corresponding to 4 asic windows)

◆ getTimeError()

double getTimeError ( ) const
inline

Returns uncertainty on time base calibration incl.

systematics

Returns
uncertainty of time axis points

Definition at line 120 of file TOPSampleTimes.h.

120{return m_timeError;}
float m_timeError
uncertainty of time axis points incl.

◆ getTimeRange()

double getTimeRange ( ) const
inline

Returns time axis range (time interval corresponding to 4 asic windows)

Returns
time axis range

Definition at line 108 of file TOPSampleTimes.h.

108{return m_timeAxis[c_TimeAxisSize];}
float m_timeAxis[c_TimeAxisSize+1]
time axis + right border point

◆ isCalibrated()

bool isCalibrated ( ) const
inline

Returns calibration status.

Returns
true, if good calibrated

Definition at line 187 of file TOPSampleTimes.h.

187{return m_calibrated == c_Calibrated;}
EStatus m_calibrated
calibration status

◆ isDefault()

bool isDefault ( ) const
inline

Returns calibration status.

Returns
true, if default (= equidistant, not calibrated)

Definition at line 193 of file TOPSampleTimes.h.

193{return m_calibrated == c_Default;}

◆ isUnusable()

bool isUnusable ( ) const
inline

Returns calibration status.

Returns
true, if bad calibrated

Definition at line 199 of file TOPSampleTimes.h.

199{return m_calibrated == c_Unusable;}

◆ setTimeError()

void setTimeError ( double  error)
inline

Sets uncertainty on time base calibration incl.

systematics

Parameters
errorestimated uncertainty of time axis points

Definition at line 85 of file TOPSampleTimes.h.

85{m_timeError = error;}

◆ setUnusable()

void setUnusable ( )
inline

Switches calibration status to unusable to flag badly calibrated constant.

Definition at line 90 of file TOPSampleTimes.h.

Member Data Documentation

◆ m_calibrated

EStatus m_calibrated = c_Default
private

calibration status

Definition at line 207 of file TOPSampleTimes.h.

◆ m_channel

unsigned short m_channel = 0
private

hardware channel number within SCROD

Definition at line 204 of file TOPSampleTimes.h.

◆ m_scrodID

unsigned short m_scrodID = 0
private

scrod ID

Definition at line 203 of file TOPSampleTimes.h.

◆ m_timeAxis

float m_timeAxis[c_TimeAxisSize+1] = {0}
private

time axis + right border point

Definition at line 205 of file TOPSampleTimes.h.

◆ m_timeError

float m_timeError = 0
private

uncertainty of time axis points incl.

systematics

Definition at line 206 of file TOPSampleTimes.h.


The documentation for this class was generated from the following files: