AliPhysics  9560d5c (9560d5c)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
EMCALIterableContainer::AliEmcalIterableContainerT< T, STAR > Class Template Referencefinal

#include <AliEmcalIterableContainer.h>

Classes

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

Public Types

typedef std::pair
< AliTLorentzVector, T * > 
momentum_object_pair
 

Public Member Functions

 AliEmcalIterableContainerT ()
 
 AliEmcalIterableContainerT (const AliEmcalContainer *cont, bool useAccept)
 
 AliEmcalIterableContainerT (const AliEmcalIterableContainerT< T, STAR > &ref)
 
AliEmcalIterableContainerToperator= (const AliEmcalIterableContainerT< T, STAR > &ref)
 
 ~AliEmcalIterableContainerT ()
 
Toperator[] (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 Member Functions

int GetInternalIndex (int index) const
 

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...
 

Friends

class iterator
 

Detailed Description

template<typename T, typename STAR = operator_star_object<T>>
class EMCALIterableContainer::AliEmcalIterableContainerT< T, STAR >

Definition at line 95 of file AliEmcalIterableContainer.h.

Member Typedef Documentation

template<typename T, typename STAR = operator_star_object<T>>
typedef std::pair<AliTLorentzVector, T*> EMCALIterableContainer::AliEmcalIterableContainerT< T, STAR >::momentum_object_pair

Definition at line 97 of file AliEmcalIterableContainer.h.

Constructor & Destructor Documentation

template<typename T , typename STAR >
EMCALIterableContainer::AliEmcalIterableContainerT< T, STAR >::AliEmcalIterableContainerT ( )

Default (I/O) constructor

Definition at line 242 of file AliEmcalIterableContainer.h.

template<typename T , typename STAR >
EMCALIterableContainer::AliEmcalIterableContainerT< T, STAR >::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 257 of file AliEmcalIterableContainer.h.

template<typename T , typename STAR >
EMCALIterableContainer::AliEmcalIterableContainerT< T, STAR >::AliEmcalIterableContainerT ( const AliEmcalIterableContainerT< T, STAR > &  ref)

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

template<typename T, typename STAR = operator_star_object<T>>
EMCALIterableContainer::AliEmcalIterableContainerT< T, STAR >::~AliEmcalIterableContainerT ( )
inline

Destructor

Definition at line 166 of file AliEmcalIterableContainer.h.

Member Function Documentation

template<typename T , typename STAR >
void EMCALIterableContainer::AliEmcalIterableContainerT< T, STAR >::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 334 of file AliEmcalIterableContainer.h.

Referenced by EMCALIterableContainer::AliEmcalIterableContainerT< T, STAR >::AliEmcalIterableContainerT().

template<typename T, typename STAR = operator_star_object<T>>
const AliEmcalContainer* EMCALIterableContainer::AliEmcalIterableContainerT< T, STAR >::GetContainer ( ) const
inline

Access to underlying EMCAL container

Returns
Underlying EMCAL container

Definition at line 180 of file AliEmcalIterableContainer.h.

template<typename T , typename STAR >
int EMCALIterableContainer::AliEmcalIterableContainerT< T, STAR >::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 301 of file AliEmcalIterableContainer.h.

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

template<typename T, typename STAR = operator_star_object<T>>
int EMCALIterableContainer::AliEmcalIterableContainerT< T, STAR >::GetInternalIndex ( int  index) const
inlineprivate

Definition at line 220 of file AliEmcalIterableContainer.h.

template<typename T, typename STAR = operator_star_object<T>>
EMCALIterableContainer::AliEmcalIterableContainerT< T, STAR >::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 174 of file AliEmcalIterableContainer.h.

template<typename T , typename STAR >
AliEmcalIterableContainerT< T, STAR > & EMCALIterableContainer::AliEmcalIterableContainerT< T, STAR >::operator= ( const AliEmcalIterableContainerT< T, STAR > &  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 286 of file AliEmcalIterableContainer.h.

template<typename T , typename STAR >
T * EMCALIterableContainer::AliEmcalIterableContainerT< T, STAR >::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 321 of file AliEmcalIterableContainer.h.

template<typename T, typename STAR = operator_star_object<T>>
iterator EMCALIterableContainer::AliEmcalIterableContainerT< T, STAR >::rbegin ( ) const
inline

Creating backward iterator at the end of the container (last entry).

Returns
Iterator at the end of the container

Definition at line 203 of file AliEmcalIterableContainer.h.

template<typename T, typename STAR = operator_star_object<T>>
iterator EMCALIterableContainer::AliEmcalIterableContainerT< T, STAR >::rend ( ) const
inline

Creating backward iterator before the beginning of the container.

Returns
Iterator before the container.

Definition at line 210 of file AliEmcalIterableContainer.h.

Friends And Related Function Documentation

Member Data Documentation

template<typename T, typename STAR = operator_star_object<T>>
TArrayI EMCALIterableContainer::AliEmcalIterableContainerT< T, STAR >::fAcceptIndices
private
template<typename T, typename STAR = operator_star_object<T>>
const AliEmcalContainer* EMCALIterableContainer::AliEmcalIterableContainerT< T, STAR >::fkContainer
private

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