![]() |
Project
|
#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. | |
Definition at line 36 of file EventHandler.h.
using o2::phos::EventHandler< CellInputType >::CellIndexRange = gsl::span<const int> |
Definition at line 41 of file EventHandler.h.
using o2::phos::EventHandler< CellInputType >::CellRange = gsl::span<const CellInputType> |
Definition at line 42 of file EventHandler.h.
using o2::phos::EventHandler< CellInputType >::ClusterRange = gsl::span<const Cluster> |
Definition at line 40 of file EventHandler.h.
using o2::phos::EventHandler< CellInputType >::TriggerRange = gsl::span<const TriggerRecord> |
Definition at line 39 of file EventHandler.h.
|
default |
Dummy constructor.
EventHandler::EventHandler | ( | CellRange | cells, |
TriggerRange | triggers | ||
) |
Constructor, initializing event handler for cells only.
cells | Container with cells for the full time frame |
triggers | Container with the trigger records corresponding to the cell container |
Definition at line 18 of file EventHandler.cxx.
EventHandler::EventHandler | ( | ClusterRange | clusters, |
CellIndexRange | cellIndices, | ||
TriggerRange | triggersCluster, | ||
TriggerRange | triggersCellIndex | ||
) |
Constructor, initializing event handler for clusters only.
clusters | Container with clusters for the full time frame |
cellIndices | Container with cell indices used by the clusters in the cluster container |
triggerCluster | Container with trigger records corresponding to the cluster container |
triggersCellIndex | Container with trigger records corresponding to the cell index container |
Definition at line 24 of file EventHandler.cxx.
EventHandler::EventHandler | ( | ClusterRange | clusters, |
CellIndexRange | cellIndices, | ||
CellRange | cells, | ||
TriggerRange | triggersCluster, | ||
TriggerRange | triggersCellIndex, | ||
TriggerRange | triggersCell | ||
) |
Constructor, initializing event handler for clusters and cells.
clusters | Container with clusters for the full time frame |
cellIndices | Container with cell indices used by the clusters in the cluster container |
cells | Container with cells for the full time frame |
triggerCluster | Container with trigger records corresponding to the cluster container |
triggersCellIndex | Container with trigger records corresponding to the cell index container |
Definition at line 32 of file EventHandler.cxx.
|
default |
Destructor.
|
inline |
EventData< CellInputType > EventHandler::buildEvent | ( | int | eventID | ) | const |
Build event information for a given event number within the timeframe.
eventID | Number of the event within the timeframe |
RangeException | in case the requested event ID is outside the range |
InteractionRecordInvalidException | in case the interaction records from cells and clusters do not match |
NotInitializedException | in 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.
|
inline |
Get forward end iteration marker.
Definition at line 237 of file EventHandler.h.
std::vector< gsl::span< const o2::phos::MCLabel > > EventHandler::getCellMCLabelForEvent | ( | int | eventID | ) | const |
Get vector of MC labels belonging to the given event.
eventID | ID of the event |
RangeException | in case the required event ID exceeds the maximum number of events |
NotInitializedException | in case the event handler is not initialized for cell |
Definition at line 112 of file EventHandler.cxx.
const EventHandler< CellInputType >::CellRange EventHandler::getCellsForEvent | ( | int | eventID | ) | const |
Get range of cells belonging to the given event.
eventID | ID of the event |
RangeException | in case the required event ID exceeds the maximum number of events |
NotInitializedException | in case the event handler is not initialized for cell |
Definition at line 99 of file EventHandler.cxx.
const EventHandler< CellInputType >::CellIndexRange EventHandler::getClusterCellIndicesForEvent | ( | int | eventID | ) | const |
Get range of cluster cell indices belonging to the given event.
eventID | ID of the event |
RangeException | in case the required event ID exceeds the maximum number of events |
NotInitializedException | in case the event handler is not initialized for clusters/cellIndices |
Definition at line 129 of file EventHandler.cxx.
const EventHandler< CellInputType >::ClusterRange EventHandler::getClustersForEvent | ( | int | eventID | ) | const |
Get range of clusters belonging to the given event.
eventID | ID of the event |
RangeException | in case the required event ID exceeds the maximum number of events |
NotInitializedException | in case the event handler is not initialized for clusters |
Definition at line 86 of file EventHandler.cxx.
o2::InteractionRecord EventHandler::getInteractionRecordForEvent | ( | int | eventID | ) | const |
Definition at line 56 of file EventHandler.cxx.
int EventHandler::getNumberOfEvents | ( | ) | const |
Definition at line 42 of file EventHandler.cxx.
|
inline |
Check whether event handler has cell data.
Definition at line 289 of file EventHandler.h.
|
inline |
Check whether event handler has cell index data.
Definition at line 285 of file EventHandler.h.
|
inline |
Check whether event handler has cluster data.
Definition at line 281 of file EventHandler.h.
|
inline |
|
inline |
Get backward end iteration marker.
Definition at line 245 of file EventHandler.h.
void EventHandler::reset | ( | ) |
Reset containers with empty ranges.
Definition at line 142 of file EventHandler.cxx.
|
inline |
Setting the data at cell level.
cells | Container for cells within the timeframe |
triggers | Container with trigger records corresponding to the cell container |
Definition at line 307 of file EventHandler.h.
|
inline |
Setting the pointer for the MCTruthContainer for cells.
mclabels | Pointer to the MCTruthContainer for cells in timeframe |
Definition at line 315 of file EventHandler.h.
|
inline |
Setting data at cluster level.
clusters | Container with clusters for the full time frame |
cellIndices | Container with cell indices used by the clusters in the cluster container |
triggerCluster | Container with trigger records corresponding to the cluster container |
triggersCellIndex | Container with trigger records corresponding to the cell index container |
Definition at line 296 of file EventHandler.h.