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

#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
 
typedef std::conditional< mom,
momentum_object_pair, T * >
::type 
value_type
 

Public Member Functions

 AliEmcalIterableContainerT ()
 
 AliEmcalIterableContainerT (const AliEmcalContainer *cont, bool useAccept)
 
 AliEmcalIterableContainerT (const AliEmcalIterableContainerT< T, mom > &ref)
 
AliEmcalIterableContainerToperator= (const AliEmcalIterableContainerT< T, mom > &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 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...
 

Detailed Description

template<typename T, bool mom = false>
class AliEmcalIterableContainerT< T, mom >

Definition at line 92 of file AliEmcalIterableContainer.h.

Member Typedef Documentation

template<typename T, bool mom = false>
typedef std::pair<AliTLorentzVector, T*> AliEmcalIterableContainerT< T, mom >::momentum_object_pair

Definition at line 94 of file AliEmcalIterableContainer.h.

template<typename T, bool mom = false>
typedef std::conditional<mom, momentum_object_pair, T*>::type AliEmcalIterableContainerT< T, mom >::value_type

Definition at line 95 of file AliEmcalIterableContainer.h.

Constructor & Destructor Documentation

template<typename T , bool mom>
AliEmcalIterableContainerT< T, mom >::AliEmcalIterableContainerT ( )

Default (I/O) constructor

Definition at line 223 of file AliEmcalIterableContainer.h.

template<typename T , bool mom>
AliEmcalIterableContainerT< T, mom >::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 238 of file AliEmcalIterableContainer.h.

template<typename T , bool mom>
AliEmcalIterableContainerT< T, mom >::AliEmcalIterableContainerT ( const AliEmcalIterableContainerT< T, mom > &  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 252 of file AliEmcalIterableContainer.h.

template<typename T, bool mom = false>
virtual AliEmcalIterableContainerT< T, mom >::~AliEmcalIterableContainerT ( )
inlinevirtual

Destructor

Definition at line 153 of file AliEmcalIterableContainer.h.

Member Function Documentation

template<typename T, bool mom = false>
iterator AliEmcalIterableContainerT< T, mom >::begin ( ) const
inline

Creating forward iterator at the beginning of the container (first entry).

Returns
Iterator at the beginning of the container.

Definition at line 176 of file AliEmcalIterableContainer.h.

Referenced by AliEmcalJetTask::FindJets(), and EMCalTriggerPtAnalysis::AliAnalysisTaskTrackDensityData::Run().

template<typename T , bool mom>
void AliEmcalIterableContainerT< T, mom >::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 315 of file AliEmcalIterableContainer.h.

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

template<typename T, bool mom = false>
iterator AliEmcalIterableContainerT< T, mom >::end ( ) const
inline

Creating forward iterator behind the last entry of the container.

Returns
Iterator behind the container.

Definition at line 183 of file AliEmcalIterableContainer.h.

Referenced by AliEmcalJetTask::FindJets(), and EMCalTriggerPtAnalysis::AliAnalysisTaskTrackDensityData::Run().

template<typename T, bool mom = false>
const AliEmcalContainer* AliEmcalIterableContainerT< T, mom >::GetContainer ( ) const
inline

Access to underlying EMCAL container

Returns
Underlying EMCAL container

Definition at line 167 of file AliEmcalIterableContainer.h.

template<typename T , bool mom>
int AliEmcalIterableContainerT< T, mom >::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 282 of file AliEmcalIterableContainer.h.

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

template<typename T, bool mom = false>
int AliEmcalIterableContainerT< T, mom >::GetInternalIndex ( int  index) const
inlineprivate

Definition at line 207 of file AliEmcalIterableContainer.h.

template<typename T, bool mom = false>
AliEmcalIterableContainerT< T, mom >::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 161 of file AliEmcalIterableContainer.h.

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

template<typename T , bool mom>
T * AliEmcalIterableContainerT< T, mom >::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 302 of file AliEmcalIterableContainer.h.

template<typename T, bool mom = false>
iterator AliEmcalIterableContainerT< T, mom >::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 190 of file AliEmcalIterableContainer.h.

template<typename T, bool mom = false>
iterator AliEmcalIterableContainerT< T, mom >::rend ( ) const
inline

Creating backward iterator before the beginning of the container.

Returns
Iterator before the container.

Definition at line 197 of file AliEmcalIterableContainer.h.

Member Data Documentation

template<typename T, bool mom = false>
TArrayI AliEmcalIterableContainerT< T, mom >::fAcceptIndices
private
template<typename T, bool mom = false>
const AliEmcalContainer* AliEmcalIterableContainerT< T, mom >::fkContainer
private
template<typename T, bool mom = false>
Bool_t AliEmcalIterableContainerT< T, mom >::fUseAccepted
private

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