![]() |
AliPhysics
7b9e818 (7b9e818)
|
Factory for correction components in the EMCal correction framework. More...
#include <AliEmcalCorrectionComponent.h>
Public Types | |
typedef std::map< std::string, AliEmcalCorrectionComponent *(*)()> | map_type |
Public Member Functions | |
virtual | ~AliEmcalCorrectionComponentFactory () |
Static Public Member Functions | |
static AliEmcalCorrectionComponent * | createInstance (std::string const &s) |
Creates an instance of an object based on the name if the name is registered in the map. More... | |
Static Protected Member Functions | |
static map_type * | getMap () |
Creates and access the component map. More... | |
Static Private Attributes | |
static map_type * | componentMap = new AliEmcalCorrectionComponentFactory::map_type |
Contains the map to all of the components. More... | |
Factory for correction components in the EMCal correction framework.
This class maintains a map between the name of the correction component and a function to create the component. This map can be then be used to create each desired component by passing the name in a string. The benefit of this approach is new components can be automatically registered without changing any of the correction classes. Only the YAML configuration needs to be changed!
The class and associated functions are based on: https://stackoverflow.com/a/582456 , and edited for our purposes.
Definition at line 455 of file AliEmcalCorrectionComponent.h.
typedef std::map<std::string, AliEmcalCorrectionComponent*(*)()> AliEmcalCorrectionComponentFactory::map_type |
Definition at line 460 of file AliEmcalCorrectionComponent.h.
|
inlinevirtual |
Definition at line 458 of file AliEmcalCorrectionComponent.h.
|
inlinestatic |
Creates an instance of an object based on the name if the name is registered in the map.
Definition at line 463 of file AliEmcalCorrectionComponent.h.
Referenced by AliEmcalCorrectionTask::InitializeComponents().
|
inlinestaticprotected |
Creates and access the component map.
Definition at line 474 of file AliEmcalCorrectionComponent.h.
Referenced by createInstance(), and RegisterCorrectionComponent< AliEmcalCorrectionClusterNonLinearity >::RegisterCorrectionComponent().
|
staticprivate |
Contains the map to all of the components.
Definition at line 483 of file AliEmcalCorrectionComponent.h.
Referenced by getMap().