CbmRoot
Loading...
Searching...
No Matches
cbm::algo::evbuild::EventBuilder Class Reference

Constructs CbmDigiEvents out of CbmDigiTimeslices. More...

#include <EventBuilder.h>

Collaboration diagram for cbm::algo::evbuild::EventBuilder:
[legend]

Public Types

typedef std::pair< std::vector< DigiEvent >, EventBuilderMonitorDataresultType
 

Public Member Functions

 EventBuilder (const EventBuilderConfig &config)
 Constructor.
 
virtual ~EventBuilder ()
 Destructor.
 
resultType operator() (const DigiData &ts, const std::vector< double > triggers, std::optional< DigiEventSelector > selector) const
 Execution.
 
std::string ToString () const
 Info to string.
 

Private Member Functions

DigiEvent BuildEvent (const DigiData &ts, EventBuilderMonitorData &monitor, double trigger) const
 Build a single event from a trigger time.
 

Static Private Member Functions

template<typename Vector >
static Vector CopyRange (const Vector &source, double tMin, double tMax)
 Copy data objects in a given time interval from the source to the target vector.
 

Private Attributes

EventBuilderConfig fConfig
 Configuration / parameters.
 

Detailed Description

Constructs CbmDigiEvents out of CbmDigiTimeslices.

Author
Volker Friese v.fri.nosp@m.ese@.nosp@m.gsi.d.nosp@m.e
Since
2021

Events are constructed by copying digi data from the source (CbmDigiTimeslice). Digis are selected in trigger windows, the sizes of which relative to a trigger time are configurable. For each trigger time, an event is generated. The time intervals may overlap, resulting in digis being attributed to multiple events.

The source digi vectors (in CbmDigiTimeslice) must be sorted w.r.t. time, otherwise the behaviour is undefined.

The trigger vector must be sorted.

Definition at line 72 of file EventBuilder.h.

Member Typedef Documentation

◆ resultType

Constructor & Destructor Documentation

◆ EventBuilder()

cbm::algo::evbuild::EventBuilder::EventBuilder ( const EventBuilderConfig & config)
inline

Constructor.

Definition at line 78 of file EventBuilder.h.

◆ ~EventBuilder()

virtual cbm::algo::evbuild::EventBuilder::~EventBuilder ( )
inlinevirtual

Destructor.

Definition at line 82 of file EventBuilder.h.

Member Function Documentation

◆ BuildEvent()

◆ CopyRange()

template<typename Vector >
static Vector cbm::algo::evbuild::EventBuilder::CopyRange ( const Vector & source,
double tMin,
double tMax )
inlinestaticprivate

Copy data objects in a given time interval from the source to the target vector.

Parameters
sourceSource data vector
tMinMinimal time
tMaxMaximal time
Returns
Target data vector

The Data class specialisation must implement the method double GetTime(), which is used to check whether the Data object falls into the specified time interval.

The source vector must be ordered w.r.t. GetTime(), otherwise the behaviour is undefined.

TODO: The current implementation searches, for each trigger, the entire source vector. This can surely be optimised when the contract that the trigger vector be sorted is properly exploited, e.g., by starting the search for the first digi in the trigger window from the start of the previous trigger window. This, however, requires bookkeeping hardly to be realised without changing the state of the class. I leave this for the future and for bright specialists.

Definition at line 127 of file EventBuilder.h.

Referenced by BuildEvent().

◆ operator()()

◆ ToString()

std::string cbm::algo::evbuild::EventBuilder::ToString ( ) const

Member Data Documentation

◆ fConfig

EventBuilderConfig cbm::algo::evbuild::EventBuilder::fConfig
private

Configuration / parameters.

Definition at line 139 of file EventBuilder.h.

Referenced by BuildEvent(), and ToString().


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