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

Helper applying a beam gate to any gate. More...

#include <ApplyBeamGate.h>

Inheritance diagram for icarus::trigger::ApplyBeamGateClass:
icarus::ns::util::mfLoggingClass

Public Types

using microseconds = util::quantities::intervals::microseconds
 Type aliases. More...
 
using optical_tick = detinfo::timescales::optical_tick
 
using optical_time_ticks = detinfo::timescales::optical_time_ticks
 

Public Member Functions

 ApplyBeamGateClass (icarus::trigger::BeamGateStruct &&beamGate, std::string const &logCategory="ApplyBeamGateClass")
 Constructor: gets the gate (in optical ticks) and its duration (in time). More...
 
icarus::trigger::OpticalTriggerGate
const & 
gate () const
 Returns the beam gate as a icarus::trigger::OpticalTriggerGate. More...
 
template<typename Gate >
Gate gateAs () const
 Returns the beam gate as the specified gate type Gate. More...
 
template<typename Gate >
Gate apply (Gate gate) const
 Returns a copy of gate in AND with this beam gate. More...
 
template<typename GateColl , typename GateObj = typename GateColl::value_type>
std::vector< GateObj > applyToAll (GateColl const &gates) const
 
auto asSimulationTime () const
 Returns the gate as a simulation time range. More...
 
auto tickRange () const
 Returns the range of the beam gate as start and stop tick. More...
 
microseconds length () const
 Returns the length of the gate (in time units). More...
 
optical_time_ticks lengthTicks () const
 Returns the length of the gate (in time units). More...
 
bool operator== (ApplyBeamGateClass const &other) const
 Comparison operators. More...
 
bool operator!= (ApplyBeamGateClass const &other) const
 

Private Attributes

icarus::trigger::BeamGateStruct
const 
fGate
 

Additional Inherited Members

- Protected Member Functions inherited from icarus::ns::util::mfLoggingClass
 mfLoggingClass (std::string const &logCategory)
 Constructor: initializes with the specified log category. More...
 
std::string logCategory () const
 Returns the logging category string for this object. More...
 
mfLoggingClass const & loggingClass () const
 Returns this object (as a logging class object). More...
 
mf::LogError mfLogError (std::string const &file={}, int const lineNumber=0) const
 Returns a mf::LogError() stream for logging. More...
 
mf::LogWarning mfLogWarning (std::string const &file={}, int const lineNumber=0) const
 Returns a mf::LogWarning() stream for logging. More...
 
mf::LogProblem mfLogProblem (std::string const &file={}, int const lineNumber=0) const
 Returns a mf::LogProblem() stream for logging. More...
 
mf::LogInfo mfLogInfo (std::string const &file={}, int const lineNumber=0) const
 Returns a mf::LogInfo() stream for logging. More...
 
mf::LogVerbatim mfLogVerbatim (std::string const &file={}, int const lineNumber=0) const
 Returns a mf::LogVerbatim() stream for logging. More...
 
mf::LogDebug mfLogDebug (std::string const &file={}, int const lineNumber=0) const
 Returns a mf::LogDebug() stream for logging. More...
 
mf::LogTrace mfLogTrace (std::string const &file={}, int const lineNumber=0) const
 Returns a mf::LogTrace() stream for logging. More...
 

Detailed Description

Helper applying a beam gate to any gate.

The gate starts from detinfo::DetectorClocks::BeamGateTime() (with an optional delay) and has length specified on construction.

The assumption that the optical tick clock starts with the electronics time is used.

Access to beam gate range may happen in a few ways: in simulation time scale and in optical time ticks. In all cases, the returned object supports the calls to start(), stop() and duration().

Definition at line 85 of file ApplyBeamGate.h.

Member Typedef Documentation

Type aliases.

Definition at line 92 of file ApplyBeamGate.h.

Definition at line 93 of file ApplyBeamGate.h.

Definition at line 94 of file ApplyBeamGate.h.

Constructor & Destructor Documentation

icarus::trigger::ApplyBeamGateClass::ApplyBeamGateClass ( icarus::trigger::BeamGateStruct &&  beamGate,
std::string const &  logCategory = "ApplyBeamGateClass" 
)
inline

Constructor: gets the gate (in optical ticks) and its duration (in time).

Definition at line 98 of file ApplyBeamGate.h.

103  , fGate(std::move(beamGate))
104  {}
Helper for logging classes.
icarus::trigger::BeamGateStruct const fGate
std::string logCategory() const
Returns the logging category string for this object.

Member Function Documentation

template<typename Gate >
Gate icarus::trigger::ApplyBeamGateClass::apply ( Gate  gate) const
inline

Returns a copy of gate in AND with this beam gate.

Definition at line 116 of file ApplyBeamGate.h.

117  { return icarus::trigger::mulGates(gate, this->gate()); }
auto mulGates(GateColl const &gates)
Multiplies all the gates in a collection.
icarus::trigger::OpticalTriggerGate const & gate() const
Returns the beam gate as a icarus::trigger::OpticalTriggerGate.
template<typename GateColl , typename GateObj >
std::vector< GateObj > icarus::trigger::ApplyBeamGateClass::applyToAll ( GateColl const &  gates) const

Returns a collection of copies of the specified gates each in AND with this beam gate.

Definition at line 198 of file ApplyBeamGate.h.

199 {
200  std::vector<GateObj> res;
202  gates.begin(), gates.end(), std::back_inserter(res),
203  [this](GateObj const& gate){ return apply(gate); }
204  );
205  return res;
206 } // icarus::trigger::ApplyBeamGateClass::applyToAll()
static constexpr Sample_t transform(Sample_t sample)
icarus::trigger::OpticalTriggerGate const & gate() const
Returns the beam gate as a icarus::trigger::OpticalTriggerGate.
Gate apply(Gate gate) const
Returns a copy of gate in AND with this beam gate.
auto icarus::trigger::ApplyBeamGateClass::asSimulationTime ( ) const
inline

Returns the gate as a simulation time range.

Definition at line 126 of file ApplyBeamGate.h.

126 { return fGate.asSimulationRange(); }
TimeRange< simulation_time > const & asSimulationRange() const
Returns the gate as start/stop pair in simulation time scale.
icarus::trigger::BeamGateStruct const fGate
icarus::trigger::OpticalTriggerGate const& icarus::trigger::ApplyBeamGateClass::gate ( ) const
inline

Returns the beam gate as a icarus::trigger::OpticalTriggerGate.

Definition at line 107 of file ApplyBeamGate.h.

108  { return fGate.asGate(); }
icarus::trigger::OpticalTriggerGate const & asGate() const
Returns the gate as an OpticalTriggerGate (electronics time).
icarus::trigger::BeamGateStruct const fGate
template<typename Gate >
Gate icarus::trigger::ApplyBeamGateClass::gateAs ( ) const
inline

Returns the beam gate as the specified gate type Gate.

Definition at line 112 of file ApplyBeamGate.h.

112 { return { gate() }; }
icarus::trigger::OpticalTriggerGate const & gate() const
Returns the beam gate as a icarus::trigger::OpticalTriggerGate.
microseconds icarus::trigger::ApplyBeamGateClass::length ( ) const
inline

Returns the length of the gate (in time units).

Definition at line 132 of file ApplyBeamGate.h.

132 { return fGate.duration(); }
Time duration() const
Returns the time duration of the gate in the specified time unit.
icarus::trigger::BeamGateStruct const fGate
optical_time_ticks icarus::trigger::ApplyBeamGateClass::lengthTicks ( ) const
inline

Returns the length of the gate (in time units).

Definition at line 135 of file ApplyBeamGate.h.

135 { return tickRange().duration(); }
auto tickRange() const
Returns the range of the beam gate as start and stop tick.
bool icarus::trigger::ApplyBeamGateClass::operator!= ( ApplyBeamGateClass const &  other) const
inline

Definition at line 141 of file ApplyBeamGate.h.

142  { return fGate != other.fGate; }
icarus::trigger::OpticalTriggerGate const fGate
icarus::trigger::BeamGateStruct const fGate
bool icarus::trigger::ApplyBeamGateClass::operator== ( ApplyBeamGateClass const &  other) const
inline

Comparison operators.

Definition at line 139 of file ApplyBeamGate.h.

140  { return fGate == other.fGate; }
icarus::trigger::OpticalTriggerGate const fGate
icarus::trigger::BeamGateStruct const fGate
auto icarus::trigger::ApplyBeamGateClass::tickRange ( ) const
inline

Returns the range of the beam gate as start and stop tick.

Definition at line 129 of file ApplyBeamGate.h.

129 { return fGate.asOptTickRange(); }
TimeRange< optical_tick > const & asOptTickRange() const
Returns the gate as start/stop pair in optical ticks.
icarus::trigger::BeamGateStruct const fGate

Member Data Documentation

icarus::trigger::BeamGateStruct const icarus::trigger::ApplyBeamGateClass::fGate
private

Definition at line 147 of file ApplyBeamGate.h.


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