AliPhysics  96866e8 (96866e8)
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 AliEmcalCorrectionComponentcreateInstance (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 192 of file AliEmcalCorrectionComponent.h.

Member Typedef Documentation

Definition at line 197 of file AliEmcalCorrectionComponent.h.

Constructor & Destructor Documentation

virtual AliEmcalCorrectionComponentFactory::~AliEmcalCorrectionComponentFactory ( )
inlinevirtual

Definition at line 195 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 200 of file AliEmcalCorrectionComponent.h.

Referenced by AliEmcalCorrectionTask::InitializeComponents().

static map_type* AliEmcalCorrectionComponentFactory::getMap ( )
inlinestaticprotected

Creates and access the component map.

Definition at line 211 of file AliEmcalCorrectionComponent.h.

Member Data Documentation

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

Contains the map to all of the components.

Definition at line 220 of file AliEmcalCorrectionComponent.h.


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