AliPhysics  2aaea23 (2aaea23)
AliEmcalCorrectionTask Class Reference

Steering task for the EMCal correction framework. More...

#include <AliEmcalCorrectionTask.h>

Inheritance diagram for AliEmcalCorrectionTask:

Public Types

enum  BeamType { kNA = -1, kpp = 0, kAA = 1, kpA = 2 }
 Switch for the beam type. More...
 

Public Member Functions

 AliEmcalCorrectionTask ()
 
 AliEmcalCorrectionTask (const char *name)
 
 AliEmcalCorrectionTask (const AliEmcalCorrectionTask &task)
 
AliEmcalCorrectionTaskoperator= (AliEmcalCorrectionTask other)
 
 AliEmcalCorrectionTask (AliEmcalCorrectionTask &&other)
 
virtual ~AliEmcalCorrectionTask ()
 
void Initialize (bool removeDummyTask=false)
 
void Print (Option_t *opt="") const
 
std::ostream & Print (std::ostream &in) const
 
std::string toString (bool includeYAMLConfigurationInfo=false) const
 
void SetForceBeamType (BeamType f)
 
void SetNeedEmcalGeometry (Bool_t b)
 
void SetUseNewCentralityEstimation (Bool_t b)
 
void SetCentralityEstimator (const char *c)
 
virtual void SetNCentBins (Int_t n)
 
void SetCentRange (Double_t min, Double_t max)
 
const std::vector< AliEmcalCorrectionComponent * > & CorrectionComponents ()
 
AliEmcalCorrectionComponentGetCorrectionComponent (const std::string &name) const
 
AliParticleContainerAddParticleContainer (const char *n)
 
AliTrackContainerAddTrackContainer (const char *n)
 
AliMCParticleContainerAddMCParticleContainer (const char *n)
 
AliClusterContainerAddClusterContainer (const char *n)
 
void AdoptParticleContainer (AliParticleContainer *cont)
 
void AdoptTrackContainer (AliTrackContainer *cont)
 
void AdoptMCParticleContainer (AliMCParticleContainer *cont)
 
void AdoptClusterContainer (AliClusterContainer *cont)
 
AliParticleContainerGetParticleContainer (Int_t i=0) const
 
AliParticleContainerGetParticleContainer (const char *name) const
 
AliClusterContainerGetClusterContainer (Int_t i=0) const
 
AliClusterContainerGetClusterContainer (const char *name) const
 
AliMCParticleContainerGetMCParticleContainer (Int_t i=0) const
 
AliMCParticleContainerGetMCParticleContainer (const char *name) const
 
AliTrackContainerGetTrackContainer (Int_t i=0) const
 
AliTrackContainerGetTrackContainer (const char *name) const
 
void RemoveParticleContainer (Int_t i=0)
 
void RemoveClusterContainer (Int_t i=0)
 
AliEmcalCorrectionCellContainerGetCellContainer (const std::string &cellsContainerName) const
 
void UserCreateOutputObjects ()
 
void UserExec (Option_t *option)
 
Bool_t UserNotify ()
 
virtual void ExecOnce ()
 
virtual Bool_t Run ()
 
Functions related to the YAML configuration files.
void SetUserConfigurationFilename (std::string name)
 Set the path to the user configuration filename. More...
 
void SetDefaultConfigurationFilename (std::string name)
 Set the path to the default configuration filename (Expert use only! The user should set the user configuration!) More...
 
std::ostream & PrintConfiguration (std::ostream &in, bool userConfig=false) const
 
bool WriteConfigurationFile (std::string filename, bool userConfig=false) const
 
bool CompareToStoredConfiguration (std::string filename, bool userConfig=false)
 
PWG::Tools::AliYAMLConfigurationGetYAMLConfiguration ()
 Retrieve the YAML configurations for direct access. More...
 

Static Public Member Functions

static AliEmcalCorrectionTaskAddTaskEmcalCorrectionTask (TString suffix="")
 
static AliEmcalCorrectionTaskConfigureEmcalCorrectionTaskOnLEGOTrain (TString suffix)
 

Private Member Functions

void SetCellsObjectInCellContainerBasedOnProperties (AliEmcalCorrectionCellContainer *cellContainer)
 
void CheckForContainerArray (AliEmcalContainer *cont, AliEmcalContainerUtils::InputObject_t objectType)
 
std::string GetInputFieldNameFromInputObjectType (AliEmcalContainerUtils::InputObject_t inputObjectType)
 
bool CheckPossibleNamesForComponentName (std::string &name, std::set< std::string > &possibleComponents)
 
BeamType GetBeamType () const
 
void PrintRequestedContainersInformation (AliEmcalContainerUtils::InputObject_t inputObjectType, std::ostream &stream) const
 
void RemoveDummyTask () const
 
Bool_t RetrieveEventObjects ()
 
void UserCreateOutputObjectsComponents ()
 
void ExecOnceComponents ()
 
void InitializeConfiguration ()
 
void DetermineComponentsToExecute (std::vector< std::string > &componentsToExecute)
 
void CheckForUnmatchedUserSettings ()
 
void InitializeComponents ()
 
void CreateInputObjects (AliEmcalContainerUtils::InputObject_t inputObjectType)
 
void AddContainersToComponent (AliEmcalCorrectionComponent *component, AliEmcalContainerUtils::InputObject_t inputObjectType, bool checkObjectExists=false)
 
void SetupContainersFromInputNodes (AliEmcalContainerUtils::InputObject_t inputObjectType, std::set< std::string > &requestedContainers)
 
void SetupCellsInfo (std::string containerName)
 
void SetupContainer (const AliEmcalContainerUtils::InputObject_t inputObjectType, const std::string containerName)
 
AliEmcalContainer * AddContainer (const AliEmcalContainerUtils::InputObject_t contType, const std::string containerName)
 
void GetPropertyNamesFromNode (const std::string configurationName, const std::string componentName, std::set< std::string > &propertyNames, const bool nodeRequired)
 

Private Attributes

PWG::Tools::AliYAMLConfiguration fYAMLConfig
 Handles configuration from YAML. More...
 
std::string fSuffix
 Suffix of the Correction Task (used to select specialized components) More...
 
std::string fUserConfigurationFilename
 ! User YAML configruation filename More...
 
std::string fDefaultConfigurationFilename
 ! Default YAML configuration filename More...
 
std::vector< std::string > fOrderedComponentsToExecute
 Ordered set of components to execute. More...
 
std::vector< AliEmcalCorrectionComponent * > fCorrectionComponents
 Contains the correction components. More...
 
bool fConfigurationInitialized
 True if the YAML configuration files are initialized. More...
 
bool fIsEsd
 File type. More...
 
bool fEventInitialized
 If the event is initialized properly. More...
 
bool fRecycleUnusedEmbeddedEventsMode
 Allows the recycling of embedded events which fail internal event selection. See the embedding helper. More...
 
Double_t fCent
 ! Event centrality More...
 
Int_t fCentBin
 ! Event centrality bin More...
 
Double_t fMinCent
 min centrality for event selection More...
 
Double_t fMaxCent
 max centrality for event selection More...
 
Int_t fNcentBins
 how many centrality bins More...
 
TString fCentEst
 name of V0 centrality estimator More...
 
Bool_t fUseNewCentralityEstimation
 Use new centrality estimation (for 2015 data) More...
 
Double_t fVertex [3]
 ! Event vertex More...
 
Int_t fNVertCont
 ! Event vertex number of contributors More...
 
BeamType fBeamType
 ! Event beam type More...
 
BeamType fForceBeamType
 forced beam type More...
 
Bool_t fNeedEmcalGeom
 whether or not the task needs the emcal geometry More...
 
AliEMCALGeometry * fGeom
 ! Emcal geometry More...
 
TObjArray fParticleCollArray
 Particle/track collection array. More...
 
TObjArray fClusterCollArray
 Cluster collection array. More...
 
std::vector< AliEmcalCorrectionCellContainer * > fCellCollArray
 Cells collection array. More...
 
TListfOutput
 ! Output for histograms More...
 

Friends

void swap (AliEmcalCorrectionTask &first, AliEmcalCorrectionTask &second)
 
std::ostream & operator<< (std::ostream &in, const AliEmcalCorrectionTask &myTask)
 

Detailed Description

Steering task for the EMCal correction framework.

This class is the steering class for the cell and cluster level corrections for the EMCal. A YAML configuration file is utilized to determine which corrections should be run and how they should be configured. The corrections are initialized by calling their Initialize() function. Similar to AliAnalysisTaskEmcal, the relevant event information is loaded, and then the Run() function of each correction is called.

In general, this steering class handles all of the configuration of the corrections, including passing the relevant EMCal containers and event objects.

Note: YAML does not play nicely with CINT and dictionary generation, so it is hidden using conditional inclusion.

Author
Raymond Ehlers raymo.nosp@m.nd.e.nosp@m.hlers.nosp@m.@yal.nosp@m.e.edu, Yale University
James Mulligan james.nosp@m..mul.nosp@m.ligan.nosp@m.@yal.nosp@m.e.edu, Yale University
Date
Jul 8, 2016

Definition at line 43 of file AliEmcalCorrectionTask.h.

Member Enumeration Documentation

Switch for the beam type.

Enumerator
kNA 

! Undefined

kpp 

! Proton-Proton

kAA 

! Nucleus-Nucleus

kpA 

! Proton-Nucleus

Definition at line 49 of file AliEmcalCorrectionTask.h.

Constructor & Destructor Documentation

AliEmcalCorrectionTask::AliEmcalCorrectionTask ( )

Default constructor.

Definition at line 40 of file AliEmcalCorrectionTask.cxx.

Referenced by AddTaskEmcalCorrectionTask().

AliEmcalCorrectionTask::AliEmcalCorrectionTask ( const char *  name)

Standard constructor.

If "_" is included in the name, then all characters after the underscore will be taken as the task suffix (sometimes described as a "specialization") and used to select settings in the YAML configuration file.

Parameters
[in]nameName of the correction task.

Definition at line 86 of file AliEmcalCorrectionTask.cxx.

AliEmcalCorrectionTask::AliEmcalCorrectionTask ( const AliEmcalCorrectionTask task)

Copy constructor.

Note that it currently takes just the pointer to the correction components and their output. More care including copy constructors for the components would be required for this to be more fully copied!

Definition at line 133 of file AliEmcalCorrectionTask.cxx.

AliEmcalCorrectionTask::AliEmcalCorrectionTask ( AliEmcalCorrectionTask &&  other)

Move constructor

Definition at line 174 of file AliEmcalCorrectionTask.cxx.

AliEmcalCorrectionTask::~AliEmcalCorrectionTask ( )
virtual

Destructor

Definition at line 231 of file AliEmcalCorrectionTask.cxx.

Member Function Documentation

AliClusterContainer* AliEmcalCorrectionTask::AddClusterContainer ( const char *  n)
inline

Definition at line 123 of file AliEmcalCorrectionTask.h.

AliEmcalContainer * AliEmcalCorrectionTask::AddContainer ( const AliEmcalContainerUtils::InputObject_t  contType,
const std::string  containerName 
)
private

Creates a new AliEmcalContainer derived container based on the requested type and the branch name set in the user and default YAML configuration and requested by a particular correction component. Supports the "usedefault" pattern to simplify setting the proper branch name. Any track input objects are created as track containers unless the branch is named "mcparticles". If this is problematic for your analysis, the track selection behavior of the track container can be disabled by setting the track selection to "kNoTrackFilter".

Note that the created container is adopted and managed by the Correction Task.

Parameters
[in]contTypeType of the input object to add
[in]containerNameName of the container to create (as defined in the YAML configuration)
Returns
The created container

Definition at line 974 of file AliEmcalCorrectionTask.cxx.

Referenced by RemoveClusterContainer(), and SetupContainer().

void AliEmcalCorrectionTask::AddContainersToComponent ( AliEmcalCorrectionComponent component,
AliEmcalContainerUtils::InputObject_t  inputObjectType,
bool  checkObjectExists = false 
)
private

Adds the previously created input objects that are managed by the Correction Task into a correction component based on which input objects are requested in the YAML configuration by the component.

Parameters
[in]componentThe correction component to which the input objects will be added
[in]inputObjectTypeThe type of input object to add to the component
[in]checkObjectExistsIf true, check if the object exists before adding it to the component

Definition at line 644 of file AliEmcalCorrectionTask.cxx.

Referenced by ExecOnceComponents(), InitializeComponents(), and RemoveClusterContainer().

AliMCParticleContainer* AliEmcalCorrectionTask::AddMCParticleContainer ( const char *  n)
inline

Definition at line 122 of file AliEmcalCorrectionTask.h.

AliParticleContainer* AliEmcalCorrectionTask::AddParticleContainer ( const char *  n)
inline

Definition at line 120 of file AliEmcalCorrectionTask.h.

AliEmcalCorrectionTask * AliEmcalCorrectionTask::AddTaskEmcalCorrectionTask ( TString  suffix = "")
static

EMCal Correction Task AddTask. Should be used by most users, except for those on the LEGO train (see below).

Parameters
[in]suffixSuffix string used to select components in a YAML configuration
Returns
A new EMCal Correction Task added to the analysis manager and ready to configure.

Definition at line 1638 of file AliEmcalCorrectionTask.cxx.

Referenced by RemoveClusterContainer().

AliTrackContainer* AliEmcalCorrectionTask::AddTrackContainer ( const char *  n)
inline

Definition at line 121 of file AliEmcalCorrectionTask.h.

void AliEmcalCorrectionTask::AdoptClusterContainer ( AliClusterContainer cont)
inline

Definition at line 127 of file AliEmcalCorrectionTask.h.

Referenced by AddContainer().

void AliEmcalCorrectionTask::AdoptMCParticleContainer ( AliMCParticleContainer cont)
inline

Definition at line 126 of file AliEmcalCorrectionTask.h.

void AliEmcalCorrectionTask::AdoptParticleContainer ( AliParticleContainer cont)
inline
void AliEmcalCorrectionTask::AdoptTrackContainer ( AliTrackContainer cont)
inline

Definition at line 125 of file AliEmcalCorrectionTask.h.

void AliEmcalCorrectionTask::CheckForContainerArray ( AliEmcalContainer *  cont,
AliEmcalContainerUtils::InputObject_t  objectType 
)
private

Checks whether a container branch exists in the event. If it doesn't exist, then the branch is created automatically. Which this approach requires some care since no fatal error will be thrown when a nonexistent branch is requested, it also allows the creation of output branches just by selecting an unused branch name. For instance, this allows the clusterizer to easily create a new output branch.

Parameters
contThe container which is requesting the branch
objectTypeThe type of the input object

Definition at line 1431 of file AliEmcalCorrectionTask.cxx.

Referenced by ExecOnce(), and RemoveClusterContainer().

void AliEmcalCorrectionTask::CheckForUnmatchedUserSettings ( )
private

Check each property defined in the user configuration file for a match to the properties in the default configuration file. The default configuration file should have all possible properties defined, so it can be treated as a reference. Thus, if there is a property that is defined in the user configuration that cannot be found in the default configuration, then it must be a typo and we should alert the user.

NOTE: This only checks settings in components. NOT variables defined at the root level, such as the pass or name! It also leaves the input objects unchecked, due to lacking a definitive list of possible settings.

Utilizes the stored ordered correction component names.

Definition at line 489 of file AliEmcalCorrectionTask.cxx.

Referenced by Initialize(), and RemoveClusterContainer().

bool AliEmcalCorrectionTask::CheckPossibleNamesForComponentName ( std::string &  name,
std::set< std::string > &  possibleComponents 
)
private

Checks for a component name in a list of possible component names. This is necessary to search for the components that are associated with a given correction task and it's associated suffix. The comparison is done between strings, so some care is needed not to execute this function too often, especially for a large number of possible components

Parameters
nameName to search for in the possible names
possibleComponentsPossible names of components that have been retrieved from the YAML file
Returns
True name in possible components name

Definition at line 1482 of file AliEmcalCorrectionTask.cxx.

Referenced by DetermineComponentsToExecute(), and RemoveClusterContainer().

bool AliEmcalCorrectionTask::CompareToStoredConfiguration ( std::string  filename,
bool  userConfig = false 
)

Compare the passed YAML configuration to the stored YAML configuration. Note that this function is not const as the passed filename is briefly added and removed to the configuration.

Parameters
filenameThe filename of the YAML configuration to compare
userConfigTrue to compare against the user configuration
Returns
True when the passed YAML configuration is the same as the stored YAML configuration

Definition at line 1390 of file AliEmcalCorrectionTask.cxx.

Referenced by SetDefaultConfigurationFilename().

AliEmcalCorrectionTask * AliEmcalCorrectionTask::ConfigureEmcalCorrectionTaskOnLEGOTrain ( TString  suffix)
static

Retrieve an existing correction task by name to perform further configuration. This should ONLY be used on the LEGO train. The suffix passed here must be unique to identify a user.

To achieve this, a dummy task is created when the configure task is called because AliAnalysisTaskCfg requires that all wagons add a task. Then, when Initialize(true) is called on the correction task, the dummy task is removed. This is a hack, but is required to work around constraints in AliAnalysisTaskCfg.

Parameters
[in]suffixSuffix string used to uniquely identify a user and find the corresponding correction task. If using a suffix with the correction task, the suffixes must match.
Returns
An existing (usually unconfigured) EMCal Correction Task which was retrieved from the analysis manager.

Definition at line 1694 of file AliEmcalCorrectionTask.cxx.

Referenced by RemoveClusterContainer().

const std::vector<AliEmcalCorrectionComponent *>& AliEmcalCorrectionTask::CorrectionComponents ( )
inline

Direct access to the correction components.

Returns
std::vector of the correction components. Using this vector, the components and their settings can be modified as desired. However, keep in mind that whatever changes are made here will NOT be reflected in the stored YAML configuration.

Definition at line 116 of file AliEmcalCorrectionTask.h.

void AliEmcalCorrectionTask::CreateInputObjects ( AliEmcalContainerUtils::InputObject_t  inputObjectType)
private

Steers the creation of all input objects of a selected type. In the case of clusters and tracks, AliEmcalContainer can be used, and a container is created for each requested object of the specified input object type. In the case of cells, an EMCal Correction Cell Container is created to handle the relevant information.

Normally, when properties are retrieved from the YAML configuration, the entire configuration is considered. However, here we only consider a subset in both the user and default configurations. In particular, the "inputObjects" section is selected and then all properties are drawn from this subset (the shared parameters are also retained so they can be used). Thus, it takes a bit more care to use this task, but it should be entirely transparent to the users - no functionality or expected flexibility is lost.

Parameters
inputObjectTypeType of the input object(s) to create

Definition at line 604 of file AliEmcalCorrectionTask.cxx.

Referenced by Initialize(), and RemoveClusterContainer().

void AliEmcalCorrectionTask::DetermineComponentsToExecute ( std::vector< std::string > &  correctionComponents)
private

Determines which components to execute based on which are selected via specialization (ie suffix), as well as which are enabled and in what order they should be executed. The returned components in order of which they should be executed.

It is recommended to store the result, as it requires a large number of string comparisons and lookups in the YAML configuration, whose associated methods also utilize a number of string comparisons.

Parameters
[out]correctionComponentsNames of the selected correction components in the order in which they should be executed.

Definition at line 397 of file AliEmcalCorrectionTask.cxx.

Referenced by Initialize(), and RemoveClusterContainer().

void AliEmcalCorrectionTask::ExecOnce ( )
virtual

Perform steps needed to initialize the analysis. This function relies on the presence of an input event (ESD or AOD event). Consequently it is called internally by UserExec for the first event.

This function connects all containers attached to this task to the corresponding arrays in the input event. Furthermore it initializes the geometry.

Definition at line 1132 of file AliEmcalCorrectionTask.cxx.

Referenced by RemoveClusterContainer(), and UserExec().

void AliEmcalCorrectionTask::ExecOnceComponents ( )
private

Calls ExecOnce() for each component. Additionally, the cells container is added to each component, as this is the first time the pointer to the CaloCells object is available.

Definition at line 1189 of file AliEmcalCorrectionTask.cxx.

Referenced by ExecOnce(), and RemoveClusterContainer().

AliEmcalCorrectionTask::BeamType AliEmcalCorrectionTask::GetBeamType ( ) const
private

Get beam type : pp-AA-pA ESDs have it directly, AODs get it from hardcoded run number ranges

Returns
Beam type of the run.

Definition at line 1502 of file AliEmcalCorrectionTask.cxx.

Referenced by RemoveClusterContainer(), and RetrieveEventObjects().

AliEmcalCorrectionCellContainer * AliEmcalCorrectionTask::GetCellContainer ( const std::string &  cellsContainerName) const

Finds the desired cell container by name.

Parameters
cellsContainerNameName of the desired cells container
Returns
Pointer to the found cell container, or 0 if not found

Definition at line 1626 of file AliEmcalCorrectionTask.cxx.

Referenced by AddContainersToComponent(), and RemoveClusterContainer().

AliClusterContainer* AliEmcalCorrectionTask::GetClusterContainer ( Int_t  i = 0) const
inline
AliClusterContainer* AliEmcalCorrectionTask::GetClusterContainer ( const char *  name) const
inline

Definition at line 131 of file AliEmcalCorrectionTask.h.

AliEmcalCorrectionComponent * AliEmcalCorrectionTask::GetCorrectionComponent ( const std::string &  name) const

Helper function to return a particular correction component. For example, it could be used for retrieving the currently loaded bad channel map. You are strongly advised NOT to use this to configure a component!

Parameters
[in]nameCorrection component name (Usually the standard names of the components)
Returns
The requested component (or nullptr if not found)

Definition at line 1606 of file AliEmcalCorrectionTask.cxx.

Referenced by CorrectionComponents(), and AliCaloPhotonCuts::InitializeEMCAL().

std::string AliEmcalCorrectionTask::GetInputFieldNameFromInputObjectType ( AliEmcalContainerUtils::InputObject_t  inputObjectType)
private

Given the input object type, it return the name of the field in the YAML configuration where information about it should be located.

Parameters
inputObjectTypeThe type of the input object
Returns
The name of the field of the requested input object in the YAML configuration file

Definition at line 1451 of file AliEmcalCorrectionTask.cxx.

Referenced by AddContainer(), AddContainersToComponent(), CreateInputObjects(), RemoveClusterContainer(), SetupCellsInfo(), and SetupContainer().

AliMCParticleContainer* AliEmcalCorrectionTask::GetMCParticleContainer ( Int_t  i = 0) const
inline

Definition at line 132 of file AliEmcalCorrectionTask.h.

AliMCParticleContainer* AliEmcalCorrectionTask::GetMCParticleContainer ( const char *  name) const
inline

Definition at line 133 of file AliEmcalCorrectionTask.h.

AliParticleContainer* AliEmcalCorrectionTask::GetParticleContainer ( Int_t  i = 0) const
inline
AliParticleContainer* AliEmcalCorrectionTask::GetParticleContainer ( const char *  name) const
inline

Definition at line 129 of file AliEmcalCorrectionTask.h.

void AliEmcalCorrectionTask::GetPropertyNamesFromNode ( const std::string  configurationName,
const std::string  componentName,
std::set< std::string > &  propertyNames,
const bool  nodeRequired 
)
private

Utility function for CheckForUnmatchedUserSettings() which returns the names of all of the properties defined in a YAML node. This can then be used to check for consistency in how properties are defined in the user and default configurations.

This function handles the nodes by hand due to the rare requirement to handle the user and default configurations separately.

Parameters
[in]configurationNameName of the configuration to be investigated
[in]componentNameName of the node from which properties are extracted
[out]propertyNamesNames of all of the properties that were in the desired node
[in]nodeRequiredTrue if the node is required to exist

Definition at line 1573 of file AliEmcalCorrectionTask.cxx.

Referenced by CheckForUnmatchedUserSettings(), and RemoveClusterContainer().

AliTrackContainer* AliEmcalCorrectionTask::GetTrackContainer ( Int_t  i = 0) const
inline

Definition at line 134 of file AliEmcalCorrectionTask.h.

AliTrackContainer* AliEmcalCorrectionTask::GetTrackContainer ( const char *  name) const
inline

Definition at line 135 of file AliEmcalCorrectionTask.h.

PWG::Tools::AliYAMLConfiguration& AliEmcalCorrectionTask::GetYAMLConfiguration ( )
inline

Retrieve the YAML configurations for direct access.

Definition at line 91 of file AliEmcalCorrectionTask.h.

void AliEmcalCorrectionTask::Initialize ( bool  removeDummyTask = false)

Initializes the Correction Task by initializing the YAML configuration and selected correction components, including setting up the input objects (cells, clusters, and tracks).

This function is the main function for initialization and should be called from a run macro! Once called, most of the configuration of the correction task and the correction components is locked in, so be certain to change any additional configuration options before calling this function!

Parameters
[in]removeDummyTaskIf true, the dummy task created with the configure function is removed.

Definition at line 236 of file AliEmcalCorrectionTask.cxx.

void AliEmcalCorrectionTask::InitializeComponents ( )
private

Creates, configures, and initializes components based on the configuration described in the YAML files. Configuration includes making the user and default configuration available to each component, as well as setting up the input clusters and tracks (cells have to be handled during ExecOnce()). Each component's individual initialization is also called.

Definition at line 551 of file AliEmcalCorrectionTask.cxx.

Referenced by Initialize(), and RemoveClusterContainer().

void AliEmcalCorrectionTask::InitializeConfiguration ( )
private

Initializes and sets up the user and default configuration files. This includes opening the files and storing the contents of the user and default YAML files into strings so that they can be streamed to the grid. (yaml-cpp objects do not work properly with ROOT streamers).

NOTE: fConfigurationInitialized is set to true if the function is successful.

Definition at line 351 of file AliEmcalCorrectionTask.cxx.

Referenced by Initialize(), and RemoveClusterContainer().

AliEmcalCorrectionTask & AliEmcalCorrectionTask::operator= ( AliEmcalCorrectionTask  other)

Assignment operator. Note that we pass by value, so a copy is created and it is fine to swap the values with the created object!

Definition at line 184 of file AliEmcalCorrectionTask.cxx.

void AliEmcalCorrectionTask::Print ( Option_t opt = "") const

Print basic correction task information using the string representation provided by AliEmcalCorrectionTask::toString

Parameters
optIf "YAML" is passed, then the YAML configuration is also printed

Definition at line 1812 of file AliEmcalCorrectionTask.cxx.

Referenced by GetYAMLConfiguration(), and operator<<().

std::ostream & AliEmcalCorrectionTask::Print ( std::ostream &  in) const

Print correction task information on an output stream using the string representation provided by AliEmcalCorrectionTask::toString. Used by operator<<

Parameters
inoutput stream stream
Returns
reference to the output stream

Definition at line 1788 of file AliEmcalCorrectionTask.cxx.

std::ostream & AliEmcalCorrectionTask::PrintConfiguration ( std::ostream &  in,
bool  userConfig = false 
) const

Print configuration string

Parameters
inStream to which the configuration string should be added
userConfigTrue if the user configuration should be printed

Definition at line 1353 of file AliEmcalCorrectionTask.cxx.

Referenced by SetDefaultConfigurationFilename(), and toString().

void AliEmcalCorrectionTask::PrintRequestedContainersInformation ( AliEmcalContainerUtils::InputObject_t  inputObjectType,
std::ostream &  stream 
) const
private

Print information about the input object containers

Definition at line 1539 of file AliEmcalCorrectionTask.cxx.

Referenced by Initialize(), RemoveClusterContainer(), and toString().

void AliEmcalCorrectionTask::RemoveClusterContainer ( Int_t  i = 0)
inline

Definition at line 137 of file AliEmcalCorrectionTask.h.

void AliEmcalCorrectionTask::RemoveDummyTask ( ) const
private

Remove the dummy task which had to be added by ConfigureEmcalCorrectionTaskOnLEGOTrain() from the Analysis Mangaer

Definition at line 316 of file AliEmcalCorrectionTask.cxx.

Referenced by Initialize(), and RemoveClusterContainer().

void AliEmcalCorrectionTask::RemoveParticleContainer ( Int_t  i = 0)
inline

Definition at line 136 of file AliEmcalCorrectionTask.h.

Bool_t AliEmcalCorrectionTask::RetrieveEventObjects ( )
private

Retrieve objects from event.

Returns

Definition at line 1221 of file AliEmcalCorrectionTask.cxx.

Referenced by RemoveClusterContainer(), and UserExec().

Bool_t AliEmcalCorrectionTask::Run ( )
virtual

Executed each event. It sets run-by-run properties in the correction components and calls Run() for each component.

Definition at line 1314 of file AliEmcalCorrectionTask.cxx.

Referenced by RemoveClusterContainer(), and UserExec().

void AliEmcalCorrectionTask::SetCellsObjectInCellContainerBasedOnProperties ( AliEmcalCorrectionCellContainer cellContainer)
private

Uses the information in the cell container to properly set the pointer to the CaloCells object in the cell container.

Parameters
[in,out]cellContainerCell container to set the pointer in

Definition at line 1413 of file AliEmcalCorrectionTask.cxx.

Referenced by AddContainersToComponent(), ExecOnce(), and RemoveClusterContainer().

void AliEmcalCorrectionTask::SetCentralityEstimator ( const char *  c)
inline

Definition at line 105 of file AliEmcalCorrectionTask.h.

void AliEmcalCorrectionTask::SetCentRange ( Double_t  min,
Double_t  max 
)
inline

Definition at line 107 of file AliEmcalCorrectionTask.h.

void AliEmcalCorrectionTask::SetDefaultConfigurationFilename ( std::string  name)
inline

Set the path to the default configuration filename (Expert use only! The user should set the user configuration!)

Definition at line 83 of file AliEmcalCorrectionTask.h.

void AliEmcalCorrectionTask::SetForceBeamType ( BeamType  f)
inline

Definition at line 101 of file AliEmcalCorrectionTask.h.

virtual void AliEmcalCorrectionTask::SetNCentBins ( Int_t  n)
inlinevirtual

Definition at line 106 of file AliEmcalCorrectionTask.h.

void AliEmcalCorrectionTask::SetNeedEmcalGeometry ( Bool_t  b)
inline

Definition at line 102 of file AliEmcalCorrectionTask.h.

void AliEmcalCorrectionTask::SetupCellsInfo ( std::string  containerName)
private

Setup cell container with information from the YAML configuration nodes corresponding to the selected input object.

The created cell containers is stored by in the correction task.

Parameters
[in]containerNameName of the container to create (as defined in the YAML configuration)

Definition at line 768 of file AliEmcalCorrectionTask.cxx.

Referenced by RemoveClusterContainer(), and SetupContainersFromInputNodes().

void AliEmcalCorrectionTask::SetupContainer ( const AliEmcalContainerUtils::InputObject_t  inputObjectType,
const std::string  containerName 
)
private

Configures AliEmcalContainer derived tasks. Sets both general properties (such as min energy, etc), as well as container type specific properties (such as Non-linearity energy cut for a cluster container). Available options are enumerated in the general documentation related to the Correction Framework, available here.

Note for experts: This implementation explicitly calls particular functions, which is much more straightforward to understand and work with, but is less flexible. This means that any new options need to be implemented here by hand. An idea for a better implementation is mentioned in comments in the function for those who are interested. Once it is implemented, AliEmcalContainer derived classes could be entirely configured through YAML.

Parameters
[in]inputObjectTypeType of the input object to configure
[in]containerNameName of the container to create (as defined in the YAML configuration)

Definition at line 809 of file AliEmcalCorrectionTask.cxx.

Referenced by RemoveClusterContainer(), and SetupContainersFromInputNodes().

void AliEmcalCorrectionTask::SetupContainersFromInputNodes ( AliEmcalContainerUtils::InputObject_t  inputObjectType,
std::set< std::string > &  requestedContainers 
)
private

Creates the input objects containers requested by the components.

Parameters
[in]inputObjectTypeType of the input objects to create
[in]requestedContainersContainers to be created

Definition at line 738 of file AliEmcalCorrectionTask.cxx.

Referenced by CreateInputObjects(), and RemoveClusterContainer().

void AliEmcalCorrectionTask::SetUseNewCentralityEstimation ( Bool_t  b)
inline

Definition at line 104 of file AliEmcalCorrectionTask.h.

void AliEmcalCorrectionTask::SetUserConfigurationFilename ( std::string  name)
inline

Set the path to the user configuration filename.

Definition at line 81 of file AliEmcalCorrectionTask.h.

std::string AliEmcalCorrectionTask::toString ( bool  includeYAMLConfigurationInfo = false) const

Prints information about the correction task.

Returns
std::string containing information about the task.

Definition at line 1756 of file AliEmcalCorrectionTask.cxx.

Referenced by GetYAMLConfiguration(), and Print().

void AliEmcalCorrectionTask::UserCreateOutputObjects ( )

Reinitializes the YAML configurations if necessary and sets up for output from the correction components. The reinitialization is necessary if the object is streamed because yaml-cpp objects cannot be streamed. Instead, the YAML configuration is stored in strings and the nodes are recreated here from the string.

Note that the number of centrality bins is also set here in the case of a forced beam-type since this is how it was done in AliAnalysisTaskEmcal.

Definition at line 1028 of file AliEmcalCorrectionTask.cxx.

Referenced by RemoveClusterContainer().

void AliEmcalCorrectionTask::UserCreateOutputObjectsComponents ( )
private

Calls UserCreateOutputObjects() for each component and ensures that the output from the correction components is eventually output by the correction task.

It also sets the number of centrality bins.

Definition at line 1058 of file AliEmcalCorrectionTask.cxx.

Referenced by RemoveClusterContainer(), and UserCreateOutputObjects().

void AliEmcalCorrectionTask::UserExec ( Option_t option)

Steers each event. It enforces that the event is initialized before executing the main analysis of the event.

Definition at line 1094 of file AliEmcalCorrectionTask.cxx.

Referenced by RemoveClusterContainer().

Bool_t AliEmcalCorrectionTask::UserNotify ( )

Executed when the file is changed. Also calls UserNotify() for each component.

Definition at line 1336 of file AliEmcalCorrectionTask.cxx.

Referenced by RemoveClusterContainer().

bool AliEmcalCorrectionTask::WriteConfigurationFile ( std::string  filename,
bool  userConfig = false 
) const

Write the desired YAML configuration to a file.

Parameters
filenameThe name of the file to write
userConfigTrue to write the user configuration
Returns
True when writing the configuration to the file was successful

Definition at line 1377 of file AliEmcalCorrectionTask.cxx.

Referenced by SetDefaultConfigurationFilename().

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  in,
const AliEmcalCorrectionTask myTask 
)
friend

Implementation of the output stream operator for AliEmcalCorrectionTask. Printing basic correction task information provided by function toString

Parameters
inoutput stream
myTaskTask which will be printed
Returns
Reference to the output stream

Definition at line 1800 of file AliEmcalCorrectionTask.cxx.

Referenced by GetYAMLConfiguration().

void swap ( AliEmcalCorrectionTask first,
AliEmcalCorrectionTask second 
)
friend

Swap function. Created using guide described here: https://stackoverflow.com/a/3279550

Definition at line 194 of file AliEmcalCorrectionTask.cxx.

Referenced by AliEmcalCorrectionTask(), operator=(), and swap().

Member Data Documentation

BeamType AliEmcalCorrectionTask::fBeamType
private

! Event beam type

Definition at line 241 of file AliEmcalCorrectionTask.h.

Referenced by AliEmcalCorrectionTask(), RetrieveEventObjects(), and swap().

std::vector<AliEmcalCorrectionCellContainer *> AliEmcalCorrectionTask::fCellCollArray
private
Double_t AliEmcalCorrectionTask::fCent
private

! Event centrality

Definition at line 232 of file AliEmcalCorrectionTask.h.

Referenced by RetrieveEventObjects(), Run(), and swap().

Int_t AliEmcalCorrectionTask::fCentBin
private

! Event centrality bin

Definition at line 233 of file AliEmcalCorrectionTask.h.

Referenced by RetrieveEventObjects(), Run(), and swap().

TString AliEmcalCorrectionTask::fCentEst
private

name of V0 centrality estimator

Definition at line 237 of file AliEmcalCorrectionTask.h.

Referenced by RetrieveEventObjects(), SetCentralityEstimator(), and swap().

bool AliEmcalCorrectionTask::fConfigurationInitialized
private

True if the YAML configuration files are initialized.

Definition at line 227 of file AliEmcalCorrectionTask.h.

Referenced by Initialize(), InitializeConfiguration(), swap(), and UserCreateOutputObjects().

std::vector<AliEmcalCorrectionComponent *> AliEmcalCorrectionTask::fCorrectionComponents
private
std::string AliEmcalCorrectionTask::fDefaultConfigurationFilename
private

! Default YAML configuration filename

Definition at line 223 of file AliEmcalCorrectionTask.h.

Referenced by InitializeConfiguration(), SetDefaultConfigurationFilename(), and swap().

bool AliEmcalCorrectionTask::fEventInitialized
private

If the event is initialized properly.

Definition at line 230 of file AliEmcalCorrectionTask.h.

Referenced by ExecOnce(), swap(), and UserExec().

BeamType AliEmcalCorrectionTask::fForceBeamType
private

forced beam type

Definition at line 242 of file AliEmcalCorrectionTask.h.

Referenced by AliEmcalCorrectionTask(), GetBeamType(), SetForceBeamType(), swap(), and UserCreateOutputObjects().

AliEMCALGeometry* AliEmcalCorrectionTask::fGeom
private

! Emcal geometry

Definition at line 244 of file AliEmcalCorrectionTask.h.

Referenced by AliEmcalCorrectionTask(), ExecOnce(), ExecOnceComponents(), and swap().

bool AliEmcalCorrectionTask::fIsEsd
private
Double_t AliEmcalCorrectionTask::fMaxCent
private

max centrality for event selection

Definition at line 235 of file AliEmcalCorrectionTask.h.

Referenced by RetrieveEventObjects(), SetCentRange(), and swap().

Double_t AliEmcalCorrectionTask::fMinCent
private

min centrality for event selection

Definition at line 234 of file AliEmcalCorrectionTask.h.

Referenced by RetrieveEventObjects(), SetCentRange(), and swap().

Int_t AliEmcalCorrectionTask::fNcentBins
private
Bool_t AliEmcalCorrectionTask::fNeedEmcalGeom
private

whether or not the task needs the emcal geometry

Definition at line 243 of file AliEmcalCorrectionTask.h.

Referenced by AliEmcalCorrectionTask(), ExecOnce(), SetNeedEmcalGeometry(), and swap().

Int_t AliEmcalCorrectionTask::fNVertCont
private

! Event vertex number of contributors

Definition at line 240 of file AliEmcalCorrectionTask.h.

Referenced by AliEmcalCorrectionTask(), RetrieveEventObjects(), and swap().

std::vector<std::string> AliEmcalCorrectionTask::fOrderedComponentsToExecute
private

Ordered set of components to execute.

Definition at line 225 of file AliEmcalCorrectionTask.h.

Referenced by CheckForUnmatchedUserSettings(), CreateInputObjects(), Initialize(), InitializeComponents(), swap(), and toString().

TList* AliEmcalCorrectionTask::fOutput
private

! Output for histograms

Definition at line 250 of file AliEmcalCorrectionTask.h.

Referenced by AliEmcalCorrectionTask(), Run(), swap(), UserCreateOutputObjects(), and UserCreateOutputObjectsComponents().

bool AliEmcalCorrectionTask::fRecycleUnusedEmbeddedEventsMode
private

Allows the recycling of embedded events which fail internal event selection. See the embedding helper.

Definition at line 231 of file AliEmcalCorrectionTask.h.

Referenced by Initialize(), swap(), and UserExec().

std::string AliEmcalCorrectionTask::fSuffix
private

Suffix of the Correction Task (used to select specialized components)

Definition at line 220 of file AliEmcalCorrectionTask.h.

Referenced by DetermineComponentsToExecute(), Initialize(), InitializeComponents(), and swap().

Bool_t AliEmcalCorrectionTask::fUseNewCentralityEstimation
private

Use new centrality estimation (for 2015 data)

Definition at line 238 of file AliEmcalCorrectionTask.h.

Referenced by RetrieveEventObjects(), SetUseNewCentralityEstimation(), and swap().

std::string AliEmcalCorrectionTask::fUserConfigurationFilename
private

! User YAML configruation filename

Definition at line 222 of file AliEmcalCorrectionTask.h.

Referenced by InitializeConfiguration(), and swap().

Double_t AliEmcalCorrectionTask::fVertex[3]
private

! Event vertex

Definition at line 239 of file AliEmcalCorrectionTask.h.

Referenced by RetrieveEventObjects(), Run(), and swap().


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