LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
detinfo::DetectorClocksWithUnits Class Reference

A partial detinfo::DetectorClocksData supporting units. More...

#include "DetectorTimings.h"

Inheritance diagram for detinfo::DetectorClocksWithUnits:
detinfo::DetectorTimings

Public Types

using nanosecond = util::quantities::nanosecond
 
using microsecond = util::quantities::microsecond
 
using megahertz = util::quantities::megahertz
 
using ticks_d = util::quantities::ticks_d
 

Public Member Functions

detinfo::DetectorClocksData const & clockData () const
 Returns the detector clocks data object. More...
 
microsecond TriggerTime () const
 Equivalent to detinfo::DetectorClocksData::TriggerTime(). More...
 
microsecond BeamGateTime () const
 Equivalent to detinfo::DetectorClocksData::BeamGateTime(). More...
 
microsecond TPCTime () const
 Equivalent to detinfo::DetectorClocksData::TPCTime(). More...
 
microsecond OpticalClockPeriod () const
 
megahertz OpticalClockFrequency () const
 
 DetectorClocksWithUnits (detinfo::DetectorClocksData const *detClocks)
 Constructor: uses detClocks for internal conversions. More...
 
 DetectorClocksWithUnits (detinfo::DetectorClocksData const &detClocks)
 Constructor: uses detClocks for internal conversions. More...
 
microsecond G4ToElecTime (nanosecond simTime) const
 Equivalent to detinfo::DetectorClocksData::G4ToElecTime(). More...
 
microsecond G4ToElecTime (double simTime) const
 Equivalent to detinfo::DetectorClocksData::G4ToElecTime(). More...
 
ticks_d TPCTick2TDC (ticks_d tpcticks) const
 Equivalent to detinfo::DetectorClocksData::G4ToElecTime(). More...
 
ticks_d TPCTick2TDC (double tpcticks) const
 Equivalent to detinfo::DetectorClocksData::G4ToElecTime(). More...
 

Private Attributes

detinfo::DetectorClocksData fClockData
 The backend instance of detinfo::DetectorClocksData this object uses. More...
 

Detailed Description

A partial detinfo::DetectorClocksData supporting units.

This class is instantiated based on a detinfo::DetectorClocksData, which is relied upon to provide the underlying functionality.

Example of usage:

The timing data is copied locally; see detinfo::DetectorClocksData for considerations on the validity time span of the timing information.

Definition at line 45 of file DetectorTimings.h.

Member Typedef Documentation

Constructor & Destructor Documentation

detinfo::DetectorClocksWithUnits::DetectorClocksWithUnits ( detinfo::DetectorClocksData const *  detClocks)
inlineexplicit

Constructor: uses detClocks for internal conversions.

Definition at line 59 of file DetectorTimings.h.

60  : DetectorClocksWithUnits(*detClocks)
61  {}
DetectorClocksWithUnits(detinfo::DetectorClocksData const *detClocks)
Constructor: uses detClocks for internal conversions.
detinfo::DetectorClocksWithUnits::DetectorClocksWithUnits ( detinfo::DetectorClocksData const &  detClocks)
inlineexplicit

Constructor: uses detClocks for internal conversions.

Definition at line 62 of file DetectorTimings.h.

63  : fClockData(detClocks)
64  {}
detinfo::DetectorClocksData fClockData
The backend instance of detinfo::DetectorClocksData this object uses.

Member Function Documentation

microsecond detinfo::DetectorClocksWithUnits::BeamGateTime ( ) const
inline

Equivalent to detinfo::DetectorClocksData::BeamGateTime().

Definition at line 74 of file DetectorTimings.h.

References detinfo::DetectorClocksData::BeamGateTime(), and clockData().

74 { return microsecond{clockData().BeamGateTime()}; }
detinfo::DetectorClocksData const & clockData() const
Returns the detector clocks data object.
double BeamGateTime() const
Beam gate electronics clock time in [us].
util::quantities::microsecond microsecond
detinfo::DetectorClocksData const& detinfo::DetectorClocksWithUnits::clockData ( ) const
inline

Returns the detector clocks data object.

Definition at line 68 of file DetectorTimings.h.

References fClockData.

Referenced by BeamGateTime(), G4ToElecTime(), OpticalClockFrequency(), OpticalClockPeriod(), TPCTick2TDC(), TPCTime(), and TriggerTime().

68 { return fClockData; }
detinfo::DetectorClocksData fClockData
The backend instance of detinfo::DetectorClocksData this object uses.
microsecond detinfo::DetectorClocksWithUnits::G4ToElecTime ( nanosecond  simTime) const
inline

Equivalent to detinfo::DetectorClocksData::G4ToElecTime().

Definition at line 81 of file DetectorTimings.h.

References clockData(), detinfo::DetectorClocksData::G4ToElecTime(), and util::quantities::concepts::Quantity< Unit, T >::value().

Referenced by detinfo::details::StartTimeImpl< detinfo::timescales::simulation_time, detinfo::timescales::electronics_time >::startTime().

82  {
83  return microsecond{clockData().G4ToElecTime(simTime.value())};
84  }
detinfo::DetectorClocksData const & clockData() const
Returns the detector clocks data object.
double G4ToElecTime(double const g4_time) const
util::quantities::microsecond microsecond
microsecond detinfo::DetectorClocksWithUnits::G4ToElecTime ( double  simTime) const
inline

Equivalent to detinfo::DetectorClocksData::G4ToElecTime().

Definition at line 85 of file DetectorTimings.h.

References G4ToElecTime().

Referenced by G4ToElecTime().

85 { return G4ToElecTime(nanosecond{simTime}); }
microsecond G4ToElecTime(nanosecond simTime) const
Equivalent to detinfo::DetectorClocksData::G4ToElecTime().
util::quantities::nanosecond nanosecond
megahertz detinfo::DetectorClocksWithUnits::OpticalClockFrequency ( ) const
inline

Equivalent to detinfo::DetectorClocksData::OpticalClock().TickPeriod().

Definition at line 106 of file DetectorTimings.h.

References clockData(), detinfo::ElecClock::Frequency(), and detinfo::DetectorClocksData::OpticalClock().

107  {
109  }
util::quantities::megahertz megahertz
detinfo::DetectorClocksData const & clockData() const
Returns the detector clocks data object.
ElecClock const & OpticalClock() const noexcept
Borrow a const Optical clock with time set to Trigger time [us].
constexpr double Frequency() const
Frequency in MHz.
Definition: ElecClock.h:176
microsecond detinfo::DetectorClocksWithUnits::OpticalClockPeriod ( ) const
inline

Equivalent to detinfo::DetectorClocksData::OpticalClock().TickPeriod().

Definition at line 99 of file DetectorTimings.h.

References clockData(), detinfo::DetectorClocksData::OpticalClock(), and detinfo::ElecClock::TickPeriod().

100  {
102  }
detinfo::DetectorClocksData const & clockData() const
Returns the detector clocks data object.
constexpr double TickPeriod() const noexcept
A single tick period in microseconds.
Definition: ElecClock.h:310
ElecClock const & OpticalClock() const noexcept
Borrow a const Optical clock with time set to Trigger time [us].
util::quantities::microsecond microsecond
ticks_d detinfo::DetectorClocksWithUnits::TPCTick2TDC ( ticks_d  tpcticks) const
inline

Equivalent to detinfo::DetectorClocksData::G4ToElecTime().

Definition at line 90 of file DetectorTimings.h.

References clockData(), detinfo::DetectorClocksData::TPCTick2TDC(), and util::quantities::concepts::Quantity< Unit, T >::value().

Referenced by detinfo::details::StartTickImpl< detinfo::timescales::TPCelectronics_tick_d, detinfo::timescales::electronics_tick_d >::startTick().

91  {
92  return ticks_d{clockData().TPCTick2TDC(tpcticks.value())};
93  }
detinfo::DetectorClocksData const & clockData() const
Returns the detector clocks data object.
util::quantities::ticks_d ticks_d
double TPCTick2TDC(double const tick) const
ticks_d detinfo::DetectorClocksWithUnits::TPCTick2TDC ( double  tpcticks) const
inline

Equivalent to detinfo::DetectorClocksData::G4ToElecTime().

Definition at line 94 of file DetectorTimings.h.

References TPCTick2TDC().

Referenced by TPCTick2TDC().

94 { return TPCTick2TDC(ticks_d{tpcticks}); }
ticks_d TPCTick2TDC(ticks_d tpcticks) const
Equivalent to detinfo::DetectorClocksData::G4ToElecTime().
util::quantities::ticks_d ticks_d
microsecond detinfo::DetectorClocksWithUnits::TPCTime ( ) const
inline

Equivalent to detinfo::DetectorClocksData::TPCTime().

Definition at line 77 of file DetectorTimings.h.

References clockData(), and detinfo::DetectorClocksData::TPCTime().

Referenced by detinfo::details::StartTimeImpl< detinfo::timescales::TPCelectronics_time, detinfo::timescales::electronics_time >::startTime().

77 { return microsecond{clockData().TPCTime()}; }
detinfo::DetectorClocksData const & clockData() const
Returns the detector clocks data object.
util::quantities::microsecond microsecond
microsecond detinfo::DetectorClocksWithUnits::TriggerTime ( ) const
inline

Equivalent to detinfo::DetectorClocksData::TriggerTime().

Definition at line 71 of file DetectorTimings.h.

References clockData(), and detinfo::DetectorClocksData::TriggerTime().

71 { return microsecond{clockData().TriggerTime()}; }
detinfo::DetectorClocksData const & clockData() const
Returns the detector clocks data object.
double TriggerTime() const
Trigger electronics clock time in [us].
util::quantities::microsecond microsecond

Member Data Documentation

detinfo::DetectorClocksData detinfo::DetectorClocksWithUnits::fClockData
private

The backend instance of detinfo::DetectorClocksData this object uses.

Definition at line 48 of file DetectorTimings.h.

Referenced by clockData().


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