Project
Loading...
Searching...
No Matches
o2::phos::EventHandler< CellInputType > Class Template Reference

#include <EventHandler.h>

Classes

class  EventIterator
 
class  InteractionRecordInvalidException
 Error handling in case the interaction records from various sources do not match. More...
 
class  NotInitializedException
 Exception handling unitialized event handler. More...
 
class  RangeException
 Exception handling errors due to exceeding the range of triggers handled by the handler. More...
 

Public Types

using TriggerRange = gsl::span< const TriggerRecord >
 
using ClusterRange = gsl::span< const Cluster >
 
using CellIndexRange = gsl::span< const int >
 
using CellRange = gsl::span< const CellInputType >
 

Public Member Functions

 EventHandler ()=default
 Dummy constructor.
 
 EventHandler (CellRange cells, TriggerRange triggers)
 Constructor, initializing event handler for cells only.
 
 EventHandler (ClusterRange clusters, CellIndexRange cellIndices, TriggerRange triggersCluster, TriggerRange triggersCellIndex)
 Constructor, initializing event handler for clusters only.
 
 EventHandler (ClusterRange clusters, CellIndexRange cellIndices, CellRange cells, TriggerRange triggersCluster, TriggerRange triggersCellIndex, TriggerRange triggersCell)
 Constructor, initializing event handler for clusters and cells.
 
 ~EventHandler ()=default
 Destructor.
 
EventIterator begin () const
 Get forward start iterator.
 
EventIterator end () const
 Get forward end iteration marker.
 
EventIterator rbegin () const
 Get backward start iterator.
 
EventIterator rend () const
 Get backward end iteration marker.
 
int getNumberOfEvents () const
 
InteractionRecord getInteractionRecordForEvent (int eventID) const
 
const ClusterRange getClustersForEvent (int eventID) const
 Get range of clusters belonging to the given event.
 
const CellRange getCellsForEvent (int eventID) const
 Get range of cells belonging to the given event.
 
std::vector< gsl::span< const o2::phos::MCLabel > > getCellMCLabelForEvent (int eventID) const
 Get vector of MC labels belonging to the given event.
 
const CellIndexRange getClusterCellIndicesForEvent (int eventID) const
 Get range of cluster cell indices belonging to the given event.
 
bool hasClusters () const
 Check whether event handler has cluster data.
 
bool hasClusterIndices () const
 Check whether event handler has cell index data.
 
bool hasCells () const
 Check whether event handler has cell data.
 
void setClusterData (ClusterRange clusters, CellIndexRange cellIndices, TriggerRange triggersCluster, TriggerRange triggersCellIndex)
 Setting data at cluster level.
 
void setCellData (CellRange cells, TriggerRange triggers)
 Setting the data at cell level.
 
void setCellMCTruthContainer (const o2::dataformats::MCTruthContainer< o2::phos::MCLabel > *mclabels)
 Setting the pointer for the MCTruthContainer for cells.
 
void reset ()
 Reset containers with empty ranges.
 
EventData< CellInputType > buildEvent (int eventID) const
 Build event information for a given event number within the timeframe.
 

Detailed Description

template<class CellInputType>
class o2::phos::EventHandler< CellInputType >

Definition at line 36 of file EventHandler.h.

Member Typedef Documentation

◆ CellIndexRange

template<class CellInputType >
using o2::phos::EventHandler< CellInputType >::CellIndexRange = gsl::span<const int>

Definition at line 41 of file EventHandler.h.

◆ CellRange

template<class CellInputType >
using o2::phos::EventHandler< CellInputType >::CellRange = gsl::span<const CellInputType>

Definition at line 42 of file EventHandler.h.

◆ ClusterRange

template<class CellInputType >
using o2::phos::EventHandler< CellInputType >::ClusterRange = gsl::span<const Cluster>

Definition at line 40 of file EventHandler.h.

◆ TriggerRange

template<class CellInputType >
using o2::phos::EventHandler< CellInputType >::TriggerRange = gsl::span<const TriggerRecord>

Definition at line 39 of file EventHandler.h.

Constructor & Destructor Documentation

◆ EventHandler() [1/4]

template<class CellInputType >
o2::phos::EventHandler< CellInputType >::EventHandler ( )
default

Dummy constructor.

◆ EventHandler() [2/4]

template<class CellInputType >
EventHandler::EventHandler ( CellRange  cells,
TriggerRange  triggers 
)

Constructor, initializing event handler for cells only.

Parameters
cellsContainer with cells for the full time frame
triggersContainer with the trigger records corresponding to the cell container

Definition at line 18 of file EventHandler.cxx.

◆ EventHandler() [3/4]

template<class CellInputType >
EventHandler::EventHandler ( ClusterRange  clusters,
CellIndexRange  cellIndices,
TriggerRange  triggersCluster,
TriggerRange  triggersCellIndex 
)

Constructor, initializing event handler for clusters only.

Parameters
clustersContainer with clusters for the full time frame
cellIndicesContainer with cell indices used by the clusters in the cluster container
triggerClusterContainer with trigger records corresponding to the cluster container
triggersCellIndexContainer with trigger records corresponding to the cell index container

Definition at line 24 of file EventHandler.cxx.

◆ EventHandler() [4/4]

template<class CellInputType >
EventHandler::EventHandler ( ClusterRange  clusters,
CellIndexRange  cellIndices,
CellRange  cells,
TriggerRange  triggersCluster,
TriggerRange  triggersCellIndex,
TriggerRange  triggersCell 
)

Constructor, initializing event handler for clusters and cells.

Parameters
clustersContainer with clusters for the full time frame
cellIndicesContainer with cell indices used by the clusters in the cluster container
cellsContainer with cells for the full time frame
triggerClusterContainer with trigger records corresponding to the cluster container
triggersCellIndexContainer with trigger records corresponding to the cell index container

Definition at line 32 of file EventHandler.cxx.

◆ ~EventHandler()

template<class CellInputType >
o2::phos::EventHandler< CellInputType >::~EventHandler ( )
default

Destructor.

Member Function Documentation

◆ begin()

template<class CellInputType >
EventIterator o2::phos::EventHandler< CellInputType >::begin ( ) const
inline

Get forward start iterator.

Returns
Start iterator

Definition at line 233 of file EventHandler.h.

◆ buildEvent()

template<class CellInputType >
EventData< CellInputType > EventHandler::buildEvent ( int  eventID) const

Build event information for a given event number within the timeframe.

Parameters
eventIDNumber of the event within the timeframe
Returns
Event data for the given event
Exceptions
RangeExceptionin case the requested event ID is outside the range
InteractionRecordInvalidExceptionin case the interaction records from cells and clusters do not match
NotInitializedExceptionin case the event handler is not initialized

Building new event for a certain event number. Based on the input data specified in the constructors or the different setters the event contains either all data consisting of clusters, cell indices and cells, or either clusters and cell indices or cells. eventID must be a valid event within the list of triggers. In case the full event is built the trigger records from the various contributors must match.

Definition at line 154 of file EventHandler.cxx.

◆ end()

template<class CellInputType >
EventIterator o2::phos::EventHandler< CellInputType >::end ( ) const
inline

Get forward end iteration marker.

Returns
Iteration end marker

Definition at line 237 of file EventHandler.h.

◆ getCellMCLabelForEvent()

template<class CellInputType >
std::vector< gsl::span< const o2::phos::MCLabel > > EventHandler::getCellMCLabelForEvent ( int  eventID) const

Get vector of MC labels belonging to the given event.

Parameters
eventIDID of the event
Returns
vector of MC labels for the event
Exceptions
RangeExceptionin case the required event ID exceeds the maximum number of events
NotInitializedExceptionin case the event handler is not initialized for cell

Definition at line 112 of file EventHandler.cxx.

◆ getCellsForEvent()

template<class CellInputType >
const EventHandler< CellInputType >::CellRange EventHandler::getCellsForEvent ( int  eventID) const

Get range of cells belonging to the given event.

Parameters
eventIDID of the event
Returns
Cell range for the event
Exceptions
RangeExceptionin case the required event ID exceeds the maximum number of events
NotInitializedExceptionin case the event handler is not initialized for cell

Definition at line 99 of file EventHandler.cxx.

◆ getClusterCellIndicesForEvent()

template<class CellInputType >
const EventHandler< CellInputType >::CellIndexRange EventHandler::getClusterCellIndicesForEvent ( int  eventID) const

Get range of cluster cell indices belonging to the given event.

Parameters
eventIDID of the event
Returns
Cluster cell index range for the event
Exceptions
RangeExceptionin case the required event ID exceeds the maximum number of events
NotInitializedExceptionin case the event handler is not initialized for clusters/cellIndices

Definition at line 129 of file EventHandler.cxx.

◆ getClustersForEvent()

template<class CellInputType >
const EventHandler< CellInputType >::ClusterRange EventHandler::getClustersForEvent ( int  eventID) const

Get range of clusters belonging to the given event.

Parameters
eventIDID of the event
Returns
Cluster range for the event
Exceptions
RangeExceptionin case the required event ID exceeds the maximum number of events
NotInitializedExceptionin case the event handler is not initialized for clusters

Definition at line 86 of file EventHandler.cxx.

◆ getInteractionRecordForEvent()

template<class CellInputType >
o2::InteractionRecord EventHandler::getInteractionRecordForEvent ( int  eventID) const

Definition at line 56 of file EventHandler.cxx.

◆ getNumberOfEvents()

template<class CellInputType >
int EventHandler::getNumberOfEvents ( ) const

Definition at line 42 of file EventHandler.cxx.

◆ hasCells()

template<class CellInputType >
bool o2::phos::EventHandler< CellInputType >::hasCells ( ) const
inline

Check whether event handler has cell data.

Returns
True in case trigger records connected to the cell container are found

Definition at line 289 of file EventHandler.h.

◆ hasClusterIndices()

template<class CellInputType >
bool o2::phos::EventHandler< CellInputType >::hasClusterIndices ( ) const
inline

Check whether event handler has cell index data.

Returns
True in case trigger records connected to the cell index container are found

Definition at line 285 of file EventHandler.h.

◆ hasClusters()

template<class CellInputType >
bool o2::phos::EventHandler< CellInputType >::hasClusters ( ) const
inline

Check whether event handler has cluster data.

Returns
True in case trigger records connected to the cluster container are found

Definition at line 281 of file EventHandler.h.

◆ rbegin()

template<class CellInputType >
EventIterator o2::phos::EventHandler< CellInputType >::rbegin ( ) const
inline

Get backward start iterator.

Returns
Start iterator

Definition at line 241 of file EventHandler.h.

◆ rend()

template<class CellInputType >
EventIterator o2::phos::EventHandler< CellInputType >::rend ( ) const
inline

Get backward end iteration marker.

Returns
Iteration end marker

Definition at line 245 of file EventHandler.h.

◆ reset()

template<class CellInputType >
void EventHandler::reset ( )

Reset containers with empty ranges.

Definition at line 142 of file EventHandler.cxx.

◆ setCellData()

template<class CellInputType >
void o2::phos::EventHandler< CellInputType >::setCellData ( CellRange  cells,
TriggerRange  triggers 
)
inline

Setting the data at cell level.

Parameters
cellsContainer for cells within the timeframe
triggersContainer with trigger records corresponding to the cell container

Definition at line 307 of file EventHandler.h.

◆ setCellMCTruthContainer()

template<class CellInputType >
void o2::phos::EventHandler< CellInputType >::setCellMCTruthContainer ( const o2::dataformats::MCTruthContainer< o2::phos::MCLabel > *  mclabels)
inline

Setting the pointer for the MCTruthContainer for cells.

Parameters
mclabelsPointer to the MCTruthContainer for cells in timeframe

Definition at line 315 of file EventHandler.h.

◆ setClusterData()

template<class CellInputType >
void o2::phos::EventHandler< CellInputType >::setClusterData ( ClusterRange  clusters,
CellIndexRange  cellIndices,
TriggerRange  triggersCluster,
TriggerRange  triggersCellIndex 
)
inline

Setting data at cluster level.

Parameters
clustersContainer with clusters for the full time frame
cellIndicesContainer with cell indices used by the clusters in the cluster container
triggerClusterContainer with trigger records corresponding to the cluster container
triggersCellIndexContainer with trigger records corresponding to the cell index container

Definition at line 296 of file EventHandler.h.


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