AliPhysics  4e47bdd (4e47bdd)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliEmcalCorrectionComponentFactory Class Reference

Factory for correction components in the EMCal correction framework. More...

#include <AliEmcalCorrectionComponent.h>

Inheritance diagram for AliEmcalCorrectionComponentFactory:

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_typegetMap ()
 Creates and access the component map. More...
 

Static Private Attributes

static map_typecomponentMap = new AliEmcalCorrectionComponentFactory::map_type
 Contains the map to all of the components. More...
 

Detailed Description

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.

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 474 of file AliEmcalCorrectionComponent.h.

Member Typedef Documentation

Definition at line 479 of file AliEmcalCorrectionComponent.h.

Constructor & Destructor Documentation

virtual AliEmcalCorrectionComponentFactory::~AliEmcalCorrectionComponentFactory ( )
inlinevirtual

Definition at line 477 of file AliEmcalCorrectionComponent.h.

Member Function Documentation

static AliEmcalCorrectionComponent* AliEmcalCorrectionComponentFactory::createInstance ( std::string const &  s)
inlinestatic

Creates an instance of an object based on the name if the name is registered in the map.

Definition at line 482 of file AliEmcalCorrectionComponent.h.

Referenced by AliEmcalCorrectionTask::InitializeComponents().

static map_type* AliEmcalCorrectionComponentFactory::getMap ( )
inlinestaticprotected

Member Data Documentation

AliEmcalCorrectionComponentFactory::map_type * AliEmcalCorrectionComponentFactory::componentMap = new AliEmcalCorrectionComponentFactory::map_type
staticprivate

Contains the map to all of the components.

Definition at line 502 of file AliEmcalCorrectionComponent.h.

Referenced by getMap().


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