10 #ifndef ICARUSCODE_PMT_TRIGGER_ALGORITHMS_FIXEDTRIGGERGATEBUILDER_H
11 #define ICARUSCODE_PMT_TRIGGER_ALGORITHMS_FIXEDTRIGGERGATEBUILDER_H
25 #include "messagefacility/MessageLogger/MessageLogger.h"
26 #include "fhiclcpp/types/Atom.h"
32 namespace icarus::trigger {
39 class FixedTriggerGateBuilder;
95 using namespace util::quantities::electronics_literals;
97 <<
"Declared above threshold at: " <<
tick;
100 <<
" we are in dead time until " <<
openUntil
101 <<
", come back later.";
111 <<
gate().openingCount((tick - 1_tick).
value())
112 <<
" => " <<
gate().openingCount(tick.value())
148 Name(
"GateDuration"),
149 Comment(
"duration of a trigger gate")
152 fhicl::Atom<bool> ExtendGate {
154 Comment(
"whether gate is extended by crossing activity inside it"),
170 virtual std::vector<TriggerGates>
build
171 (std::vector<WaveformWithBaseline>
const& waveforms)
const override
199 #endif // ICARUSCODE_PMT_TRIGGER_ALGORITHMS_FIXEDTRIGGERGATEBUILDER_H
microsecond fGateDuration
Duration of a channel gate [s].
microsecond_as<> microsecond
Type of time stored in microseconds, in double precision.
optical_time_ticks fGateTicks
Duration of a channel gate [ticks].
virtual void setup(detinfo::DetectorTimings const &timings) override
Algorithm setup.
Base interface for gate builders.
FixedGateInfo(TriggerGate_t &gate, optical_time_ticks gateDuration, bool extendGate=false)
timescale_traits< OpticalTimeCategory >::tick_interval_t optical_time_ticks
void aboveThresholdAt(optical_tick tick)
TriggerGateData_t & gate() const
FixedGateManager(optical_time_ticks gateDuration, bool extendGate=false)
BEGIN_PROLOG GateDuration
Utilities to read and write quantities in FHiCL configuration.
constexpr auto TriggerGateDebugLog
Simple type definitions for trigger algorithms.
tick_as<> tick
Tick number, represented by std::ptrdiff_t.
optical_time_ticks gateDuration
FixedTriggerGateBuilder(Config const &config)
Constructor: sets the configuration.
BEGIN_PROLOG vertical distance to the surface Name
GateInfo_t create(GateInfo_t::TriggerGate_t &gate) const
Algorithm to produce trigger gates out of optical readout waveforms.
optical_tick openUntil
Activity ignored up to this tick excluded.
Dimensioned variables related to electronics.
timescale_traits< OpticalTimeCategory >::tick_t optical_tick
void belowThresholdAt(optical_tick)
virtual std::vector< TriggerGates > build(std::vector< WaveformWithBaseline > const &waveforms) const override
Returns a collection of TriggerGates objects sorted by threshold.
A class exposing an upgraded interface of detinfo::DetectorClocksData.
bool const extendGate
Whether new crossings extend the duration of opening or are ignored.
optical_time_ticks gateDuration
Ticks to keep the gate open.
Fixed-length gate builder.
bool const fExtendGate
Whether gate opening time can be extended.
std::vector< TriggerGates > unifiedBuild(GateMgr &&gateManager, std::vector< WaveformWithBaseline > const &waveforms) const
Returns a collection of TriggerGates objects sorted by threshold.
Base_t::TriggerGates::triggergate_t TriggerGate_t