All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Types | Public Member Functions | Private Attributes | List of all members
icarus::trigger::BeamGateStruct Struct Reference

Object representing a time gate, with a start and and end. More...

#include <BeamGateStruct.h>

Classes

struct  TimeRange
 Utility class expressing a time range. More...
 

Public Types

using microseconds = util::quantities::intervals::microseconds
 
using electronics_time = detinfo::timescales::electronics_time
 
using simulation_time = detinfo::timescales::simulation_time
 
using optical_tick = detinfo::timescales::optical_tick
 

Public Member Functions

 BeamGateStruct (microseconds duration, microseconds delay, detinfo::DetectorTimings const &detTimings)
 Constructor: gate of specified duration and start. More...
 
Access
icarus::trigger::OpticalTriggerGate
const & 
asGate () const
 Returns the gate as an OpticalTriggerGate (electronics time). More...
 
TimeRange< simulation_time >
const & 
asSimulationRange () const
 Returns the gate as start/stop pair in simulation time scale. More...
 
TimeRange< optical_tick > const & asOptTickRange () const
 Returns the gate as start/stop pair in optical ticks. More...
 
TimeRange< electronics_time >
const & 
asElectronicsTimeRange () const
 Returns the gate as start/stop pair in electronics time scale. More...
 
template<typename Time = microseconds>
Time duration () const
 Returns the time duration of the gate in the specified time unit. More...
 
bool operator== (BeamGateStruct const &other) const
 Comparison operators. More...
 
bool operator!= (BeamGateStruct const &other) const
 

Private Attributes

icarus::trigger::OpticalTriggerGate
const 
fGate
 
TimeRange< electronics_time > const fRangeElec
 
TimeRange< simulation_time > const fRangeSim
 
TimeRange< optical_tick > const fRangeOpt
 

Detailed Description

Object representing a time gate, with a start and and end.

The object caches the gate in a few formats.

Definition at line 58 of file BeamGateStruct.h.

Member Typedef Documentation

Definition at line 62 of file BeamGateStruct.h.

Definition at line 61 of file BeamGateStruct.h.

Definition at line 64 of file BeamGateStruct.h.

Definition at line 63 of file BeamGateStruct.h.

Constructor & Destructor Documentation

icarus::trigger::BeamGateStruct::BeamGateStruct ( microseconds  duration,
microseconds  delay,
detinfo::DetectorTimings const &  detTimings 
)

Constructor: gate of specified duration and start.

Parameters
durationlength of the gate [s]
delay(default: 0_us) time the gate opens relative to beam gate opening [s]
detTimingsobject used for time conversions

Definition at line 140 of file BeamGateStruct.h.

145  , fRangeElec
146  {
147  detTimings.BeamGateTime() + delay,
148  detTimings.BeamGateTime() + delay + duration
149  }
150  , fRangeSim
151  {
152  detTimings.toSimulationTime(fRangeElec.start()),
153  detTimings.toSimulationTime(fRangeElec.end())
154  }
155  , fRangeOpt
156  {
157  detTimings.toOpticalTick(fRangeElec.start()),
158  detTimings.toOpticalTick(fRangeElec.end())
159  }
160 {} // icarus::trigger::BeamGateStruct::BeamGateStruct()
TimeRange< simulation_time > const fRangeSim
icarus::trigger::OpticalTriggerGate const fGate
TimeRange< electronics_time > const fRangeElec
Simple utility to generate gates around beam time.
Definition: BeamGateMaker.h:49
fDetProps &fDetProps fDetProps &fDetProps detTimings
Time duration() const
Returns the time duration of the gate in the specified time unit.
TimeRange< optical_tick > const fRangeOpt

Member Function Documentation

TimeRange<electronics_time> const& icarus::trigger::BeamGateStruct::asElectronicsTimeRange ( ) const
inline

Returns the gate as start/stop pair in electronics time scale.

Definition at line 105 of file BeamGateStruct.h.

106  { return fRangeElec; }
TimeRange< electronics_time > const fRangeElec
icarus::trigger::OpticalTriggerGate const& icarus::trigger::BeamGateStruct::asGate ( ) const
inline

Returns the gate as an OpticalTriggerGate (electronics time).

Definition at line 94 of file BeamGateStruct.h.

94 { return fGate; }
icarus::trigger::OpticalTriggerGate const fGate
TimeRange<optical_tick> const& icarus::trigger::BeamGateStruct::asOptTickRange ( ) const
inline

Returns the gate as start/stop pair in optical ticks.

Definition at line 101 of file BeamGateStruct.h.

102  { return fRangeOpt; }
TimeRange< optical_tick > const fRangeOpt
TimeRange<simulation_time> const& icarus::trigger::BeamGateStruct::asSimulationRange ( ) const
inline

Returns the gate as start/stop pair in simulation time scale.

Definition at line 97 of file BeamGateStruct.h.

98  { return fRangeSim; }
TimeRange< simulation_time > const fRangeSim
template<typename Time = microseconds>
Time icarus::trigger::BeamGateStruct::duration ( ) const
inline

Returns the time duration of the gate in the specified time unit.

Definition at line 110 of file BeamGateStruct.h.

110 { return { asElectronicsTimeRange().duration() }; }
TimeRange< electronics_time > const & asElectronicsTimeRange() const
Returns the gate as start/stop pair in electronics time scale.
bool icarus::trigger::BeamGateStruct::operator!= ( BeamGateStruct const &  other) const
inline

Definition at line 119 of file BeamGateStruct.h.

120  { return asGate() != other.asGate(); }
icarus::trigger::OpticalTriggerGate const & asGate() const
Returns the gate as an OpticalTriggerGate (electronics time).
bool icarus::trigger::BeamGateStruct::operator== ( BeamGateStruct const &  other) const
inline

Comparison operators.

Definition at line 117 of file BeamGateStruct.h.

118  { return asGate() == other.asGate(); }
icarus::trigger::OpticalTriggerGate const & asGate() const
Returns the gate as an OpticalTriggerGate (electronics time).

Member Data Documentation

icarus::trigger::OpticalTriggerGate const icarus::trigger::BeamGateStruct::fGate
private

Definition at line 126 of file BeamGateStruct.h.

TimeRange<electronics_time> const icarus::trigger::BeamGateStruct::fRangeElec
private

Definition at line 128 of file BeamGateStruct.h.

TimeRange<optical_tick> const icarus::trigger::BeamGateStruct::fRangeOpt
private

Definition at line 132 of file BeamGateStruct.h.

TimeRange<simulation_time> const icarus::trigger::BeamGateStruct::fRangeSim
private

Definition at line 130 of file BeamGateStruct.h.


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