AliPhysics  a9863a5 (a9863a5)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliEmcalIterableContainerT< T > Class Template Reference

#include <AliEmcalIterableContainer.h>

Inheritance diagram for AliEmcalIterableContainerT< T >:

Classes

class  iterator
 bidirectional stl iterator over the EMCAL iterable container More...
 

Public Member Functions

 AliEmcalIterableContainerT ()
 
 AliEmcalIterableContainerT (const AliEmcalContainer *cont, bool useAccept)
 
 AliEmcalIterableContainerT (const AliEmcalIterableContainerT &ref)
 
AliEmcalIterableContainerToperator= (const AliEmcalIterableContainerT &ref)
 
virtual ~AliEmcalIterableContainerT ()
 
T * operator[] (int index) const
 
 operator int () const
 
const AliEmcalContainerGetContainer () const
 
int GetEntries () const
 
iterator begin () const
 
iterator end () const
 
iterator rbegin () const
 
iterator rend () const
 

Protected Member Functions

void BuildAcceptIndices ()
 

Private Attributes

const AliEmcalContainerfkContainer
 Container to be iterated over. More...
 
TArrayI fAcceptIndices
 Array of accepted indices. More...
 
Bool_t fUseAccepted
 Switch between accepted and all objects. More...
 

Detailed Description

template<class T>
class AliEmcalIterableContainerT< T >

Definition at line 53 of file AliEmcalIterableContainer.h.

Constructor & Destructor Documentation

Default (I/O) constructor

Definition at line 22 of file AliEmcalIterableContainer.cxx.

template<class T >
AliEmcalIterableContainerT< T >::AliEmcalIterableContainerT ( const AliEmcalContainer cont,
bool  useAccept 
)

Standard constructor, to be used by the users. Specifying the type of iteration (all vs. accepted). In case the iterator runs over accepted object, an index map is build inside the constructor.

Parameters
[in]contEMCAL container to iterate over
[in]useAcceptIf true accepted objects are used in the iteration, otherwise all objects

Definition at line 38 of file AliEmcalIterableContainer.cxx.

Copy constructor. Initializing all parameters from the reference. As the container is not owner over its input container only pointers are copied.

Parameters
[in]refReference for the copy

Definition at line 53 of file AliEmcalIterableContainer.cxx.

template<class T>
virtual AliEmcalIterableContainerT< T >::~AliEmcalIterableContainerT ( )
inlinevirtual

Destructor

Definition at line 106 of file AliEmcalIterableContainer.h.

Member Function Documentation

template<class T >
void AliEmcalIterableContainerT< T >::BuildAcceptIndices ( )
protected

Build list of accepted indices inside the container. For this all objects inside the container are checked for being accepted or not.

Definition at line 117 of file AliEmcalIterableContainer.cxx.

Referenced by AliEmcalIterableContainerT< T >::AliEmcalIterableContainerT().

template<class T>
const AliEmcalContainer* AliEmcalIterableContainerT< T >::GetContainer ( ) const
inline

Access to underlying EMCAL container

Returns
Underlying EMCAL container

Definition at line 120 of file AliEmcalIterableContainer.h.

template<class T >
int AliEmcalIterableContainerT< T >::GetEntries ( ) const

Return the number of objects to iterate over (depending on whether the iterator loops over all or only accepted objects)

Returns
Number of iterable objects in container

Definition at line 85 of file AliEmcalIterableContainer.cxx.

Referenced by AliEmcalIterableContainerT< T >::end(), AliJetContainer::GetNAcceptedJets(), AliEmcalIterableContainerT< T >::operator int(), and AliEmcalIterableContainerT< T >::rbegin().

template<class T>
AliEmcalIterableContainerT< T >::operator int ( ) const
inline

Integer conversion operator: Returning the size if the container (number of entries)

Returns
Number of entries in the container

Definition at line 114 of file AliEmcalIterableContainer.h.

template<class T >
AliEmcalIterableContainerT< T > & AliEmcalIterableContainerT< T >::operator= ( const AliEmcalIterableContainerT< T > &  ref)

Assignment operator. As the container is not owner over the input container only pointers are copied

Parameters
[in]refReference for assignment
Returns
Object after assignment

Definition at line 69 of file AliEmcalIterableContainer.cxx.

template<class T >
T * AliEmcalIterableContainerT< T >::operator[] ( int  index) const

Array index operator. Returns object of the container at the position provided by the parameter index. The operator distinguishes between all and accepted objects:

  • If accepted was specified in the constructor the index refers to the nth accepted object, neglecting rejected objects in between. For this it relies on its internal index map.
  • If accepted was not specified in the constructor the index refers to the nth object inside the container, based on all objects including rejected objects. The index map is not needed in this case.
    Parameters
    [in]indexIndex of the object inside the container to access
    Returns
    The object at the given index (NULL if the index is out of range)

Definition at line 105 of file AliEmcalIterableContainer.cxx.

Member Data Documentation

template<class T>
TArrayI AliEmcalIterableContainerT< T >::fAcceptIndices
private

Array of accepted indices.

Definition at line 157 of file AliEmcalIterableContainer.h.

Referenced by AliEmcalIterableContainerT< T >::operator=().

template<class T>
const AliEmcalContainer* AliEmcalIterableContainerT< T >::fkContainer
private

Container to be iterated over.

Definition at line 156 of file AliEmcalIterableContainer.h.

Referenced by AliEmcalIterableContainerT< T >::GetContainer(), and AliEmcalIterableContainerT< T >::operator=().

template<class T>
Bool_t AliEmcalIterableContainerT< T >::fUseAccepted
private

Switch between accepted and all objects.

Definition at line 158 of file AliEmcalIterableContainer.h.

Referenced by AliEmcalIterableContainerT< T >::AliEmcalIterableContainerT(), and AliEmcalIterableContainerT< T >::operator=().


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