Belle II Software  release-08-01-10
KLMTime Class Reference

KLM time conversion. More...

#include <KLMTime.h>

Collaboration diagram for KLMTime:

Public Member Functions

void updateConstants ()
 Update constants from database objects. More...
 
double getTDCPeriod () const
 Get TDC period.
 
double getCTimePeriod () const
 Get CTIME period.
 
double getScintillatorTime (int ctime, int tdc, int triggerCTime) const
 Get time for scintillator. More...
 
std::pair< int, double > getRPCTimes (int ctime, int tdc, int triggerTime) const
 Get coarse and fine times for RPC. More...
 
double getTimeSimulation (int tdc, bool scintillator) const
 Get time for simulation. More...
 
uint16_t getTDCByTime (double time) const
 Get TDC by time.
 

Static Public Member Functions

static KLMTimeInstance ()
 Instantiation.
 

Private Member Functions

 KLMTime ()
 Constructor.
 
 ~KLMTime ()
 Destructor.
 

Private Attributes

DBObjPtr< KLMTimeConversionm_KLMTimeConversion
 KLM time conversion.
 
DBObjPtr< HardwareClockSettingsm_HardwareClockSettings
 Hardware clock settings.
 
double m_TDCPeriod = 0.
 TDC period (stored here because getting it from m_HardwareClockSettings requires to search in a map).
 
double m_CTimePeriod = 0.
 CTIME period.
 

Detailed Description

KLM time conversion.

Definition at line 27 of file KLMTime.h.

Member Function Documentation

◆ getRPCTimes()

std::pair< int, double > getRPCTimes ( int  ctime,
int  tdc,
int  triggerTime 
) const

Get coarse and fine times for RPC.

Parameters
[in]ctimeREVO9 time.
[in]tdcTDC.
[in]triggerTimeREVO9 Trigger time.

Definition at line 46 of file KLMTime.cc.

47 {
48  /* Relative time in TDC periods for RPC hits. */
49  int relativeTime = tdc & 0x7FF;
50  /*
51  * TDC frequency is 8 times greater than revo9 frequency.
52  * The 2 last bits are zero, thus, the precision is 4 * (TDC period).
53  * The TDC has 11 bits of dynamic range. Shift the triggerTime by
54  * 10 ticks to align the new prompt-time peak with the old
55  * TriggerCTime-relative peak (for backward compatibility of calibration).
56  */
57  int trigger = ((triggerTime - 10) & 0x0FF) << 3;
58  if (relativeTime <= trigger)
59  relativeTime -= trigger;
60  else
61  relativeTime -= trigger + 0x800;
62  return std::pair<int, double>(ctime - triggerTime,
63  relativeTime * m_TDCPeriod);
64 }
double m_TDCPeriod
TDC period (stored here because getting it from m_HardwareClockSettings requires to search in a map).
Definition: KLMTime.h:112

◆ getScintillatorTime()

double getScintillatorTime ( int  ctime,
int  tdc,
int  triggerCTime 
) const

Get time for scintillator.

Parameters
[in]ctimeCTIME.
[in]tdcTDC.
[in]triggerCTimeTrigger CTIME.

Definition at line 27 of file KLMTime.cc.

◆ getTimeSimulation()

double getTimeSimulation ( int  tdc,
bool  scintillator 
) const

Get time for simulation.

Parameters
[in]tdcTDC.
[in]scintillatorScintillator (true) or RPC (false).

Definition at line 66 of file KLMTime.cc.

◆ updateConstants()

void updateConstants ( )

Update constants from database objects.

This function needs to be called when database objects change, for example, at the beginning of the run.

Definition at line 20 of file KLMTime.cc.


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