Jpp test-rotations-old
the software that should make you happy
Loading...
Searching...
No Matches
time_converter Class Reference

Auxiliary class to convert DAQ hit time to/from Monte Carlo hit time. More...

#include <time_converter.hh>

Public Member Functions

 time_converter ()
 Default constructor.
 
 time_converter (const Evt &event)
 Constructor.
 
 time_converter (const Evt &event, const JDAQChronometer &chronometer)
 Constructor.
 
double getTime () const
 Get DAQ/trigger time minus Monte Carlo time.
 
double putTime () const
 Get Monte Carlo time minus DAQ/trigger time.
 
double getTime (const double t0) const
 Get Monte Carlo hit time.
 
double putTime (const double t0) const
 Get DAQ hit time.
 

Protected Attributes

double __t0
 
double __t1
 

Detailed Description

Auxiliary class to convert DAQ hit time to/from Monte Carlo hit time.

Definition at line 19 of file time_converter.hh.

Constructor & Destructor Documentation

◆ time_converter() [1/3]

time_converter::time_converter ( )
inline

Default constructor.

Definition at line 25 of file time_converter.hh.

25 :
26 __t0(0.0),
27 __t1(0.0)
28 {}

◆ time_converter() [2/3]

time_converter::time_converter ( const Evt & event)
inline

Constructor.

Note that this constructor should only be used after incorporation of KM3NETDAQ::JDAQEvent.

Parameters
eventevent

Definition at line 37 of file time_converter.hh.

37 :
38 __t0(event.mc_t),
40 {}
double getTimeOfRTS(const JDAQChronometer &chronometer)
Get time of last RTS in ns since start of run for a given chronometer.
int frame_index
from the raw data
Definition Evt.hh:29
double mc_t
MC: time where the mc-event was put in the timeslice, since start of run (offset+frameidx*timeslice_d...
Definition Evt.hh:47

◆ time_converter() [3/3]

time_converter::time_converter ( const Evt & event,
const JDAQChronometer & chronometer )
inline

Constructor.

Parameters
eventMonte Carlo event
chronometerDAQ chronometer

Definition at line 49 of file time_converter.hh.

50 :
51 __t0(event.mc_t),
52 __t1(getTimeOfRTS(chronometer))
53 {}

Member Function Documentation

◆ getTime() [1/2]

double time_converter::getTime ( ) const
inline

Get DAQ/trigger time minus Monte Carlo time.

Returns
time difference [ns]

Definition at line 61 of file time_converter.hh.

62 {
63 return __t1 - __t0;
64 }

◆ putTime() [1/2]

double time_converter::putTime ( ) const
inline

Get Monte Carlo time minus DAQ/trigger time.

Returns
time difference [ns]

Definition at line 72 of file time_converter.hh.

73 {
74 return __t0 - __t1;
75 }

◆ getTime() [2/2]

double time_converter::getTime ( const double t0) const
inline

Get Monte Carlo hit time.

Parameters
t0DAQ/trigger hit time [ns]
Returns
Monte Carlo hit time [ns]

Definition at line 84 of file time_converter.hh.

85 {
86 return t0 + __t1 - __t0;
87 }

◆ putTime() [2/2]

double time_converter::putTime ( const double t0) const
inline

Get DAQ hit time.

Parameters
t0Monte Carlo hit time [ns]
Returns
DAQ/trigger hit time [ns]

Definition at line 96 of file time_converter.hh.

97 {
98 return t0 - __t1 + __t0;
99 }

Member Data Documentation

◆ __t0

double time_converter::__t0
protected

Definition at line 102 of file time_converter.hh.

◆ __t1

double time_converter::__t1
protected

Definition at line 103 of file time_converter.hh.


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