All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Types | Public Member Functions | Static Public Attributes | Protected Types | Protected Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
icarus::trigger::TriggerGateData< Tick, TickInterval > Class Template Reference

Logical multi-level gate. More...

#include <TriggerGateData.h>

Inheritance diagram for icarus::trigger::TriggerGateData< Tick, TickInterval >:
icarus::trigger::ReadoutTriggerGate< Tick, TickInterval, ChannelIDType > icarus::trigger::OpticalTriggerGate icarus::trigger::MultiChannelOpticalTriggerGate icarus::trigger::SingleChannelOpticalTriggerGate

Classes

struct  CompareTick
 Comparison by tick number. More...
 

Public Types

using triggergatedata_t = TriggerGateData< Tick, TickInterval >
 This type. More...
 
using ClockTick_t = Tick
 Type of a point in time, measured in ticks. More...
 
using ClockTicks_t = TickInterval
 Type of a time interval, measured in ticks. More...
 
using OpeningCount_t = unsigned int
 Type of count of number of open channels. More...
 
using OpeningDiff_t = std::make_signed_t< OpeningCount_t >
 Type representing a variation of open channels. More...
 

Public Member Functions

 TriggerGateData ()
 Constructor: a closed gate for the channel in waveform. More...
 
bool operator== (TriggerGateData const &) const
 
bool operator!= (TriggerGateData const &) const
 
Query
ClockTick_t lastTick () const
 Returns the number of ticks this gate covers. More...
 
OpeningCount_t openingCount (ClockTick_t tick) const
 Returns the opening count of the gate at the specified tick. More...
 
bool alwaysClosed () const
 Returns whether this gate never opened. More...
 
bool isOpen (ClockTick_t tick) const
 Returns whether the gate is open at all at the specified tick. More...
 
ClockTick_t findOpen (OpeningCount_t minOpening=1U, ClockTick_t start=MinTick, ClockTick_t end=MaxTick) const
 Returns the tick at which the gate opened. More...
 
ClockTick_t findClose (OpeningCount_t minOpening=1U, ClockTick_t start=MinTick, ClockTick_t end=MaxTick) const
 Returns the tick at which the gate closed. More...
 
ClockTick_t findMaxOpen (ClockTick_t start=MinTick, ClockTick_t end=MaxTick) const
 Returns the tick at which the gate has the maximum opening. More...
 
std::pair< OpeningCount_t,
OpeningCount_t
openingRange (ClockTick_t start, ClockTick_t end) const
 Returns the range of trigger opening values in the specified range. More...
 
Gate opening and closing operations
void setOpeningAt (ClockTick_t tick, OpeningCount_t openingCount)
 Changes the opening to match openingCount at the specified time. More...
 
void openAt (ClockTick_t tick, OpeningDiff_t count)
 Open this gate at the specified time (increase the opening by count). More...
 
void openAt (ClockTick_t tick)
 Open this gate at the specified time (increase the opening by 1). More...
 
void openBetween (ClockTick_t start, ClockTick_t end, OpeningDiff_t count=1)
 Open this gate at specified start tick, and close it at end tick. More...
 
void openFor (ClockTick_t tick, ClockTicks_t length, OpeningDiff_t count=1)
 Open this gate at the specified time, and close it length ticks later. More...
 
void closeAt (ClockTick_t tick, OpeningDiff_t count)
 Close this gate at the specified time (decrease the opening by count). More...
 
void closeAt (ClockTick_t tick)
 Close this gate at the specified time. More...
 
void closeAllAt (ClockTick_t tick)
 Completely close this gate at the specified time. More...
 
void clear ()
 Sets the gate levels in the state at construction. More...
 

Static Public Attributes

static constexpr ClockTick_t MinTick = std::numeric_limits<ClockTick_t>::min()
 An unbearably small tick number. More...
 
static constexpr ClockTick_t MaxTick = std::numeric_limits<ClockTick_t>::max()
 An unbearably large tick number. More...
 

Protected Types

using EventType = details::TriggerGateEventType
 
using Status = details::TriggerGateStatus< ClockTick_t, OpeningCount_t >
 
using GateEvolution_t = std::vector< Status >
 Type to describe the time evolution of the gate. More...
 

Protected Member Functions

 TriggerGateData (GateEvolution_t &&gateLevel)
 Protected constructor: set the data directly. More...
 

Private Types

using status_iterator = typename GateEvolution_t::iterator
 
using status_const_iterator = typename GateEvolution_t::const_iterator
 

Private Member Functions

std::optional
< status_const_iterator
findLastStatusFor (ClockTick_t tick) const
 Returns a const-iterator to the status current at tick, or no value. More...
 
std::optional< status_iteratorfindLastStatusFor (ClockTick_t tick)
 Returns an iterator to the status current at tick, or no value. More...
 
status_iterator findLastStatusForTickOrThrow (ClockTick_t tick)
 
status_const_iterator findLastStatusForTickOrThrow (ClockTick_t tick) const
 
template<typename Op >
status_const_iterator findStatus (Op op, ClockTick_t start=MinTick, ClockTick_t end=MaxTick) const
 Returns an iterator to the first status for which op(status) is true. More...
 
status_const_iterator findOpenStatus (OpeningCount_t minOpening=1U, ClockTick_t start=MinTick, ClockTick_t end=MaxTick) const
 Returns an iterator to the first open status (. More...
 
status_const_iterator findCloseStatus (OpeningCount_t minOpening=1U, ClockTick_t start=MinTick, ClockTick_t end=MaxTick) const
 Returns an iterator to the first close status (. More...
 
status_const_iterator findMaxOpenStatus (ClockTick_t start=MinTick, ClockTick_t end=MaxTick) const
 Returns an iterator to the maximum open status (. More...
 
void compact ()
 Maintenance operation: removes unconsequential stati. More...
 

Static Private Member Functions

static GateEvolution_t startingGateLevel ()
 Helper returning the starting state of the levels at construction time. More...
 

Private Attributes

GateEvolution_t fGateLevel
 Evolution of the gate in time. More...
 

Static Private Attributes

static Status const NewGateStatus
 A new gate starts with this status: opening level set to 0. More...
 

Friends

std::ostream & operator (std::ostream &, triggergatedata_t const &)
 
std::ostream & operator (std::ostream &, Status const &)
 

Combination operations

triggergatedata_tMin (triggergatedata_t const &other)
 Combines with a gate, keeping the minimum opening among the two. More...
 
triggergatedata_tMax (triggergatedata_t const &other)
 Combines with a gate, keeping the maximum opening among the two. More...
 
triggergatedata_tSum (triggergatedata_t const &other)
 Combines with a gate, keeping the sum of openings of the two. More...
 
triggergatedata_tMul (triggergatedata_t const &other)
 Combines with a gate, keeping the product of openings of the two. More...
 
static triggergatedata_t Min (triggergatedata_t const &a, triggergatedata_t const &b)
 Returns a gate with the minimum opening between the specified two. More...
 
static triggergatedata_t Max (triggergatedata_t const &a, triggergatedata_t const &b)
 Returns a gate with the maximum opening between the specified two. More...
 
static triggergatedata_t Sum (triggergatedata_t const &a, triggergatedata_t const &b)
 Returns a gate with opening sum of the specified two. More...
 
static triggergatedata_t Mul (triggergatedata_t const &a, triggergatedata_t const &b)
 Returns a gate with opening product of the specified two. More...
 
template<typename Op >
static triggergatedata_t SymmetricCombination (Op &&op, triggergatedata_t const &a, triggergatedata_t const &b, ClockTicks_t aDelay=ClockTicks_t{}, ClockTicks_t bDelay=ClockTicks_t{})
 Returns a gate combination of the openings of two other gates. More...
 

Detailed Description

template<typename Tick, typename TickInterval>
class icarus::trigger::TriggerGateData< Tick, TickInterval >

Logical multi-level gate.

Template Parameters
Ticktype used to count the ticks
TickIntervaltype used to quantify tick difference

A TriggerGate object tracks a logical multi-level gate, that is a gate whose level can be not only 0 or 1, but an arbitrary integral number. The gate level is defined as a positive number. The general convention is that a level of 0 means the gate is closed, while any other level (typically 1) means it's open. In a multi-level gate, one can choose to interpret the gate as open only if it reaches a chosen level higher than 1. The time domain of the gate is measured in ticks, which in this context are optical detector clock ticks defined on the electronics time scale. That means that tick #0 is set at the origin of that time scale. The gate is unlimited, i.e. it can accommodate changes on any time tick from #0 on (up to the machine limitations, MaxTick). For practical purposes, lastTick() is instrumental to find the tick of the last gate change.

Internally, the gate is represented by "events". The first event, at tick #0, sets the level of the gate to the lowest possible (0, closed). Each event may change the level at a given tick and all the following ones until MaxTick. An actual gate is therefore defined by two events, an opening event (that is an increase in level) and a closing one (a shift of the same amount in the opposite direction).

Definition at line 86 of file TriggerGateData.h.

Member Typedef Documentation

template<typename Tick, typename TickInterval>
using icarus::trigger::TriggerGateData< Tick, TickInterval >::ClockTick_t = Tick

Type of a point in time, measured in ticks.

Definition at line 140 of file TriggerGateData.h.

template<typename Tick, typename TickInterval>
using icarus::trigger::TriggerGateData< Tick, TickInterval >::ClockTicks_t = TickInterval

Type of a time interval, measured in ticks.

Definition at line 143 of file TriggerGateData.h.

template<typename Tick, typename TickInterval>
using icarus::trigger::TriggerGateData< Tick, TickInterval >::EventType = details::TriggerGateEventType
protected

Definition at line 410 of file TriggerGateData.h.

template<typename Tick, typename TickInterval>
using icarus::trigger::TriggerGateData< Tick, TickInterval >::GateEvolution_t = std::vector<Status>
protected

Type to describe the time evolution of the gate.

Definition at line 414 of file TriggerGateData.h.

template<typename Tick, typename TickInterval>
using icarus::trigger::TriggerGateData< Tick, TickInterval >::OpeningCount_t = unsigned int

Type of count of number of open channels.

Definition at line 146 of file TriggerGateData.h.

template<typename Tick, typename TickInterval>
using icarus::trigger::TriggerGateData< Tick, TickInterval >::OpeningDiff_t = std::make_signed_t<OpeningCount_t>

Type representing a variation of open channels.

Definition at line 149 of file TriggerGateData.h.

template<typename Tick, typename TickInterval>
using icarus::trigger::TriggerGateData< Tick, TickInterval >::Status = details::TriggerGateStatus<ClockTick_t, OpeningCount_t>
protected

Definition at line 411 of file TriggerGateData.h.

template<typename Tick, typename TickInterval>
using icarus::trigger::TriggerGateData< Tick, TickInterval >::status_const_iterator = typename GateEvolution_t::const_iterator
private

Definition at line 431 of file TriggerGateData.h.

template<typename Tick, typename TickInterval>
using icarus::trigger::TriggerGateData< Tick, TickInterval >::status_iterator = typename GateEvolution_t::iterator
private

Definition at line 430 of file TriggerGateData.h.

template<typename Tick, typename TickInterval>
using icarus::trigger::TriggerGateData< Tick, TickInterval >::triggergatedata_t = TriggerGateData<Tick, TickInterval>

This type.

Definition at line 137 of file TriggerGateData.h.

Constructor & Destructor Documentation

template<typename Tick, typename TickInterval>
icarus::trigger::TriggerGateData< Tick, TickInterval >::TriggerGateData ( )
inline

Constructor: a closed gate for the channel in waveform.

Definition at line 164 of file TriggerGateData.h.

GateEvolution_t fGateLevel
Evolution of the gate in time.
static GateEvolution_t startingGateLevel()
Helper returning the starting state of the levels at construction time.
template<typename Tick, typename TickInterval>
icarus::trigger::TriggerGateData< Tick, TickInterval >::TriggerGateData ( GateEvolution_t &&  gateLevel)
inlineprotected

Protected constructor: set the data directly.

Definition at line 417 of file TriggerGateData.h.

418  : fGateLevel(std::move(gateLevel)) {}
GateEvolution_t fGateLevel
Evolution of the gate in time.

Member Function Documentation

template<typename Tick, typename TickInterval>
bool icarus::trigger::TriggerGateData< Tick, TickInterval >::alwaysClosed ( ) const
inline

Returns whether this gate never opened.

Definition at line 178 of file TriggerGateData.h.

178 { return findOpenStatus() == fGateLevel.end(); }
status_const_iterator findOpenStatus(OpeningCount_t minOpening=1U, ClockTick_t start=MinTick, ClockTick_t end=MaxTick) const
Returns an iterator to the first open status (.
GateEvolution_t fGateLevel
Evolution of the gate in time.
template<typename Tick, typename TickInterval>
void icarus::trigger::TriggerGateData< Tick, TickInterval >::clear ( )
inline

Sets the gate levels in the state at construction.

Definition at line 283 of file TriggerGateData.h.

GateEvolution_t fGateLevel
Evolution of the gate in time.
static GateEvolution_t startingGateLevel()
Helper returning the starting state of the levels at construction time.
template<typename Tick, typename TickInterval>
void icarus::trigger::TriggerGateData< Tick, TickInterval >::closeAllAt ( ClockTick_t  tick)
inline

Completely close this gate at the specified time.

Definition at line 280 of file TriggerGateData.h.

280 { setOpeningAt(tick, 0U); }
tick_as<> tick
Tick number, represented by std::ptrdiff_t.
Definition: electronics.h:75
void setOpeningAt(ClockTick_t tick, OpeningCount_t openingCount)
Changes the opening to match openingCount at the specified time.
template<typename Tick, typename TickInterval>
void icarus::trigger::TriggerGateData< Tick, TickInterval >::closeAt ( ClockTick_t  tick,
OpeningDiff_t  count 
)
inline

Close this gate at the specified time (decrease the opening by count).

Definition at line 273 of file TriggerGateData.h.

274  { return openAt(tick, -count); }
tick_as<> tick
Tick number, represented by std::ptrdiff_t.
Definition: electronics.h:75
void openAt(ClockTick_t tick, OpeningDiff_t count)
Open this gate at the specified time (increase the opening by count).
std::size_t count(Cont const &cont)
template<typename Tick, typename TickInterval>
void icarus::trigger::TriggerGateData< Tick, TickInterval >::closeAt ( ClockTick_t  tick)
inline

Close this gate at the specified time.

Definition at line 277 of file TriggerGateData.h.

277 { closeAt(tick, 1); }
void closeAt(ClockTick_t tick, OpeningDiff_t count)
Close this gate at the specified time (decrease the opening by count).
tick_as<> tick
Tick number, represented by std::ptrdiff_t.
Definition: electronics.h:75
template<typename Tick, typename TickInterval>
void icarus::trigger::TriggerGateData< Tick, TickInterval >::compact ( )
private

Maintenance operation: removes unconsequential stati.

template<typename Tick, typename TickInterval>
ClockTick_t icarus::trigger::TriggerGateData< Tick, TickInterval >::findClose ( OpeningCount_t  minOpening = 1U,
ClockTick_t  start = MinTick,
ClockTick_t  end = MaxTick 
) const

Returns the tick at which the gate closed.

Parameters
minOpeningminimum count to consider the gate open (default: 1)
startfirst tick to check _(by default, the first available one)_
endif getting to this tick, give up _(by default, to the end)_
Returns
the tick at which the gate closed, or end if never
See Also
findOpen()

The closing is defined as the opening count being changed to strictly below minOpening.

If the count is already below minOpening at the specified start tick, the current level is ignored and only the next change which keeps the gate closed is reported.

template<typename Tick, typename TickInterval>
status_const_iterator icarus::trigger::TriggerGateData< Tick, TickInterval >::findCloseStatus ( OpeningCount_t  minOpening = 1U,
ClockTick_t  start = MinTick,
ClockTick_t  end = MaxTick 
) const
private

Returns an iterator to the first close status (.

See Also
findClose()).
template<typename Tick, typename TickInterval>
std::optional<status_const_iterator> icarus::trigger::TriggerGateData< Tick, TickInterval >::findLastStatusFor ( ClockTick_t  tick) const
private

Returns a const-iterator to the status current at tick, or no value.

template<typename Tick, typename TickInterval>
std::optional<status_iterator> icarus::trigger::TriggerGateData< Tick, TickInterval >::findLastStatusFor ( ClockTick_t  tick)
private

Returns an iterator to the status current at tick, or no value.

template<typename Tick, typename TickInterval>
status_iterator icarus::trigger::TriggerGateData< Tick, TickInterval >::findLastStatusForTickOrThrow ( ClockTick_t  tick)
private

Returns an iterator to the status current at tick.

Exceptions
cet::exceptionif tick can't be handled
template<typename Tick, typename TickInterval>
status_const_iterator icarus::trigger::TriggerGateData< Tick, TickInterval >::findLastStatusForTickOrThrow ( ClockTick_t  tick) const
private

Returns a const-iterator to the status current at tick.

Exceptions
cet::exceptionif tick can't be handled
template<typename Tick, typename TickInterval>
ClockTick_t icarus::trigger::TriggerGateData< Tick, TickInterval >::findMaxOpen ( ClockTick_t  start = MinTick,
ClockTick_t  end = MaxTick 
) const

Returns the tick at which the gate has the maximum opening.

Parameters
startfirst tick to check _(by default, the first available one)_
endif getting to this tick, give up _(by default, to the end)_
Returns
the first tick with the maximum opening, or end if never
template<typename Tick, typename TickInterval>
status_const_iterator icarus::trigger::TriggerGateData< Tick, TickInterval >::findMaxOpenStatus ( ClockTick_t  start = MinTick,
ClockTick_t  end = MaxTick 
) const
private

Returns an iterator to the maximum open status (.

See Also
findMaxOpen()).
template<typename Tick, typename TickInterval>
ClockTick_t icarus::trigger::TriggerGateData< Tick, TickInterval >::findOpen ( OpeningCount_t  minOpening = 1U,
ClockTick_t  start = MinTick,
ClockTick_t  end = MaxTick 
) const

Returns the tick at which the gate opened.

Parameters
minOpeningminimum count to consider the gate open _(default: 1)_
startfirst tick to check (by default, the first available one)
endif getting to this tick, give up (by default, to the end)
Returns
the tick at which the gate opened, or end if never
See Also
findClose(), findMaxOpen()

If the count is already above (or equal to) minOpening at the specified start tick, the current level is ignored and only the next change which keeps the gate open is reported.

template<typename Tick, typename TickInterval>
status_const_iterator icarus::trigger::TriggerGateData< Tick, TickInterval >::findOpenStatus ( OpeningCount_t  minOpening = 1U,
ClockTick_t  start = MinTick,
ClockTick_t  end = MaxTick 
) const
private

Returns an iterator to the first open status (.

See Also
findOpen()).
template<typename Tick, typename TickInterval>
template<typename Op >
status_const_iterator icarus::trigger::TriggerGateData< Tick, TickInterval >::findStatus ( Op  op,
ClockTick_t  start = MinTick,
ClockTick_t  end = MaxTick 
) const
private

Returns an iterator to the first status for which op(status) is true.

template<typename Tick, typename TickInterval>
bool icarus::trigger::TriggerGateData< Tick, TickInterval >::isOpen ( ClockTick_t  tick) const
inline

Returns whether the gate is open at all at the specified tick.

Definition at line 181 of file TriggerGateData.h.

181 { return openingCount(tick) > 0U; }
tick_as<> tick
Tick number, represented by std::ptrdiff_t.
Definition: electronics.h:75
OpeningCount_t openingCount(ClockTick_t tick) const
Returns the opening count of the gate at the specified tick.
template<typename Tick, typename TickInterval>
ClockTick_t icarus::trigger::TriggerGateData< Tick, TickInterval >::lastTick ( ) const
inline

Returns the number of ticks this gate covers.

Definition at line 172 of file TriggerGateData.h.

172 { return fGateLevel.back().tick; }
GateEvolution_t fGateLevel
Evolution of the gate in time.
template<typename Tick, typename TickInterval>
triggergatedata_t& icarus::trigger::TriggerGateData< Tick, TickInterval >::Max ( triggergatedata_t const &  other)

Combines with a gate, keeping the maximum opening among the two.

Parameters
othergate to combine to
Returns
this object
See Also
Min(), Sum()

Multi-level equivalent of an or logical operation.

template<typename Tick, typename TickInterval>
static triggergatedata_t icarus::trigger::TriggerGateData< Tick, TickInterval >::Max ( triggergatedata_t const &  a,
triggergatedata_t const &  b 
)
static

Returns a gate with the maximum opening between the specified two.

Parameters
afirst gate
bsecond gate
Returns
gate with at every tick the maximum opening among a and b
See Also
Min(), Sum()

Multi-level equivalent of an or logical operation.

template<typename Tick, typename TickInterval>
triggergatedata_t& icarus::trigger::TriggerGateData< Tick, TickInterval >::Min ( triggergatedata_t const &  other)

Combines with a gate, keeping the minimum opening among the two.

Parameters
othergate to combine to
Returns
this object
See Also
Max()

Multi-level equivalent of an and logical operation.

template<typename Tick, typename TickInterval>
static triggergatedata_t icarus::trigger::TriggerGateData< Tick, TickInterval >::Min ( triggergatedata_t const &  a,
triggergatedata_t const &  b 
)
static

Returns a gate with the minimum opening between the specified two.

Parameters
afirst gate
bsecond gate
Returns
gate with at every tick the minimum opening among a and b
See Also
Max()

Multi-level equivalent of an and logical operation.

template<typename Tick, typename TickInterval>
triggergatedata_t& icarus::trigger::TriggerGateData< Tick, TickInterval >::Mul ( triggergatedata_t const &  other)

Combines with a gate, keeping the product of openings of the two.

Parameters
othergate to combine to
Returns
this object
See Also
Min(), Max(), Sum()

Multi-level equivalent of an extended and.

template<typename Tick, typename TickInterval>
static triggergatedata_t icarus::trigger::TriggerGateData< Tick, TickInterval >::Mul ( triggergatedata_t const &  a,
triggergatedata_t const &  b 
)
static

Returns a gate with opening product of the specified two.

Parameters
afirst gate
bsecond gate
Returns
gate with at every tick the product of openings of a and b
See Also
Max(), Sum()
template<typename Tick, typename TickInterval>
void icarus::trigger::TriggerGateData< Tick, TickInterval >::openAt ( ClockTick_t  tick,
OpeningDiff_t  count 
)
inline

Open this gate at the specified time (increase the opening by count).

Definition at line 259 of file TriggerGateData.h.

260  { openBetween(tick, MaxTick, count); }
static constexpr ClockTick_t MaxTick
An unbearably large tick number.
void openBetween(ClockTick_t start, ClockTick_t end, OpeningDiff_t count=1)
Open this gate at specified start tick, and close it at end tick.
tick_as<> tick
Tick number, represented by std::ptrdiff_t.
Definition: electronics.h:75
std::size_t count(Cont const &cont)
template<typename Tick, typename TickInterval>
void icarus::trigger::TriggerGateData< Tick, TickInterval >::openAt ( ClockTick_t  tick)
inline

Open this gate at the specified time (increase the opening by 1).

Definition at line 263 of file TriggerGateData.h.

263 { openAt(tick, 1); }
tick_as<> tick
Tick number, represented by std::ptrdiff_t.
Definition: electronics.h:75
void openAt(ClockTick_t tick, OpeningDiff_t count)
Open this gate at the specified time (increase the opening by count).
template<typename Tick, typename TickInterval>
void icarus::trigger::TriggerGateData< Tick, TickInterval >::openBetween ( ClockTick_t  start,
ClockTick_t  end,
OpeningDiff_t  count = 1 
)

Open this gate at specified start tick, and close it at end tick.

template<typename Tick, typename TickInterval>
void icarus::trigger::TriggerGateData< Tick, TickInterval >::openFor ( ClockTick_t  tick,
ClockTicks_t  length,
OpeningDiff_t  count = 1 
)
inline

Open this gate at the specified time, and close it length ticks later.

Definition at line 269 of file TriggerGateData.h.

270  { openBetween(tick, tick + length, count); }
void openBetween(ClockTick_t start, ClockTick_t end, OpeningDiff_t count=1)
Open this gate at specified start tick, and close it at end tick.
tick_as<> tick
Tick number, represented by std::ptrdiff_t.
Definition: electronics.h:75
std::size_t count(Cont const &cont)
template<typename Tick, typename TickInterval>
OpeningCount_t icarus::trigger::TriggerGateData< Tick, TickInterval >::openingCount ( ClockTick_t  tick) const

Returns the opening count of the gate at the specified tick.

template<typename Tick, typename TickInterval>
std::pair<OpeningCount_t, OpeningCount_t> icarus::trigger::TriggerGateData< Tick, TickInterval >::openingRange ( ClockTick_t  start,
ClockTick_t  end 
) const

Returns the range of trigger opening values in the specified range.

Parameters
startthe first tick to consider
endthe first tick to exclude
Returns
a pair, { lower, upper } opening values

This method returns the lowest opening value seen in the tick range, and the lowest opening value above that one not seen in the same range. Therefore, a gate always closed (opening value 0) in the full range will return { 0, 1 }, a gate always opened (opening value 1) will return { 1, 2 }, a gate which opened or closed within the tick range will return { 0, 2 }. In case the tick range is empty, the returned value contains the same value for both extremes.

This function does not describe where the two extreme counts were found.

template<typename Tick, typename TickInterval>
bool icarus::trigger::TriggerGateData< Tick, TickInterval >::operator!= ( TriggerGateData< Tick, TickInterval > const &  ) const
template<typename Tick, typename TickInterval>
bool icarus::trigger::TriggerGateData< Tick, TickInterval >::operator== ( TriggerGateData< Tick, TickInterval > const &  ) const
template<typename Tick, typename TickInterval>
void icarus::trigger::TriggerGateData< Tick, TickInterval >::setOpeningAt ( ClockTick_t  tick,
OpeningCount_t  openingCount 
)

Changes the opening to match openingCount at the specified time.

template<typename Tick, typename TickInterval>
static GateEvolution_t icarus::trigger::TriggerGateData< Tick, TickInterval >::startingGateLevel ( )
staticprivate

Helper returning the starting state of the levels at construction time.

template<typename Tick, typename TickInterval>
triggergatedata_t& icarus::trigger::TriggerGateData< Tick, TickInterval >::Sum ( triggergatedata_t const &  other)

Combines with a gate, keeping the sum of openings of the two.

Parameters
othergate to combine to
Returns
this object
See Also
Min(), Max()
template<typename Tick, typename TickInterval>
static triggergatedata_t icarus::trigger::TriggerGateData< Tick, TickInterval >::Sum ( triggergatedata_t const &  a,
triggergatedata_t const &  b 
)
static

Returns a gate with opening sum of the specified two.

Parameters
afirst gate
bsecond gate
Returns
gate with at every tick the total opening of a and b
See Also
Max()
template<typename Tick, typename TickInterval>
template<typename Op >
static triggergatedata_t icarus::trigger::TriggerGateData< Tick, TickInterval >::SymmetricCombination ( Op &&  op,
triggergatedata_t const &  a,
triggergatedata_t const &  b,
ClockTicks_t  aDelay = ClockTicks_t{},
ClockTicks_t  bDelay = ClockTicks_t{} 
)
static

Returns a gate combination of the openings of two other gates.

Template Parameters
Opbinary operation: OpeningCount_t (x2) to OpeningCount_t
Parameters
opsymmetric binary combination operation
afirst gate
bsecond gate
aDelayticks of delay to be added to the first gate
bDelayticks of delay to be added to the second gate
Returns
gate with opening combination of a and b

For this algorithm to work, the operation needs to be symmetric, i.e. op(c1, c2) == op(c2, c1) for every valid combinations of counts c1 and c2.

Friends And Related Function Documentation

template<typename Tick, typename TickInterval>
std::ostream& operator ( std::ostream &  ,
triggergatedata_t const &   
)
friend
template<typename Tick, typename TickInterval>
std::ostream& operator ( std::ostream &  ,
Status const &   
)
friend

Member Data Documentation

template<typename Tick, typename TickInterval>
GateEvolution_t icarus::trigger::TriggerGateData< Tick, TickInterval >::fGateLevel
private

Evolution of the gate in time.

Definition at line 451 of file TriggerGateData.h.

template<typename Tick, typename TickInterval>
constexpr ClockTick_t icarus::trigger::TriggerGateData< Tick, TickInterval >::MaxTick = std::numeric_limits<ClockTick_t>::max()
static

An unbearably large tick number.

Definition at line 160 of file TriggerGateData.h.

template<typename Tick, typename TickInterval>
constexpr ClockTick_t icarus::trigger::TriggerGateData< Tick, TickInterval >::MinTick = std::numeric_limits<ClockTick_t>::min()
static

An unbearably small tick number.

Definition at line 156 of file TriggerGateData.h.

template<typename Tick, typename TickInterval>
Status const icarus::trigger::TriggerGateData< Tick, TickInterval >::NewGateStatus
staticprivate

A new gate starts with this status: opening level set to 0.

Definition at line 448 of file TriggerGateData.h.


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