10 #ifndef SBNOBJ_ICARUS_PMT_TRIGGER_DATA_READOUTTRIGGERGATE_H
11 #define SBNOBJ_ICARUS_PMT_TRIGGER_DATA_READOUTTRIGGERGATE_H
23 #include <initializer_list>
35 namespace icarus::trigger {
40 template <
typename Tick,
typename TickInterval,
typename ChannelIDType>
43 template <
typename Tick,
typename TickInterval,
typename ChannelIDType>
55 {
using std::runtime_error::runtime_error; };
59 {
using ReadoutTriggerGateError::ReadoutTriggerGateError; };
65 using ReadoutTriggerGateError::ReadoutTriggerGateError;
73 template <
typename Gate>
77 template <
typename Gate>
102 template <
typename Tick,
typename TickInterval,
typename ChannelIDType>
105 ,
public ReadoutTriggerGateTag
144 { GateData_t::operator=(data);
return *
this; }
146 { GateData_t::operator=(std::move(data));
return *
this; }
311 template <
typename Op>
335 template <
typename BIter,
typename EIter>
347 (std::initializer_list<ChannelID_t>
const& moreChannels);
355 template <
typename BIter,
typename EIter>
370 template <
typename BIter,
typename EIter>
392 #include "sbnobj/ICARUS/PMT/Trigger/Data/ReadoutTriggerGate.tcc"
396 #endif // SBNOBJ_ICARUS_PMT_TRIGGER_DATA_READOUTTRIGGERGATE_H
decltype(auto) channels() const
Returns the channels associated to the gate data.
ReadoutTriggerGate & Mul(ReadoutTriggerGate const &other)
Combines with a gate, keeping the product of openings of the two.
This_t & addChannels(std::initializer_list< ChannelID_t > channels)
Associates the specified channels to this readout gate.
ChannelID_t channel() const
Returns the channel associated to the gate data.
ChannelList_t & normalizeChannels()
Removes duplicate channel IDs and sorts the remaining ones.
double std(const std::vector< short > &wf, const double ped_mean, size_t start, size_t nsample)
icarus::trigger::ReadoutTriggerGate< Tick, TickInterval, ChannelIDType > This_t
Type of this class.
std::size_t nChannels() const
Returns the number of associated channels.
constexpr bool isReadoutTriggerGate_v
Flag: true if Gate type derives from a ReadoutTriggerGate instance.
std::ostream & operator<<(std::ostream &out, icarus::trigger::ApplyBeamGateClass const &gate)
bool operator!=(ReadoutTriggerGate const &) const
ReadoutTriggerGate & Max(ReadoutTriggerGate const &other)
Combines with a gate, keeping the maximum opening among the two.
std::vector< ChannelID_t > ChannelList_t
Type of list of associated channels.
More than one channel associated to the readout gate.
void associateChannels(std::initializer_list< ChannelID_t > const &moreChannels)
Associates this data with the channels from the specified list.
static ReadoutTriggerGate SymmetricCombination(Op &&op, ReadoutTriggerGate const &a, ReadoutTriggerGate const &b, ClockTicks_t aDelay=ClockTicks_t{0}, ClockTicks_t bDelay=ClockTicks_t{0})
Returns a gate combination of the openings of two other gates.
ChannelIDType ChannelID_t
Type of stored channel ID.
GateData_t const & gateLevels() const
Access to the underlying gate level data.
ReadoutTriggerGate()=default
static ChannelList_t & mergeSortedChannelsInto(ChannelList_t &channels, BIter b, EIter e)
ReadoutTriggerGate & Min(ReadoutTriggerGate const &other)
Combines with a gate, keeping the minimum opening among the two.
This_t & addChannel(ChannelID_t const channel)
Associates the specified channel to this readout gate.
static ChannelList_t & mergeChannelsInto(ChannelList_t &channels, BIter b, EIter e)
Adds channels from iterators b to e into channels (returned).
Base class for all exceptions from icarus::trigger::ReadoutTriggerGate.
Logical multi-level gate associated to one or more readout channels.
Tick ClockTick_t
Tick point.
A logical multilevel gate for triggering.
void associateChannelsFromGate(ReadoutTriggerGate const &other)
Associates this data with the channels from the other gate.
bool hasChannel() const
Returns whether exactly one channel id associated to the gate data.
std::size_t nChannels
Number of channels.
static ChannelList_t mergeChannels(ChannelList_t const &a, ChannelList_t const &b)
Returns a merged list of channels from a and b.
Type traits: Gate type derives from a ReadoutTriggerGate instance.
GateData_t & gateLevels()
Access to the underlying gate level data (mutable).
static ChannelList_t & normalizeSortedChannels(ChannelList_t &channels)
Removes duplicate channel IDs.
MoreThanOneChannelError(std::string msg, std::size_t nChannels)
ReadoutTriggerGate(GateEvolution_t &&gateLevel, BIter b, EIter e)
Protected constructor: set the data directly.
ReadoutTriggerGate & operator=(ReadoutTriggerGate const &)=default
ReadoutTriggerGate & Sum(ReadoutTriggerGate const &other)
Combines with a gate, keeping the sum of openings of the two.
TickInterval ClockTicks_t
Tick interval.
typename Base_t::GateEvolution_t GateEvolution_t
Logical multi-level gate.
icarus::trigger::TriggerGateData< Tick, TickInterval > Base_t
Type of the base class.
No channel associated to the readout gate.
bool hasChannels() const
Returns whether there is any channel id associated to the gate data.
std::vector< Status > GateEvolution_t
Type to describe the time evolution of the gate.
All ReadoutTriggerGate template instances derive from this tag.
bool operator==(ReadoutTriggerGate const &) const
ChannelList_t fChannels
List of readout channels associated to this data.
ReadoutTriggerGate(GateEvolution_t &&gateLevel, ChannelList_t &&channels)
Protected constructor: set the data directly.