| The Gaudi Framework v29r1 (5cd95fa2)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

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

`#include <GaudiPython/AlgDecorators.h>`

## Public Types
typedef std::vector< const StatEntity * > | 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 const StatEntity * | _counter_a_ (const GaudiAlgorithm *alg, const std::string &name)
static const StatEntity * | _counter_t_ (const GaudiTool *alg, const std::string &name)
static const StatEntity * | _counter_a_ (const IAlgorithm *alg, const std::string &name)
static const 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 46 of file AlgDecorators.h.

## Member Typedef Documentation

typedef std::vector<const StatEntity*> GaudiPython::AlgDecorator::Counters

the actual type of vector of counters

Definition at line 51 of file AlgDecorators.h.

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

Definition at line 53 of file AlgDecorators.h.

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

Definition at line 52 of file AlgDecorators.h.

## Member Function Documentation

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

Definition at line 127 of file AlgDecorators.cpp.

128 {
129 return cmp ? &( cmp->counter( name ) ) : nullptr; // RETURN
130 }

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

Definition at line 141 of file AlgDecorators.cpp.

142 {
143 return cmp ? _counter_a_( dynamic_cast<const GaudiAlgorithm*>( cmp ), name ) : nullptr;
144 }
GaudiPython::AlgDecorator::_counter_a_
static const StatEntity * _counter_a_(const GaudiAlgorithm *alg, const std::string &name)
Definition: AlgDecorators.cpp:127

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

Definition at line 134 of file AlgDecorators.cpp.

135 {
136 return cmp ? &( cmp->counter( name ) ) : nullptr; // RETURN
137 }

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

Definition at line 148 of file AlgDecorators.cpp.

149 {
150 return cmp ? _counter_t_( dynamic_cast<const GaudiTool*>( cmp ), name ) : nullptr;
151 }
GaudiPython::AlgDecorator::_counter_t_
static const StatEntity * _counter_t_(const GaudiTool *alg, const std::string &name)
Definition: AlgDecorators.cpp:134

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

Definition at line 71 of file AlgDecorators.cpp.

73 {
74 names.clear();
75 out.clear();
76 if ( !alg ) {
77 return 0;
78 } // RETURN
79 //
80 for ( const auto& cnt : alg->counters() ) {
81 names.push_back( cnt.first );
82 out.push_back( &cnt.second );
83 }
84 return out.size();
85 }
GaudiCommon::counters
const Statistics & counters() const
accessor to all counters
Definition: GaudiCommon.h:465
std::vector::push_back
T push_back(T...args)
std::vector::clear
T clear(T...args)

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

Definition at line 107 of file AlgDecorators.cpp.

109 {
110 names.clear();
111 out.clear();
112 return alg ? _counters_a_( dynamic_cast<const GaudiAlgorithm*>( alg ), names, out ) : 0;
113 }
GaudiPython::AlgDecorator::_counters_a_
static size_t _counters_a_(const GaudiAlgorithm *alg, std::vector< std::string > &names, Counters &out)
Definition: AlgDecorators.cpp:71
std::vector::clear
T clear(T...args)

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

Definition at line 89 of file AlgDecorators.cpp.

91 {
92 names.clear();
93 out.clear();
94 if ( !alg ) {
95 return 0;
96 } // RETURN
97 //
98 for ( const auto& cnt : alg->counters() ) {
99 names.push_back( cnt.first );
100 out.push_back( &cnt.second );
101 }
102 return out.size();
103 }
GaudiCommon::counters
const Statistics & counters() const
accessor to all counters
Definition: GaudiCommon.h:465
std::vector::push_back
T push_back(T...args)
std::vector::clear
T clear(T...args)

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

Definition at line 117 of file AlgDecorators.cpp.

119 {
120 names.clear();
121 out.clear();
122 return alg ? _counters_t_( dynamic_cast<const GaudiTool*>( alg ), names, out ) : 0;
123 }
GaudiPython::AlgDecorator::_counters_t_
static size_t _counters_t_(const GaudiTool *alg, std::vector< std::string > &names, Counters &out)
Definition: AlgDecorators.cpp:89
std::vector::clear
T clear(T...args)

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

Definition at line 155 of file AlgDecorators.cpp.

156 {
157 tools.clear();
158 if ( cmp ) tools = cmp->tools();
159 return tools.size(); // RETURN
160 }
std::vector::size
T size(T...args)
Algorithm::tools
const std::vector< IAlgTool * > & tools() const
Definition: Algorithm.cpp:922

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

Definition at line 173 of file AlgDecorators.cpp.

174 {
175 tools.clear();
176 return cmp ? _tools_a_( dynamic_cast<const GaudiAlgorithm*>( cmp ), tools ) : 0;
177 }
GaudiPython::AlgDecorator::_tools_a_
static size_t _tools_a_(const GaudiAlgorithm *, Tools &tools)
Definition: AlgDecorators.cpp:155

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

Definition at line 164 of file AlgDecorators.cpp.

165 {
166 tools.clear();
167 if ( cmp ) tools = cmp->tools();
168 return tools.size(); // RETURN
169 }
AlgTool::tools
const std::vector< IAlgTool * > & tools() const
Definition: AlgTool.cpp:473
std::vector::size
T size(T...args)

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

Definition at line 181 of file AlgDecorators.cpp.

182 {
183 tools.clear();
184 return cmp ? _tools_t_( dynamic_cast<const GaudiTool*>( cmp ), tools ) : 0;
185 }
GaudiPython::AlgDecorator::_tools_t_
static size_t _tools_t_(const GaudiTool *, Tools &tools)
Definition: AlgDecorators.cpp:164

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 194 of file AlgDecorators.cpp.

195 {
196 return alg ? alg->exist<DataObject>( alg->evtSvc(), location, useRootInTes ) : false;
197 }
GaudiPython.HistoUtils.location
location
Definition: HistoUtils.py:899
GaudiAlgorithm::exist
bool exist(IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const
Check the existence of a data object or container in the Gaudi Transient Event Store.
Definition: GaudiAlgorithm.h:488
Algorithm::evtSvc
SmartIF< IDataProviderSvc > & evtSvc() const
shortcut for method eventSvc
Definition: Algorithm.h:282
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:29

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 206 of file AlgDecorators.cpp.

208 {
209 return alg ? alg->get<DataObject>( alg->evtSvc(), location, useRootInTes ) : nullptr;
210 }
GaudiPython.HistoUtils.location
location
Definition: HistoUtils.py:899
GaudiAlgorithm::get
Gaudi::Utils::GetData< TYPE >::return_type get(IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const
Templated access to the data in Gaudi Transient Store.
Definition: GaudiAlgorithm.h:240
Algorithm::evtSvc
SmartIF< IDataProviderSvc > & evtSvc() const
shortcut for method eventSvc
Definition: Algorithm.h:282
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:29

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 64 of file AlgDecorators.cpp.

65 {
66 return alg ? alg->svc<IInterface>( name, create ) : nullptr;
67 }
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:32
IInterface
Definition of the basic interface.
Definition: IInterface.h:277
GaudiCommon::svc
SmartIF< SERVICE > svc(const std::string &name, const bool create=true) const
A useful method for the easy location of services.
Definition: GaudiCommonImp.h:158

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 37 of file AlgDecorators.cpp.

39 {
40 return alg ? alg->tool<IAlgTool>( type, name, parent, create ) : nullptr;
41 }
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:32
gaudirun.type
type
Definition: gaudirun.py:133
IAlgTool
The interface implemented by the AlgTool base class.
Definition: IAlgTool.h:23
GaudiCommon::tool
TOOL * tool(const std::string &type, const std::string &name, const IInterface *parent=0, bool create=true) const
Useful method for the easy location of tools.
Definition: GaudiCommonImp.h:108

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 51 of file AlgDecorators.cpp.

53 {
54 return alg ? alg->tool<IAlgTool>( typeAndName, parent, create ) : nullptr;
55 }
IAlgTool
The interface implemented by the AlgTool base class.
Definition: IAlgTool.h:23
GaudiCommon::tool
TOOL * tool(const std::string &type, const std::string &name, const IInterface *parent=0, bool create=true) const
Useful method for the easy location of tools.
Definition: GaudiCommonImp.h:108

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

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