![]() |
Project
|
Handler for EMCAL event data. More...
#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... | |
class | TriggerBitsInvalidException |
Error handling in case the trigger bits from various sources do not match. 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 |
Get the number of events handled by the event handler. | |
InteractionRecord | getInteractionRecordForEvent (int eventID) const |
Get the interaction record for the given event. | |
uint64_t | getTriggerBitsForEvent (int eventID) const |
Get the interaction record for the given event. | |
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::emcal::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::emcal::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. | |
Handler for EMCAL event data.
Initializing the event handler
The event handler is initialized with EMCAL data (clusters and / or cells) from an entire time frame. In order to identify objects within the time frame belonging to the same collision the event handler needs to be always initialized with the object and the corresponding range of trigger records. The event handler supports full and partial event information. Different constructors allow the initialization either as full event (with cluster and cell information) or with either cluster or cell information.
Example (full event):
.{cxx}
#Getting the event data
Access to the data is possible either directly via the buildEvent method for a certain event number or via an iterator iterating over the triggers in the Trigger record collection. For the buildEvent method the event ID must be in a valid range.
Example (buildEvent):
.{cxx}
Example (iterator):
.{cxx}
#Supported cell input types The event handler can support o2::emcal::Digit or o2::emcal::Cell as input type for cells.
Definition at line 86 of file EventHandler.h.
using o2::emcal::EventHandler< CellInputType >::CellIndexRange = gsl::span<const int> |
Definition at line 91 of file EventHandler.h.
using o2::emcal::EventHandler< CellInputType >::CellRange = gsl::span<const CellInputType> |
Definition at line 92 of file EventHandler.h.
using o2::emcal::EventHandler< CellInputType >::ClusterRange = gsl::span<const Cluster> |
Definition at line 90 of file EventHandler.h.
using o2::emcal::EventHandler< CellInputType >::TriggerRange = gsl::span<const TriggerRecord> |
Definition at line 89 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 EMCAL 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 184 of file EventHandler.cxx.
|
inline |
Get forward end iteration marker.
Definition at line 320 of file EventHandler.h.
std::vector< gsl::span< const o2::emcal::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 142 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 129 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 159 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 116 of file EventHandler.cxx.
o2::InteractionRecord EventHandler::getInteractionRecordForEvent | ( | int | eventID | ) | const |
Get the interaction record for the given event.
eventID | ID of the event in timeframe |
RangeException | in case the required event ID exceeds the maximum number of events |
InteractionRecordInvalidException | If the interaction record for the same event from differnt containers has different content |
NotInitializedException | in case the event handler is not initialized |
Requires at least on interaction record container to be set (clusters, cells or cell indices).
Definition at line 56 of file EventHandler.cxx.
int EventHandler::getNumberOfEvents | ( | ) | const |
Get the number of events handled by the event handler.
NotInitializedException | If the event handler is not initialized |
Definition at line 42 of file EventHandler.cxx.
uint64_t EventHandler::getTriggerBitsForEvent | ( | int | eventID | ) | const |
Get the interaction record for the given event.
eventID | ID of the event in timeframe |
RangeException | in case the required event ID exceeds the maximum number of events |
TriggerBitsInvalidException | in case the trigger bits for the same event from differnt containers are different |
NotInitializedException | in case the event handler is not initialized |
Requires at least on interaction record container to be set (clusters, cells or cell indices).
Definition at line 86 of file EventHandler.cxx.
|
inline |
Check whether event handler has cell data.
Definition at line 393 of file EventHandler.h.
|
inline |
Check whether event handler has cell index data.
Definition at line 389 of file EventHandler.h.
|
inline |
Check whether event handler has cluster data.
Definition at line 385 of file EventHandler.h.
|
inline |
|
inline |
Get backward end iteration marker.
Definition at line 328 of file EventHandler.h.
void EventHandler::reset | ( | ) |
Reset containers with empty ranges.
Definition at line 172 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 411 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 419 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 400 of file EventHandler.h.