KLM time conversion.
More...
#include <KLMTime.h>
|
void | updateConstants () |
| Update constants from database objects.
|
|
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.
|
|
std::pair< int, double > | getRPCTimes (int ctime, int tdc, int triggerTime) const |
| Get coarse and fine times for RPC.
|
|
double | getTimeSimulation (int tdc, bool scintillator) const |
| Get time for simulation.
|
|
uint16_t | getTDCByTime (double time) const |
| Get TDC by time.
|
|
KLM time conversion.
Definition at line 27 of file KLMTime.h.
◆ KLMTime()
◆ ~KLMTime()
◆ getCTimePeriod()
double getCTimePeriod |
( |
| ) |
const |
|
inline |
Get CTIME period.
Definition at line 53 of file KLMTime.h.
54 {
56 }
double m_CTimePeriod
CTIME period.
◆ getRPCTimes()
std::pair< int, double > getRPCTimes |
( |
int |
ctime, |
|
|
int |
tdc, |
|
|
int |
triggerTime |
|
) |
| const |
Get coarse and fine times for RPC.
- Parameters
-
[in] | ctime | REVO9 time. |
[in] | tdc | TDC. |
[in] | triggerTime | REVO9 Trigger time. |
Definition at line 46 of file KLMTime.cc.
47{
48
49 int relativeTime = tdc & 0x7FF;
50
51
52
53
54
55
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,
64}
double m_TDCPeriod
TDC period (stored here because getting it from m_HardwareClockSettings requires to search in a map).
◆ getScintillatorTime()
double getScintillatorTime |
( |
int |
ctime, |
|
|
int |
tdc, |
|
|
int |
triggerCTime |
|
) |
| const |
Get time for scintillator.
- Parameters
-
[in] | ctime | CTIME. |
[in] | tdc | TDC. |
[in] | triggerCTime | Trigger CTIME. |
Definition at line 27 of file KLMTime.cc.
28{
30
31 int relativeTime;
32
33
34
35 int correctedCTime = (((ctime << cTimeShift) & 0xFFFF) << 3) + (tdc & 0x7);
36 int correctedTriggerCTime = ((triggerCTime << cTimeShift) & 0xFFFF) << 3;
37
38 if (correctedCTime <= correctedTriggerCTime)
39 relativeTime = correctedCTime - correctedTriggerCTime;
40 else
41 relativeTime = correctedCTime - correctedTriggerCTime - (0x10000 << 3);
42
44}
DBObjPtr< KLMTimeConversion > m_KLMTimeConversion
KLM time conversion.
◆ getTDCByTime()
uint16_t getTDCByTime |
( |
double |
time | ) |
const |
◆ getTDCPeriod()
double getTDCPeriod |
( |
| ) |
const |
|
inline |
Get TDC period.
Definition at line 45 of file KLMTime.h.
◆ getTimeSimulation()
double getTimeSimulation |
( |
int |
tdc, |
|
|
bool |
scintillator |
|
) |
| const |
Get time for simulation.
- Parameters
-
[in] | tdc | TDC. |
[in] | scintillator | Scintillator (true) or RPC (false). |
Definition at line 66 of file KLMTime.cc.
67{
69 (void)scintillator;
71}
◆ Instance()
Instantiation.
Definition at line 14 of file KLMTime.cc.
15{
16 static KLMTime klmElementNumbers;
17 return klmElementNumbers;
18}
◆ 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.
21{
25}
DBObjPtr< HardwareClockSettings > m_HardwareClockSettings
Hardware clock settings.
◆ m_CTimePeriod
double m_CTimePeriod = 0. |
|
private |
◆ m_HardwareClockSettings
Hardware clock settings.
Definition at line 106 of file KLMTime.h.
◆ m_KLMTimeConversion
KLM time conversion.
Definition at line 103 of file KLMTime.h.
◆ m_TDCPeriod
TDC period (stored here because getting it from m_HardwareClockSettings requires to search in a map).
Definition at line 112 of file KLMTime.h.
The documentation for this class was generated from the following files: