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

Container of logical gates for all triggering channels for a threshold. More...

#include <TriggerGateBuilder.h>

Public Types

using triggergate_t = icarus::trigger::TrackedOpticalTriggerGate< raw::OpDetWaveform >
 
using GateData_t = std::vector< triggergate_t >
 

Public Member Functions

 TriggerGates (ADCCounts_t threshold, GateData_t &&gates)
 Constructor: acquires data of the specified gates. More...
 
 TriggerGates (ADCCounts_t threshold)
 Constructor: no trigger gate added. More...
 
template<typename Stream >
void dump (Stream &out) const
 Dumps the content of this set of gates into the out stream. More...
 
bool operator< (TriggerGates const &other) const
 Comparison: sorts by increasing threshold. More...
 

Static Public Member Functions

static constexpr bool isValidChannel (Channel_t channel)
 

Private Attributes

ADCCounts_t fThreshold
 The threshold for all the gates. More...
 
GateData_t fGates
 All the gates, at most one per channel. More...
 

Detailed Description

Container of logical gates for all triggering channels for a threshold.

Definition at line 116 of file TriggerGateBuilder.h.

Member Typedef Documentation

Definition at line 124 of file TriggerGateBuilder.h.

Definition at line 123 of file TriggerGateBuilder.h.

Constructor & Destructor Documentation

icarus::trigger::TriggerGateBuilder::TriggerGates::TriggerGates ( ADCCounts_t  threshold,
GateData_t &&  gates 
)
inline

Constructor: acquires data of the specified gates.

Definition at line 128 of file TriggerGateBuilder.h.

129  : fThreshold(threshold), fGates(std::move(gates))
130  {}
ADCCounts_t fThreshold
The threshold for all the gates.
GateData_t fGates
All the gates, at most one per channel.
icarus::trigger::TriggerGateBuilder::TriggerGates::TriggerGates ( ADCCounts_t  threshold)
inline

Constructor: no trigger gate added.

Definition at line 133 of file TriggerGateBuilder.h.

134  : TriggerGates(threshold, {})
TriggerGates(ADCCounts_t threshold, GateData_t &&gates)
Constructor: acquires data of the specified gates.

Member Function Documentation

template<typename Stream >
void icarus::trigger::TriggerGateBuilder::TriggerGates::dump ( Stream out) const

Dumps the content of this set of gates into the out stream.

Definition at line 285 of file TriggerGateBuilder.h.

286 {
287 
288  auto const nOpenGates = fGates.size() - std::count_if(
289  fGates.begin(), fGates.end(),
290  [](auto const& gate){ return gate.gate().alwaysClosed(); }
291  );
292  out << nOpenGates << "/" << fGates.size() << " trigger gates on threshold "
293  << fThreshold;
294  if (nOpenGates) {
295  out << ":";
296  for (auto const& gate: icarus::trigger::gatesIn(fGates)) {
297  if (gate.alwaysClosed()) continue;
298  out << "\n " << gate;
299  }
300  }
301  out << "\n";
302 } // icarus::trigger::TriggerGateBuilder::TriggerGates::dump()
auto gatesIn(TrackingGateColl &trackingGates)
ADCCounts_t fThreshold
The threshold for all the gates.
GateData_t fGates
All the gates, at most one per channel.
static constexpr bool icarus::trigger::TriggerGateBuilder::TriggerGates::isValidChannel ( Channel_t  channel)
inlinestatic

Definition at line 163 of file TriggerGateBuilder.h.

164  { return channel != InvalidChannel; }
static constexpr Channel_t InvalidChannel
Mnemonic for an invalid optical detector channel.
bool icarus::trigger::TriggerGateBuilder::TriggerGates::operator< ( TriggerGates const &  other) const
inline

Comparison: sorts by increasing threshold.

Definition at line 159 of file TriggerGateBuilder.h.

160  { return threshold() < other.threshold(); }

Member Data Documentation

GateData_t icarus::trigger::TriggerGateBuilder::TriggerGates::fGates
private

All the gates, at most one per channel.

Definition at line 168 of file TriggerGateBuilder.h.

ADCCounts_t icarus::trigger::TriggerGateBuilder::TriggerGates::fThreshold
private

The threshold for all the gates.

Definition at line 167 of file TriggerGateBuilder.h.


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