LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
evgen::details Namespace Reference

Classes

struct  Average
 
class  TimeInUnits
 
class  TimeInUnitsBase
 Class reading a Clock and converting the value to a specific Unit. More...
 

Typedefs

using ns_clock_t = details::TimeInUnits< std::chrono::high_resolution_clock, std::chrono::nanoseconds >
 

Functions

template<typename T >
auto discretize (T value, T period)
 Returns the multiple of period closest to value. More...
 

Typedef Documentation

using evgen::details::ns_clock_t = typedef details::TimeInUnits <std::chrono::high_resolution_clock, std::chrono::nanoseconds>

Definition at line 283 of file GeneratedEventTimestamp_plugin.cc.

Function Documentation

template<typename T >
auto evgen::details::discretize ( value,
period 
)

Returns the multiple of period closest to value.

Definition at line 96 of file GeneratedEventTimestamp_plugin.cc.

Referenced by evgen::details::TimeInUnitsBase< Clock, Unit >::currentOffsetFromEpoch().

96  {
97  auto const excess = value % period;
98  auto const base = value - excess;
99  return (excess < (period / T(2)))? base: base + period;
100  } // discretize()
double value
Definition: spectrum.C:18