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

#include <AliEmcalIterableContainer.h>

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< T > &ref)
 
AliEmcalIterableContainerT< T > & operator= (const AliEmcalIterableContainerT< T > &ref)
 
virtual ~AliEmcalIterableContainerT ()
 
T * operator[] (int index) const
 
 operator int () const
 
const AliEmcalContainer * GetContainer () const
 
int GetEntries () const
 
iterator begin () const
 
iterator end () const
 
iterator rbegin () const
 
iterator rend () const
 

Protected Member Functions

void BuildAcceptIndices ()
 

Private Attributes

const AliEmcalContainer * fkContainer
 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 167 of file AliEmcalIterableContainer.h.

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 182 of file AliEmcalIterableContainer.h.

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 196 of file AliEmcalIterableContainer.h.

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 258 of file AliEmcalIterableContainer.h.

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 226 of file AliEmcalIterableContainer.h.

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 211 of file AliEmcalIterableContainer.h.

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 246 of file AliEmcalIterableContainer.h.

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 file: