The Gaudi Framework  master (594c33fa)
GaudiPython::AlgDecorator Class Reference

simple class that allows to "decorate" the python algorithm with 'basic' functionality from class GaudiAlgorithm More...

#include </builds/gaudi/Gaudi/GaudiAlg/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 IAlgTooltool_ (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 IAlgTooltool_ (const GaudiAlgorithm *alg, const std::string &typeAndName, const IInterface *parent=0, const bool create=true)
 get the tool from GaudiAlgorithm More...
 
static IInterfacesvc_ (const GaudiAlgorithm *alg, const std::string &name, const bool create=false)
 get the service from GaudiAlgorithm More...
 
static DataObjectget_ (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

simple class that allows to "decorate" the python algorithm with 'basic' functionality from class GaudiAlgorithm

Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@l.nosp@m.app..nosp@m.in2p3.nosp@m..fr
Date
2007-08-03

Definition at line 40 of file AlgDecorators.h.

Member Typedef Documentation

◆ Counters

the actual type of vector of counters

Definition at line 44 of file AlgDecorators.h.

◆ Services

◆ Tools

Member Function Documentation

◆ _counter_a_() [1/2]

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

Definition at line 84 of file AlgDecorators.cpp.

84  {
85  return cmp ? &( cmp->counter( name ) ) : nullptr; // RETURN
86 }

◆ _counter_a_() [2/2]

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

Definition at line 96 of file AlgDecorators.cpp.

96  {
97  return cmp ? _counter_a_( dynamic_cast<const GaudiAlgorithm*>( cmp ), name ) : nullptr;
98 }

◆ _counter_t_() [1/2]

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

Definition at line 90 of file AlgDecorators.cpp.

90  {
91  return cmp ? &( cmp->counter( name ) ) : nullptr; // RETURN
92 }

◆ _counter_t_() [2/2]

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

Definition at line 102 of file AlgDecorators.cpp.

102  {
103  return cmp ? _counter_t_( dynamic_cast<const GaudiTool*>( cmp ), name ) : nullptr;
104 }

◆ _counters_a_() [1/2]

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

◆ _counters_a_() [2/2]

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

◆ _counters_t_() [1/2]

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

◆ _counters_t_() [2/2]

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

◆ _tools_a_() [1/2]

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

Definition at line 108 of file AlgDecorators.cpp.

108  {
109  tools.clear();
110  if ( cmp ) tools = cmp->tools();
111  return tools.size(); // RETURN
112 }

◆ _tools_a_() [2/2]

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

Definition at line 124 of file AlgDecorators.cpp.

124  {
125  tools.clear();
126  return cmp ? _tools_a_( dynamic_cast<const GaudiAlgorithm*>( cmp ), tools ) : 0;
127 }

◆ _tools_t_() [1/2]

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

Definition at line 116 of file AlgDecorators.cpp.

116  {
117  tools.clear();
118  if ( cmp ) tools = cmp->tools();
119  return tools.size(); // RETURN
120 }

◆ _tools_t_() [2/2]

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

Definition at line 131 of file AlgDecorators.cpp.

131  {
132  tools.clear();
133  return cmp ? _tools_t_( dynamic_cast<const GaudiTool*>( cmp ), tools ) : 0;
134 }

◆ exist()

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

get the data from TES

Parameters
algGaudiAlgorithm
locationdata location in TES
useRoonInTesflag to respect RootInTes
Returns
the data

Definition at line 143 of file AlgDecorators.cpp.

144  {
145  return alg ? alg->exist<DataObject>( alg->evtSvc(), location, useRootInTes ) : false;
146 }

◆ get_()

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

get the data from TES

Parameters
algGaudiAlgorithm
locationdata location in TES
useRoonInTesflag to respect RootInTes
Returns
the data

Definition at line 155 of file AlgDecorators.cpp.

156  {
157  return alg ? alg->get<DataObject>( alg->evtSvc(), location, useRootInTes ) : nullptr;
158 }

◆ svc_()

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

get the service from GaudiAlgorithm

Parameters
algGaudiAlgorithm
nameservice name
createflag to create
Returns
the tool

Definition at line 78 of file AlgDecorators.cpp.

78  {
79  return alg ? alg->svc<IInterface>( name, create ) : nullptr;
80 }

◆ 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
algGaudiAlgorithm
typetool type
nametool name
parenttool parent
createflag to create
Returns
the tool

Definition at line 53 of file AlgDecorators.cpp.

54  {
55  return alg ? alg->tool<IAlgTool>( type, name, parent, create ) : nullptr;
56 }

◆ 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
algGaudiAlgorithm
typeAndNametool type/name
parenttool parent
createflag to create
Returns
the tool

Definition at line 66 of file AlgDecorators.cpp.

67  {
68  return alg ? alg->tool<IAlgTool>( typeAndName, parent, create ) : nullptr;
69 }

The documentation for this class was generated from the following files:
GaudiPython::AlgDecorator::_tools_a_
static size_t _tools_a_(const GaudiAlgorithm *, Tools &tools)
Definition: AlgDecorators.cpp:108
IAlgTool
Definition: IAlgTool.h:33
GaudiAlg.HistoUtils.location
location
Definition: HistoUtils.py:964
std::vector::size
T size(T... args)
GaudiPython::AlgDecorator::_counter_t_
static StatEntity * _counter_t_(const GaudiTool *alg, const std::string &name)
Definition: AlgDecorators.cpp:90
ManySmallAlgs.alg
alg
Definition: ManySmallAlgs.py:81
GaudiAlgorithm
Definition: GaudiAlgorithm.h:104
GaudiPython::AlgDecorator::_counter_a_
static StatEntity * _counter_a_(const GaudiAlgorithm *alg, const std::string &name)
Definition: AlgDecorators.cpp:84
GaudiPython.Bindings.nullptr
nullptr
Definition: Bindings.py:87
Gaudi::Algorithm::tools
const std::vector< IAlgTool * > & tools() const
Definition: Algorithm.cpp:617
gaudirun.type
type
Definition: gaudirun.py:160
ConditionsStallTest.name
name
Definition: ConditionsStallTest.py:77
AlgTool::tools
const std::vector< IAlgTool * > & tools() const
Definition: AlgTool.cpp:399
IInterface
Definition: IInterface.h:237
DataObject
Definition: DataObject.h:36
GaudiTool
Definition: GaudiTool.h:110
GaudiPython::AlgDecorator::_tools_t_
static size_t _tools_t_(const GaudiTool *, Tools &tools)
Definition: AlgDecorators.cpp:116