libtcspc.DetectionPairEvent

class libtcspc.DetectionPairEvent(numeric_traits=None)[source]

Bases: EventType

Event representing a pair of detections (a start and a stop).

Emitted by the PairAll, PairOne, PairAllBetween, and PairOneBetween processors, and consumed by the TimeCorrelateAtStart, TimeCorrelateAtStop, TimeCorrelateAtMidpoint, and TimeCorrelateAtFraction processors.

Parameters:

numeric_traits (NumericTraits or None) – Set of integer types parameterising the C++ event. None (the default) uses NumericTraits defaults.

Notes

The corresponding C++ event is std::array<tcspc::detection_event, 2>; element 0 is the start detection and element 1 is the stop detection.

A value is constructed with the single field elements, given as a sequence of exactly two DetectionEvent EventInstance values (the start and the stop):

DetectionPairEvent(nt).value(elements=[start, stop])

When delivered to a Python sink (or read back), elements is a tuple of two DetectionEvent EventInstance values; an EventInstance of this type also supports len(...) and indexing.

Constructing and inspecting individual event values from Python is intended for debugging and learning only and is extremely slow; production graphs process events in compiled C++ and exchange bulk data via buckets.

See also

DetectionEvent

The element type of the pair.

ArrayEventType

The generic fixed-size-array event type this specializes.