Convenience base class for user sort classes.
More...
#include <LogicalEventSorterBase.hpp>
|
|
class | LogicalEventCollector< LogicalEventSorterBase, Tr > |
| |
template<class Ev, class Tr>
class pottu::LogicalEventSorterBase< Ev, Tr >
Convenience base class for user sort classes.
This base class implements process() method which calls LogicalEventCollector which then calls the methods onTimeOrderError() and constructAndProcessLogicalEvent() of the user class.
- Template Parameters
-
| Ev | Logical event class. Must be derived from SharedResource and implement clear() method. The clear should initiate an instance so that it can be used again. |
| Tr | Trigger class. Should implement methods feed() and reset(). Trigger can have internal state. One instance of this class will be created by LogicalEventSorterBase. |
◆ LogicalEventSorterBase()
template<class Ev , class Tr >
Constructor.
- Parameters
-
| name | Name for the instance handle to the context. This is used in prosessing stage statistics. |
| triggerDeadTime | Time [tics] after trigger a new trigger is not allowed. |
| eventDelay | Time [tics] after trigger the event will be started. Can be also negative to collect detector event before a trigger. |
| maxEventLength | Maximum length of the collected event [tics] from triggertime + eventDelay. |
◆ constructAndProcessLogicalEvent()
template<class Ev , class Tr >
|
|
protectedpure virtualnoexcept |
Called if the object has found a new trigger. This must be implemented in the derived class.
- Parameters
-
| first | Iterator to the first detector event inside the logical event window. |
| last | Iterator pointing to the first detector event after the logical event. |
| triggerTime | Time stamp of the trigger. |
| eventStartTime | Time stamp of the beginning of the logical event window. |
| eventStopTime | Time stamp of the end of the logical event window. This is the smallest time stamp which is NOT included. |
◆ context()
template<class Ev , class Tr >
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: LogicalEventSorterBase.hpp:130
◆ getEventDelay()
template<class Ev , class Tr >
Returns the event delay.
- Returns
- The event delay.
◆ getEventMaxLength()
template<class Ev , class Tr >
Returns the maximum event length.
- Returns
- The maximum event length
◆ getNewEvent()
template<class Ev , class Tr >
Returns new logical event.
The returned event is allocated or recycled and clear() has been called for it.
◆ getTriggerDeadtime()
template<class Ev , class Tr >
Returns the trigger dead time.
- Returns
- The trigger dead time
◆ process()
template<class Ev , class Tr >
Uses or modifies detector events in a container.
- Parameters
-
| data | Vector containing detector events to be modified or used. |
Typically only the fields of each detector event is modified and the event is otherwise kept the same.
Implements pottu::StageDetectorEvent.
The documentation for this class was generated from the following file: