| The Gaudi Framework v32r1 (f65d50dc)

Public Types | Static Public Member Functions | List of all members
GaudiPython::AlgDecorator Class Reference

`#include <GaudiPython/AlgDecorators.h>`

## Public Types
typedef std::vector< Gaudi::Accumulators::PrintableCounter * > | Counters
| the actual type of vector of counters More...
typedef std::vector< IAlgTool * > | Tools
typedef std::vector< IService * > | Services

## Static Public Member Functions
static IAlgTool * | tool_ (const GaudiAlgorithm *alg, const std::string &type, const std::string &name, const IInterface *parent=0, const bool create=true)
| get the tool from GaudiAlgorithm More...
static IAlgTool * | tool_ (const GaudiAlgorithm *alg, const std::string &typeAndName, const IInterface *parent=0, const bool create=true)
| get the tool from GaudiAlgorithm More...
static IInterface * | svc_ (const GaudiAlgorithm *alg, const std::string &name, const bool create=false)
| get the service from GaudiAlgorithm More...
static DataObject * | get_ (const GaudiAlgorithm *alg, const std::string &location, const bool useRootInTes)
| get the data from TES More...
static bool | exist (const GaudiAlgorithm *alg, const std::string &location, const bool useRootInTes)
| get the data from TES More...
static size_t | _counters_a_ (const GaudiAlgorithm *alg, std::vector< std::string > &names, Counters &out)
static size_t | _counters_t_ (const GaudiTool *alg, std::vector< std::string > &names, Counters &out)
static size_t | _counters_a_ (const IAlgorithm *alg, std::vector< std::string > &names, Counters &out)
static size_t | _counters_t_ (const IAlgTool *alg, std::vector< std::string > &names, Counters &out)
static StatEntity * | _counter_a_ (const GaudiAlgorithm *alg, const std::string &name)
static StatEntity * | _counter_t_ (const GaudiTool *alg, const std::string &name)
static StatEntity * | _counter_a_ (const IAlgorithm *alg, const std::string &name)
static StatEntity * | _counter_t_ (const IAlgTool *alg, const std::string &name)
static size_t | _tools_a_ (const GaudiAlgorithm *, Tools &tools)
static size_t | _tools_t_ (const GaudiTool *, Tools &tools)
static size_t | _tools_a_ (const IAlgorithm *, Tools &tools)
static size_t | _tools_t_ (const IAlgTool *, Tools &tools)

## Detailed Description

Definition at line 45 of file AlgDecorators.h.

## Member Typedef Documentation

## ◆ Counters

typedef std::vector<Gaudi::Accumulators::PrintableCounter*> GaudiPython::AlgDecorator::Counters

the actual type of vector of counters

Definition at line 49 of file AlgDecorators.h.

## ◆ Services

typedef std::vector<IService*> GaudiPython::AlgDecorator::Services

Definition at line 51 of file AlgDecorators.h.

## ◆ Tools

typedef std::vector<IAlgTool*> GaudiPython::AlgDecorator::Tools

Definition at line 50 of file AlgDecorators.h.

## Member Function Documentation

## ◆ _counter_a_() [1/2]

StatEntity * GaudiPython::AlgDecorator::_counter_a_ | ( | const GaudiAlgorithm * | alg,
|  | const std::string & | name
| ) |  |
| static

Definition at line 120 of file AlgDecorators.cpp.

120 {
121 return cmp ? &( cmp->counter( name ) ) : nullptr; // RETURN
122 }
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:41

## ◆ _counter_a_() [2/2]

StatEntity * GaudiPython::AlgDecorator::_counter_a_ | ( | const IAlgorithm * | alg,
|  | const std::string & | name
| ) |  |
| static

Definition at line 132 of file AlgDecorators.cpp.

132 {
133 return cmp ? _counter_a_( dynamic_cast<const GaudiAlgorithm*>( cmp ), name ) : nullptr;
134 }
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:41
GaudiPython::AlgDecorator::_counter_a_
static StatEntity * _counter_a_(const GaudiAlgorithm *alg, const std::string &name)
Definition: AlgDecorators.cpp:120

## ◆ _counter_t_() [1/2]

StatEntity * GaudiPython::AlgDecorator::_counter_t_ | ( | const GaudiTool * | alg,
|  | const std::string & | name
| ) |  |
| static

Definition at line 126 of file AlgDecorators.cpp.

126 {
127 return cmp ? &( cmp->counter( name ) ) : nullptr; // RETURN
128 }
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:41

## ◆ _counter_t_() [2/2]

StatEntity * GaudiPython::AlgDecorator::_counter_t_ | ( | const IAlgTool * | alg,
|  | const std::string & | name
| ) |  |
| static

Definition at line 138 of file AlgDecorators.cpp.

138 {
139 return cmp ? _counter_t_( dynamic_cast<const GaudiTool*>( cmp ), name ) : nullptr;
140 }
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:41
GaudiPython::AlgDecorator::_counter_t_
static StatEntity * _counter_t_(const GaudiTool *alg, const std::string &name)
Definition: AlgDecorators.cpp:126

## ◆ _counters_a_() [1/2]

size_t GaudiPython::AlgDecorator::_counters_a_ | ( | const GaudiAlgorithm * | alg,
|  | std::vector< std::string > & | names,
|  | Counters & | out
| ) |  |
| static

Definition at line 74 of file AlgDecorators.cpp.

75 {
76 names.clear();
77 out.clear();
78 if ( !alg ) return 0;
79 alg->forEachCounter( [&]( const std::string& name, auto& counter ) {
80 names.push_back( name );
81 out.push_back( &counter );
82 } );
83 return out.size();
84 }
ManySmallAlgs.alg
alg
Definition: ManySmallAlgs.py:69
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:41
std::string
STL class.
std::vector::push_back
T push_back(T... args)
std::vector::clear
T clear(T... args)
plotSpeedupsPyRoot.counter
int counter
Definition: plotSpeedupsPyRoot.py:147

## ◆ _counters_a_() [2/2]

size_t GaudiPython::AlgDecorator::_counters_a_ | ( | const IAlgorithm * | alg,
|  | std::vector< std::string > & | names,
|  | Counters & | out
| ) |  |
| static

Definition at line 102 of file AlgDecorators.cpp.

103 {
104 names.clear();
105 out.clear();
106 return alg ? _counters_a_( dynamic_cast<const GaudiAlgorithm*>( alg ), names, out ) : 0;
107 }
GaudiPython::AlgDecorator::_counters_a_
static size_t _counters_a_(const GaudiAlgorithm *alg, std::vector< std::string > &names, Counters &out)
Definition: AlgDecorators.cpp:74
ManySmallAlgs.alg
alg
Definition: ManySmallAlgs.py:69
std::vector::clear
T clear(T... args)

## ◆ _counters_t_() [1/2]

size_t GaudiPython::AlgDecorator::_counters_t_ | ( | const GaudiTool * | alg,
|  | std::vector< std::string > & | names,
|  | Counters & | out
| ) |  |
| static

Definition at line 88 of file AlgDecorators.cpp.

89 {
90 names.clear();
91 out.clear();
92 if ( !alg ) return 0;
93 alg->forEachCounter( [&]( const std::string& name, auto& counter ) {
94 names.push_back( name );
95 out.push_back( &counter );
96 } );
97 return out.size();
98 }
ManySmallAlgs.alg
alg
Definition: ManySmallAlgs.py:69
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:41
std::string
STL class.
std::vector::push_back
T push_back(T... args)
std::vector::clear
T clear(T... args)
plotSpeedupsPyRoot.counter
int counter
Definition: plotSpeedupsPyRoot.py:147

## ◆ _counters_t_() [2/2]

size_t GaudiPython::AlgDecorator::_counters_t_ | ( | const IAlgTool * | alg,
|  | std::vector< std::string > & | names,
|  | Counters & | out
| ) |  |
| static

Definition at line 111 of file AlgDecorators.cpp.

112 {
113 names.clear();
114 out.clear();
115 return alg ? _counters_t_( dynamic_cast<const GaudiTool*>( alg ), names, out ) : 0;
116 }
ManySmallAlgs.alg
alg
Definition: ManySmallAlgs.py:69
GaudiPython::AlgDecorator::_counters_t_
static size_t _counters_t_(const GaudiTool *alg, std::vector< std::string > &names, Counters &out)
Definition: AlgDecorators.cpp:88
std::vector::clear
T clear(T... args)

## ◆ _tools_a_() [1/2]

size_t GaudiPython::AlgDecorator::_tools_a_ | ( | const GaudiAlgorithm * | cmp,
|  | Tools & | tools
| ) |  |
| static

Definition at line 144 of file AlgDecorators.cpp.

144 {
145 tools.clear();
146 if ( cmp ) tools = cmp->tools();
147 return tools.size(); // RETURN
148 }

## ◆ _tools_a_() [2/2]

size_t GaudiPython::AlgDecorator::_tools_a_ | ( | const IAlgorithm * | cmp,
|  | Tools & | tools
| ) |  |
| static

Definition at line 160 of file AlgDecorators.cpp.

160 {
161 tools.clear();
162 return cmp ? _tools_a_( dynamic_cast<const GaudiAlgorithm*>( cmp ), tools ) : 0;
163 }
GaudiPython::AlgDecorator::_tools_a_
static size_t _tools_a_(const GaudiAlgorithm *, Tools &tools)
Definition: AlgDecorators.cpp:144

## ◆ _tools_t_() [1/2]

size_t GaudiPython::AlgDecorator::_tools_t_ | ( | const GaudiTool * | cmp,
|  | Tools & | tools
| ) |  |
| static

Definition at line 152 of file AlgDecorators.cpp.

152 {
153 tools.clear();
154 if ( cmp ) tools = cmp->tools();
155 return tools.size(); // RETURN
156 }

## ◆ _tools_t_() [2/2]

size_t GaudiPython::AlgDecorator::_tools_t_ | ( | const IAlgTool * | cmp,
|  | Tools & | tools
| ) |  |
| static

Definition at line 167 of file AlgDecorators.cpp.

167 {
168 tools.clear();
169 return cmp ? _tools_t_( dynamic_cast<const GaudiTool*>( cmp ), tools ) : 0;
170 }
GaudiPython::AlgDecorator::_tools_t_
static size_t _tools_t_(const GaudiTool *, Tools &tools)
Definition: AlgDecorators.cpp:152

## ◆ exist()

bool GaudiPython::AlgDecorator::exist | ( | const GaudiAlgorithm * | alg,
|  | const std::string & | location,
|  | const bool | useRootInTes
| ) |  |
| static

get the data from TES

Parameters

  alg | GaudiAlgorithm
  location | data location in TES
  useRoonInTes | flag to respect RootInTes

Returns
  the data

Definition at line 179 of file AlgDecorators.cpp.

180 {
181 return alg ? alg->exist<DataObject>( alg->evtSvc(), location, useRootInTes ) : false;
182 }
ManySmallAlgs.alg
alg
Definition: ManySmallAlgs.py:69
GaudiPython.HistoUtils.location
location
Definition: HistoUtils.py:936
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30

## ◆ get_()

DataObject * GaudiPython::AlgDecorator::get_ | ( | const GaudiAlgorithm * | alg,
|  | const std::string & | location,
|  | const bool | useRootInTes
| ) |  |
| static

get the data from TES

Parameters

  alg | GaudiAlgorithm
  location | data location in TES
  useRoonInTes | flag to respect RootInTes

Returns
  the data

Definition at line 191 of file AlgDecorators.cpp.

192 {
193 return alg ? alg->get<DataObject>( alg->evtSvc(), location, useRootInTes ) : nullptr;
194 }
ManySmallAlgs.alg
alg
Definition: ManySmallAlgs.py:69
GaudiPython.HistoUtils.location
location
Definition: HistoUtils.py:936
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30

## ◆ svc_()

IInterface * GaudiPython::AlgDecorator::svc_ | ( | const GaudiAlgorithm * | alg,
|  | const std::string & | name,
|  | const bool | create = `false`
| ) |  |
| static

get the service from GaudiAlgorithm

Parameters

  alg | GaudiAlgorithm
  name | service name
  create | flag to create

Returns
  the tool

Definition at line 68 of file AlgDecorators.cpp.

68 {
69 return alg ? alg->svc<IInterface>( name, create ) : nullptr;
70 }
ManySmallAlgs.alg
alg
Definition: ManySmallAlgs.py:69
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:41
IInterface
Definition of the basic interface.
Definition: IInterface.h:244

## ◆ tool_() [1/2]

IAlgTool * GaudiPython::AlgDecorator::tool_ | ( | const GaudiAlgorithm * | alg,
|  | const std::string & | type,
|  | const std::string & | name,
|  | const IInterface * | parent = `0`,
|  | const bool | create = `true`
| ) |  |
| static

get the tool from GaudiAlgorithm

Parameters

  alg | GaudiAlgorithm
  type | tool type
  name | tool name
  parent | tool parent
  create | flag to create

Returns
  the tool

Definition at line 43 of file AlgDecorators.cpp.

44 {
45 return alg ? alg->tool<IAlgTool>( type, name, parent, create ) : nullptr;
46 }
ManySmallAlgs.alg
alg
Definition: ManySmallAlgs.py:69
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:41
gaudirun.type
type
Definition: gaudirun.py:142
IAlgTool
The interface implemented by the AlgTool base class.
Definition: IAlgTool.h:23

## ◆ tool_() [2/2]

IAlgTool * GaudiPython::AlgDecorator::tool_ | ( | const GaudiAlgorithm * | alg,
|  | const std::string & | typeAndName,
|  | const IInterface * | parent = `0`,
|  | const bool | create = `true`
| ) |  |
| static

get the tool from GaudiAlgorithm

Parameters

  alg | GaudiAlgorithm
  typeAndName | tool type/name
  parent | tool parent
  create | flag to create

Returns
  the tool

Definition at line 56 of file AlgDecorators.cpp.

57 {
58 return alg ? alg->tool<IAlgTool>( typeAndName, parent, create ) : nullptr;
59 }
ManySmallAlgs.alg
alg
Definition: ManySmallAlgs.py:69
IAlgTool
The interface implemented by the AlgTool base class.
Definition: IAlgTool.h:23

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

- GaudiPython/GaudiPython/AlgDecorators.h
- GaudiPython/src/Lib/AlgDecorators.cpp