AliPhysics  a3be53f (a3be53f)
AliEmcalIterableContainer Class Reference

Container implementing iterable functionality of the EMCAL containers. More...

#include <AliEmcalIterableContainer.h>

Detailed Description

Container implementing iterable functionality of the EMCAL containers.

Markus Fasel, Lawrence Berkeley National Laboratory
Salvatore Aiola, Yale University
March 23rd, 2016

Providing an interface to iterator functionality for the AliEmcalContainer and inheriting objects, iterating over either all or only accepted objects inside the container. The content is specified in the constructor.

EMCAL iterable containers should not be created by hand. Instead, the EMCAL container provides the functionality to create the interface for both cases:

AliEmcalContainer *cont;
AliEmcalIterableContainer *accepted = cont->accepted(), // iterative container over accepted entries
*all = cont->all(); // iterative container over all entries

Once created, EMCAL iterable containers implement the functions begin(), end(), rbegin() and rend() creating stl iterators (type AliEmcalIterableContainer::iterator). These can be used as normal stl iterators

for(AliEmcalIterableContainer::iterator iter = all.begin(); iter != all.end(); ++iter){
// Do something with the object

In case c++11 is used this code simplifies to

for(auto en : all){
// Do something with the object

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