AliPhysics  dc874a1 (dc874a1)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliEmcalCorrectionComponent Class Reference

Base class for correction components in the EMCal correction framework. More...

#include <AliEmcalCorrectionComponent.h>

Inheritance diagram for AliEmcalCorrectionComponent:

Public Member Functions

 AliEmcalCorrectionComponent ()
 
 AliEmcalCorrectionComponent (const char *name)
 
virtual ~AliEmcalCorrectionComponent ()
 
virtual Bool_t Initialize ()
 
virtual void UserCreateOutputObjects ()
 
virtual void ExecOnce ()
 
virtual Bool_t Run ()
 
virtual Bool_t UserNotify ()
 
void GetEtaPhiDiff (const AliVTrack *t, const AliVCluster *v, Double_t &phidiff, Double_t &etadiff)
 
void UpdateCells ()
 
Bool_t RunChanged ()
 
void GetPass ()
 
void FillCellQA (TH1F *h)
 
AliClusterContainerGetClusterContainer ()
 
AliParticleContainerGetParticleContainer ()
 
AliVCaloCells * GetCaloCells ()
 
TListGetOutputList ()
 
void SetClusterContainer (AliClusterContainer *cont)
 
void SetParticleContainer (AliParticleContainer *cont)
 
void SetCaloCells (AliVCaloCells *cells)
 
void SetRecoUtils (AliEMCALRecoUtils *ru)
 
void SetEvent (AliVEvent *event)
 
void SetMCEvent (AliMCEvent *mcevent)
 
void SetEMCALGeometry (AliEMCALGeometry *geometry)
 
void SetCentralityBin (Int_t bin)
 
void SetCentrality (Double_t cent)
 
void SetNcentralityBins (Int_t n)
 
void SetIsESD (Bool_t isESD)
 
void SetUserConfiguration (YAML::Node &node)
 Make copy to ensure that the nodes do not point to each other (?) More...
 
void SetDefaultConfiguration (YAML::Node &node)
 
template<typename T >
bool GetProperty (std::string propertyName, T &property, bool requiredProperty=true, std::string correctionName="")
 Retrieve property. More...
 

Static Public Member Functions

template<typename T >
static bool GetProperty (std::string propertyName, T &property, const YAML::Node &userConfiguration, const YAML::Node &defaultConfiguration, bool requiredProperty=true, std::string correctionName="")
 Retrieve property driver function. It is static so that it can be used by other classes. More...
 
static bool IsSharedValue (std::string &value)
 

Static Protected Member Functions

template<typename T >
static bool GetPropertyFromNodes (const YAML::Node &node, const YAML::Node &sharedParametersNode, std::string propertyName, T &property, const std::string correctionName, const std::string configurationType, int nodesDeep=0)
 
template<typename T >
static bool GetPropertyFromNode (const YAML::Node &node, std::string propertyName, T &property)
 
template<typename T >
static std::enable_if
<!std::is_arithmetic< T >
::value &&!std::is_same< T,
std::string >::value
&&!std::is_same< T, bool >
::value >::type 
PrintRetrievedPropertyValue (T &property, std::stringstream &tempMessage)
 
template<typename T >
static std::enable_if
< std::is_arithmetic< T >
::value||std::is_same< T,
std::string >::value||std::is_same
< T, bool >::value >::type 
PrintRetrievedPropertyValue (T &property, std::stringstream &tempMessage)
 

Protected Attributes

YAML::Node fUserConfiguration
 
YAML::Node fDefaultConfiguration
 User YAML configuration. More...
 
Bool_t fCreateHisto
 Default YAML configuration. More...
 
Int_t fRun
 ! Run number More...
 
TString fFilepass
 Input data pass number. More...
 
Bool_t fGetPassFromFileName
 Get fFilepass from file name. More...
 
AliVEvent * fEvent
 ! Pointer to event More...
 
Bool_t fEsdMode
 flag for ESD More...
 
AliMCEvent * fMCEvent
 ! MC More...
 
Double_t fCent
 ! Event centrality More...
 
Int_t fNcentBins
 How many centrality bins (this member copied from AliAnalysisTaskEmcal) More...
 
Int_t fCentBin
 ! Event centrality bin More...
 
Int_t fNbins
 No. of pt bins. More...
 
Double_t fMinBinPt
 Min pt in histograms. More...
 
Double_t fMaxBinPt
 Max pt in histograms. More...
 
Double_t fVertex [3]
 ! Event vertex More...
 
AliEMCALGeometry * fGeom
 ! Geometry object More...
 
Bool_t fIsEmbedded
 Trigger, embedded signal. More...
 
Int_t fMinMCLabel
 Minimum MC label value for the tracks/clusters being considered MC particles. More...
 
AliClusterContainerfClusCont
 Pointer to the cluster container. More...
 
AliParticleContainerfPartCont
 Pointer to the track/particle container. More...
 
AliVCaloCells * fCaloCells
 ! Pointer to CaloCells More...
 
AliEMCALRecoUtils * fRecoUtils
 Pointer to RecoUtils. More...
 
TListfOutput
 ! List of output histograms More...
 
TString fBasePath
 Base folder path to get root files. More...
 

Private Member Functions

 AliEmcalCorrectionComponent (const AliEmcalCorrectionComponent &)
 
AliEmcalCorrectionComponentoperator= (const AliEmcalCorrectionComponent &)
 

Detailed Description

Base class for correction components in the EMCal correction framework.

Base class for all correction components in the EMCal Correction Framework. Each correction component corresponds to a correction needed for the EMCal. Creation, configuration, and execution of all of the components is handled by AliEmcalCorrectionTask. Each new component is automatically registered through the AliEmcalCorrectionComponentFactory class, and is thus automatically available to execute. Components are configured through a set of YAML configuration files. For more information about the steering, see AliEmcalCorrectionTask.

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

Constructor & Destructor Documentation

AliEmcalCorrectionComponent::AliEmcalCorrectionComponent ( )

Default constructor

Definition at line 28 of file AliEmcalCorrectionComponent.cxx.

AliEmcalCorrectionComponent::AliEmcalCorrectionComponent ( const char *  name)

Standard constructor

Definition at line 67 of file AliEmcalCorrectionComponent.cxx.

AliEmcalCorrectionComponent::~AliEmcalCorrectionComponent ( )
virtual

Destructor

Definition at line 106 of file AliEmcalCorrectionComponent.cxx.

AliEmcalCorrectionComponent::AliEmcalCorrectionComponent ( const AliEmcalCorrectionComponent )
private

Member Function Documentation

void AliEmcalCorrectionComponent::ExecOnce ( )
virtual

Execute once for the first event to initialize the analysis. Similar to ExecOnce() in AliAnalysisTaskEmcal

Definition at line 145 of file AliEmcalCorrectionComponent.cxx.

void AliEmcalCorrectionComponent::FillCellQA ( TH1F *  h)
AliVCaloCells* AliEmcalCorrectionComponent::GetCaloCells ( )
inline
AliClusterContainer* AliEmcalCorrectionComponent::GetClusterContainer ( )
inline

Definition at line 62 of file AliEmcalCorrectionComponent.h.

void AliEmcalCorrectionComponent::GetEtaPhiDiff ( const AliVTrack *  t,
const AliVCluster *  v,
Double_t phidiff,
Double_t etadiff 
)

Calculate \(\phi\) and \(\eta\) difference between a track (t) and a cluster (c). The position of the track is obtained on the EMCAL surface

Parameters
[in]tTrack to check
[in]vCluster to check
[out]phidiffDistance in \(\phi\) between cluster and track
[out]etadiffDistance in \(\eta\) between cluster and track

Definition at line 184 of file AliEmcalCorrectionComponent.cxx.

Referenced by AliEmcalCorrectionClusterHadronicCorrection::ApplyHadCorrOneTrack(), AliEmcalCorrectionClusterHadronicCorrection::DoMatchedTracksLoop(), AliEmcalCorrectionClusterTrackMatcher::DoMatching(), and AliEmcalCorrectionClusterTrackMatcher::UpdateClusters().

TList* AliEmcalCorrectionComponent::GetOutputList ( )
inline

Definition at line 65 of file AliEmcalCorrectionComponent.h.

AliParticleContainer* AliEmcalCorrectionComponent::GetParticleContainer ( )
inline

Definition at line 63 of file AliEmcalCorrectionComponent.h.

void AliEmcalCorrectionComponent::GetPass ( )

Get pass from filename. Sets pass in fFilepass.

Definition at line 256 of file AliEmcalCorrectionComponent.cxx.

Referenced by Run().

template<typename T >
bool AliEmcalCorrectionComponent::GetProperty ( std::string  propertyName,
T property,
bool  requiredProperty = true,
std::string  correctionName = "" 
)

Retrieve property.

Get the requested property from the YAML configuration. This function is generally used by AliEmcalCorrectionComponent derived tasks as a wrapper around the more complicated functions to retrieve properties.

Parameters
[in]propertyNameName of the property to retrieve
[out]propertyContainers the retrieved property
[in]requiredPropertyTrue if the property is required
[in]correctionNameName of the correction from where the property should be retrieved
Returns
True if the property was set successfully

Definition at line 155 of file AliEmcalCorrectionComponent.h.

Referenced by AliEmcalCorrectionTask::AddContainer(), AliEmcalCorrectionTask::AddContainersToComponent(), AliEmcalCorrectionTask::CreateInputObjects(), AliEmcalCorrectionTask::DetermineComponentsToExecute(), AliEmcalCorrectionTask::GetNodeForInputObjects(), AliEmcalCorrectionTask::GetPropertyNamesFromNode(), AliEmcalCorrectionCellBadChannel::Initialize(), AliEmcalCorrectionCellEnergy::Initialize(), AliEmcalCorrectionCellTimeCalib::Initialize(), AliEmcalCorrectionClusterExotics::Initialize(), AliEmcalCorrectionClusterHadronicCorrection::Initialize(), Initialize(), AliEmcalCorrectionClusterNonLinearity::Initialize(), AliEmcalCorrectionClusterizer::Initialize(), AliEmcalCorrectionClusterTrackMatcher::Initialize(), AliEmcalCorrectionTask::SetupCellsInfo(), and AliEmcalCorrectionTask::SetupContainer().

template<typename T >
bool AliEmcalCorrectionComponent::GetProperty ( std::string  propertyName,
T property,
const YAML::Node &  userConfiguration,
const YAML::Node &  defaultConfiguration,
bool  requiredProperty = true,
std::string  correctionName = "" 
)
static

Retrieve property driver function. It is static so that it can be used by other classes.

General function to get a property from a set of YAML configuration files. It first calls checks the user configuration, and then if the property is not found, it then checks the default configuration. If the property is required but it is not found, a fatal error is thrown.

Parameters
[in]propertyNameName of the property to retrieve
[out]propertyContains the retrieved property
[in]userConfigurationYAML user configuration node
[in]defaultConfigurationYAML default configuration node
[in]requiredPropertyTrue if the property is required
[in]correctionNameName of the correction from where the property should be retrieved
Returns
True if the property was set successfully

Definition at line 182 of file AliEmcalCorrectionComponent.h.

template<typename T >
bool AliEmcalCorrectionComponent::GetPropertyFromNode ( const YAML::Node &  node,
std::string  propertyName,
T property 
)
staticprotected

Utility function to retrieve the property from a already selected YAML node.

Parameters
[in]nodeYAML node from which the property should be retrieved
[in]propertyNameName of the property to retrieve
[out]propertyContains the retrieved property

Definition at line 421 of file AliEmcalCorrectionComponent.h.

Referenced by GetPropertyFromNodes().

template<typename T >
bool AliEmcalCorrectionComponent::GetPropertyFromNodes ( const YAML::Node &  node,
const YAML::Node &  sharedParametersNode,
std::string  propertyName,
T property,
const std::string  correctionName,
const std::string  configurationType,
int  nodesDeep = 0 
)
staticprotected

Actually handles retrieving parameters from YAML nodes.

The retrieval procedure is as follows:

  • Check if the property is defined in the base of the node
  • If the property is found:
    • Check whether it requests a shared parameter
      • If so, attempt to retrieve the property from the shared parameter.
    • If not, attempt to retrieve the parameter from the correction name
    • In either case, through a warning (or fatal if requested) if it is not found
  • If not found, attempt to find a node named by the correction name:
    • If it exists, recurse in this function. It will not go more than two levels deep!
    • If it does not exist, attempt to find a substring name by removing all characters after the first "_"
      • Recurse if found
Parameters
[in]nodeMain YAML node containing the properties
[in]sharedParametersNodeYAML node containing the shared parameters
[in]propertyNameName of the property to retrieve
[out]propertyContains the retrieved property
[in]correctionNameName of the correction from where the property should be retrieved
[in]configurationTypeName of the configuration type. Either "user" or "default"
[in]nodesDeepKeeps track of how many nodes deep we have recursed. Optional parameter that the user does not need to set.
Returns
True if the property was set successfully

Definition at line 251 of file AliEmcalCorrectionComponent.h.

Referenced by GetProperty().

bool AliEmcalCorrectionComponent::IsSharedValue ( std::string &  value)
static

Check if value is a shared parameter, meaning we should look at another node. Also edits the input string to remove "sharedParameters:" if it exists, making it ready for use.

Parameters
[in]valueString containing the string value return by the parameter.
Returns
True if the value is shared.

Definition at line 239 of file AliEmcalCorrectionComponent.cxx.

Referenced by GetPropertyFromNodes().

AliEmcalCorrectionComponent& AliEmcalCorrectionComponent::operator= ( const AliEmcalCorrectionComponent )
private
template<typename T >
std::enable_if<!std::is_arithmetic< T >::value &&!std::is_same< T, std::string >::value &&!std::is_same< T, bool >::value >::type AliEmcalCorrectionComponent::PrintRetrievedPropertyValue ( T property,
std::stringstream &  tempMessage 
)
staticprotected

Handles all other cases where the property cannot be printed.

NOTE: This function retunrs void! See: https://stackoverflow.com/a/29044828

Parameters
[in]propertyProperty to be printed
[in,out]tempMessageStringstream into which the property should be streamed

Definition at line 407 of file AliEmcalCorrectionComponent.h.

Referenced by GetPropertyFromNodes().

template<typename T >
std::enable_if< std::is_arithmetic< T >::value||std::is_same< T, std::string >::value||std::is_same< T, bool >::value >::type AliEmcalCorrectionComponent::PrintRetrievedPropertyValue ( T property,
std::stringstream &  tempMessage 
)
staticprotected

Prints the retrieved property value if the type is easily printable. This function handles arithmetic values, strings, and bools. Further types could be handled by other functions that are selectively enabled by std::enable_if<>.

NOTE: This function retunrs void! See: https://stackoverflow.com/a/29044828

Parameters
[in]propertyProperty to be printed
[in,out]tempMessageStringstream into which the property should be streamed

Definition at line 391 of file AliEmcalCorrectionComponent.h.

Bool_t AliEmcalCorrectionComponent::RunChanged ( )
void AliEmcalCorrectionComponent::SetCaloCells ( AliVCaloCells *  cells)
inline
void AliEmcalCorrectionComponent::SetCentrality ( Double_t  cent)
inline

Definition at line 77 of file AliEmcalCorrectionComponent.h.

void AliEmcalCorrectionComponent::SetCentralityBin ( Int_t  bin)
inline

Definition at line 76 of file AliEmcalCorrectionComponent.h.

void AliEmcalCorrectionComponent::SetClusterContainer ( AliClusterContainer cont)
inline
void AliEmcalCorrectionComponent::SetDefaultConfiguration ( YAML::Node &  node)
inline
void AliEmcalCorrectionComponent::SetEMCALGeometry ( AliEMCALGeometry *  geometry)
inline

Definition at line 75 of file AliEmcalCorrectionComponent.h.

void AliEmcalCorrectionComponent::SetEvent ( AliVEvent *  event)
inline

Definition at line 72 of file AliEmcalCorrectionComponent.h.

void AliEmcalCorrectionComponent::SetIsESD ( Bool_t  isESD)
inline
void AliEmcalCorrectionComponent::SetMCEvent ( AliMCEvent *  mcevent)
inline

Definition at line 73 of file AliEmcalCorrectionComponent.h.

void AliEmcalCorrectionComponent::SetNcentralityBins ( Int_t  n)
inline

Definition at line 78 of file AliEmcalCorrectionComponent.h.

void AliEmcalCorrectionComponent::SetParticleContainer ( AliParticleContainer cont)
inline
void AliEmcalCorrectionComponent::SetRecoUtils ( AliEMCALRecoUtils *  ru)
inline

Definition at line 70 of file AliEmcalCorrectionComponent.h.

void AliEmcalCorrectionComponent::SetUserConfiguration ( YAML::Node &  node)
inline

Make copy to ensure that the nodes do not point to each other (?)

Definition at line 83 of file AliEmcalCorrectionComponent.h.

Referenced by AliEmcalCorrectionTask::InitializeComponents().

void AliEmcalCorrectionComponent::UpdateCells ( )

Remove bad cells from the cell list Recalibrate energy and time cells

Definition at line 207 of file AliEmcalCorrectionComponent.cxx.

Referenced by AliEmcalCorrectionCellBadChannel::Run(), AliEmcalCorrectionCellTimeCalib::Run(), and AliEmcalCorrectionCellEnergy::Run().

Bool_t AliEmcalCorrectionComponent::UserNotify ( )
virtual

Notifying the user that the input data file has changed and performing steps needed to be done.

Definition at line 170 of file AliEmcalCorrectionComponent.cxx.

Member Data Documentation

Bool_t AliEmcalCorrectionComponent::fCreateHisto
protected
YAML::Node AliEmcalCorrectionComponent::fDefaultConfiguration
protected

User YAML configuration.

Definition at line 104 of file AliEmcalCorrectionComponent.h.

Referenced by GetProperty(), and SetDefaultConfiguration().

Bool_t AliEmcalCorrectionComponent::fGetPassFromFileName
protected

Get fFilepass from file name.

Definition at line 110 of file AliEmcalCorrectionComponent.h.

Referenced by Initialize(), and Run().

Bool_t AliEmcalCorrectionComponent::fIsEmbedded
protected
Double_t AliEmcalCorrectionComponent::fMaxBinPt
protected

Max pt in histograms.

Definition at line 119 of file AliEmcalCorrectionComponent.h.

Referenced by AliEmcalCorrectionClusterHadronicCorrection::UserCreateOutputObjects().

AliMCEvent* AliEmcalCorrectionComponent::fMCEvent
protected
Double_t AliEmcalCorrectionComponent::fMinBinPt
protected

Min pt in histograms.

Definition at line 118 of file AliEmcalCorrectionComponent.h.

Referenced by AliEmcalCorrectionClusterHadronicCorrection::UserCreateOutputObjects().

Int_t AliEmcalCorrectionComponent::fMinMCLabel
protected

Minimum MC label value for the tracks/clusters being considered MC particles.

Definition at line 123 of file AliEmcalCorrectionComponent.h.

Referenced by AliEmcalCorrectionClusterHadronicCorrection::DoMatchedTracksLoop().

Int_t AliEmcalCorrectionComponent::fNbins
protected
YAML::Node AliEmcalCorrectionComponent::fUserConfiguration
protected

Definition at line 103 of file AliEmcalCorrectionComponent.h.

Referenced by GetProperty().

Double_t AliEmcalCorrectionComponent::fVertex[3]
protected

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