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

Simple utility to generate gates around beam time. More...

#include <BeamGateMaker.h>

Public Types

using time_interval = detinfo::timescales::time_interval
 
using optical_time = detinfo::timescales::optical_time
 
using optical_tick = detinfo::timescales::optical_tick
 
using optical_time_ticks = detinfo::timescales::optical_time_ticks
 

Public Member Functions

 BeamGateMaker (detinfo::DetectorTimings const &detTimings)
 Constructor: uses a copy of the specified detector timing provider. More...
 
 BeamGateMaker (detinfo::DetectorClocksData const &clockData)
 Constructor: uses the specified detector clocks service. More...
 
Start and end time
optical_time startTime (time_interval const delay=DefaultDelay) const
 
optical_time endTime (time_interval const duration, time_interval const delay=DefaultDelay) const
 Time of beam gate closure, in optical time scale. More...
 
optical_tick startTick (time_interval const delay=DefaultDelay) const
 
optical_tick endTick (time_interval const duration, time_interval const delay=DefaultDelay) const
 Time of beam gate closure, in optical ticks. More...
 
template<typename Gate = icarus::trigger::OpticalTriggerGate>
Gate make (time_interval length, time_interval delay=DefaultDelay) const
 Returns a gate object of the specified duration. More...
 
template<typename Gate = icarus::trigger::OpticalTriggerGate>
Gate operator() (time_interval length, time_interval delay=DefaultDelay) const
 

Private Attributes

detinfo::DetectorTimings const fDetTimings
 Detector timing provider. More...
 

Static Private Attributes

static constexpr
util::quantities::microsecond 
DefaultDelay { 0.0 }
 Value used for default delay. More...
 

Detailed Description

Simple utility to generate gates around beam time.

Example: to create an object describing a beam gate of 10 s, run:

using namespace util::quantities::time_literals;
(*lar::providerFrom<detinfo::DetectorClocks>());
auto const beamGate = makeBeamGate(10_us);

The time of the gate is in optical detector electronics ticks.

Definition at line 49 of file BeamGateMaker.h.

Member Typedef Documentation

Definition at line 61 of file BeamGateMaker.h.

Definition at line 60 of file BeamGateMaker.h.

Definition at line 62 of file BeamGateMaker.h.

Definition at line 59 of file BeamGateMaker.h.

Constructor & Destructor Documentation

icarus::trigger::BeamGateMaker::BeamGateMaker ( detinfo::DetectorTimings const &  detTimings)
inline

Constructor: uses a copy of the specified detector timing provider.

Definition at line 66 of file BeamGateMaker.h.

68  {}
detinfo::DetectorTimings const fDetTimings
Detector timing provider.
Definition: BeamGateMaker.h:51
fDetProps &fDetProps fDetProps &fDetProps detTimings
icarus::trigger::BeamGateMaker::BeamGateMaker ( detinfo::DetectorClocksData const &  clockData)
inline

Constructor: uses the specified detector clocks service.

Definition at line 71 of file BeamGateMaker.h.

detinfo::DetectorTimings makeDetectorTimings(detinfo::DetectorClocksData const &detClocks)
BeamGateMaker(detinfo::DetectorTimings const &detTimings)
Constructor: uses a copy of the specified detector timing provider.
Definition: BeamGateMaker.h:66

Member Function Documentation

optical_tick icarus::trigger::BeamGateMaker::endTick ( time_interval const  duration,
time_interval const  delay = DefaultDelay 
) const
inline

Time of beam gate closure, in optical ticks.

Definition at line 96 of file BeamGateMaker.h.

98  { return fDetTimings.toOpticalTick(endTime(duration, delay)); }
optical_tick toOpticalTick(TimePoint time) const
Returns the time point converted in units of optical time ticks.
detinfo::DetectorTimings const fDetTimings
Detector timing provider.
Definition: BeamGateMaker.h:51
optical_time endTime(time_interval const duration, time_interval const delay=DefaultDelay) const
Time of beam gate closure, in optical time scale.
Definition: BeamGateMaker.h:85
optical_time icarus::trigger::BeamGateMaker::endTime ( time_interval const  duration,
time_interval const  delay = DefaultDelay 
) const
inline

Time of beam gate closure, in optical time scale.

Definition at line 85 of file BeamGateMaker.h.

87  { return startTime(delay) + duration; }
optical_time startTime(time_interval const delay=DefaultDelay) const
Definition: BeamGateMaker.h:80
template<typename Gate = icarus::trigger::OpticalTriggerGate>
Gate icarus::trigger::BeamGateMaker::make ( time_interval  length,
time_interval  delay = DefaultDelay 
) const
inline

Returns a gate object of the specified duration.

Template Parameters
Gatetype of gate object to be returned (default: icarus::trigger::OpticalTriggerGate)
Parameters
lengthduration of the gate to be open
delaytime from beam gate time when this gate opens (default: 0)
Returns
a Gate object representing a gate opened at beam gate time

The returned object represents a gate opening at beam gate time (with an optional delay) for the specified duration. The time of the gate is in optical ticks.

Definition at line 120 of file BeamGateMaker.h.

121  {
123  beamGate.gateLevels().openFor
124  (startTick(delay).value(), fDetTimings.toOpticalTicks(length).value());
125  return beamGate;
126  }
GateData_t & gateLevels()
Access to the underlying gate level data (mutable).
Ticks toOpticalTicks(time_interval time) const
Returns the optical ticks corresponding to a time interval.
detinfo::DetectorTimings const fDetTimings
Detector timing provider.
Definition: BeamGateMaker.h:51
Logical multi-level gate associated to one or more waveforms.
temporary value
void openFor(ClockTick_t tick, ClockTicks_t length, OpeningDiff_t count=1)
Open this gate at the specified time, and close it length ticks later.
optical_tick startTick(time_interval const delay=DefaultDelay) const
Definition: BeamGateMaker.h:91
template<typename Gate = icarus::trigger::OpticalTriggerGate>
Gate icarus::trigger::BeamGateMaker::operator() ( time_interval  length,
time_interval  delay = DefaultDelay 
) const
inline

Definition at line 131 of file BeamGateMaker.h.

132  { return make<Gate>(length, delay); }
optical_tick icarus::trigger::BeamGateMaker::startTick ( time_interval const  delay = DefaultDelay) const
inline

Time of beam gate opening, in optical ticks.

Parameters
delayopening delay after the nominal beam gate time

Definition at line 91 of file BeamGateMaker.h.

92  { return fDetTimings.toOpticalTick(startTime(delay)); }
optical_tick toOpticalTick(TimePoint time) const
Returns the time point converted in units of optical time ticks.
detinfo::DetectorTimings const fDetTimings
Detector timing provider.
Definition: BeamGateMaker.h:51
optical_time startTime(time_interval const delay=DefaultDelay) const
Definition: BeamGateMaker.h:80
optical_time icarus::trigger::BeamGateMaker::startTime ( time_interval const  delay = DefaultDelay) const
inline

Time of beam gate opening, in optical time scale.

Parameters
delayopening delay after the nominal beam gate time

Definition at line 80 of file BeamGateMaker.h.

81  { return fDetTimings.BeamGateTime() + delay; }
electronics_time BeamGateTime() const
detinfo::DetectorTimings const fDetTimings
Detector timing provider.
Definition: BeamGateMaker.h:51

Member Data Documentation

constexpr util::quantities::microsecond icarus::trigger::BeamGateMaker::DefaultDelay { 0.0 }
staticprivate

Value used for default delay.

Definition at line 54 of file BeamGateMaker.h.

detinfo::DetectorTimings const icarus::trigger::BeamGateMaker::fDetTimings
private

Detector timing provider.

Definition at line 51 of file BeamGateMaker.h.


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