| The Gaudi Framework v28r2p1 (f1a77ff4)

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

147 {
148 return cmp ? &( cmp -> counter ( name ) ) : nullptr; // RETURN
149 }
plotSpeedupsPyRoot.counter
int counter
Definition: plotSpeedupsPyRoot.py:141

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

Definition at line 162 of file AlgDecorators.cpp.

163 {
164 return cmp ? _counter_a_ ( dynamic_cast<const GaudiAlgorithm*>( cmp ) , name )
165 : nullptr;
166 }
GaudiPython::AlgDecorator::_counter_a_
static const StatEntity * _counter_a_(const GaudiAlgorithm *alg, const std::string &name)
Definition: AlgDecorators.cpp:146

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

Definition at line 154 of file AlgDecorators.cpp.

155 {
156 return cmp ? &( cmp -> counter ( name ) ) : nullptr; // RETURN
157 }
plotSpeedupsPyRoot.counter
int counter
Definition: plotSpeedupsPyRoot.py:141

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

Definition at line 171 of file AlgDecorators.cpp.

172 {
173 return cmp ? _counter_t_ ( dynamic_cast<const GaudiTool*>( cmp ) , name )
174 : nullptr;
175 }
GaudiPython::AlgDecorator::_counter_t_
static const StatEntity * _counter_t_(const GaudiTool *alg, const std::string &name)
Definition: AlgDecorators.cpp:154

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

Definition at line 82 of file AlgDecorators.cpp.

85 {
86 names.clear () ;
87 out.clear () ;
88 if ( !alg ) { return 0 ; } // RETURN
89 //
90 for ( const auto& cnt : alg->counters() )
91 {
92 names.push_back ( cnt.first ) ;
93 out .push_back ( &cnt.second ) ;
94 }
95 return out.size() ;
96 }
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 120 of file AlgDecorators.cpp.

123 {
124 names.clear () ;
125 out.clear () ;
126 return alg ? _counters_a_ ( dynamic_cast<const GaudiAlgorithm*>( alg ) , names , out )
127 : 0;
128 }
GaudiPython::AlgDecorator::_counters_a_
static size_t _counters_a_(const GaudiAlgorithm *alg, std::vector< std::string > &names, Counters &out)
Definition: AlgDecorators.cpp:82
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 101 of file AlgDecorators.cpp.

104 {
105 names.clear () ;
106 out.clear () ;
107 if ( !alg ) { return 0 ; } // RETURN
108 //
109 for ( const auto& cnt : alg->counters() )
110 {
111 names.push_back ( cnt.first ) ;
112 out .push_back ( &cnt.second ) ;
113 }
114 return out.size() ;
115 }
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 133 of file AlgDecorators.cpp.

136 {
137 names.clear () ;
138 out.clear () ;
139 return alg ? _counters_t_ ( dynamic_cast<const GaudiTool*>( alg ) , names , out )
140 : 0;
141 }
GaudiPython::AlgDecorator::_counters_t_
static size_t _counters_t_(const GaudiTool *alg, std::vector< std::string > &names, Counters &out)
Definition: AlgDecorators.cpp:101
std::vector::clear
T clear(T...args)

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

Definition at line 180 of file AlgDecorators.cpp.

181 {
182 tools.clear() ;
183 if ( cmp ) tools = cmp->tools() ;
184 return tools.size() ; // RETURN
185 }
std::vector::size
T size(T...args)
Algorithm::tools
const std::vector< IAlgTool * > & tools() const
Definition: Algorithm.cpp:901

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

Definition at line 200 of file AlgDecorators.cpp.

201 {
202 tools.clear() ;
203 return cmp ? _tools_a_ ( dynamic_cast<const GaudiAlgorithm*> ( cmp ) , tools )
204 : 0;
205 }
GaudiPython::AlgDecorator::_tools_a_
static size_t _tools_a_(const GaudiAlgorithm *, Tools &tools)
Definition: AlgDecorators.cpp:180

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

Definition at line 190 of file AlgDecorators.cpp.

191 {
192 tools.clear() ;
193 if ( cmp ) tools = cmp->tools() ;
194 return tools.size() ; // RETURN
195 }
AlgTool::tools
const std::vector< IAlgTool * > & tools() const
Definition: AlgTool.cpp:457
std::vector::size
T size(T...args)

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

Definition at line 210 of file AlgDecorators.cpp.

211 {
212 tools.clear() ;
213 return cmp ? _tools_t_ ( dynamic_cast<const GaudiTool*> ( cmp ) , tools ) : 0;
214 }
GaudiPython::AlgDecorator::_tools_t_
static size_t _tools_t_(const GaudiTool *, Tools &tools)
Definition: AlgDecorators.cpp:190

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

227 {
228 return alg ? alg->exist<DataObject> ( alg->evtSvc() , location , useRootInTes )
229 : false;
230 }
GaudiPython.HistoUtils.location
location
Definition: HistoUtils.py:774
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:276
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30

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

243 {
244 return alg ? alg->get<DataObject> ( alg->evtSvc() , location , useRootInTes )
245 : nullptr;
246 }
GaudiPython.HistoUtils.location
location
Definition: HistoUtils.py:774
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:276
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30

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

75 {
76 return alg ? alg -> svc<IInterface> ( name , create ) : nullptr;
77 }
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:28

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

43 {
44 return alg ? alg -> tool<IAlgTool> ( type , name , parent , create ) : nullptr;
45 }
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:28
gaudirun.type
type
Definition: gaudirun.py:125

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.

60 {
61 return alg ? alg->tool<IAlgTool>( typeAndName , parent , create ) : nullptr;
62 }
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:129

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

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