Pottu
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
pottu::LogicalEventSorter< Ev, Tr, D > Class Template Reference

Convenience base class for user sort classes. More...

#include <LogicalEventSorter.hpp>

Inheritance diagram for pottu::LogicalEventSorter< Ev, Tr, D >:
Inheritance graph
[legend]
Collaboration diagram for pottu::LogicalEventSorter< Ev, Tr, D >:
Collaboration graph
[legend]

Public Types

using logical_event_pool_t = SharedResourcePool< Ev >
 
using logical_event_handle_t = typename logical_event_pool_t::logical_event_handle_t
 

Public Member Functions

 LogicalEventSorter (const std::string &name, int triggerDeadTime, int eventDelay, int maxEventLength)
 Constructor. More...
 
void process (std::vector< DetectorEvent > &data) noexcept
 Feeds data to object buffers. Tests for triggers. More...
 
int64_t getEventMaxLength () const
 Returns the maximum event length. More...
 
int64_t getEventDelay () const
 Returns the event delay. More...
 
int64_t getTriggerDeadtime () const
 Returns the trigger dead time. More...
 
- Public Member Functions inherited from pottu::StageDetectorEvent
virtual ~StageDetectorEvent ()
 Virtual desctructor.
 

Protected Member Functions

logical_event_handle_t getNewEvent () noexcept
 Returns new logical event. More...
 
ContextHandlecontext () noexcept
 Returns pointer to the ContextHandle. More...
 

Protected Attributes

ContextHandle_ctxh
 Handle for the context.
 
logical_event_pool_t _logicalEventPool
 
Tr _triggerer
 
LogicalEventCollector< D, Tr > _eventCollector
 

Detailed Description

template<class Ev, class Tr, class D>
class pottu::LogicalEventSorter< Ev, Tr, D >

Convenience base class for user sort classes.

Deprecated:
. Please use LogicalEventSorterBase instead.

This base class implements process() method which calls LogicalEventCollector which then calls the methods onTimeOrderError() and constructAndProcessLogicalEvent() of the user class.

Template Parameters
EvLogical event class. Must be derived from SharedResource and implement clear() method. The clear should initiate an instance so that it can be used again.
TrTrigger class. Should implement methods feed() and reset(). Trigger can have internal state. One instance of this class will be created by LogicalEventSorter.
DThe inherited user class. This type is required to call the beforementioned user class methods on time order error and on event creation.

Constructor & Destructor Documentation

◆ LogicalEventSorter()

template<class Ev , class Tr , class D >
pottu::LogicalEventSorter< Ev, Tr, D >::LogicalEventSorter ( const std::string &  name,
int  triggerDeadTime,
int  eventDelay,
int  maxEventLength 
)
inline

Constructor.

Parameters
nameName for the instance handle to the context. This is used in prosessing stage statistics.
triggerDeadTimeTime [tics] after trigger a new trigger is not allowed.
eventDelayTime [tics] after trigger the event will be started. Can be also negative to collect detector event before a trigger.
maxEventLengthMaximum length of the collected event [tics] from triggertime + eventDelay.

Member Function Documentation

◆ context()

template<class Ev , class Tr , class D >
ContextHandle* pottu::LogicalEventSorter< Ev, Tr, D >::context ( )
inlineprotectednoexcept

Returns pointer to the ContextHandle.

Typically this is used to print some log messages by calling

context->logInfo("Something happened");
ContextHandle * context() noexcept
Returns pointer to the ContextHandle.
Definition: LogicalEventSorter.hpp:114

◆ getEventDelay()

template<class Ev , class Tr , class D >
int64_t pottu::LogicalEventSorter< Ev, Tr, D >::getEventDelay ( ) const
inline

Returns the event delay.

Returns
The event delay.

◆ getEventMaxLength()

template<class Ev , class Tr , class D >
int64_t pottu::LogicalEventSorter< Ev, Tr, D >::getEventMaxLength ( ) const
inline

Returns the maximum event length.

Returns
The maximum event length

◆ getNewEvent()

template<class Ev , class Tr , class D >
logical_event_handle_t pottu::LogicalEventSorter< Ev, Tr, D >::getNewEvent ( )
inlineprotectednoexcept

Returns new logical event.

The returned event is allocated or recycled and clear() has been called for it.

◆ getTriggerDeadtime()

template<class Ev , class Tr , class D >
int64_t pottu::LogicalEventSorter< Ev, Tr, D >::getTriggerDeadtime ( ) const
inline

Returns the trigger dead time.

Returns
The trigger dead time

◆ process()

template<class Ev , class Tr , class D >
void pottu::LogicalEventSorter< Ev, Tr, D >::process ( std::vector< DetectorEvent > &  data)
inlinevirtualnoexcept

Feeds data to object buffers. Tests for triggers.

Parameters
dataDetector events to be fed into the buffers.

Implements pottu::StageDetectorEvent.


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