McStas Readout Master 0.8.0
Loading...
Searching...
No Matches
pulse_grid Class Reference

The source's pulses: pulse k is at k periods after the UNIX epoch. More...

#include <efu_time.h>

Public Member Functions

 pulse_grid (const uint64_t period_ns)
 
uint64_t period_ns () const
 
efu_time period () const
 
uint64_t at_or_before (const uint64_t ns) const
 The latest pulse at or before ns.
 
uint64_t after (const uint64_t ns) const
 The first pulse strictly after ns.
 

Static Public Member Functions

static pulse_grid from_rate (const double rate)
 
static pulse_grid from_period (const efu_time &period)
 For a period given as a time: to the nearest nanosecond. efu_time(double) truncates to a whole tick, so efu_time(1.0 / 14) is 2 ns short of an ESS pulse; prefer from_rate.
 

Detailed Description

The source's pulses: pulse k is at k periods after the UNIX epoch.

Anchored on the epoch rather than on whenever a Readout or Sender happens to be created, so every one of them – every MPI rank of a simulation, every replay – and anything else keeping the same grid, like mccode-plumber's mp-tdc, agree on when a pulse was. The period is a whole number of nanoseconds, round(1e9 / rate), which is also what the EFU takes an ESS pulse to be.

Definition at line 177 of file efu_time.h.

Constructor & Destructor Documentation

◆ pulse_grid()

pulse_grid::pulse_grid ( const uint64_t  period_ns)
inlineexplicit

Definition at line 180 of file efu_time.h.

Member Function Documentation

◆ after()

uint64_t pulse_grid::after ( const uint64_t  ns) const
inline

The first pulse strictly after ns.

Definition at line 199 of file efu_time.h.

◆ at_or_before()

uint64_t pulse_grid::at_or_before ( const uint64_t  ns) const
inline

The latest pulse at or before ns.

Definition at line 197 of file efu_time.h.

Referenced by Readout::update_time().

◆ from_period()

static pulse_grid pulse_grid::from_period ( const efu_time &  period)
inlinestatic

For a period given as a time: to the nearest nanosecond. efu_time(double) truncates to a whole tick, so efu_time(1.0 / 14) is 2 ns short of an ESS pulse; prefer from_rate.

Definition at line 190 of file efu_time.h.

◆ from_rate()

static pulse_grid pulse_grid::from_rate ( const double  rate)
inlinestatic

Definition at line 183 of file efu_time.h.

◆ period()

efu_time pulse_grid::period ( ) const
inline

Definition at line 195 of file efu_time.h.

◆ period_ns()

uint64_t pulse_grid::period_ns ( ) const
inline

Definition at line 194 of file efu_time.h.


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