AliPhysics  cdeda5a (cdeda5a)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliEmcalContainerUtils Namespace Reference

Helper functions related to AliEmcalContainer derived objects. More...


enum  InputObject_t { kNoDefinedInputObject = -1, kCaloCells = 0, kCluster = 1, kTrack = 2 }
 Type of input object to be created More...


std::string DetermineUseDefaultName (InputObject_t objType, bool esdMode, bool returnObjectType=false)
AliVEvent * GetEvent (AliVEvent *inputEvent, bool isEmbedding=false)
template<class T >
TAddContainer (const char *n, TObjArray &collection)
template<class T >
TGetContainer (Int_t i, const TObjArray &collection)
template<class T >
TGetContainer (const char *name, const TObjArray &collection)

Detailed Description

Helper functions related to AliEmcalContainer derived objects.

This namespace includes a variety of helper functions related to AliEmcalContainer derived objects, as well as configuring input objects.

Functions include:

  • Automatically determine the proper input object branch name based on the input object and file (AOD or ESD) types. This is determined by the "usedefault" pattern (see the code for precise implementation). It can also return the proper type input object to be stored in a collection such as a TClonesArray.
  • Centralizing the code to add and get containers from the collections of containers often stored in analysis tasks.

Usage of the add, and get containers code should be something like (for cluster containers):

AliClusterContainer * AddClusterContainer(const char * name) { AddContainer<AliClusterContainer>(name, fClusterCollArray); }
AliClusterContainer * GetClusterContainer(Int_t i) { GetContainer<AliClusterContainer>(i, fClusterCollArray); }
AliClusterContainer * GetClusterContainer(const char * name) { GetContainer<AliClusterContainer>(name, fClusterCollArray); }

The code is similar for other containers. See AliEmcalCorrectionTask for an example.

Raymond Ehlers, Yale University
Dec 6, 2016

Enumeration Type Documentation

Type of input object to be created


Not initialized type.


Calo cells.


Cluster container.


Track container.

Definition at line 43 of file AliEmcalContainerUtils.h.

Function Documentation

template<class T >
T * AliEmcalContainerUtils::AddContainer ( const char *  n,
TObjArray collection 

Create new container and attach it to the passed collection. The name provided to this function must match the name of the array attached to the new container inside the input event.

[in]nName of the container and the array the container points to
[in]collectionCollection into which the new container will be added
Pointer to the new container

Definition at line 81 of file AliEmcalContainerUtils.h.

std::string AliEmcalContainerUtils::DetermineUseDefaultName ( InputObject_t  objType,
bool  esdMode,
bool  returnObjectType = false 

Given a container type, it returns the proper default branch name based on the "usedefault" pattern. This is useful to properly handle creating input objects such as AliEmcalContainer derived objects. If returnObjectType is true, it returns the "default" (unlikely to change) object type instead of the branch name. This is useful to properly determine the type of an object for a TClonesArray.

This function can also be very useful in places such as an AddTask(). Using it can significantly reduce code duplication!

[in]objTypeType of the input object
[in]esdModeTrue if running with an ESD
[in]returnObjectTypeReturns the "default" type of the object rather than the branch name
The name corresponding to the request branch name or object type.

Definition at line 29 of file AliEmcalContainerUtils.cxx.

Referenced by AliEmcalCorrectionTask::AddContainer(), AliEmcalCorrectionTask::CheckForContainerArray(), AliEmcalCopyCollection::CreateNewObjectBranch(), AliEmcalCorrectionCellCombineCollections::Initialize(), AliEmcalCopyCollection::NewBranch(), and AliEmcalCorrectionTask::SetupCellsInfo().

template<class T >
T * AliEmcalContainerUtils::GetContainer ( const char *  name,
const TObjArray collection 

Find container container in the collection according to its name

[in]nameName of the container
[in]collectionCollection which stores available containers
Container found under the given name

Definition at line 113 of file AliEmcalContainerUtils.h.

AliVEvent * AliEmcalContainerUtils::GetEvent ( AliVEvent *  inputEvent,
bool  isEmbedding = false 

Get the proper event based on whether embedding is enabled or not. Useful when determining from which event an input object should be retrieved. It could either be the current input event or an embedded event.

[in]inputEventThe input event of the analysis. Will be returned if nothing else is requested. Usually just InputEvent().
[in]isEmbeddingTrue if the event from embedding should be used.
The input event to be used

Definition at line 104 of file AliEmcalContainerUtils.cxx.

Referenced by AliEmcalCorrectionTask::CheckForContainerArray(), AliEmcalCopyCollection::CreateNewObjectBranch(), AliEmcalCorrectionTask::SetCellsObjectInCellContainerBasedOnProperties(), AliAnalysisTaskMEVertexingHF::UserExec(), and AliAnalysisTaskCaloTrackCorrelationM::UserExec().