libtcspc C++ API
Streaming TCSPC and time tag data processing
Loading...
Searching...
No Matches
tcspc::bh_spc_event Struct Reference

Description

Binary record interpretation for raw BH SPC event.

This interprets the FIFO format used by most BH SPC models, except for SPC-600, SPC-630, and TDC models.

Public Member Functions

constexpr auto adc_value () const noexcept -> u16np
 Read the ADC value (i.e., difference time) if this event represents a photon.
constexpr auto gap_flag () const noexcept -> bool
 Read the 'gap' (data lost) flag.
auto gap_flag (bool gap) noexcept -> bh_spc_event &
 Set or clear the gap flag of this event.
constexpr auto invalid_flag () const noexcept -> bool
 Read the 'invalid' flag.
constexpr auto is_multiple_macrotime_overflow () const noexcept -> bool
 Determine if this event represents multiple macrotime overflows.
constexpr auto macrotime () const noexcept -> u16np
 Read the macrotime counter value (no rollover correction).
constexpr auto macrotime_overflow_flag () const noexcept -> bool
 Read the 'macrotime overflow' flag.
constexpr auto marker_bits () const noexcept -> u8np
 Read the marker bits (mask) if this event represents markers.
constexpr auto marker_flag () const noexcept -> bool
 Read the 'marker' flag.
constexpr auto multiple_macrotime_overflow_count () const noexcept -> u32np
 Read the macrotime overflow count if this event represents multiple macrotime overflows.
constexpr auto routing_signals () const noexcept -> u8np
 Read the routing signals (usually the detector channel) if this event represents a photon.

Static Public Member Functions

static constexpr auto make_invalid_photon (u16np macrotime, u16np adc_value) -> bh_spc_event
 Make an event representing an invalid photon event.
static constexpr auto make_marker (u16np macrotime, u8np marker_bits, bool macrotime_overflow=false) -> bh_spc_event
 Make an event representing a marker.
static constexpr auto make_marker0_with_intensity_count (u16np macrotime, u8np marker_bits, u16np count, bool macrotime_overflow=false) -> bh_spc_event
 Make an event representing a marker, with marker 0 intensity count as generated by SPC-160 and SPC-180N.
static constexpr auto make_multiple_macrotime_overflow (u32np count) -> bh_spc_event
 Make an event representing a multiple macrotime overflow.
static constexpr auto make_photon (u16np macrotime, u16np adc_value, u8np route, bool macrotime_overflow=false) -> bh_spc_event
 Make an event representing a valid photon event.

Public Attributes

std::array< std::byte, 4 > bytes
 Bytes of the 32-bit raw device event.

Static Public Attributes

static constexpr bool has_markers = true
 Whether this event type can represent marker events.
static constexpr u32 macrotime_overflow_period = 1 << 12
 The macrotime overflow period of this event type.

Friends

auto operator<< (std::ostream &strm, bh_spc_event const &e) -> std::ostream &
 Stream insertion operator.
auto operator== (bh_spc_event const &lhs, bh_spc_event const &rhs) noexcept -> bool=default
 Equality comparison operator.

Member Function Documentation

◆ gap_flag()

auto tcspc::bh_spc_event::gap_flag ( bool gap) -> bh_spc_event &
inlinenoexcept

Set or clear the gap flag of this event.

All other bits are unaffected.

Parameters
gapif true, set the gap bit; otherwise clear
Returns
event

◆ make_invalid_photon()

constexpr auto tcspc::bh_spc_event::make_invalid_photon ( u16np macrotime,
u16np adc_value ) -> bh_spc_event
inlinestaticconstexpr

Make an event representing an invalid photon event.

The gap flag is cleared. This event type does not allow invalid photons to carry a macrotime overflow.

Parameters
macrotimethe photon macrotime; 0 to 4095
adc_valuethe photon ADC value (microtime); 0 to 4095
Returns
event

◆ make_marker()

constexpr auto tcspc::bh_spc_event::make_marker ( u16np macrotime,
u8np marker_bits,
bool macrotime_overflow = false ) -> bh_spc_event
inlinestaticconstexpr

Make an event representing a marker.

The gap flag is cleared.

Parameters
macrotimethe marker macrotime; 0 to 4095
marker_bitsthe marker bitmask; 1 to 15 (0 is allowed but may not be handled correctly by other readers)
macrotime_overflowwhether to set the macrotime overflow flag
Returns
event

◆ make_marker0_with_intensity_count()

constexpr auto tcspc::bh_spc_event::make_marker0_with_intensity_count ( u16np macrotime,
u8np marker_bits,
u16np count,
bool macrotime_overflow = false ) -> bh_spc_event
inlinestaticconstexpr

Make an event representing a marker, with marker 0 intensity count as generated by SPC-160 and SPC-180N.

The gap flag is cleared.

Parameters
macrotimethe marker macrotime; 0 to 4095
marker_bitsthe marker bitmask; 1 to 15; bit 0 must be set
countthe intensity counter value (photons since previous marker 0); 0 to 4095
macrotime_overflowwhether to set the macrotime overflow flag
Returns
event

◆ make_multiple_macrotime_overflow()

constexpr auto tcspc::bh_spc_event::make_multiple_macrotime_overflow ( u32np count) -> bh_spc_event
inlinestaticconstexpr

Make an event representing a multiple macrotime overflow.

The gap flag is cleared.

Parameters
countthe number of macrotime overflows; 1 to 268,435,455 (0 is allowed but may not be handled correctly by other readers)
Returns
event

◆ make_photon()

constexpr auto tcspc::bh_spc_event::make_photon ( u16np macrotime,
u16np adc_value,
u8np route,
bool macrotime_overflow = false ) -> bh_spc_event
inlinestaticconstexpr

Make an event representing a valid photon event.

The gap flag is cleared.

Parameters
macrotimethe photon macrotime; 0 to 4095
adc_valuethe photon ADC value (microtime); 0 to 4095
routethe routing signals (channel); 0 to 15
macrotime_overflowwhether to set the macrotime overflow flag
Returns
event

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