![]() |
AliPhysics
4ffc478 (4ffc478)
|
Steering task for the EMCal correction frameworkThis 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. More...
#include <AliEmcalCorrectionTask.h>
Public Types | |
enum | BeamType { kNA = -1, kpp = 0, kAA = 1, kpA = 2 } |
Switch for the beam type. More... | |
enum | InputObject_t { kNoDefinedInputObject = -1, kCaloCells = 0, kCluster = 1, kTrack = 2 } |
Type of input object to be created. More... | |
Static Public Member Functions | |
static std::string | DetermineUseDefaultName (InputObject_t contType, bool esdMode, bool returnObjectType=false) |
static AliVEvent * | GetEvent (AliVEvent *inputEvent, bool isEmbedding=false) |
Public Attributes | |
std::map< std::string, AliVCluster::VCluUserDefEnergy_t > | clusterEnergyTypeMap |
std::map< std::string, AliEmcalTrackSelection::ETrackFilterType_t > | trackFilterTypeMap |
Private Member Functions | |
AliEmcalCorrectionTask (const AliEmcalCorrectionTask &) | |
AliEmcalCorrectionTask & | operator= (const AliEmcalCorrectionTask &) |
void | SetupConfigurationFilePath (std::string &filename, bool userFile=false) |
void | InitializeConfiguration () |
void | RetrieveExecutionOrder (std::vector< std::string > &componentsToAdd) |
void | InitializeComponents () |
void | SetCellsObjectInCellContainerBasedOnProperties (AliEmcalCorrectionCellContainer *cellContainer) |
void | CheckForContainerArray (AliEmcalContainer *cont, InputObject_t objectType) |
std::string | GetInputFieldNameFromInputObjectType (InputObject_t inputObjectType) |
void | CreateInputObjects (InputObject_t inputObjectType) |
void | AddContainersToComponent (AliEmcalCorrectionComponent *component, InputObject_t inputObjectType) |
void | SetupContainersFromInputNodes (InputObject_t inputObjectType, YAML::Node &userInputObjectNode, YAML::Node &defaultInputObjectNode, std::set< std::string > &requestedContainers) |
void | GetNodeForInputObjects (YAML::Node &inputNode, YAML::Node &nodeToRetrieveFrom, std::string &inputObjectName, bool requiredProperty) |
void | SetupCellsInfo (std::string containerName, YAML::Node &userNode, YAML::Node &defaultNode) |
void | SetupContainer (InputObject_t inputObjectType, std::string containerName, YAML::Node &userNode, YAML::Node &defaultNode) |
AliEmcalContainer * | AddContainer (InputObject_t contType, std::string &containerName, YAML::Node &userNode, YAML::Node &defaultNode) |
Bool_t | RetrieveEventObjects () |
void | ExecOnceComponents () |
void | UserCreateOutputObjectsComponents () |
BeamType | GetBeamType () |
Static Private Member Functions | |
static bool | DoesFileExist (const std::string &filename) |
Private Attributes | |
YAML::Node | fUserConfiguration |
YAML::Node | fDefaultConfiguration |
User YAML Configuration. More... | |
std::string | fUserConfigurationString |
Default YAML Configuration. More... | |
std::string | fDefaultConfigurationString |
Store the default YAML configuration as a string so that it can be streamed. More... | |
std::string | fUserConfigurationFilename |
! User YAML configruation filename More... | |
std::string | fDefaultConfigurationFilename |
! Default YAML configuration filename More... | |
std::vector < AliEmcalCorrectionComponent * > | fCorrectionComponents |
Contains the correction components. More... | |
bool | fConfigurationInitialized |
True if the YAML files are initialized. More... | |
bool | fIsEsd |
File type. More... | |
TString | fRunPeriod |
Run period (passed by user) More... | |
bool | fEventInitialized |
If the event is initialized properly. 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... | |
TList * | fOutput |
! Output for histograms More... | |
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.
Definition at line 45 of file AliEmcalCorrectionTask.h.
Switch for the beam type.
Enumerator | |
---|---|
kNA |
! Undefined |
kpp |
! Proton-Proton |
kAA |
! Nucleus-Nucleus |
kpA |
! Proton-Nucleus |
Definition at line 51 of file AliEmcalCorrectionTask.h.
Type of input object to be created.
Enumerator | |
---|---|
kNoDefinedInputObject |
Not initialied type. |
kCaloCells |
Calo cells. |
kCluster |
Cluster container. |
kTrack |
Track container. |
Definition at line 62 of file AliEmcalCorrectionTask.h.
AliEmcalCorrectionTask::AliEmcalCorrectionTask | ( | ) |
Definition at line 42 of file AliEmcalCorrectionTask.cxx.
AliEmcalCorrectionTask::AliEmcalCorrectionTask | ( | const char * | name | ) |
Definition at line 88 of file AliEmcalCorrectionTask.cxx.
|
virtual |
Definition at line 1422 of file AliEmcalCorrectionTask.cxx.
|
private |
AliClusterContainer * AliEmcalCorrectionTask::AddClusterContainer | ( | const char * | n | ) |
Create new cluster container and attach it to the task. The name provided to this function must match the name of the array attached to the new container inside the input event.
[in] | n | Name of the container and the array the container points to |
Definition at line 1292 of file AliEmcalCorrectionTask.cxx.
|
private |
Creates a new container based on the requested type and the branch name set in the configuration file. Suppports the "usedefault" pattern to simplify setting the proper branch name.
Note: Adding a container using this function also sets the container variable (for example, fPartCont for a particle container), so it can be used immediately after this function is called.
[in] | contType | Type of container to be created |
Definition at line 901 of file AliEmcalCorrectionTask.cxx.
Referenced by SetupContainer().
|
private |
Definition at line 951 of file AliEmcalCorrectionTask.cxx.
Referenced by ExecOnceComponents(), and InitializeComponents().
AliMCParticleContainer * AliEmcalCorrectionTask::AddMCParticleContainer | ( | const char * | n | ) |
Create new container for MC particles and attach it to the task. The name provided to this function must match the name of the array attached to the new container inside the input event.
[in] | n | Name of the container and the array the container points to |
Definition at line 1238 of file AliEmcalCorrectionTask.cxx.
AliParticleContainer * AliEmcalCorrectionTask::AddParticleContainer | ( | const char * | n | ) |
Create new particle container and attach it to the task. The name provided to this function must match the name of the array attached to the new container inside the input event.
[in] | n | Name of the container and the array the container points to |
Definition at line 1274 of file AliEmcalCorrectionTask.cxx.
AliTrackContainer * AliEmcalCorrectionTask::AddTrackContainer | ( | const char * | n | ) |
Create new track container and attach it to the task. The name provided to this function must match the name of the array attached to the new container inside the input event.
[in] | n | Name of the container and the array the container points to |
Definition at line 1256 of file AliEmcalCorrectionTask.cxx.
|
inline |
Definition at line 118 of file AliEmcalCorrectionTask.h.
Referenced by AddContainer().
|
inline |
Definition at line 117 of file AliEmcalCorrectionTask.h.
|
inline |
Definition at line 115 of file AliEmcalCorrectionTask.h.
Referenced by AddContainer(), AdoptMCParticleContainer(), and AdoptTrackContainer().
|
inline |
Definition at line 116 of file AliEmcalCorrectionTask.h.
|
private |
Definition at line 1216 of file AliEmcalCorrectionTask.cxx.
Referenced by ExecOnce().
|
inline |
Definition at line 137 of file AliEmcalCorrectionTask.h.
|
private |
Definition at line 649 of file AliEmcalCorrectionTask.cxx.
Referenced by Initialize().
|
static |
Given a container type, it returns the proper branch name based on the "usedefault" pattern. If returnObjectType is true, it returns the "default" (unlikely to change) object type given the input object type and the file mode.
Definition at line 823 of file AliEmcalCorrectionTask.cxx.
Referenced by AddContainer(), CheckForContainerArray(), AliEmcalCopyCollection::CreateNewObjectBranch(), AliEmcalCopyCollection::NewBranch(), and SetupCellsInfo().
|
inlinestaticprivate |
Checks if a file exists. This is done inline to make it efficient. See: https://stackoverflow.com/a/19841704
filename | String containing the filename of the file to check. |
Definition at line 140 of file AliEmcalCorrectionTask.cxx.
Referenced by InitializeConfiguration().
|
virtual |
Executed once per event to initialize objects. The user probably does not need to overload it.
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 1150 of file AliEmcalCorrectionTask.cxx.
Referenced by UserExec().
|
private |
Definition at line 1025 of file AliEmcalCorrectionTask.cxx.
Referenced by ExecOnce().
|
private |
Get beam type : pp-AA-pA ESDs have it directly, AODs get it from hardcoded run number ranges
Definition at line 1432 of file AliEmcalCorrectionTask.cxx.
Referenced by RetrieveEventObjects().
AliEmcalCorrectionCellContainer * AliEmcalCorrectionTask::GetCellContainer | ( | const std::string & | cellsContainerName | ) | const |
Definition at line 996 of file AliEmcalCorrectionTask.cxx.
Referenced by AddContainersToComponent().
AliClusterContainer * AliEmcalCorrectionTask::GetClusterContainer | ( | Int_t | i = 0 | ) | const |
Get \( i^{th} \) cluster container attached to this task
[in] | i | Index of the cluster container |
Definition at line 1320 of file AliEmcalCorrectionTask.cxx.
Referenced by AddContainersToComponent(), and SetupContainersFromInputNodes().
AliClusterContainer * AliEmcalCorrectionTask::GetClusterContainer | ( | const char * | name | ) | const |
Find cluster container attached to this task according to its name
[in] | name | Name of the cluster container |
Definition at line 1343 of file AliEmcalCorrectionTask.cxx.
|
static |
Definition at line 1195 of file AliEmcalCorrectionTask.cxx.
Referenced by CheckForContainerArray(), AliEmcalCopyCollection::CreateNewObjectBranch(), and SetCellsObjectInCellContainerBasedOnProperties().
|
private |
Given the input type, return the name of the field in the YAML file where information about it should be lcoated.
Definition at line 548 of file AliEmcalCorrectionTask.cxx.
Referenced by AddContainersToComponent(), and CreateInputObjects().
|
inline |
Definition at line 123 of file AliEmcalCorrectionTask.h.
|
inline |
Definition at line 124 of file AliEmcalCorrectionTask.h.
|
private |
Definition at line 572 of file AliEmcalCorrectionTask.cxx.
Referenced by CreateInputObjects().
AliParticleContainer * AliEmcalCorrectionTask::GetParticleContainer | ( | Int_t | i = 0 | ) | const |
Get \( i^{th} \) particle container attached to this task
[in] | i | Index of the particle container |
Definition at line 1308 of file AliEmcalCorrectionTask.cxx.
Referenced by AddContainersToComponent(), GetMCParticleContainer(), GetTrackContainer(), and SetupContainersFromInputNodes().
AliParticleContainer * AliEmcalCorrectionTask::GetParticleContainer | ( | const char * | name | ) | const |
Find particle container attached to this task according to its name
[in] | name | Name of the particle container |
Definition at line 1332 of file AliEmcalCorrectionTask.cxx.
|
inline |
Definition at line 133 of file AliEmcalCorrectionTask.h.
|
inline |
Definition at line 125 of file AliEmcalCorrectionTask.h.
|
inline |
Definition at line 126 of file AliEmcalCorrectionTask.h.
void AliEmcalCorrectionTask::Initialize | ( | ) |
Definition at line 327 of file AliEmcalCorrectionTask.cxx.
|
private |
Definition at line 402 of file AliEmcalCorrectionTask.cxx.
Referenced by Initialize().
|
private |
Definition at line 192 of file AliEmcalCorrectionTask.cxx.
Referenced by Initialize().
|
private |
|
inline |
Definition at line 128 of file AliEmcalCorrectionTask.h.
|
inline |
Definition at line 127 of file AliEmcalCorrectionTask.h.
|
private |
Retrieve objects from event.
Definition at line 1050 of file AliEmcalCorrectionTask.cxx.
Referenced by UserExec().
|
private |
Definition at line 386 of file AliEmcalCorrectionTask.cxx.
Referenced by CreateInputObjects(), and InitializeComponents().
|
virtual |
Executed each event once all objects are available
Definition at line 1381 of file AliEmcalCorrectionTask.cxx.
Referenced by UserExec().
|
private |
Definition at line 1012 of file AliEmcalCorrectionTask.cxx.
Referenced by ExecOnce().
|
inline |
Definition at line 106 of file AliEmcalCorrectionTask.h.
|
inline |
Definition at line 131 of file AliEmcalCorrectionTask.h.
|
inline |
Definition at line 132 of file AliEmcalCorrectionTask.h.
|
private |
Definition at line 615 of file AliEmcalCorrectionTask.cxx.
Referenced by SetupContainersFromInputNodes().
|
private |
Handles expanding ALICE_PHYSICS and copying the file from the grid if necessary.
Definition at line 150 of file AliEmcalCorrectionTask.cxx.
Referenced by InitializeConfiguration().
|
private |
Definition at line 699 of file AliEmcalCorrectionTask.cxx.
Referenced by SetupContainersFromInputNodes().
|
private |
Definition at line 587 of file AliEmcalCorrectionTask.cxx.
Referenced by CreateInputObjects().
|
inline |
Definition at line 135 of file AliEmcalCorrectionTask.h.
|
inline |
Definition at line 105 of file AliEmcalCorrectionTask.h.
void AliEmcalCorrectionTask::UserCreateOutputObjects | ( | ) |
Definition at line 459 of file AliEmcalCorrectionTask.cxx.
|
private |
Calls UserCreateOutputObjects() for each component.
Definition at line 511 of file AliEmcalCorrectionTask.cxx.
Referenced by UserCreateOutputObjects().
void AliEmcalCorrectionTask::UserExec | ( | Option_t * | option | ) |
Definition at line 1354 of file AliEmcalCorrectionTask.cxx.
Bool_t AliEmcalCorrectionTask::UserNotify | ( | ) |
Definition at line 1405 of file AliEmcalCorrectionTask.cxx.
bool AliEmcalCorrectionTask::WriteConfigurationFile | ( | std::string | filename, |
bool | userConfig = false |
||
) |
Writes the desired yaml configuration to a file.
filename | The name of the file to write. |
userCofig | True to write the user configuration. |
Definition at line 293 of file AliEmcalCorrectionTask.cxx.
std::map<std::string, AliVCluster::VCluUserDefEnergy_t> AliEmcalCorrectionTask::clusterEnergyTypeMap |
Definition at line 70 of file AliEmcalCorrectionTask.h.
|
private |
!event beam type
Definition at line 206 of file AliEmcalCorrectionTask.h.
Referenced by RetrieveEventObjects().
|
private |
Cells collection array.
Definition at line 213 of file AliEmcalCorrectionTask.h.
Referenced by ExecOnce(), GetCellContainer(), Initialize(), and SetupCellsInfo().
|
private |
! Event centrality
Definition at line 197 of file AliEmcalCorrectionTask.h.
Referenced by RetrieveEventObjects(), and Run().
|
private |
! Event centrality bin
Definition at line 198 of file AliEmcalCorrectionTask.h.
Referenced by RetrieveEventObjects(), and Run().
|
private |
name of V0 centrality estimator
Definition at line 202 of file AliEmcalCorrectionTask.h.
Referenced by RetrieveEventObjects().
|
private |
cluster collection array
Definition at line 212 of file AliEmcalCorrectionTask.h.
Referenced by AddClusterContainer(), AdoptClusterContainer(), AliEmcalCorrectionTask(), ExecOnce(), GetClusterContainer(), Initialize(), RemoveClusterContainer(), and RetrieveEventObjects().
|
private |
True if the YAML files are initialized.
Definition at line 192 of file AliEmcalCorrectionTask.h.
Referenced by Initialize(), InitializeConfiguration(), UserCreateOutputObjects(), and WriteConfigurationFile().
|
private |
Contains the correction components.
Definition at line 191 of file AliEmcalCorrectionTask.h.
Referenced by CorrectionComponents(), ExecOnceComponents(), InitializeComponents(), Run(), UserCreateOutputObjectsComponents(), and UserNotify().
|
private |
User YAML Configuration.
Definition at line 182 of file AliEmcalCorrectionTask.h.
Referenced by AddContainersToComponent(), CreateInputObjects(), InitializeComponents(), InitializeConfiguration(), RetrieveExecutionOrder(), and UserCreateOutputObjects().
|
private |
! Default YAML configuration filename
Definition at line 189 of file AliEmcalCorrectionTask.h.
Referenced by InitializeConfiguration(), and SetDefaultConfigurationFilename().
|
private |
Store the default YAML configuration as a string so that it can be streamed.
Definition at line 186 of file AliEmcalCorrectionTask.h.
Referenced by InitializeConfiguration(), UserCreateOutputObjects(), and WriteConfigurationFile().
|
private |
If the event is initialized properly.
Definition at line 196 of file AliEmcalCorrectionTask.h.
Referenced by ExecOnce(), and UserExec().
|
private |
forced beam type
Definition at line 207 of file AliEmcalCorrectionTask.h.
Referenced by GetBeamType(), SetForceBeamType(), and UserCreateOutputObjects().
|
private |
!emcal geometry
Definition at line 209 of file AliEmcalCorrectionTask.h.
Referenced by ExecOnce(), and ExecOnceComponents().
|
private |
File type.
Definition at line 194 of file AliEmcalCorrectionTask.h.
Referenced by AddContainer(), CheckForContainerArray(), Initialize(), InitializeComponents(), and SetupCellsInfo().
|
private |
max centrality for event selection
Definition at line 200 of file AliEmcalCorrectionTask.h.
Referenced by RetrieveEventObjects().
|
private |
min centrality for event selection
Definition at line 199 of file AliEmcalCorrectionTask.h.
Referenced by RetrieveEventObjects().
|
private |
how many centrality bins
Definition at line 201 of file AliEmcalCorrectionTask.h.
Referenced by RetrieveEventObjects(), UserCreateOutputObjects(), and UserCreateOutputObjectsComponents().
|
private |
whether or not the task needs the emcal geometry
Definition at line 208 of file AliEmcalCorrectionTask.h.
Referenced by ExecOnce().
|
private |
!event vertex number of contributors
Definition at line 205 of file AliEmcalCorrectionTask.h.
Referenced by RetrieveEventObjects().
|
private |
! Output for histograms
Definition at line 215 of file AliEmcalCorrectionTask.h.
Referenced by Run(), UserCreateOutputObjects(), and UserCreateOutputObjectsComponents().
|
private |
particle/track collection array
Definition at line 211 of file AliEmcalCorrectionTask.h.
Referenced by AddMCParticleContainer(), AddParticleContainer(), AddTrackContainer(), AdoptParticleContainer(), AliEmcalCorrectionTask(), ExecOnce(), GetParticleContainer(), Initialize(), RemoveParticleContainer(), and RetrieveEventObjects().
|
private |
Run period (passed by user)
Definition at line 195 of file AliEmcalCorrectionTask.h.
Referenced by GetRunPeriod(), InitializeConfiguration(), and SetRunPeriod().
|
private |
Use new centrality estimation (for 2015 data)
Definition at line 203 of file AliEmcalCorrectionTask.h.
Referenced by RetrieveEventObjects(), and SetUseNewCentralityEstimation().
|
private |
Definition at line 181 of file AliEmcalCorrectionTask.h.
Referenced by AddContainersToComponent(), CreateInputObjects(), InitializeComponents(), InitializeConfiguration(), RetrieveExecutionOrder(), and UserCreateOutputObjects().
|
private |
! User YAML configruation filename
Definition at line 188 of file AliEmcalCorrectionTask.h.
Referenced by InitializeConfiguration(), and SetUserConfigurationFilename().
|
private |
Default YAML Configuration.
Store the User YAML configuration as a string so that it can be streamed
Definition at line 185 of file AliEmcalCorrectionTask.h.
Referenced by InitializeConfiguration(), UserCreateOutputObjects(), and WriteConfigurationFile().
|
private |
!event vertex
Definition at line 204 of file AliEmcalCorrectionTask.h.
Referenced by AliEmcalCorrectionTask(), and RetrieveEventObjects().
std::map<std::string, AliEmcalTrackSelection::ETrackFilterType_t> AliEmcalCorrectionTask::trackFilterTypeMap |
Definition at line 77 of file AliEmcalCorrectionTask.h.
Referenced by SetupContainer().