Public Member Functions | Protected Attributes | List of all members
gar::detinfo::DetectorClocksStandardGAr Class Reference

#include <DetectorClocksStandardGAr.h>

Inheritance diagram for gar::detinfo::DetectorClocksStandardGAr:
gar::detinfo::DetectorClocks

Public Member Functions

 DetectorClocksStandardGAr ()
 
 DetectorClocksStandardGAr (fhicl::ParameterSet const &pset)
 
 DetectorClocksStandardGAr (DetectorClocksStandardGAr const &)=delete
 
virtual ~DetectorClocksStandardGAr ()
 
bool Configure (fhicl::ParameterSet const &pset)
 
bool Update (uint64_t ts=0)
 
virtual double TriggerOffsetTPC () const
 
void debugReport () const
 
std::string TrigModuleName () const
 
virtual double G4ToElecTime (double g4_time) const
 Given Geant4 time [ns], returns relative time [ns] w.r.t. electronics time T0. More...
 
virtual double TriggerTime () const
 Trigger electronics clock time in [us]. More...
 
virtual double BeamGateTime () const
 Beam gate electronics clock time in [us]. More...
 
virtual double SpillLength () const
 Duration of spill [ns]. More...
 
virtual std::vector< std::stringConfigNames () const
 
virtual std::vector< double > ConfigValues () const
 
void SetConfigValue (size_t i, double val)
 
virtual void SetTriggerTime (double trig_time, double beam_time)
 Setter for trigger times. More...
 
virtual void SetSpillLength (double spillLength)
 
virtual const ElecClockTPCClock () const
 Borrow a const TPC clock with time set to Trigger time [us]. More...
 
virtual ElecClock TPCClock (double time) const
 Create a TPC clock for a given time [us] from clock counting start. More...
 
detinfo::ElecClock TPCClock (unsigned int sample, unsigned int frame) const
 Create a TPC clock for a given sample/frame number in TPC clock frequency. More...
 
virtual const detinfo::ElecClockTriggerClock () const
 Borrow a const Trigger clock with time set to Trigger time [us]. More...
 
virtual detinfo::ElecClock TriggerClock (double time) const
 Create a Trigger clock for a given time [us] from clock counting start. More...
 
virtual detinfo::ElecClock TriggerClock (unsigned int sample, unsigned int frame) const
 Create a Trigger clock for a given sample/frame number in Trigger clock frequency. More...
 
virtual const detinfo::ElecClockExternalClock () const
 Borrow a const Trigger clock with time set to External Time [us]. More...
 
virtual detinfo::ElecClock ExternalClock (double time) const
 Create a External clock for a given time [us] from clock counting start. More...
 
virtual detinfo::ElecClock ExternalClock (unsigned int sample, unsigned int frame) const
 Create a External clock for a given sample/frame number in External clock frequency. More...
 
virtual double TPCTick2TrigTime (double tick) const
 Given TPC time-tick (waveform index), returns time [ns] w.r.t. trigger time stamp. More...
 
virtual double TPCTick2BeamTime (double tick) const
 Given TPC time-tick (waveform index), returns time [ns] w.r.t. beam gate time. More...
 
virtual double ExternalTick2TrigTime (double tick, size_t sample, size_t frame) const
 Given External time-tick (waveform index), sample and frame number, returns time [ns] w.r.t. trigger time stamp. More...
 
virtual double ExternalTick2BeamTime (double tick, size_t sample, size_t frame) const
 Given External time-tick (waveform index), sample and frame number, returns time [ns] w.r.t. beam gate time stamp. More...
 
virtual double TPCTick2TDC (double tick) const
 Given TPC time-tick (waveform index), returns electronics clock count [tdc]. More...
 
virtual double TPCG4Time2TDC (double g4time) const
 Given G4 time [ns], returns corresponding TPC electronics clock count [tdc]. More...
 
virtual double ExternalTick2TDC (double tick, size_t sample, size_t frame) const
 Given External time-tick (waveform index), sample and frame number, returns time electronics clock count [tdc]. More...
 
virtual double ExternalG4Time2TDC (double g4time) const
 Given G4 time [ns], returns corresponding External electronics clock count [tdc]. More...
 
virtual double TPCTick2Time (double tick) const
 Given TPC time-tick (waveform index), returns electronics clock [us]. More...
 
virtual double ExternalTick2Time (double tick, size_t sample, size_t frame) const
 Given External time-tick (waveform index), sample and frame number, returns electronics clock [us]. More...
 
virtual double TPCTDC2Tick (double tdc) const
 Given electronics clock count [tdc] returns TPC time-tick. More...
 
virtual double TPCG4Time2Tick (double g4time) const
 Given G4 time returns electronics clock count [tdc]. More...
 
bool InheritClockConfig ()
 
void ApplyParams ()
 Internal function to apply loaded parameters to member attributes. More...
 
bool IsRightConfig (const fhicl::ParameterSet &ps) const
 Internal function used to search for the right configuration set in the data file. More...
 
- Public Member Functions inherited from gar::detinfo::DetectorClocks
 DetectorClocks (const DetectorClocks &)=delete
 
 DetectorClocks (DetectorClocks &&)=delete
 
DetectorClocksoperator= (const DetectorClocks &)=delete
 
DetectorClocksoperator= (DetectorClocks &&)=delete
 
virtual ~DetectorClocks ()=default
 

Protected Attributes

std::vector< std::stringfConfigName
 
std::vector< double > fConfigValue
 
bool fInheritClockConfig
 
std::string fTrigModuleName
 
double fG4RefTime
 Electronics clock counting start time in G4 time frame [us]. More...
 
double fFramePeriod
 Frame period. More...
 
ElecClock fTPCClock
 TPC clock. More...
 
ElecClock fTriggerClock
 Trigger clock. More...
 
ElecClock fExternalClock
 External clock. More...
 
double fTriggerOffsetTPC
 Time offset from trigger to TPC readout start. More...
 
double fTriggerTime
 Trigger time in [ns]. More...
 
double fBeamGateTime
 BeamGate time in [ns]. More...
 
double fSpillLength
 Duration of beam spill, ns. More...
 

Additional Inherited Members

- Protected Member Functions inherited from gar::detinfo::DetectorClocks
 DetectorClocks ()=default
 

Detailed Description

Definition at line 24 of file DetectorClocksStandardGAr.h.

Constructor & Destructor Documentation

gar::detinfo::DetectorClocksStandardGAr::DetectorClocksStandardGAr ( )

Definition at line 8 of file DetectorClocksStandardGAr.cxx.

11  , fTrigModuleName ("")
18  , fTriggerTime (0)
19  , fBeamGateTime (0)
20  {
21 
22  fConfigName.at(detinfo::kG4RefTime) = "G4RefTime";
23  fConfigName.at(detinfo::kTriggerOffsetTPC) = "TriggerOffsetTPC";
24  fConfigName.at(detinfo::kFramePeriod) = "FramePeriod";
25  fConfigName.at(detinfo::kClockSpeedTPC) = "ClockSpeedTPC";
26  fConfigName.at(detinfo::kClockSpeedTrigger) = "ClockSpeedTrigger";
27  fConfigName.at(detinfo::kClockSpeedExternal) = "ClockSpeedExternal";
28  fConfigName.at(detinfo::kDefaultTrigTime) = "DefaultTrigTime";
29  fConfigName.at(detinfo::kDefaultBeamTime) = "DefaultBeamTime";
30  fConfigName.at(detinfo::kDefaultSpillLength) = "DefaultSpillLength";
31 
32  fInheritClockConfig = false;
33  }
const double kDEFAULT_FREQUENCY_TRIGGER
Default Trigger clock speed in MHz.
const double kDEFAULT_FRAME_PERIOD
Default Frame period in nano-second.
const double kDEFAULT_MC_CLOCK_T0
Default G4 reference time in nano-second.
const double kDEFAULT_FREQUENCY_TPC
Default TPC clock speed in MHz.
double fG4RefTime
Electronics clock counting start time in G4 time frame [us].
double fTriggerOffsetTPC
Time offset from trigger to TPC readout start.
const double kDEFAULT_FREQUENCY_EXTERNAL
Default External clock speed in MHz.
const double kDEFAULT_TRIG_OFFSET_TPC
Default TPC readout start time offset from trigger in nano-second.
gar::detinfo::DetectorClocksStandardGAr::DetectorClocksStandardGAr ( fhicl::ParameterSet const &  pset)

Definition at line 36 of file DetectorClocksStandardGAr.cxx.

38  {
39  // In a constructor, the version of virtual method that is called
40  // is always the one specific of the class being constructed
41  // (the one mentioned in the name of the constructor itself).
42  // For clarity, we explicitly show that:
44 
45  }
bool Configure(fhicl::ParameterSet const &pset)
gar::detinfo::DetectorClocksStandardGAr::DetectorClocksStandardGAr ( DetectorClocksStandardGAr const &  )
delete
virtual gar::detinfo::DetectorClocksStandardGAr::~DetectorClocksStandardGAr ( )
inlinevirtual

Definition at line 30 of file DetectorClocksStandardGAr.h.

30 {};

Member Function Documentation

void gar::detinfo::DetectorClocksStandardGAr::ApplyParams ( )

Internal function to apply loaded parameters to member attributes.

Definition at line 80 of file DetectorClocksStandardGAr.cxx.

82  {
83 
87 
90 
91  }
double fG4RefTime
Electronics clock counting start time in G4 time frame [us].
double fTriggerOffsetTPC
Time offset from trigger to TPC readout start.
Class representing the time measured by an electronics clock.
Definition: ElecClock.h:91
virtual double gar::detinfo::DetectorClocksStandardGAr::BeamGateTime ( ) const
inlinevirtual

Beam gate electronics clock time in [us].

Implements gar::detinfo::DetectorClocks.

Definition at line 54 of file DetectorClocksStandardGAr.h.

54 { return fBeamGateTime; }
virtual std::vector<std::string> gar::detinfo::DetectorClocksStandardGAr::ConfigNames ( ) const
inlinevirtual

Implements gar::detinfo::DetectorClocks.

Definition at line 60 of file DetectorClocksStandardGAr.h.

60 { return fConfigName; }
bool gar::detinfo::DetectorClocksStandardGAr::Configure ( fhicl::ParameterSet const &  pset)

Definition at line 55 of file DetectorClocksStandardGAr.cxx.

56  {
57 
58  // Read fcl parameters
59  fTrigModuleName = pset.get< std::string >( "TrigModuleName" );
60  fInheritClockConfig = pset.get< bool >( "InheritClockConfig" );
61  fConfigValue.at(kG4RefTime) = pset.get< double >( fConfigName.at(kG4RefTime) .c_str() );
62  fConfigValue.at(kFramePeriod) = pset.get< double >( fConfigName.at(kFramePeriod) .c_str() );
63  fConfigValue.at(kTriggerOffsetTPC) = pset.get< double >( fConfigName.at(kTriggerOffsetTPC) .c_str() );
64  fConfigValue.at(kClockSpeedTPC) = pset.get< double >( fConfigName.at(kClockSpeedTPC) .c_str() );
65  fConfigValue.at(kClockSpeedTrigger) = pset.get< double >( fConfigName.at(kClockSpeedTrigger) .c_str() );
66  fConfigValue.at(kClockSpeedExternal) = pset.get< double >( fConfigName.at(kClockSpeedExternal).c_str() );
67  fConfigValue.at(kDefaultTrigTime) = pset.get< double >( fConfigName.at(kDefaultTrigTime) .c_str() );
68  fConfigValue.at(kDefaultBeamTime) = pset.get< double >( fConfigName.at(kDefaultBeamTime) .c_str() );
69  fConfigValue.at(kDefaultSpillLength) = pset.get< double >( fConfigName.at(kDefaultSpillLength).c_str() );
70 
71  // Save fcl parameters in a container to check for inheritance
73 
74  ApplyParams();
75 
76  return true;
77  }
std::string string
Definition: nybbler.cc:12
void ApplyParams()
Internal function to apply loaded parameters to member attributes.
virtual std::vector<double> gar::detinfo::DetectorClocksStandardGAr::ConfigValues ( ) const
inlinevirtual

Implements gar::detinfo::DetectorClocks.

Definition at line 61 of file DetectorClocksStandardGAr.h.

61 { return fConfigValue; }
void gar::detinfo::DetectorClocksStandardGAr::debugReport ( ) const

Definition at line 109 of file DetectorClocksStandardGAr.cxx.

111  {
112  MF_LOG_VERBATIM("DetectorClocksStandardGAr")
113  << "fConfigValues contents: ";
114 
115  for(size_t i = 0; i < kInheritConfigTypeMax; ++i)
116  MF_LOG_VERBATIM("DetectorClocksStandardGAr")
117  << " "
118  << fConfigName.at(i).c_str()
119  << " ... "
120  << fConfigValue.at(i);
121 
122  MF_LOG_VERBATIM("DetectorClocksStandardGAr")
123  << "Trigger time @ " << fTriggerTime
124  << "\nBeamGate time @ " << fBeamGateTime
125  << "\nTrigOffsetTPC @ " << TriggerOffsetTPC()
126  << "\nG4RefTime @ " << fG4RefTime
127  << "\nTPC Freq. @ " << fTPCClock.Frequency()
128  << "\nTrigger Freq. @ " << fTriggerClock.Frequency()
129  << "\nExternal Freq. @ " << fExternalClock.Frequency()
130  << "\nTPC start tick [tdc] : " << TPCTick2TDC(0)
131  << "\nTPC start tick from trigger [ns] : " << TPCTick2TrigTime(0)
132  << "\nTPC start tick from beam [ns] : " << TPCTick2BeamTime(0)
133  << "\nTPC tdc=0 in tick : " << TPCTDC2Tick(0)
134  << "\nTPC G4 time 0 in tick : " << TPCG4Time2Tick(0);
135 
136  }
virtual double TPCTick2TrigTime(double tick) const
Given TPC time-tick (waveform index), returns time [ns] w.r.t. trigger time stamp.
double fG4RefTime
Electronics clock counting start time in G4 time frame [us].
virtual double TPCG4Time2Tick(double g4time) const
Given G4 time returns electronics clock count [tdc].
#define MF_LOG_VERBATIM(category)
double Frequency() const
Frequency in MHz.
Definition: ElecClock.h:89
virtual double TPCTDC2Tick(double tdc) const
Given electronics clock count [tdc] returns TPC time-tick.
virtual double TPCTick2TDC(double tick) const
Given TPC time-tick (waveform index), returns electronics clock count [tdc].
virtual double TPCTick2BeamTime(double tick) const
Given TPC time-tick (waveform index), returns time [ns] w.r.t. beam gate time.
virtual const detinfo::ElecClock& gar::detinfo::DetectorClocksStandardGAr::ExternalClock ( ) const
inlinevirtual

Borrow a const Trigger clock with time set to External Time [us].

Implements gar::detinfo::DetectorClocks.

Definition at line 111 of file DetectorClocksStandardGAr.h.

112  { return fExternalClock; }
virtual detinfo::ElecClock gar::detinfo::DetectorClocksStandardGAr::ExternalClock ( double  time) const
inlinevirtual

Create a External clock for a given time [us] from clock counting start.

Implements gar::detinfo::DetectorClocks.

Definition at line 115 of file DetectorClocksStandardGAr.h.

double FramePeriod() const
A single frame period in micro-second.
Definition: ElecClock.h:92
double Frequency() const
Frequency in MHz.
Definition: ElecClock.h:89
Class representing the time measured by an electronics clock.
Definition: ElecClock.h:91
virtual detinfo::ElecClock gar::detinfo::DetectorClocksStandardGAr::ExternalClock ( unsigned int  sample,
unsigned int  frame 
) const
inlinevirtual

Create a External clock for a given sample/frame number in External clock frequency.

Implements gar::detinfo::DetectorClocks.

Definition at line 119 of file DetectorClocksStandardGAr.h.

121  { detinfo::ElecClock clock = ExternalClock(); clock.SetTime(sample,frame); return clock; }
Class representing the time measured by an electronics clock.
Definition: ElecClock.h:91
virtual const detinfo::ElecClock & ExternalClock() const
Borrow a const Trigger clock with time set to External Time [us].
virtual double gar::detinfo::DetectorClocksStandardGAr::ExternalG4Time2TDC ( double  g4time) const
inlinevirtual

Given G4 time [ns], returns corresponding External electronics clock count [tdc].

Implements gar::detinfo::DetectorClocks.

Definition at line 161 of file DetectorClocksStandardGAr.h.

162  { return G4ToElecTime(g4time) / fExternalClock.TickPeriod(); }
double TickPeriod() const
A single tick period in nano-second, frequency is in MHz.
Definition: ElecClock.h:125
virtual double G4ToElecTime(double g4_time) const
Given Geant4 time [ns], returns relative time [ns] w.r.t. electronics time T0.
virtual double gar::detinfo::DetectorClocksStandardGAr::ExternalTick2BeamTime ( double  tick,
size_t  sample,
size_t  frame 
) const
inlinevirtual

Given External time-tick (waveform index), sample and frame number, returns time [ns] w.r.t. beam gate time stamp.

Implements gar::detinfo::DetectorClocks.

Definition at line 141 of file DetectorClocksStandardGAr.h.

142  { return fExternalClock.TickPeriod() * tick + fExternalClock.Time(sample,frame) - BeamGateTime(); }
virtual double BeamGateTime() const
Beam gate electronics clock time in [us].
double TickPeriod() const
A single tick period in nano-second, frequency is in MHz.
Definition: ElecClock.h:125
tick_as<> tick
Tick number, represented by std::ptrdiff_t.
Definition: electronics.h:75
double Time() const
Time (stored) in nano-second.
Definition: ElecClock.h:77
virtual double gar::detinfo::DetectorClocksStandardGAr::ExternalTick2TDC ( double  tick,
size_t  sample,
size_t  frame 
) const
inlinevirtual

Given External time-tick (waveform index), sample and frame number, returns time electronics clock count [tdc].

Implements gar::detinfo::DetectorClocks.

Definition at line 157 of file DetectorClocksStandardGAr.h.

158  { return fExternalClock.Ticks(sample,frame) + tick; }
tick_as<> tick
Tick number, represented by std::ptrdiff_t.
Definition: electronics.h:75
int Ticks() const
of Ticks
Definition: ElecClock.h:95
virtual double gar::detinfo::DetectorClocksStandardGAr::ExternalTick2Time ( double  tick,
size_t  sample,
size_t  frame 
) const
inlinevirtual

Given External time-tick (waveform index), sample and frame number, returns electronics clock [us].

Implements gar::detinfo::DetectorClocks.

Definition at line 172 of file DetectorClocksStandardGAr.h.

173  { return fExternalClock.Time(sample,frame) + tick * fExternalClock.TickPeriod(); }
double TickPeriod() const
A single tick period in nano-second, frequency is in MHz.
Definition: ElecClock.h:125
tick_as<> tick
Tick number, represented by std::ptrdiff_t.
Definition: electronics.h:75
double Time() const
Time (stored) in nano-second.
Definition: ElecClock.h:77
virtual double gar::detinfo::DetectorClocksStandardGAr::ExternalTick2TrigTime ( double  tick,
size_t  sample,
size_t  frame 
) const
inlinevirtual

Given External time-tick (waveform index), sample and frame number, returns time [ns] w.r.t. trigger time stamp.

Implements gar::detinfo::DetectorClocks.

Definition at line 137 of file DetectorClocksStandardGAr.h.

138  { return fExternalClock.TickPeriod() * tick + fExternalClock.Time(sample,frame) - TriggerTime(); }
double TickPeriod() const
A single tick period in nano-second, frequency is in MHz.
Definition: ElecClock.h:125
tick_as<> tick
Tick number, represented by std::ptrdiff_t.
Definition: electronics.h:75
virtual double TriggerTime() const
Trigger electronics clock time in [us].
double Time() const
Time (stored) in nano-second.
Definition: ElecClock.h:77
virtual double gar::detinfo::DetectorClocksStandardGAr::G4ToElecTime ( double  g4_time) const
inlinevirtual

Given Geant4 time [ns], returns relative time [ns] w.r.t. electronics time T0.

Implements gar::detinfo::DetectorClocks.

Definition at line 48 of file DetectorClocksStandardGAr.h.

48 {return g4_time - fG4RefTime; }
double fG4RefTime
Electronics clock counting start time in G4 time frame [us].
bool gar::detinfo::DetectorClocksStandardGAr::InheritClockConfig ( )
inline
bool gar::detinfo::DetectorClocksStandardGAr::IsRightConfig ( const fhicl::ParameterSet ps) const

Internal function used to search for the right configuration set in the data file.

Definition at line 94 of file DetectorClocksStandardGAr.cxx.

96  {
97  std::string s;
98  double d;
99 
100  bool result = !ps.get_if_present("module_label", s);
101  for(size_t i = 0; result && i < kInheritConfigTypeMax; ++i)
102 
103  result = result && ps.get_if_present(fConfigName.at(i).c_str(),d);
104 
105  return result;
106  }
static QCString result
std::string string
Definition: nybbler.cc:12
std::optional< T > get_if_present(std::string const &key) const
Definition: ParameterSet.h:224
static QCString * s
Definition: config.cpp:1042
void gar::detinfo::DetectorClocksStandardGAr::SetConfigValue ( size_t  i,
double  val 
)
inline

Definition at line 63 of file DetectorClocksStandardGAr.h.

virtual void gar::detinfo::DetectorClocksStandardGAr::SetSpillLength ( double  spillLength)
inlinevirtual

Definition at line 73 of file DetectorClocksStandardGAr.h.

73 { fSpillLength = spillLength; }
double fSpillLength
Duration of beam spill, ns.
virtual void gar::detinfo::DetectorClocksStandardGAr::SetTriggerTime ( double  trig_time,
double  beam_time 
)
inlinevirtual

Setter for trigger times.

Definition at line 66 of file DetectorClocksStandardGAr.h.

67  {
68  fTriggerTime = trig_time;
69  fBeamGateTime = beam_time;
70  fTPCClock.SetTime(trig_time);
71  fTriggerClock.SetTime(trig_time);
72  }
void SetTime(double time)
Definition: ElecClock.h:58
virtual double gar::detinfo::DetectorClocksStandardGAr::SpillLength ( ) const
inlinevirtual

Duration of spill [ns].

Implements gar::detinfo::DetectorClocks.

Definition at line 57 of file DetectorClocksStandardGAr.h.

57 { return fSpillLength; }
double fSpillLength
Duration of beam spill, ns.
virtual const ElecClock& gar::detinfo::DetectorClocksStandardGAr::TPCClock ( ) const
inlinevirtual

Borrow a const TPC clock with time set to Trigger time [us].

Implements gar::detinfo::DetectorClocks.

Definition at line 79 of file DetectorClocksStandardGAr.h.

80  { return fTPCClock; }
virtual ElecClock gar::detinfo::DetectorClocksStandardGAr::TPCClock ( double  time) const
inlinevirtual

Create a TPC clock for a given time [us] from clock counting start.

Implements gar::detinfo::DetectorClocks.

Definition at line 83 of file DetectorClocksStandardGAr.h.

84  { return ElecClock(time,fTPCClock.FramePeriod(),fTPCClock.Frequency());}
double FramePeriod() const
A single frame period in micro-second.
Definition: ElecClock.h:92
double Frequency() const
Frequency in MHz.
Definition: ElecClock.h:89
detinfo::ElecClock gar::detinfo::DetectorClocksStandardGAr::TPCClock ( unsigned int  sample,
unsigned int  frame 
) const
inlinevirtual

Create a TPC clock for a given sample/frame number in TPC clock frequency.

Implements gar::detinfo::DetectorClocks.

Definition at line 87 of file DetectorClocksStandardGAr.h.

89  { detinfo::ElecClock clock = TPCClock(); clock.SetTime(sample,frame); return clock; }
Class representing the time measured by an electronics clock.
Definition: ElecClock.h:91
virtual const ElecClock & TPCClock() const
Borrow a const TPC clock with time set to Trigger time [us].
virtual double gar::detinfo::DetectorClocksStandardGAr::TPCG4Time2TDC ( double  g4time) const
inlinevirtual

Given G4 time [ns], returns corresponding TPC electronics clock count [tdc].

Implements gar::detinfo::DetectorClocks.

Definition at line 153 of file DetectorClocksStandardGAr.h.

154  { return G4ToElecTime(g4time) / fTPCClock.TickPeriod(); }
double TickPeriod() const
A single tick period in nano-second, frequency is in MHz.
Definition: ElecClock.h:125
virtual double G4ToElecTime(double g4_time) const
Given Geant4 time [ns], returns relative time [ns] w.r.t. electronics time T0.
virtual double gar::detinfo::DetectorClocksStandardGAr::TPCG4Time2Tick ( double  g4time) const
inlinevirtual

Given G4 time returns electronics clock count [tdc].

Implements gar::detinfo::DetectorClocks.

Definition at line 184 of file DetectorClocksStandardGAr.h.

185  { return (G4ToElecTime(g4time) - (TriggerTime() + TriggerOffsetTPC())) / fTPCClock.TickPeriod(); }
double TickPeriod() const
A single tick period in nano-second, frequency is in MHz.
Definition: ElecClock.h:125
virtual double TriggerTime() const
Trigger electronics clock time in [us].
virtual double G4ToElecTime(double g4_time) const
Given Geant4 time [ns], returns relative time [ns] w.r.t. electronics time T0.
virtual double gar::detinfo::DetectorClocksStandardGAr::TPCTDC2Tick ( double  tdc) const
inlinevirtual

Given electronics clock count [tdc] returns TPC time-tick.

Implements gar::detinfo::DetectorClocks.

Definition at line 180 of file DetectorClocksStandardGAr.h.

181  { return ( tdc - (TriggerTime() + TriggerOffsetTPC()) / fTPCClock.TickPeriod() ); }
double TickPeriod() const
A single tick period in nano-second, frequency is in MHz.
Definition: ElecClock.h:125
virtual double TriggerTime() const
Trigger electronics clock time in [us].
virtual double gar::detinfo::DetectorClocksStandardGAr::TPCTick2BeamTime ( double  tick) const
inlinevirtual

Given TPC time-tick (waveform index), returns time [ns] w.r.t. beam gate time.

Implements gar::detinfo::DetectorClocks.

Definition at line 133 of file DetectorClocksStandardGAr.h.

virtual double BeamGateTime() const
Beam gate electronics clock time in [us].
double TickPeriod() const
A single tick period in nano-second, frequency is in MHz.
Definition: ElecClock.h:125
tick_as<> tick
Tick number, represented by std::ptrdiff_t.
Definition: electronics.h:75
virtual double TriggerTime() const
Trigger electronics clock time in [us].
virtual double gar::detinfo::DetectorClocksStandardGAr::TPCTick2TDC ( double  tick) const
inlinevirtual

Given TPC time-tick (waveform index), returns electronics clock count [tdc].

Implements gar::detinfo::DetectorClocks.

Definition at line 149 of file DetectorClocksStandardGAr.h.

150  { return ( (TriggerTime() + TriggerOffsetTPC()) / fTPCClock.TickPeriod() + tick ); }
double TickPeriod() const
A single tick period in nano-second, frequency is in MHz.
Definition: ElecClock.h:125
tick_as<> tick
Tick number, represented by std::ptrdiff_t.
Definition: electronics.h:75
virtual double TriggerTime() const
Trigger electronics clock time in [us].
virtual double gar::detinfo::DetectorClocksStandardGAr::TPCTick2Time ( double  tick) const
inlinevirtual

Given TPC time-tick (waveform index), returns electronics clock [us].

Implements gar::detinfo::DetectorClocks.

Definition at line 168 of file DetectorClocksStandardGAr.h.

169  { return TriggerTime() + TriggerOffsetTPC() + tick * fTPCClock.TickPeriod(); }
double TickPeriod() const
A single tick period in nano-second, frequency is in MHz.
Definition: ElecClock.h:125
tick_as<> tick
Tick number, represented by std::ptrdiff_t.
Definition: electronics.h:75
virtual double TriggerTime() const
Trigger electronics clock time in [us].
virtual double gar::detinfo::DetectorClocksStandardGAr::TPCTick2TrigTime ( double  tick) const
inlinevirtual

Given TPC time-tick (waveform index), returns time [ns] w.r.t. trigger time stamp.

Implements gar::detinfo::DetectorClocks.

Definition at line 129 of file DetectorClocksStandardGAr.h.

130  { return fTPCClock.TickPeriod() * tick + TriggerOffsetTPC(); }
double TickPeriod() const
A single tick period in nano-second, frequency is in MHz.
Definition: ElecClock.h:125
tick_as<> tick
Tick number, represented by std::ptrdiff_t.
Definition: electronics.h:75
virtual const detinfo::ElecClock& gar::detinfo::DetectorClocksStandardGAr::TriggerClock ( ) const
inlinevirtual

Borrow a const Trigger clock with time set to Trigger time [us].

Implements gar::detinfo::DetectorClocks.

Definition at line 95 of file DetectorClocksStandardGAr.h.

96  { return fTriggerClock; }
virtual detinfo::ElecClock gar::detinfo::DetectorClocksStandardGAr::TriggerClock ( double  time) const
inlinevirtual

Create a Trigger clock for a given time [us] from clock counting start.

Implements gar::detinfo::DetectorClocks.

Definition at line 99 of file DetectorClocksStandardGAr.h.

double FramePeriod() const
A single frame period in micro-second.
Definition: ElecClock.h:92
double Frequency() const
Frequency in MHz.
Definition: ElecClock.h:89
Class representing the time measured by an electronics clock.
Definition: ElecClock.h:91
virtual detinfo::ElecClock gar::detinfo::DetectorClocksStandardGAr::TriggerClock ( unsigned int  sample,
unsigned int  frame 
) const
inlinevirtual

Create a Trigger clock for a given sample/frame number in Trigger clock frequency.

Implements gar::detinfo::DetectorClocks.

Definition at line 103 of file DetectorClocksStandardGAr.h.

105  { detinfo::ElecClock clock = TriggerClock(); clock.SetTime(sample,frame); return clock; }
Class representing the time measured by an electronics clock.
Definition: ElecClock.h:91
virtual const detinfo::ElecClock & TriggerClock() const
Borrow a const Trigger clock with time set to Trigger time [us].
virtual double gar::detinfo::DetectorClocksStandardGAr::TriggerOffsetTPC ( ) const
inlinevirtual

Implements gar::detinfo::DetectorClocks.

Definition at line 35 of file DetectorClocksStandardGAr.h.

36  {
37  if (fTriggerOffsetTPC<0)
38  return fTriggerOffsetTPC;
39  else
40  return -fTriggerOffsetTPC/fTPCClock.Frequency(); //convert ticks to us
41  }
double fTriggerOffsetTPC
Time offset from trigger to TPC readout start.
double Frequency() const
Frequency in MHz.
Definition: ElecClock.h:89
virtual double gar::detinfo::DetectorClocksStandardGAr::TriggerTime ( ) const
inlinevirtual

Trigger electronics clock time in [us].

Implements gar::detinfo::DetectorClocks.

Definition at line 51 of file DetectorClocksStandardGAr.h.

51 { return fTriggerTime; }
std::string gar::detinfo::DetectorClocksStandardGAr::TrigModuleName ( ) const
inline
bool gar::detinfo::DetectorClocksStandardGAr::Update ( uint64_t  ts = 0)

Definition at line 49 of file DetectorClocksStandardGAr.cxx.

50  {
51  return true;
52  }

Member Data Documentation

double gar::detinfo::DetectorClocksStandardGAr::fBeamGateTime
protected

BeamGate time in [ns].

Definition at line 227 of file DetectorClocksStandardGAr.h.

std::vector<std::string> gar::detinfo::DetectorClocksStandardGAr::fConfigName
protected

Definition at line 197 of file DetectorClocksStandardGAr.h.

std::vector<double> gar::detinfo::DetectorClocksStandardGAr::fConfigValue
protected

Definition at line 199 of file DetectorClocksStandardGAr.h.

ElecClock gar::detinfo::DetectorClocksStandardGAr::fExternalClock
protected

External clock.

Definition at line 218 of file DetectorClocksStandardGAr.h.

double gar::detinfo::DetectorClocksStandardGAr::fFramePeriod
protected

Frame period.

Definition at line 209 of file DetectorClocksStandardGAr.h.

double gar::detinfo::DetectorClocksStandardGAr::fG4RefTime
protected

Electronics clock counting start time in G4 time frame [us].

Definition at line 206 of file DetectorClocksStandardGAr.h.

bool gar::detinfo::DetectorClocksStandardGAr::fInheritClockConfig
protected

Definition at line 201 of file DetectorClocksStandardGAr.h.

double gar::detinfo::DetectorClocksStandardGAr::fSpillLength
protected

Duration of beam spill, ns.

Definition at line 230 of file DetectorClocksStandardGAr.h.

ElecClock gar::detinfo::DetectorClocksStandardGAr::fTPCClock
protected

TPC clock.

Definition at line 212 of file DetectorClocksStandardGAr.h.

ElecClock gar::detinfo::DetectorClocksStandardGAr::fTriggerClock
protected

Trigger clock.

Definition at line 215 of file DetectorClocksStandardGAr.h.

double gar::detinfo::DetectorClocksStandardGAr::fTriggerOffsetTPC
protected

Time offset from trigger to TPC readout start.

Definition at line 221 of file DetectorClocksStandardGAr.h.

double gar::detinfo::DetectorClocksStandardGAr::fTriggerTime
protected

Trigger time in [ns].

Definition at line 224 of file DetectorClocksStandardGAr.h.

std::string gar::detinfo::DetectorClocksStandardGAr::fTrigModuleName
protected

Definition at line 203 of file DetectorClocksStandardGAr.h.


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