LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
detinfo::DetectorClocksStandard Class Reference

Implementation of detinfo::DetectorClocks interface with fixed settings from configuration. More...

#include "DetectorClocksStandard.h"

Inheritance diagram for detinfo::DetectorClocksStandard:
detinfo::DetectorClocks

Public Member Functions

 DetectorClocksStandard ()
 
 DetectorClocksStandard (fhicl::ParameterSet const &pset)
 
 DetectorClocksStandard (DetectorClocksStandard const &)=delete
 
virtual ~DetectorClocksStandard ()
 
bool Configure (fhicl::ParameterSet const &pset)
 
bool Update (uint64_t ts=0)
 
virtual double TriggerOffsetTPC () const override
 
virtual double TPCTime () const override
 Returns the TPC electronics start time in electronics time. More...
 
void debugReport () const
 
std::string TrigModuleName () const
 Returns the input tag of the trigger data product. More...
 
void SetDefaultTriggerTime ()
 Sets trigger and beam gate time from default configuration values. More...
 
virtual double G4ToElecTime (double g4_time) const override
 Given Geant4 time [ns], returns relative time [us] w.r.t. electronics time T0. More...
 
virtual double TriggerTime () const override
 Trigger electronics clock time in [us]. More...
 
virtual double BeamGateTime () const override
 Beam gate electronics clock time in [us]. More...
 
virtual std::vector< std::string > ConfigNames () const override
 
virtual std::vector< double > ConfigValues () const override
 
void SetConfigValue (size_t i, double val)
 
virtual void SetTriggerTime (double trig_time, double beam_time)
 Setter for trigger times. More...
 
virtual const ::detinfo::ElecClockTPCClock () const override
 Borrow a const TPC clock with time set to Trigger time [us]. More...
 
virtual ::detinfo::ElecClock TPCClock (double time) const override
 Create a TPC clock for a given time [us] from clock counting start. More...
 
detinfo::ElecClock TPCClock (unsigned int sample, unsigned int frame) const override
 Create a TPC clock for a given sample/frame number in TPC clock frequency. More...
 
virtual const detinfo::ElecClockOpticalClock () const override
 Borrow a const Optical clock with time set to Trigger time [us]. More...
 
virtual detinfo::ElecClock OpticalClock (double time) const override
 Create a Optical clock for a given time [us] from clock counting start. More...
 
virtual detinfo::ElecClock OpticalClock (unsigned int sample, unsigned int frame) const override
 Create a Optical clock for a given sample/frame number in Optical clock frequency. More...
 
virtual const detinfo::ElecClockTriggerClock () const override
 Borrow a const Trigger clock with time set to Trigger time [us]. More...
 
virtual detinfo::ElecClock TriggerClock (double time) const override
 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 override
 Create a Trigger clock for a given sample/frame number in Trigger clock frequency. More...
 
virtual const detinfo::ElecClockExternalClock () const override
 Borrow a const Trigger clock with time set to External Time [us]. More...
 
virtual detinfo::ElecClock ExternalClock (double time) const override
 
virtual detinfo::ElecClock ExternalClock (unsigned int sample, unsigned int frame) const override
 Create a External clock for a given sample/frame number in External clock frequency. More...
 
virtual double TPCTick2TrigTime (double tick) const override
 Given TPC time-tick (waveform index), returns time [us] w.r.t. trigger time stamp. More...
 
virtual double TPCTick2BeamTime (double tick) const override
 Given TPC time-tick (waveform index), returns time [us] w.r.t. beam gate time. More...
 
virtual double OpticalTick2TrigTime (double tick, size_t sample, size_t frame) const override
 Given Optical time-tick (waveform index), sample and frame number, returns time [us] w.r.t. trigger time stamp. More...
 
virtual double OpticalTick2BeamTime (double tick, size_t sample, size_t frame) const override
 Given Optical time-tick (waveform index), sample and frame number, returns time [us] w.r.t. beam gate time stamp. More...
 
virtual double ExternalTick2TrigTime (double tick, size_t sample, size_t frame) const override
 Given External time-tick (waveform index), sample and frame number, returns time [us] w.r.t. trigger time stamp. More...
 
virtual double ExternalTick2BeamTime (double tick, size_t sample, size_t frame) const override
 Given External time-tick (waveform index), sample and frame number, returns time [us] w.r.t. beam gate time stamp. More...
 
virtual double Time2Tick (double time) const override
 Returns the specified electronics time in TDC electronics ticks. More...
 
virtual double TPCTick2TDC (double tick) const override
 Given TPC time-tick (waveform index), returns electronics clock count [tdc]. More...
 
virtual double TPCG4Time2TDC (double g4time) const override
 Given G4 time [ns], returns corresponding TPC electronics clock count [tdc]. More...
 
virtual double OpticalTick2TDC (double tick, size_t sample, size_t frame) const override
 Given Optical time-tick (waveform index), sample and frame number, returns time electronics clock count [tdc]. More...
 
virtual double OpticalG4Time2TDC (double g4time) const override
 Given G4 time [ns], returns corresponding Optical electronics clock count [tdc]. More...
 
virtual double ExternalTick2TDC (double tick, size_t sample, size_t frame) const override
 Given External time-tick (waveform index), sample and frame number, returns time electronics clock count [tdc]. More...
 
virtual double ExternalG4Time2TDC (double g4time) const override
 Given G4 time [ns], returns corresponding External electronics clock count [tdc]. More...
 
virtual double TPCTick2Time (double tick) const override
 Given TPC time-tick (waveform index), returns electronics clock [us]. More...
 
virtual double OpticalTick2Time (double tick, size_t sample, size_t frame) const override
 Given Optical time-tick (waveform index), sample and frame number, returns electronics clock [us]. More...
 
virtual double ExternalTick2Time (double tick, size_t sample, size_t frame) const override
 Given External time-tick (waveform index), sample and frame number, returns electronics clock [us]. More...
 
virtual double TPCTDC2Tick (double tdc) const override
 Given electronics clock count [tdc] returns TPC time-tick. More...
 
virtual double TPCG4Time2Tick (double g4time) const override
 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...
 

Protected Member Functions

double doTPCTime () const
 Implementation of TPCTime(). More...
 
double doTime2Tick (double time) const
 Implementation of Time2Tick(). More...
 

Protected Attributes

std::vector< std::string > fConfigName
 
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...
 
::detinfo::ElecClock fTPCClock
 TPC clock. More...
 
::detinfo::ElecClock fOpticalClock
 Optical clock. More...
 
::detinfo::ElecClock fTriggerClock
 Trigger clock. More...
 
::detinfo::ElecClock fExternalClock
 External clock. More...
 
double fTriggerOffsetTPC
 Time offset from trigger to TPC readout start. More...
 
double fTriggerTime
 Trigger time in [us]. More...
 
double fBeamGateTime
 BeamGate time in [us]. More...
 

Detailed Description

Implementation of detinfo::DetectorClocks interface with fixed settings from configuration.

In this implementation, all quantities are defined at configuration time and are unchanged for the duration of the entire job, with the exception of the trigger time (see below).

Configuration parameters

All configuration parameters are mandatory, unless explicitly stated.

  • G4RefTime (nanoseconds): simulation (Geant4) start time in electronics time scale, i.e. when time 0.0 of simulation happens in the electronics time scale
  • TriggerOffsetTPC: time elapsed between the start of the TPC readout clock and the hardware trigger; it can be expressed in one of two ways:

    • negative number [µs]: the offset of the start of the TPC readout clock start respect to the trigger time (where negative means that the clock starts before the trigger arrives)
    • positive number [ticks]: the number of TPC readout clock tick at which the trigger arrives; despite this being a tick number, it can be fractional for added precision

    For example, TriggerOffsetTPC of -1600.0 means that the TDC clock starts 1.6 milliseconds before the hardware trigger. TriggerOffsetTPC of 3200.0 means that the trigger arrives at the exact start of tick 3200 of the TPC readout. In this example, if the sampling frequency of that readout is 2 MHz, these two settings are equivalent.

  • FramePeriod (microseconds): duration of an electronics clock frame; all clocks share the same frame period
  • ClockSpeedTPC (megahertz): frequency of the TPC electronics clock
  • ClockSpeedOptical (megahertz): frequency of the optical electronics clock
  • ClockSpeedTrigger (megahertz): frequency of the trigger electronics clock
  • ClockSpeedExternal (megahertz): frequency of the external electronics clock
  • DefaultTrigTime (microseconds): the default hardware trigger time, measured in the electronics time frame
  • DefaultBeamTime (microseconds): the default beam gate opening time, measured in the electronics time frame
  • TrigModuleName (string): input tag for the trigger data product (see "Trigger time" section below)
  • InheritClockConfig (boolean): whether to inherit the configuration from previous jobs (see "Consistency check" below)

Consistency check

The consistency check feature verifies that the current configuration of detinfo::DetectorClocksStandard is compatible with the one from previous jobs. It is expected that when this feature is enabled (InheritClockConfig is configured to be true), either the configuration is overridden to follow the previous ones, or an exception is thrown in case of inconsistency.

The service provider (detinfo::DetectorClocksStandard) does not provide a facility to inherit configuration from a previous job, but it stores the expectation whether this should happen (InheritClockConfig()). The service provider manager is in charge of implementing this feature (see detinfo::DetectorClocksStandardService for the manager in the art environment).

Timing specifics

For the general timing requirements, see the documentation of detinfo::DetectorClocks.

Trigger time

In this implementation, the trigger time and the beam gate time both default to 0.0 µs.

The manager of this provider is expected to set those values by calling detinfo::DetectorClocksStandard::SetTriggerTime(). See detinfo::DetectorClocksStandardService for the manager in the art environment.

Bug:
ExternalClock() clock is never initialized!

Definition at line 117 of file DetectorClocksStandard.h.

Constructor & Destructor Documentation

detinfo::DetectorClocksStandard::DetectorClocksStandard ( )

Definition at line 4 of file DetectorClocksStandard.cxx.

References fConfigName, detinfo::kClockSpeedExternal, detinfo::kClockSpeedOptical, detinfo::kClockSpeedTPC, detinfo::kClockSpeedTrigger, detinfo::kDefaultBeamTime, detinfo::kDefaultTrigTime, detinfo::kFramePeriod, detinfo::kG4RefTime, and detinfo::kTriggerOffsetTPC.

7  fInheritClockConfig(false),
8  fTrigModuleName(""),
18 {
19 
20  fConfigName.at(detinfo::kG4RefTime) = "G4RefTime";
21  fConfigName.at(detinfo::kTriggerOffsetTPC) = "TriggerOffsetTPC";
22  fConfigName.at(detinfo::kFramePeriod) = "FramePeriod";
23  fConfigName.at(detinfo::kClockSpeedTPC) = "ClockSpeedTPC";
24  fConfigName.at(detinfo::kClockSpeedOptical) = "ClockSpeedOptical";
25  fConfigName.at(detinfo::kClockSpeedTrigger) = "ClockSpeedTrigger";
26  fConfigName.at(detinfo::kClockSpeedExternal) = "ClockSpeedExternal";
27  fConfigName.at(detinfo::kDefaultTrigTime) = "DefaultTrigTime";
28  fConfigName.at(detinfo::kDefaultBeamTime) = "DefaultBeamTime";
29 }
::detinfo::ElecClock fTPCClock
TPC clock.
const double kDEFAULT_MC_CLOCK_T0
Default G4 reference time in micro-second.
std::vector< std::string > fConfigName
const double kDEFAULT_FREQUENCY_EXTERNAL
Default External clock speed in MHz.
::detinfo::ElecClock fOpticalClock
Optical clock.
::detinfo::ElecClock fTriggerClock
Trigger clock.
double fTriggerTime
Trigger time in [us].
double fG4RefTime
Electronics clock counting start time in G4 time frame [us].
const double kDEFAULT_FREQUENCY_OPTICAL
Default Optical clock speed in MHz.
const double kDEFAULT_FRAME_PERIOD
Default Frame period in micro-second.
const double kDEFAULT_FREQUENCY_TRIGGER
Default Trigger clock speed in MHz.
double fBeamGateTime
BeamGate time in [us].
double fTriggerOffsetTPC
Time offset from trigger to TPC readout start.
const double kDEFAULT_FREQUENCY_TPC
Default TPC clock speed in MHz.
const double kDEFAULT_TRIG_OFFSET_TPC
Default TPC readout start time offset from trigger in micro-second.
::detinfo::ElecClock fExternalClock
External clock.
const double kDEFAULT_TRIG_TIME
Default TriggerTime in micro-second.
const double kDEFAULT_BEAM_TIME
Default BeamGateTime in micro-second.
detinfo::DetectorClocksStandard::DetectorClocksStandard ( fhicl::ParameterSet const &  pset)

Definition at line 32 of file DetectorClocksStandard.cxx.

References Configure().

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

Definition at line 123 of file DetectorClocksStandard.h.

References Configure(), and Update().

123 {};

Member Function Documentation

void detinfo::DetectorClocksStandard::ApplyParams ( )

Internal function to apply loaded parameters to member attributes.

Definition at line 72 of file DetectorClocksStandard.cxx.

References fBeamGateTime, fConfigValue, fFramePeriod, fG4RefTime, fOpticalClock, fTPCClock, fTriggerClock, fTriggerOffsetTPC, fTriggerTime, detinfo::kClockSpeedOptical, detinfo::kClockSpeedTPC, detinfo::kClockSpeedTrigger, detinfo::kDefaultBeamTime, detinfo::kDefaultTrigTime, detinfo::kFramePeriod, detinfo::kG4RefTime, and detinfo::kTriggerOffsetTPC.

Referenced by Configure(), and InheritClockConfig().

74 {
75 
81  // FIXME: fExternalClock is not initialized!!!
85 }
::detinfo::ElecClock fTPCClock
TPC clock.
::detinfo::ElecClock fOpticalClock
Optical clock.
::detinfo::ElecClock fTriggerClock
Trigger clock.
double fTriggerTime
Trigger time in [us].
double fG4RefTime
Electronics clock counting start time in G4 time frame [us].
double fBeamGateTime
BeamGate time in [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 detinfo::DetectorClocksStandard::BeamGateTime ( ) const
inlineoverridevirtual

Beam gate electronics clock time in [us].

Implements detinfo::DetectorClocks.

Definition at line 165 of file DetectorClocksStandard.h.

References fBeamGateTime.

Referenced by ExternalTick2BeamTime(), OpticalTick2BeamTime(), and TPCTick2BeamTime().

165 { return fBeamGateTime; }
double fBeamGateTime
BeamGate time in [us].
virtual std::vector<std::string> detinfo::DetectorClocksStandard::ConfigNames ( ) const
inlineoverridevirtual

Returns a list of provider configuration names.

See also
ConfigValues()

Implements detinfo::DetectorClocks.

Definition at line 167 of file DetectorClocksStandard.h.

References fConfigName.

167 { return fConfigName; }
std::vector< std::string > fConfigName
bool detinfo::DetectorClocksStandard::Configure ( fhicl::ParameterSet const &  pset)

Definition at line 51 of file DetectorClocksStandard.cxx.

References ApplyParams(), fConfigName, fConfigValue, fInheritClockConfig, fTrigModuleName, fhicl::ParameterSet::get(), detinfo::kClockSpeedExternal, detinfo::kClockSpeedOptical, detinfo::kClockSpeedTPC, detinfo::kClockSpeedTrigger, detinfo::kDefaultBeamTime, detinfo::kDefaultTrigTime, detinfo::kFramePeriod, detinfo::kG4RefTime, detinfo::kTriggerOffsetTPC, and SetDefaultTriggerTime().

Referenced by DetectorClocksStandard(), and ~DetectorClocksStandard().

52 {
53 
54  // Read fcl parameters
55  fInheritClockConfig = pset.get< bool >( "InheritClockConfig" );
56  fTrigModuleName = pset.get< std::string >( "TrigModuleName" );
57  fConfigValue.at(kG4RefTime) = pset.get< double >( fConfigName.at(kG4RefTime).c_str() );
58  fConfigValue.at(kFramePeriod) = pset.get< double >( fConfigName.at(kFramePeriod).c_str() );
59  fConfigValue.at(kTriggerOffsetTPC) = pset.get< double >( fConfigName.at(kTriggerOffsetTPC).c_str());
60  fConfigValue.at(kClockSpeedTPC) = pset.get< double >( fConfigName.at(kClockSpeedTPC).c_str() );
61  fConfigValue.at(kClockSpeedOptical) = pset.get< double >( fConfigName.at(kClockSpeedOptical).c_str());
62  fConfigValue.at(kClockSpeedTrigger) = pset.get< double >( fConfigName.at(kClockSpeedTrigger).c_str() );
63  fConfigValue.at(kClockSpeedExternal)= pset.get< double >( fConfigName.at(kClockSpeedExternal).c_str());
64  fConfigValue.at(kDefaultTrigTime) = pset.get< double >( fConfigName.at(kDefaultTrigTime).c_str() );
65  fConfigValue.at(kDefaultBeamTime) = pset.get< double >( fConfigName.at(kDefaultBeamTime).c_str() );
66  ApplyParams();
68  return true;
69 }
std::vector< std::string > fConfigName
void ApplyParams()
Internal function to apply loaded parameters to member attributes.
void SetDefaultTriggerTime()
Sets trigger and beam gate time from default configuration values.
virtual std::vector<double> detinfo::DetectorClocksStandard::ConfigValues ( ) const
inlineoverridevirtual

Returns a list of provider configuration values (same order as ConfigNames()).

See also
ConfigNames()

Implements detinfo::DetectorClocks.

Definition at line 168 of file DetectorClocksStandard.h.

References fConfigValue.

Referenced by SetDefaultTriggerTime().

168 { return fConfigValue; }
void detinfo::DetectorClocksStandard::debugReport ( ) const

Definition at line 104 of file DetectorClocksStandard.cxx.

References fBeamGateTime, fConfigName, fConfigValue, fExternalClock, fG4RefTime, fOpticalClock, detinfo::ElecClock::Frequency(), fTPCClock, fTriggerClock, fTriggerTime, detinfo::kInheritConfigTypeMax, Time2Tick(), TPCG4Time2Tick(), TPCTDC2Tick(), TPCTick2BeamTime(), TPCTick2TDC(), TPCTick2TrigTime(), TriggerOffsetTPC(), and TriggerTime().

Referenced by TPCTime().

106 {
107  std::cout << "fConfigValues contents: "<<std::endl;
108  for(size_t i=0;i<kInheritConfigTypeMax; ++i)
109 
110  std::cout<<" "<<fConfigName.at(i).c_str()<<" ... "<<fConfigValue.at(i)<<std::endl;
111 
112  std::cout<<std::endl;
113 
114  std::cout
115  << "Trigger time @ " << fTriggerTime << std::endl
116  << "BeamGate time @ " << fBeamGateTime << std::endl
117  << "TrigOffsetTPC @ " << TriggerOffsetTPC() << std::endl
118  << "G4RefTime @ " << fG4RefTime << std::endl
119  << "TPC Freq. @ " << fTPCClock.Frequency() << std::endl
120  << "Optical Freq. @ " << fOpticalClock.Frequency() << std::endl
121  << "Trigger Freq. @ " << fTriggerClock.Frequency() << std::endl
122  << "External Freq. @ " << fExternalClock.Frequency() << std::endl
123  << "TPC start tick [tdc] : " << TPCTick2TDC(0) <<std::endl
124  << "TPC start tick from trigger [us] : " << TPCTick2TrigTime(0) <<std::endl
125  << "TPC start tick from beam [us] : " << TPCTick2BeamTime(0) <<std::endl
126  << "TPC tdc=0 in tick : " << TPCTDC2Tick(0) << std::endl
127  << "TPC G4 time 0 in tick : " << TPCG4Time2Tick(0) << std::endl
128  << "Trigger in TPC tick : " << Time2Tick(TriggerTime()) << std::endl
129  << std::endl;
130 
131 }
::detinfo::ElecClock fTPCClock
TPC clock.
virtual double TPCTDC2Tick(double tdc) const override
Given electronics clock count [tdc] returns TPC time-tick.
std::vector< std::string > fConfigName
::detinfo::ElecClock fOpticalClock
Optical clock.
::detinfo::ElecClock fTriggerClock
Trigger clock.
double fTriggerTime
Trigger time in [us].
double fG4RefTime
Electronics clock counting start time in G4 time frame [us].
virtual double TPCTick2TDC(double tick) const override
Given TPC time-tick (waveform index), returns electronics clock count [tdc].
double fBeamGateTime
BeamGate time in [us].
virtual double TriggerOffsetTPC() const override
virtual double TriggerTime() const override
Trigger electronics clock time in [us].
::detinfo::ElecClock fExternalClock
External clock.
virtual double TPCG4Time2Tick(double g4time) const override
Given G4 time returns electronics clock count [tdc].
virtual double TPCTick2BeamTime(double tick) const override
Given TPC time-tick (waveform index), returns time [us] w.r.t. beam gate time.
virtual double Time2Tick(double time) const override
Returns the specified electronics time in TDC electronics ticks.
double Frequency() const
Frequency in MHz.
Definition: ElecClock.h:229
virtual double TPCTick2TrigTime(double tick) const override
Given TPC time-tick (waveform index), returns time [us] w.r.t. trigger time stamp.
double detinfo::DetectorClocksStandard::doTime2Tick ( double  time) const
inlineprotected

Implementation of Time2Tick().

Definition at line 378 of file DetectorClocksStandard.h.

References doTPCTime(), and detinfo::ElecClock::TickPeriod().

Referenced by Time2Tick().

379  { return (time - doTPCTime()) / fTPCClock.TickPeriod(); }
::detinfo::ElecClock fTPCClock
TPC clock.
double TickPeriod() const
A single tick period in microseconds.
Definition: ElecClock.h:342
double doTPCTime() const
Implementation of TPCTime().
double detinfo::DetectorClocksStandard::doTPCTime ( ) const
inlineprotected

Implementation of TPCTime().

Definition at line 375 of file DetectorClocksStandard.h.

References TriggerOffsetTPC(), and TriggerTime().

Referenced by doTime2Tick(), TPCG4Time2Tick(), TPCTDC2Tick(), TPCTick2TDC(), TPCTick2Time(), and TPCTime().

375 { return TriggerTime() + TriggerOffsetTPC(); }
virtual double TriggerOffsetTPC() const override
virtual double TriggerTime() const override
Trigger electronics clock time in [us].
virtual const detinfo::ElecClock& detinfo::DetectorClocksStandard::ExternalClock ( ) const
inlineoverridevirtual

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

Implements detinfo::DetectorClocks.

Definition at line 242 of file DetectorClocksStandard.h.

References fExternalClock.

Referenced by ExternalClock().

243  { return fExternalClock; }
::detinfo::ElecClock fExternalClock
External clock.
virtual detinfo::ElecClock detinfo::DetectorClocksStandard::ExternalClock ( double  time) const
inlineoverridevirtual

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

Bug:
The frequency is taken from TriggerClock(), not ExternalClock()

Implements detinfo::DetectorClocks.

Definition at line 247 of file DetectorClocksStandard.h.

References fExternalClock, detinfo::ElecClock::FramePeriod(), detinfo::ElecClock::Frequency(), and fTriggerClock.

::detinfo::ElecClock fTriggerClock
Trigger clock.
double FramePeriod() const
A single frame period in microseconds.
Definition: ElecClock.h:232
::detinfo::ElecClock fExternalClock
External clock.
Class representing the time measured by an electronics clock.
Definition: ElecClock.h:91
double Frequency() const
Frequency in MHz.
Definition: ElecClock.h:229
virtual detinfo::ElecClock detinfo::DetectorClocksStandard::ExternalClock ( unsigned int  sample,
unsigned int  frame 
) const
inlineoverridevirtual

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

Implements detinfo::DetectorClocks.

Definition at line 251 of file DetectorClocksStandard.h.

References ExternalClock(), and detinfo::ElecClock::SetTime().

253  { detinfo::ElecClock clock = ExternalClock(); clock.SetTime(sample,frame); return clock; }
void SetTime(double time)
Directly sets the current time on the clock.
Definition: ElecClock.h:138
virtual const detinfo::ElecClock & ExternalClock() const override
Borrow a const Trigger clock with time set to External Time [us].
Class representing the time measured by an electronics clock.
Definition: ElecClock.h:91
virtual double detinfo::DetectorClocksStandard::ExternalG4Time2TDC ( double  g4time) const
inlineoverridevirtual

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

Implements detinfo::DetectorClocks.

Definition at line 302 of file DetectorClocksStandard.h.

References fExternalClock, G4ToElecTime(), and detinfo::ElecClock::TickPeriod().

303  { return G4ToElecTime(g4time) / fExternalClock.TickPeriod(); }
virtual double G4ToElecTime(double g4_time) const override
Given Geant4 time [ns], returns relative time [us] w.r.t. electronics time T0.
double TickPeriod() const
A single tick period in microseconds.
Definition: ElecClock.h:342
::detinfo::ElecClock fExternalClock
External clock.
virtual double detinfo::DetectorClocksStandard::ExternalTick2BeamTime ( double  tick,
size_t  sample,
size_t  frame 
) const
inlineoverridevirtual

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

Implements detinfo::DetectorClocks.

Definition at line 275 of file DetectorClocksStandard.h.

References BeamGateTime(), fExternalClock, detinfo::ElecClock::TickPeriod(), and detinfo::ElecClock::Time().

276  { return fExternalClock.TickPeriod() * tick + fExternalClock.Time(sample,frame) - BeamGateTime(); }
double TickPeriod() const
A single tick period in microseconds.
Definition: ElecClock.h:342
::detinfo::ElecClock fExternalClock
External clock.
double Time() const
Current time (as stored) in microseconds.
Definition: ElecClock.h:191
virtual double BeamGateTime() const override
Beam gate electronics clock time in [us].
virtual double detinfo::DetectorClocksStandard::ExternalTick2TDC ( double  tick,
size_t  sample,
size_t  frame 
) const
inlineoverridevirtual

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

Implements detinfo::DetectorClocks.

Definition at line 299 of file DetectorClocksStandard.h.

References fExternalClock, and detinfo::ElecClock::Ticks().

300  { return fExternalClock.Ticks(sample,frame) + tick; }
int Ticks() const
Current clock tick (that is, the number of tick Time() falls in).
Definition: ElecClock.h:235
::detinfo::ElecClock fExternalClock
External clock.
virtual double detinfo::DetectorClocksStandard::ExternalTick2Time ( double  tick,
size_t  sample,
size_t  frame 
) const
inlineoverridevirtual

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

Implements detinfo::DetectorClocks.

Definition at line 315 of file DetectorClocksStandard.h.

References fExternalClock, detinfo::ElecClock::TickPeriod(), and detinfo::ElecClock::Time().

316  { return fExternalClock.Time(sample,frame) + tick * fExternalClock.TickPeriod(); }
double TickPeriod() const
A single tick period in microseconds.
Definition: ElecClock.h:342
::detinfo::ElecClock fExternalClock
External clock.
double Time() const
Current time (as stored) in microseconds.
Definition: ElecClock.h:191
virtual double detinfo::DetectorClocksStandard::ExternalTick2TrigTime ( double  tick,
size_t  sample,
size_t  frame 
) const
inlineoverridevirtual

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

Implements detinfo::DetectorClocks.

Definition at line 272 of file DetectorClocksStandard.h.

References fExternalClock, detinfo::ElecClock::TickPeriod(), detinfo::ElecClock::Time(), and TriggerTime().

273  { return fExternalClock.TickPeriod() * tick + fExternalClock.Time(sample,frame) - TriggerTime(); }
virtual double TriggerTime() const override
Trigger electronics clock time in [us].
double TickPeriod() const
A single tick period in microseconds.
Definition: ElecClock.h:342
::detinfo::ElecClock fExternalClock
External clock.
double Time() const
Current time (as stored) in microseconds.
Definition: ElecClock.h:191
virtual double detinfo::DetectorClocksStandard::G4ToElecTime ( double  g4_time) const
inlineoverridevirtual

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

Implements detinfo::DetectorClocks.

Definition at line 159 of file DetectorClocksStandard.h.

References fG4RefTime.

Referenced by ExternalG4Time2TDC(), OpticalG4Time2TDC(), TPCG4Time2TDC(), and TPCG4Time2Tick().

159 {return g4_time * 1.e-3 - fG4RefTime; }
double fG4RefTime
Electronics clock counting start time in G4 time frame [us].
bool detinfo::DetectorClocksStandard::InheritClockConfig ( )
inline
bool detinfo::DetectorClocksStandard::IsRightConfig ( const fhicl::ParameterSet ps) const

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

Definition at line 88 of file DetectorClocksStandard.cxx.

References d, fConfigName, detinfo::kInheritConfigTypeMax, and s.

Referenced by InheritClockConfig().

90 {
91  std::string s;
92  double d;
93 
94  // TODO replace with has_key()
95  bool result = !ps.get_if_present("module_label", s);
96  for(size_t i=0; result && i<kInheritConfigTypeMax; ++i)
97 
98  result = result && ps.get_if_present(fConfigName.at(i).c_str(),d);
99 
100  return result;
101 }
Float_t s
Definition: plot.C:23
std::vector< std::string > fConfigName
Float_t d
Definition: plot.C:237
bool get_if_present(std::string const &key, T &value) const
Definition: ParameterSet.h:208
virtual const detinfo::ElecClock& detinfo::DetectorClocksStandard::OpticalClock ( ) const
inlineoverridevirtual

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

Implements detinfo::DetectorClocks.

Definition at line 210 of file DetectorClocksStandard.h.

References fOpticalClock.

Referenced by OpticalClock().

211  { return fOpticalClock; }
::detinfo::ElecClock fOpticalClock
Optical clock.
virtual detinfo::ElecClock detinfo::DetectorClocksStandard::OpticalClock ( double  time) const
inlineoverridevirtual

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

Implements detinfo::DetectorClocks.

Definition at line 214 of file DetectorClocksStandard.h.

References fOpticalClock, detinfo::ElecClock::FramePeriod(), and detinfo::ElecClock::Frequency().

::detinfo::ElecClock fOpticalClock
Optical clock.
double FramePeriod() const
A single frame period in microseconds.
Definition: ElecClock.h:232
Class representing the time measured by an electronics clock.
Definition: ElecClock.h:91
double Frequency() const
Frequency in MHz.
Definition: ElecClock.h:229
virtual detinfo::ElecClock detinfo::DetectorClocksStandard::OpticalClock ( unsigned int  sample,
unsigned int  frame 
) const
inlineoverridevirtual

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

Implements detinfo::DetectorClocks.

Definition at line 218 of file DetectorClocksStandard.h.

References OpticalClock(), and detinfo::ElecClock::SetTime().

220  { detinfo::ElecClock clock = OpticalClock(); clock.SetTime(sample,frame); return clock; }
void SetTime(double time)
Directly sets the current time on the clock.
Definition: ElecClock.h:138
virtual const detinfo::ElecClock & OpticalClock() const override
Borrow a const Optical clock with time set to Trigger time [us].
Class representing the time measured by an electronics clock.
Definition: ElecClock.h:91
virtual double detinfo::DetectorClocksStandard::OpticalG4Time2TDC ( double  g4time) const
inlineoverridevirtual

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

Implements detinfo::DetectorClocks.

Definition at line 296 of file DetectorClocksStandard.h.

References fOpticalClock, G4ToElecTime(), and detinfo::ElecClock::TickPeriod().

297  { return G4ToElecTime(g4time) / fOpticalClock.TickPeriod(); }
virtual double G4ToElecTime(double g4_time) const override
Given Geant4 time [ns], returns relative time [us] w.r.t. electronics time T0.
::detinfo::ElecClock fOpticalClock
Optical clock.
double TickPeriod() const
A single tick period in microseconds.
Definition: ElecClock.h:342
virtual double detinfo::DetectorClocksStandard::OpticalTick2BeamTime ( double  tick,
size_t  sample,
size_t  frame 
) const
inlineoverridevirtual

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

Implements detinfo::DetectorClocks.

Definition at line 269 of file DetectorClocksStandard.h.

References BeamGateTime(), fOpticalClock, detinfo::ElecClock::TickPeriod(), and detinfo::ElecClock::Time().

270  { return fOpticalClock.TickPeriod() * tick + fOpticalClock.Time(sample,frame) - BeamGateTime(); }
::detinfo::ElecClock fOpticalClock
Optical clock.
double TickPeriod() const
A single tick period in microseconds.
Definition: ElecClock.h:342
double Time() const
Current time (as stored) in microseconds.
Definition: ElecClock.h:191
virtual double BeamGateTime() const override
Beam gate electronics clock time in [us].
virtual double detinfo::DetectorClocksStandard::OpticalTick2TDC ( double  tick,
size_t  sample,
size_t  frame 
) const
inlineoverridevirtual

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

Implements detinfo::DetectorClocks.

Definition at line 293 of file DetectorClocksStandard.h.

References fOpticalClock, and detinfo::ElecClock::Ticks().

294  { return fOpticalClock.Ticks(sample,frame) + tick; }
::detinfo::ElecClock fOpticalClock
Optical clock.
int Ticks() const
Current clock tick (that is, the number of tick Time() falls in).
Definition: ElecClock.h:235
virtual double detinfo::DetectorClocksStandard::OpticalTick2Time ( double  tick,
size_t  sample,
size_t  frame 
) const
inlineoverridevirtual

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

Implements detinfo::DetectorClocks.

Definition at line 312 of file DetectorClocksStandard.h.

References fOpticalClock, detinfo::ElecClock::TickPeriod(), and detinfo::ElecClock::Time().

313  { return fOpticalClock.Time(sample,frame) + tick * fOpticalClock.TickPeriod(); }
::detinfo::ElecClock fOpticalClock
Optical clock.
double TickPeriod() const
A single tick period in microseconds.
Definition: ElecClock.h:342
double Time() const
Current time (as stored) in microseconds.
Definition: ElecClock.h:191
virtual double detinfo::DetectorClocksStandard::OpticalTick2TrigTime ( double  tick,
size_t  sample,
size_t  frame 
) const
inlineoverridevirtual

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

Implements detinfo::DetectorClocks.

Definition at line 266 of file DetectorClocksStandard.h.

References fOpticalClock, detinfo::ElecClock::TickPeriod(), detinfo::ElecClock::Time(), and TriggerTime().

267  { return fOpticalClock.TickPeriod() * tick + fOpticalClock.Time(sample,frame) - TriggerTime(); }
::detinfo::ElecClock fOpticalClock
Optical clock.
virtual double TriggerTime() const override
Trigger electronics clock time in [us].
double TickPeriod() const
A single tick period in microseconds.
Definition: ElecClock.h:342
double Time() const
Current time (as stored) in microseconds.
Definition: ElecClock.h:191
void detinfo::DetectorClocksStandard::SetConfigValue ( size_t  i,
double  val 
)
inline

Definition at line 170 of file DetectorClocksStandard.h.

References fConfigValue.

170 { fConfigValue[i] = val; }
void detinfo::DetectorClocksStandard::SetDefaultTriggerTime ( )

Sets trigger and beam gate time from default configuration values.

Definition at line 134 of file DetectorClocksStandard.cxx.

References ConfigValues(), detinfo::kDefaultBeamTime, detinfo::kDefaultTrigTime, and SetTriggerTime().

Referenced by Configure(), detinfo::setDetectorClocksStandardTrigger(), and TrigModuleName().

136 {
137  std::vector<double> const& cfgValues = ConfigValues();
138 
140  cfgValues.at(detinfo::kDefaultTrigTime),
141  cfgValues.at(detinfo::kDefaultBeamTime)
142  );
143 
144 } // detinfo::DetectorClocksStandard::SetDefaultTriggerTime()
virtual void SetTriggerTime(double trig_time, double beam_time)
Setter for trigger times.
virtual std::vector< double > ConfigValues() const override
virtual void detinfo::DetectorClocksStandard::SetTriggerTime ( double  trig_time,
double  beam_time 
)
inlinevirtual

Setter for trigger times.

Parameters
trig_timehardware trigger time in electronics time scale
beam_timebeam gate opening time in electronics time scale

The hardware trigger and beam gate opening times are set, and the electronic clocks are updated to store the new trigger time.

Definition at line 181 of file DetectorClocksStandard.h.

References fBeamGateTime, fOpticalClock, fTPCClock, fTriggerClock, fTriggerTime, and detinfo::ElecClock::SetTime().

Referenced by SetDefaultTriggerTime(), and detinfo::setDetectorClocksStandardTriggersFromRawTrigger().

182  {
183  fTriggerTime = trig_time;
184  fBeamGateTime = beam_time;
185  fTPCClock.SetTime(trig_time);
186  fOpticalClock.SetTime(trig_time);
187  fTriggerClock.SetTime(trig_time);
188  }
::detinfo::ElecClock fTPCClock
TPC clock.
void SetTime(double time)
Directly sets the current time on the clock.
Definition: ElecClock.h:138
::detinfo::ElecClock fOpticalClock
Optical clock.
::detinfo::ElecClock fTriggerClock
Trigger clock.
double fTriggerTime
Trigger time in [us].
double fBeamGateTime
BeamGate time in [us].
virtual double detinfo::DetectorClocksStandard::Time2Tick ( double  time) const
inlineoverridevirtual

Returns the specified electronics time in TDC electronics ticks.

Implements detinfo::DetectorClocks.

Definition at line 279 of file DetectorClocksStandard.h.

References doTime2Tick().

Referenced by debugReport().

280  { return doTime2Tick(time); }
double doTime2Tick(double time) const
Implementation of Time2Tick().
virtual const ::detinfo::ElecClock& detinfo::DetectorClocksStandard::TPCClock ( ) const
inlineoverridevirtual

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

Implements detinfo::DetectorClocks.

Definition at line 194 of file DetectorClocksStandard.h.

References fTPCClock.

Referenced by TPCClock().

195  { return fTPCClock; }
::detinfo::ElecClock fTPCClock
TPC clock.
virtual ::detinfo::ElecClock detinfo::DetectorClocksStandard::TPCClock ( double  time) const
inlineoverridevirtual

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

Implements detinfo::DetectorClocks.

Definition at line 198 of file DetectorClocksStandard.h.

References detinfo::ElecClock::FramePeriod(), detinfo::ElecClock::Frequency(), and fTPCClock.

199  { return ::detinfo::ElecClock(time,fTPCClock.FramePeriod(),fTPCClock.Frequency());}
::detinfo::ElecClock fTPCClock
TPC clock.
double FramePeriod() const
A single frame period in microseconds.
Definition: ElecClock.h:232
double Frequency() const
Frequency in MHz.
Definition: ElecClock.h:229
detinfo::ElecClock detinfo::DetectorClocksStandard::TPCClock ( unsigned int  sample,
unsigned int  frame 
) const
inlineoverridevirtual

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

Implements detinfo::DetectorClocks.

Definition at line 202 of file DetectorClocksStandard.h.

References detinfo::ElecClock::SetTime(), and TPCClock().

204  { detinfo::ElecClock clock = TPCClock(); clock.SetTime(sample,frame); return clock; }
void SetTime(double time)
Directly sets the current time on the clock.
Definition: ElecClock.h:138
virtual const ::detinfo::ElecClock & TPCClock() const override
Borrow a const TPC clock with time set to Trigger time [us].
Class representing the time measured by an electronics clock.
Definition: ElecClock.h:91
virtual double detinfo::DetectorClocksStandard::TPCG4Time2TDC ( double  g4time) const
inlineoverridevirtual

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

Implements detinfo::DetectorClocks.

Definition at line 290 of file DetectorClocksStandard.h.

References fTPCClock, G4ToElecTime(), and detinfo::ElecClock::TickPeriod().

291  { return G4ToElecTime(g4time) / fTPCClock.TickPeriod(); }
::detinfo::ElecClock fTPCClock
TPC clock.
virtual double G4ToElecTime(double g4_time) const override
Given Geant4 time [ns], returns relative time [us] w.r.t. electronics time T0.
double TickPeriod() const
A single tick period in microseconds.
Definition: ElecClock.h:342
virtual double detinfo::DetectorClocksStandard::TPCG4Time2Tick ( double  g4time) const
inlineoverridevirtual

Given G4 time returns electronics clock count [tdc].

Implements detinfo::DetectorClocks.

Definition at line 326 of file DetectorClocksStandard.h.

References doTPCTime(), fTPCClock, G4ToElecTime(), and detinfo::ElecClock::TickPeriod().

Referenced by debugReport().

327  { return (G4ToElecTime(g4time) - doTPCTime()) / fTPCClock.TickPeriod(); }
::detinfo::ElecClock fTPCClock
TPC clock.
virtual double G4ToElecTime(double g4_time) const override
Given Geant4 time [ns], returns relative time [us] w.r.t. electronics time T0.
double TickPeriod() const
A single tick period in microseconds.
Definition: ElecClock.h:342
double doTPCTime() const
Implementation of TPCTime().
virtual double detinfo::DetectorClocksStandard::TPCTDC2Tick ( double  tdc) const
inlineoverridevirtual

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

Implements detinfo::DetectorClocks.

Definition at line 323 of file DetectorClocksStandard.h.

References doTPCTime(), fTPCClock, and detinfo::ElecClock::TickPeriod().

Referenced by debugReport().

324  { return ( tdc - doTPCTime() / fTPCClock.TickPeriod() ); }
::detinfo::ElecClock fTPCClock
TPC clock.
double TickPeriod() const
A single tick period in microseconds.
Definition: ElecClock.h:342
double doTPCTime() const
Implementation of TPCTime().
virtual double detinfo::DetectorClocksStandard::TPCTick2BeamTime ( double  tick) const
inlineoverridevirtual

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

Implements detinfo::DetectorClocks.

Definition at line 263 of file DetectorClocksStandard.h.

References BeamGateTime(), TPCTick2TrigTime(), and TriggerTime().

Referenced by debugReport().

264  { return TPCTick2TrigTime(tick) + TriggerTime() - BeamGateTime(); }
virtual double TriggerTime() const override
Trigger electronics clock time in [us].
virtual double BeamGateTime() const override
Beam gate electronics clock time in [us].
virtual double TPCTick2TrigTime(double tick) const override
Given TPC time-tick (waveform index), returns time [us] w.r.t. trigger time stamp.
virtual double detinfo::DetectorClocksStandard::TPCTick2TDC ( double  tick) const
inlineoverridevirtual

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

Implements detinfo::DetectorClocks.

Definition at line 287 of file DetectorClocksStandard.h.

References doTPCTime(), fTPCClock, and detinfo::ElecClock::TickPeriod().

Referenced by debugReport().

288  { return ( doTPCTime() / fTPCClock.TickPeriod() + tick ); }
::detinfo::ElecClock fTPCClock
TPC clock.
double TickPeriod() const
A single tick period in microseconds.
Definition: ElecClock.h:342
double doTPCTime() const
Implementation of TPCTime().
virtual double detinfo::DetectorClocksStandard::TPCTick2Time ( double  tick) const
inlineoverridevirtual

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

Implements detinfo::DetectorClocks.

Definition at line 309 of file DetectorClocksStandard.h.

References doTPCTime(), fTPCClock, and detinfo::ElecClock::TickPeriod().

310  { return doTPCTime() + tick * fTPCClock.TickPeriod(); }
::detinfo::ElecClock fTPCClock
TPC clock.
double TickPeriod() const
A single tick period in microseconds.
Definition: ElecClock.h:342
double doTPCTime() const
Implementation of TPCTime().
virtual double detinfo::DetectorClocksStandard::TPCTick2TrigTime ( double  tick) const
inlineoverridevirtual

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

Implements detinfo::DetectorClocks.

Definition at line 260 of file DetectorClocksStandard.h.

References fTPCClock, detinfo::ElecClock::TickPeriod(), and TriggerOffsetTPC().

Referenced by debugReport(), and TPCTick2BeamTime().

261  { return fTPCClock.TickPeriod() * tick + TriggerOffsetTPC(); }
::detinfo::ElecClock fTPCClock
TPC clock.
virtual double TriggerOffsetTPC() const override
double TickPeriod() const
A single tick period in microseconds.
Definition: ElecClock.h:342
virtual double detinfo::DetectorClocksStandard::TPCTime ( ) const
inlineoverridevirtual

Returns the TPC electronics start time in electronics time.

Implements detinfo::DetectorClocks.

Definition at line 142 of file DetectorClocksStandard.h.

References debugReport(), and doTPCTime().

142 { return doTPCTime(); }
double doTPCTime() const
Implementation of TPCTime().
virtual const detinfo::ElecClock& detinfo::DetectorClocksStandard::TriggerClock ( ) const
inlineoverridevirtual

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

Implements detinfo::DetectorClocks.

Definition at line 226 of file DetectorClocksStandard.h.

References fTriggerClock.

Referenced by TriggerClock().

227  { return fTriggerClock; }
::detinfo::ElecClock fTriggerClock
Trigger clock.
virtual detinfo::ElecClock detinfo::DetectorClocksStandard::TriggerClock ( double  time) const
inlineoverridevirtual

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

Implements detinfo::DetectorClocks.

Definition at line 230 of file DetectorClocksStandard.h.

References detinfo::ElecClock::FramePeriod(), detinfo::ElecClock::Frequency(), and fTriggerClock.

::detinfo::ElecClock fTriggerClock
Trigger clock.
double FramePeriod() const
A single frame period in microseconds.
Definition: ElecClock.h:232
Class representing the time measured by an electronics clock.
Definition: ElecClock.h:91
double Frequency() const
Frequency in MHz.
Definition: ElecClock.h:229
virtual detinfo::ElecClock detinfo::DetectorClocksStandard::TriggerClock ( unsigned int  sample,
unsigned int  frame 
) const
inlineoverridevirtual

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

Implements detinfo::DetectorClocks.

Definition at line 234 of file DetectorClocksStandard.h.

References detinfo::ElecClock::SetTime(), and TriggerClock().

236  { detinfo::ElecClock clock = TriggerClock(); clock.SetTime(sample,frame); return clock; }
void SetTime(double time)
Directly sets the current time on the clock.
Definition: ElecClock.h:138
virtual const detinfo::ElecClock & TriggerClock() const override
Borrow a const Trigger clock with time set to Trigger time [us].
Class representing the time measured by an electronics clock.
Definition: ElecClock.h:91
virtual double detinfo::DetectorClocksStandard::TriggerOffsetTPC ( ) const
inlineoverridevirtual
See also
detinfo::DetectorClocks::TriggerOffsetTPC()

This offset is set via configuration parameter TriggerOffsetTPC.

Implements detinfo::DetectorClocks.

Definition at line 133 of file DetectorClocksStandard.h.

References detinfo::ElecClock::Frequency(), fTPCClock, and fTriggerOffsetTPC.

Referenced by debugReport(), doTPCTime(), and TPCTick2TrigTime().

134  {
135  if (fTriggerOffsetTPC<0)
136  return fTriggerOffsetTPC;
137  else
138  return -fTriggerOffsetTPC/fTPCClock.Frequency(); //convert ticks to us
139  }
::detinfo::ElecClock fTPCClock
TPC clock.
double fTriggerOffsetTPC
Time offset from trigger to TPC readout start.
double Frequency() const
Frequency in MHz.
Definition: ElecClock.h:229
virtual double detinfo::DetectorClocksStandard::TriggerTime ( ) const
inlineoverridevirtual

Trigger electronics clock time in [us].

Implements detinfo::DetectorClocks.

Definition at line 162 of file DetectorClocksStandard.h.

References fTriggerTime.

Referenced by debugReport(), doTPCTime(), ExternalTick2TrigTime(), OpticalTick2TrigTime(), and TPCTick2BeamTime().

162 { return fTriggerTime; }
double fTriggerTime
Trigger time in [us].
std::string detinfo::DetectorClocksStandard::TrigModuleName ( ) const
inline

Returns the input tag of the trigger data product.

Returns
the input tag of the trigger data product (as string)

The trigger module name is set directly in the configuration as TrigModuleName.

Definition at line 153 of file DetectorClocksStandard.h.

References fTrigModuleName, and SetDefaultTriggerTime().

Referenced by detinfo::setDetectorClocksStandardTriggersFromEvent().

bool detinfo::DetectorClocksStandard::Update ( uint64_t  ts = 0)

Definition at line 45 of file DetectorClocksStandard.cxx.

Referenced by ~DetectorClocksStandard().

46 {
47  return true;
48 }

Member Data Documentation

double detinfo::DetectorClocksStandard::fBeamGateTime
protected

BeamGate time in [us].

Definition at line 372 of file DetectorClocksStandard.h.

Referenced by ApplyParams(), BeamGateTime(), debugReport(), and SetTriggerTime().

std::vector<std::string> detinfo::DetectorClocksStandard::fConfigName
protected
std::vector<double> detinfo::DetectorClocksStandard::fConfigValue
protected
::detinfo::ElecClock detinfo::DetectorClocksStandard::fExternalClock
protected
double detinfo::DetectorClocksStandard::fFramePeriod
protected

Frame period.

Definition at line 351 of file DetectorClocksStandard.h.

Referenced by ApplyParams().

double detinfo::DetectorClocksStandard::fG4RefTime
protected

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

Definition at line 348 of file DetectorClocksStandard.h.

Referenced by ApplyParams(), debugReport(), and G4ToElecTime().

bool detinfo::DetectorClocksStandard::fInheritClockConfig
protected

Definition at line 343 of file DetectorClocksStandard.h.

Referenced by Configure(), and InheritClockConfig().

::detinfo::ElecClock detinfo::DetectorClocksStandard::fOpticalClock
protected
::detinfo::ElecClock detinfo::DetectorClocksStandard::fTPCClock
protected
::detinfo::ElecClock detinfo::DetectorClocksStandard::fTriggerClock
protected

Trigger clock.

Definition at line 360 of file DetectorClocksStandard.h.

Referenced by ApplyParams(), debugReport(), ExternalClock(), SetTriggerTime(), and TriggerClock().

double detinfo::DetectorClocksStandard::fTriggerOffsetTPC
protected

Time offset from trigger to TPC readout start.

Definition at line 366 of file DetectorClocksStandard.h.

Referenced by ApplyParams(), and TriggerOffsetTPC().

double detinfo::DetectorClocksStandard::fTriggerTime
protected

Trigger time in [us].

Definition at line 369 of file DetectorClocksStandard.h.

Referenced by ApplyParams(), debugReport(), SetTriggerTime(), and TriggerTime().

std::string detinfo::DetectorClocksStandard::fTrigModuleName
protected

Definition at line 345 of file DetectorClocksStandard.h.

Referenced by Configure(), and TrigModuleName().


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