Pottu
Public Member Functions | Public Attributes | List of all members
pottu::TimeAdjuster Class Reference

Adjusts individual channel timing and merges channels back in time order. More...

#include <TimeAdjuster.hpp>

Inheritance diagram for pottu::TimeAdjuster:
Inheritance graph
[legend]
Collaboration diagram for pottu::TimeAdjuster:
Collaboration graph
[legend]

Public Member Functions

void setCorrection (uint16_t ch, int64_t correction)
 Registers timestamp correction for a channel. More...
 
int64_t getCorrection (uint16_t ch) const noexcept
 Returns correction of the timestamp registered to a channel. More...
 
virtual void process (std::vector< DetectorEvent > &input, std::vector< DetectorEvent > &output)
 Consumes detector events and returns different detector events. More...
 
- Public Member Functions inherited from pottu::StageDetectorEventToDetectorEvent
virtual ~StageDetectorEventToDetectorEvent ()
 Virtual destructor.
 

Public Attributes

ContextHandle_ctxh
 
std::array< int64_t, 4096 > _chTimeCorrections
 
int64_t _maxCorrection {0}
 
int64_t _minCorrection {0}
 
int64_t _correctionWidth {0}
 
int64_t _tsPrev {0}
 
std::deque< DetectorEvent_queue
 

Detailed Description

Adjusts individual channel timing and merges channels back in time order.

Member Function Documentation

◆ getCorrection()

int64_t pottu::TimeAdjuster::getCorrection ( uint16_t  ch) const
inlinenoexcept

Returns correction of the timestamp registered to a channel.

Returns
Registered correction or zero if channel is not registered.

◆ process()

virtual void pottu::TimeAdjuster::process ( std::vector< DetectorEvent > &  input,
std::vector< DetectorEvent > &  output 
)
inlinevirtual

Consumes detector events and returns different detector events.

Parameters
inputDetector events to consume. Do not use the events in input after this call.
outputDetector events (usually different than input) returned.

Stage using this kind of process pattern typically holds a buffer of detector events.

Implements pottu::StageDetectorEventToDetectorEvent.

◆ setCorrection()

void pottu::TimeAdjuster::setCorrection ( uint16_t  ch,
int64_t  correction 
)
inline

Registers timestamp correction for a channel.

Parameters
chChannel the correction should be applied
correctionCorrection in tics. Positive value delays the event.

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