ATLAS Offline Software
Loading...
Searching...
No Matches
IDTPM2::AnalysisR4 Class Reference

#include <AnalysisR4.h>

Collaboration diagram for IDTPM2::AnalysisR4:

Public Member Functions

 AnalysisR4 (const std::string &name)
virtual void initialise ()
virtual void execute (TrackAnalysisStore &collections) const
virtual void finalize ()
const std::string & name () const
void set_monTool (ToolHandle< GenericMonitoringTool > *m)
ToolHandle< GenericMonitoringTool > * monTool ()
void addFillTool (const std::string &toolname)
 add a fill tool = this is called from the parent class, otherwise there are no fill tools booked

Protected Types

using FactoryFn = std::unique_ptr<IPlotBase>(*)( const std::string&, ToolHandle<GenericMonitoringTool>* )
 factory stuff ..

Protected Member Functions

std::unique_ptr< IPlotBase > create (const std::string &key)
 factory stuff ..
void registerCreator (const std::string &key, FactoryFn builder)
 do we want this to be public ??

Protected Attributes

std::map< std::string, FactoryFn > m_factory
 initialise the factory in the constructor, so the header does not need to be modified to add a tool Also some factory helper function should be added so that tools can be added to the factory on the fly, without needing to recompile the code

Private Attributes

std::string m_name
ToolHandle< GenericMonitoringTool > * m_monTool
 the parent montool
std::vector< std::unique_ptr< IPlotBase > > m_tools
 the tool children

Detailed Description

Definition at line 33 of file AnalysisR4.h.

Member Typedef Documentation

◆ FactoryFn

using IDTPM2::AnalysisR4::FactoryFn = std::unique_ptr<IPlotBase>(*)( const std::string&, ToolHandle<GenericMonitoringTool>* )
protected

factory stuff ..

Definition at line 70 of file AnalysisR4.h.

Constructor & Destructor Documentation

◆ AnalysisR4()

IDTPM2::AnalysisR4::AnalysisR4 ( const std::string & name)

register the different plotters ...

Definition at line 31 of file AnalysisR4.cxx.

32 : m_name(name), m_monTool(0)
33{
42}
ToolHandle< GenericMonitoringTool > * m_monTool
the parent montool
Definition AnalysisR4.h:91
void registerCreator(const std::string &key, FactoryFn builder)
do we want this to be public ??
Definition AnalysisR4.h:73
std::string m_name
Definition AnalysisR4.h:88
const std::string & name() const
Definition AnalysisR4.h:45
static std::unique_ptr< IPlotBase > create(const std::string &name, ToolHandle< GenericMonitoringTool > *m)
factory creation mathod
Definition IPlotBase.h:50

Member Function Documentation

◆ addFillTool()

void IDTPM2::AnalysisR4::addFillTool ( const std::string & toolname)
inline

add a fill tool = this is called from the parent class, otherwise there are no fill tools booked

Definition at line 53 of file AnalysisR4.h.

53{ m_tools.emplace_back( create( toolname ) ); }
std::vector< std::unique_ptr< IPlotBase > > m_tools
the tool children
Definition AnalysisR4.h:94
std::unique_ptr< IPlotBase > create(const std::string &key)
factory stuff ..
Definition AnalysisR4.h:59

◆ create()

std::unique_ptr< IPlotBase > IDTPM2::AnalysisR4::create ( const std::string & key)
inlineprotected

factory stuff ..

Definition at line 59 of file AnalysisR4.h.

59 {
60 std::map<std::string, FactoryFn>::const_iterator itr = m_factory.find(key);
61 if (itr == m_factory.end()) throw std::runtime_error("IPlotBase Factory: No class of type " + key );
62 return itr->second( key+"-"+name(), monTool() );
63 }
ToolHandle< GenericMonitoringTool > * monTool()
Definition AnalysisR4.h:49
std::map< std::string, FactoryFn > m_factory
initialise the factory in the constructor, so the header does not need to be modified to add a tool A...
Definition AnalysisR4.h:84

◆ execute()

void IDTPM2::AnalysisR4::execute ( TrackAnalysisStore & collections) const
virtual

Definition at line 67 of file AnalysisR4.cxx.

67 {
68 // if ( m_tools.empty() ) throw std::runtime_error( "AnalysisR4::execute() cowardly: won't run analysis with no output" );
69 for ( size_t i=m_tools.size() ; i-- ; ) m_tools[i]->execute( collections );
70}

◆ finalize()

void IDTPM2::AnalysisR4::finalize ( )
virtual

Definition at line 74 of file AnalysisR4.cxx.

74 {
75 for ( size_t i=m_tools.size() ; i-- ; ) m_tools[i]->finalize();
76}

◆ initialise()

void IDTPM2::AnalysisR4::initialise ( )
virtual

we have to tell the class which sets of plots it should create from the factory This can be done externally using the addFillTool() method, but any default tools that should always be enabled, should be created here, like this ...

all the tools are set from the TrackAnalysis by calling addFillTool()

Definition at line 46 of file AnalysisR4.cxx.

46 {
47
48 if ( !monTool() ) throw std::runtime_error( "AnalysisR4:initialize() monTool not found" );
49
55 // m_tools.emplace_back( create( "Tier0" ) );
56 // m_tools.emplace_back( create( "Resolutions" ) );
57 // m_tools.emplace_back( create( "Efficiencies" ) );
58 // ...
59
61 for ( size_t i=m_tools.size() ; i-- ; ) m_tools[i]->initialize();
62
63}

◆ monTool()

ToolHandle< GenericMonitoringTool > * IDTPM2::AnalysisR4::monTool ( )
inline

Definition at line 49 of file AnalysisR4.h.

49{ return m_monTool; }

◆ name()

const std::string & IDTPM2::AnalysisR4::name ( ) const
inline

Definition at line 45 of file AnalysisR4.h.

45{ return m_name; }

◆ registerCreator()

void IDTPM2::AnalysisR4::registerCreator ( const std::string & key,
FactoryFn builder )
inlineprotected

do we want this to be public ??

Definition at line 73 of file AnalysisR4.h.

73 {
74 m_factory.insert( std::map<std::string, FactoryFn>::value_type( key, builder ) );
75 }

◆ set_monTool()

void IDTPM2::AnalysisR4::set_monTool ( ToolHandle< GenericMonitoringTool > * m)
inline

Definition at line 47 of file AnalysisR4.h.

Member Data Documentation

◆ m_factory

std::map<std::string, FactoryFn> IDTPM2::AnalysisR4::m_factory
protected

initialise the factory in the constructor, so the header does not need to be modified to add a tool Also some factory helper function should be added so that tools can be added to the factory on the fly, without needing to recompile the code

Definition at line 84 of file AnalysisR4.h.

◆ m_monTool

ToolHandle<GenericMonitoringTool>* IDTPM2::AnalysisR4::m_monTool
private

the parent montool

Definition at line 91 of file AnalysisR4.h.

◆ m_name

std::string IDTPM2::AnalysisR4::m_name
private

Definition at line 88 of file AnalysisR4.h.

◆ m_tools

std::vector<std::unique_ptr<IPlotBase> > IDTPM2::AnalysisR4::m_tools
private

the tool children

Definition at line 94 of file AnalysisR4.h.


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