8 #ifndef ICARUSCODE_PMT_TRIGGER_ALGORITHMS_APPLYBEAMGATE_H
9 #define ICARUSCODE_PMT_TRIGGER_ALGORITHMS_APPLYBEAMGATE_H
33 namespace icarus::trigger {
35 class ApplyBeamGateClass;
49 std::string
const& logCategory =
"ApplyBeamGateClass"
64 std::string
const& logCategory =
"ApplyBeamGateClass"
67 std::ostream&
operator<<
100 std::string
const&
logCategory =
"ApplyBeamGateClass"
111 template <
typename Gate>
115 template <
typename Gate>
122 <
typename GateColl,
typename GateObj =
typename GateColl::value_type>
123 std::vector<GateObj>
applyToAll(GateColl
const& gates)
const;
159 std::string
const& logCategory
174 std::string
const& logCategory
175 ) -> ApplyBeamGateClass
177 using namespace util::quantities::time_literals;
183 std::ostream& icarus::trigger::operator<<
186 out << gate.gate() <<
" (simulation time: " << gate.asSimulationTime()
196 <
typename GateColl,
typename GateObj >
198 (GateColl
const& gates)
const
200 std::vector<GateObj> res;
202 gates.begin(), gates.end(), std::back_inserter(res),
203 [
this](GateObj
const& gate){
return apply(gate); }
211 #endif // ICARUSCODE_PMT_TRIGGER_ALGORITHMS_APPLYBEAMGATE_H
optical_time_ticks lengthTicks() const
Returns the length of the gate (in time units).
double std(const std::vector< short > &wf, const double ped_mean, size_t start, size_t nsample)
ApplyBeamGateClass makeApplyBeamGate(util::quantities::intervals::microseconds duration, util::quantities::intervals::microseconds delay, detinfo::DetectorClocksData const &clockData, std::string const &logCategory="ApplyBeamGateClass")
Returns a new ApplyBeamGateClass object with the specified gate.
An object representing a time gate, with a start and and end.
auto mulGates(GateColl const &gates)
Multiplies all the gates in a collection.
detinfo::timescales::optical_time_ticks optical_time_ticks
icarus::trigger::OpticalTriggerGate const & asGate() const
Returns the gate as an OpticalTriggerGate (electronics time).
microseconds_as<> microseconds
Type of time interval stored in microseconds, in double precision.
Base class facilitating logging to message facility.
icarus::trigger::OpticalTriggerGate const & gate() const
Returns the beam gate as a icarus::trigger::OpticalTriggerGate.
Helper applying a beam gate to any gate.
detinfo::timescales::optical_tick optical_tick
auto tickRange() const
Returns the range of the beam gate as start and stop tick.
Helper for logging classes.
mfLoggingClass(std::string const &logCategory)
Constructor: initializes with the specified log category.
timescale_traits< OpticalTimeCategory >::tick_interval_t optical_time_ticks
Interface to detinfo::DetectorClocks.
Gate gateAs() const
Returns the beam gate as the specified gate type Gate.
bool operator!=(ApplyBeamGateClass const &other) const
TimeRange< simulation_time > const & asSimulationRange() const
Returns the gate as start/stop pair in simulation time scale.
TimeRange< optical_tick > const & asOptTickRange() const
Returns the gate as start/stop pair in optical ticks.
auto asSimulationTime() const
Returns the gate as a simulation time range.
A trigger gate data object for optical detector electronics.
microseconds length() const
Returns the length of the gate (in time units).
Utilities for the conversion of trigger gate data formats.
An interval (duration, length, distance) between two quantity points.
bool operator==(ApplyBeamGateClass const &other) const
Comparison operators.
Object representing a time gate, with a start and and end.
Gate apply(Gate gate) const
Returns a copy of gate in AND with this beam gate.
timescale_traits< OpticalTimeCategory >::tick_t optical_tick
Contains all timing reference information for the detector.
BeamGateStruct makeBeamGateStruct(detinfo::DetectorTimings const &detTimings, util::quantities::intervals::microseconds duration, util::quantities::intervals::microseconds delay=util::quantities::intervals::microseconds{0.0})
Creates a BeamGateStruct object of specified duration and start.
Logical multi-level gate associated to one or more waveforms.
Dimensioned variables representing space or time quantities.
A class exposing an upgraded interface of detinfo::DetectorClocksData.
Data types for detinfo::DetectorTimings.
Time duration() const
Returns the time duration of the gate in the specified time unit.
icarus::trigger::BeamGateStruct const fGate
std::vector< GateObj > applyToAll(GateColl const &gates) const
std::string logCategory() const
Returns the logging category string for this object.
ApplyBeamGateClass(icarus::trigger::BeamGateStruct &&beamGate, std::string const &logCategory="ApplyBeamGateClass")
Constructor: gets the gate (in optical ticks) and its duration (in time).