| The Gaudi Framework v27r1

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

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

Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | Private Attributes | List of all members
AlgTool Class Reference

Base class from which all the concrete tool classes should be derived. More...

`#include <GaudiKernel/AlgTool.h>`

Inheritance diagram for AlgTool:
[legend]
Collaboration diagram for AlgTool:
[legend]

## Public Types
typedef Gaudi::PluginService::Factory< IAlgTool *, const std::string &, const std::string &, const IInterface * > | Factory
Public Types inherited from CommonMessaging< implements< IAlgTool, IDataHandleHolder, IProperty, IStateful > >
using | base_class = CommonMessaging

## Public Member Functions
StatusCode | queryInterface (const InterfaceID &riid, void **ppvUnknown) override
| Query for a given interface. More...
const std::string & | name () const override
| Retrieve full identifying name of the concrete tool object. More...
const std::string & | type () const override
| Retrieve type (concrete class) of the sub-algtool. More...
const IInterface * | parent () const override
| Retrieve parent of the sub-algtool. More...
StatusCode | configure () override
StatusCode | initialize () override
StatusCode | start () override
StatusCode | stop () override
StatusCode | finalize () override
StatusCode | terminate () override
StatusCode | reinitialize () override
StatusCode | restart () override
Gaudi::StateMachine::State | FSMState () const override
Gaudi::StateMachine::State | targetFSMState () const override
StatusCode | sysInitialize () override
| Initialize AlgTool. More...
StatusCode | sysStart () override
| Start AlgTool. More...
StatusCode | sysStop () override
| Stop AlgTool. More...
StatusCode | sysFinalize () override
| Finalize AlgTool. More...
StatusCode | sysReinitialize () override
| Initialize AlgTool. More...
StatusCode | sysRestart () override
| Start AlgTool. More...
StatusCode | setProperty (const Property &p) override
| Default implementations for IProperty interface. More...
StatusCode | setProperty (const std::string &s) override
StatusCode | setProperty (const std::string &n, const std::string &v) override
StatusCode | getProperty (Property *p) const override
const Property & | getProperty (const std::string &name) const override
StatusCode | getProperty (const std::string &n, std::string &v) const override
const std::vector< Property * > & | getProperties () const override
bool | hasProperty (const std::string &name) const override
PropertyMgr * | getPropertyMgr () const
template<class TYPE >
StatusCode | setProperty (const std::string &name, const TYPE &value)
| set the property form the value More...
| AlgTool (const std::string &type, const std::string &name, const IInterface *parent)
| Standard Constructor. More...
SmartIF< ISvcLocator > & | serviceLocator () const override
| Retrieve pointer to service locator. More...
ISvcLocator * | svcLoc () const
| shortcut for the method service locator More...
IDataProviderSvc * | evtSvc () const
| accessor to event service service More...
IToolSvc * | toolSvc () const
| The standard ToolSvc service, Return a pointer to the service if present. More...
StatusCode | setProperties ()
| Method for setting declared properties to the values specified in the jobOptions via the job option service. More...
template<class T >
StatusCode | service (const std::string &name, T *&svc, bool createIf=true) const
| Access a service by name, creating it if it doesn't already exist. More...
template<class T >
StatusCode | service (const std::string &type, const std::string &name, T *&svc) const
| Access a service by name, type creating it if it doesn't already exist. More...
SmartIF< IService > | service (const std::string &name, const bool createIf=true, const bool quiet=false) const
| Return a pointer to the service identified by name (or "type/name") More...
template<typename T >
SmartIF< T > | service (const std::string &name, const bool createIf=true, const bool quiet=false) const
template<class T >
Property * | declareProperty (const std::string &name, T &property, const std::string &doc="none") const
| Declare the named property. More...
Property * | declareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="") const
| Declare remote named properties. More...
template<class T >
Property * | declareProperty (const std::string &name, ToolHandle< T > &hndl, const std::string &doc="none") const
template<class T >
StatusCode | declareTool (ToolHandle< T > &handle, std::string toolTypeAndName="", bool createIf=true)
template<class T >
Property * | declareProperty (const std::string &name, ToolHandleArray< T > &hndlArr, const std::string &doc="none") const
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override
virtual const DataObjIDColl & | extraInputDeps () const override
virtual const DataObjIDColl & | extraOutputDeps () const override
virtual void | acceptDHVisitor (IDataHandleVisitor *) const override
DataObjIDColl | inputDataObjs () const
DataObjIDColl | outputDataObjs () const
void | commitHandles () override
void | registerTool (IAlgTool *tool) const
void | deregisterTool (IAlgTool *tool) const
template<class T >
StatusCode | declarePublicTool (ToolHandle< T > &handle, std::string toolTypeAndName="", bool createIf=true)
| Declare used public tool. More...
template<class T >
StatusCode | declarePrivateTool (ToolHandle< T > &handle, std::string toolTypeAndName="", bool createIf=true)
| Declare used private tool. More...
const std::vector< IAlgTool * > & | tools () const
IAuditorSvc * | auditorSvc () const
| Access the auditor service. More...
IMonitorSvc * | monitorSvc () const
| Access the monitor service. More...
template<class T >
void | declareInfo (const std::string &name, const T &var, const std::string &desc) const
| Declare monitoring information. More...
void | declareInfo (const std::string &name, const std::string &format, const void *var, int size, const std::string &desc) const
| Declare monitoring information (special case) More...
| ~AlgTool () override
Public Member Functions inherited from CommonMessagingBase
virtual | ~CommonMessagingBase ()=default
| Virtual destructor. More...
SmartIF< IMessageSvc > & | msgSvc () const
| The standard message service. More...
MsgStream & | msgStream () const
| Return an uninitialized MsgStream. More...
MsgStream & | msgStream (const MSG::Level level) const
| Predefined configurable message stream for the efficient printouts. More...
MsgStream & | always () const
| shortcut for the method msgStream(MSG::ALWAYS) More...
MsgStream & | fatal () const
| shortcut for the method msgStream(MSG::FATAL) More...
MsgStream & | err () const
| shortcut for the method msgStream(MSG::ERROR) More...
MsgStream & | error () const
| shortcut for the method msgStream(MSG::ERROR) More...
MsgStream & | warning () const
| shortcut for the method msgStream(MSG::WARNING) More...
MsgStream & | info () const
| shortcut for the method msgStream(MSG::INFO) More...
MsgStream & | debug () const
| shortcut for the method msgStream(MSG::DEBUG) More...
MsgStream & | verbose () const
| shortcut for the method msgStream(MSG::VERBOSE) More...
MsgStream & | msg () const
| shortcut for the method msgStream(MSG::INFO) More...
MSG::Level | msgLevel () const
| get the output level from the embedded MsgStream More...
MSG::Level | outputLevel () const __attribute__((deprecated))
| Backward compatibility function for getting the output level. More...
bool | msgLevel (MSG::Level lvl) const
| get the output level from the embedded MsgStream More...

## Protected Member Functions
template<typename I >
void | declareInterface (I *i)
virtual void | declareInput (Gaudi::DataHandle *im) override
virtual void | declareOutput (Gaudi::DataHandle *im) override
std::vector< IAlgTool * > & | tools ()
Protected Member Functions inherited from CommonMessaging< implements< IAlgTool, IDataHandleHolder, IProperty, IStateful > >
void | updateMsgStreamOutputLevel (int level)
| Update the output level of the cached MsgStream. More...

## Protected Attributes
std::unique_ptr< IDataHandleVisitor > | m_updateDataHandles
| Hook for for derived classes to provide a custom visitor for data handles. More...
SmartIF< PropertyMgr > | m_propertyMgr
| Property Manager. More...

## Private Types
typedef std::list< std::pair< InterfaceID, void * > > | InterfaceList

## Private Member Functions
void | initToolHandles () const
StatusCode | service_i (const std::string &algName, bool createIf, const InterfaceID &iid, void **ppSvc) const
| flag indicating whether ToolHandle tools have been added to m_tools More...
StatusCode | service_i (const std::string &svcType, const std::string &svcName, const InterfaceID &iid, void **ppS) const

## Private Attributes
std::vector< Gaudi::DataHandle * > | m_inputHandles
std::vector< Gaudi::DataHandle * > | m_outputHandles
DataObjIDColl | m_inputDataObjs
DataObjIDColl | m_outputDataObjs
DataObjIDColl | m_extInputDataObjs
DataObjIDColl | m_extOutputDataObjs
IntegerProperty | m_outputLevel = MSG::NIL
| AlgTool output level. More...
std::string | m_type
| AlgTool type (concrete class name) More...
const std::string | m_name
| AlgTool full name. More...
const IInterface * | m_parent = nullptr
| AlgTool parent. More...
SmartIF< ISvcLocator > | m_svcLocator
| Pointer to Service Locator service. More...
SmartIF< IDataProviderSvc > | m_evtSvc
| Event data service. More...
SmartIF< IToolSvc > | m_ptoolSvc
| Tool service. More...
SmartIF< IMonitorSvc > | m_pMonitorSvc
| Online Monitoring Service. More...
std::string | m_monitorSvcName
| Name to use for Monitor Service. More...
InterfaceList | m_interfaceList
| Interface list. More...
std::string | m_threadID
| Thread Id for Alg Tool. More...
std::vector< IAlgTool * > | m_tools
std::vector< BaseToolHandle * > | m_toolHandles
std::vector< GaudiHandleArrayBase * > | m_toolHandleArrays
bool | m_toolHandlesInit = false
SmartIF< IAuditorSvc > | m_pAuditorSvc
| Auditor Service. More...
BooleanProperty | m_auditInit = false
bool | m_auditorInitialize = false
| flag for auditors in "initialize()" More...
bool | m_auditorStart = false
| flag for auditors in "start()" More...
bool | m_auditorStop = false
| flag for auditors in "stop()" More...
bool | m_auditorFinalize = false
| flag for auditors in "finalize()" More...
bool | m_auditorReinitialize = false
| flag for auditors in "reinitialize()" More...
bool | m_auditorRestart = false
| flag for auditors in "restart()" More...
Gaudi::StateMachine::State | m_state = Gaudi::StateMachine::CONFIGURED
| state of the Tool More...
Gaudi::StateMachine::State | m_targetState = Gaudi::StateMachine::CONFIGURED
| state of the Tool More...

## Detailed Description

Base class from which all the concrete tool classes should be derived.

Specific methods for doing something useful should be implemented in the concrete tools. Sub-types of this class could implement an additional interface for behavior common to sets of concrete tools (for example vertexers).

Author
  Gloria Corti
  Pere Mato

Definition at line 45 of file AlgTool.h.

## Member Typedef Documentation

typedef Gaudi::PluginService::Factory<IAlgTool*, const std::string&, const std::string&, const IInterface*> AlgTool::Factory

Definition at line 54 of file AlgTool.h.

typedef std::list<std::pair<InterfaceID,void*> > AlgTool::InterfaceList
| private

Definition at line 479 of file AlgTool.h.

## Constructor & Destructor Documentation

AlgTool::AlgTool | ( | const std::string & | type,
|  | const std::string & | name,
|  | const IInterface * | parent
| ) |  |

Standard Constructor.

Parameters

  type | the concrete class of the sub-algtool
  name | the full name of the concrete sub-algtool
  parent | the parent of the concrete sub-algtool

Definition at line 193 of file AlgTool.cpp.

197 : m_type ( type )
198 , m_name ( name )
199 , m_parent ( parent )
200 , m_propertyMgr ( new PropertyMgr() )
201 {
202 addRef(); // Initial count set to 1
203
204 declareProperty( "MonitorService", m_monitorSvcName = "MonitorSvc" );
205
206 { // get the "OutputLevel" property from parent
207 const Property* _p = Gaudi::Utils::getProperty ( parent , "OutputLevel") ;
208 if ( _p ) { m_outputLevel.assign( *_p ) ; }
209 declareProperty ( "OutputLevel" , m_outputLevel ) ;
210 m_outputLevel.declareUpdateHandler([this](Property&) { this->updateMsgStreamOutputLevel(this->m_outputLevel) ; } );
211 }
212
213 IInterface* _p = const_cast<IInterface*> ( parent ) ;
214
215 if ( Algorithm* _alg = dynamic_cast<Algorithm*> ( _p ) )
216 {
217 m_svcLocator = _alg -> serviceLocator () ;
218 m_threadID = getGaudiThreadIDfromName ( _alg -> name() ) ;
219 }
220 else if ( Service* _svc = dynamic_cast<Service*> ( _p ) )
221 {
222 m_svcLocator = _svc -> serviceLocator () ;
223 m_threadID = getGaudiThreadIDfromName ( _svc -> name() ) ;
224 }
225 else if ( AlgTool* _too = dynamic_cast<AlgTool*> ( _p ) )
226 {
227 m_svcLocator = _too -> serviceLocator ();
228 m_threadID = getGaudiThreadIDfromName ( _too ->m_threadID ) ;
229 }
230 else if ( Auditor* _aud = dynamic_cast<Auditor*> ( _p ) )
231 {
232 m_svcLocator = _aud -> serviceLocator() ;
233 m_threadID = getGaudiThreadIDfromName ( _aud -> name() ) ;
234 }
235 else
236 {
237 throw GaudiException
238 ( "Failure to create tool '"
239 + type + "/" + name + "': illegal parent type '"
240 + System::typeinfoName(typeid(*_p)) + "'", "AlgTool", 0 );
241 }
242
243
244 { // audit tools
245 auto appMgr = m_svcLocator->service<IProperty>("ApplicationMgr");
246 if ( !appMgr ) {
247 throw GaudiException("Could not locate ApplicationMgr","AlgTool",0);
248 }
249 const Property* p = Gaudi::Utils::getProperty( appMgr , "AuditTools");
250 if ( p ) { m_auditInit.assign ( *p ) ; }
251 declareProperty ( "AuditTools", m_auditInit );
252 bool audit = m_auditInit.value();
253 // Declare common AlgTool properties with their defaults
254 declareProperty ( "AuditInitialize" , m_auditorInitialize = audit ) ;
255 declareProperty ( "AuditStart" , m_auditorStart = audit ) ;
256 declareProperty ( "AuditStop" , m_auditorStop = audit ) ;
257 declareProperty ( "AuditFinalize" , m_auditorFinalize = audit ) ;
258 }
259
260 //declare Extra input and output properties
261 declareProperty( "ExtraInputs", m_extInputDataObjs);
262 declareProperty( "ExtraOutputs", m_extOutputDataObjs);
263
264
265 // check thread ID and try if tool name indicates thread ID
266 if ( m_threadID.empty() )
267 { m_threadID = getGaudiThreadIDfromName ( AlgTool::name() ) ; }
268 }
std::string::empty
T empty(T...args)
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:23
AlgTool::m_type
std::string m_type
AlgTool type (concrete class name)
Definition: AlgTool.h:481
Property::declareUpdateHandler
virtual Property & declareUpdateHandler(std::function< void(Property &)> fun)
set new callback for update
Definition: Property.cpp:72
System::typeinfoName
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:297
AlgTool::m_parent
const IInterface * m_parent
AlgTool parent.
Definition: AlgTool.h:483
AlgTool::m_outputLevel
IntegerProperty m_outputLevel
AlgTool output level.
Definition: AlgTool.h:480
Gaudi::Utils::getProperty
GAUDI_API Property * getProperty(const IProperty *p, const std::string &name)
simple function which gets the property with given name from the component
Definition: Property.cpp:278
PropertyMgr
Property manager helper class.
Definition: PropertyMgr.h:37
AlgTool::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: AlgTool.cpp:86
AlgTool::m_monitorSvcName
std::string m_monitorSvcName
Name to use for Monitor Service.
Definition: AlgTool.h:488
AlgTool::m_name
const std::string m_name
AlgTool full name.
Definition: AlgTool.h:482
ISvcLocator::service
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
Definition: ISvcLocator.h:78
AlgTool::m_propertyMgr
SmartIF< PropertyMgr > m_propertyMgr
Property Manager.
Definition: AlgTool.h:490
CommonMessaging< implements< IAlgTool, IDataHandleHolder, IProperty, IStateful > >::updateMsgStreamOutputLevel
void updateMsgStreamOutputLevel(int level)
Update the output level of the cached MsgStream.
Definition: CommonMessaging.h:187
AlgTool::declareProperty
Property * declareProperty(const std::string &name, T &property, const std::string &doc="none") const
Declare the named property.
Definition: AlgTool.h:249
IInterface
Definition of the basic interface.
Definition: IInterface.h:234
AlgTool::m_threadID
std::string m_threadID
Thread Id for Alg Tool.
Definition: AlgTool.h:493
PropertyWithValue::value
const TYPE & value() const
explicit conversion
Definition: Property.h:341
AlgTool::m_auditorFinalize
bool m_auditorFinalize
flag for auditors in "finalize()"
Definition: AlgTool.h:517
Algorithm
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:74
Property
Property base class allowing Property* collections to be "homogeneous".
Definition: Property.h:38
PropertyWithValue::assign
bool assign(const Property &source) override
get the value from another property
Definition: Property.h:269
AlgTool
Base class from which all the concrete tool classes should be derived.
Definition: AlgTool.h:45
AlgTool::m_svcLocator
SmartIF< ISvcLocator > m_svcLocator
Pointer to Service Locator service.
Definition: AlgTool.h:484
IOTest.appMgr
tuple appMgr
Definition: IOTest.py:83
AlgTool::m_extInputDataObjs
DataObjIDColl m_extInputDataObjs
Definition: AlgTool.h:333
AlgTool::m_auditInit
BooleanProperty m_auditInit
Definition: AlgTool.h:513
AlgTool::m_auditorStart
bool m_auditorStart
flag for auditors in "start()"
Definition: AlgTool.h:515
IProperty
The IProperty is the basic interface for all components which have properties that can be set or get...
Definition: IProperty.h:21
Service
Base class for all services.
Definition: Service.h:36
AlgTool::m_auditorStop
bool m_auditorStop
flag for auditors in "stop()"
Definition: AlgTool.h:516
getGaudiThreadIDfromName
GAUDI_API std::string getGaudiThreadIDfromName(const std::string &name)
helper function to extract Gaudi Thread ID from thread copy name
Definition: ThreadGaudi.cpp:26
AlgTool::name
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:65
AlgTool::m_auditorInitialize
bool m_auditorInitialize
flag for auditors in "initialize()"
Definition: AlgTool.h:514
AlgTool::m_extOutputDataObjs
DataObjIDColl m_extOutputDataObjs
Definition: AlgTool.h:333
Auditor
Base class from which all concrete auditor classes should be derived.
Definition: Auditor.h:35
AlgTool::parent
const IInterface * parent() const override
Retrieve parent of the sub-algtool.
Definition: AlgTool.cpp:79

AlgTool::~AlgTool | ( |  | ) |
| override

Definition at line 453 of file AlgTool.cpp.

455 {
456 if( m_pMonitorSvc ) { m_pMonitorSvc->undeclareAll(this); }
457 }
AlgTool::m_pMonitorSvc
SmartIF< IMonitorSvc > m_pMonitorSvc
Online Monitoring Service.
Definition: AlgTool.h:487
IMonitorSvc::undeclareAll
virtual void undeclareAll(const IInterface *owner)=0
Undeclare monitoring information.

## Member Function Documentation

void AlgTool::acceptDHVisitor | ( | IDataHandleVisitor * | vis | ) | const
| override virtual

Definition at line 566 of file AlgTool.cpp.

566 {
567 //-----------------------------------------------------------------------------
568 vis->visit(this);
569
570 for (auto tool : tools()) {
571 AlgTool *at = dynamic_cast<AlgTool*>(tool);
572 vis->visit(at);
573 }
574
575 }
IDataHandleVisitor::visit
virtual void visit(const IDataHandleHolder *)=0
AlgTool::tools
const std::vector< IAlgTool * > & tools() const
Definition: AlgTool.cpp:512
AlgTool
Base class from which all the concrete tool classes should be derived.
Definition: AlgTool.h:45

IAuditorSvc * AlgTool::auditorSvc | ( |  | ) | const

Access the auditor service.

Definition at line 553 of file AlgTool.cpp.

553 {
554 //---------------------------------------------------------------------------
555 if ( !m_pAuditorSvc ) {
556 m_pAuditorSvc = service( "AuditorSvc", true );
557 if( !m_pAuditorSvc ) {
558 throw GaudiException("Service [AuditorSvc] not found", name(), StatusCode::FAILURE);
559 }
560 }
561 return m_pAuditorSvc.get();
562 }
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:23
SmartIF::get
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:76
StatusCode::FAILURE
Definition: StatusCode.h:29
AlgTool::service
StatusCode service(const std::string &name, T *&svc, bool createIf=true) const
Access a service by name, creating it if it doesn't already exist.
Definition: AlgTool.h:195
AlgTool::m_pAuditorSvc
SmartIF< IAuditorSvc > m_pAuditorSvc
Auditor Service.
Definition: AlgTool.h:511
AlgTool::name
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:65

void AlgTool::commitHandles | ( |  | ) |
| override

Definition at line 579 of file AlgTool.cpp.

579 {
580 //-----------------------------------------------------------------------------
581
582 for (auto h : m_outputHandles) {
583 h->commit();
584 }
585
586 for (auto t : m_tools) {
587 AlgTool* at = dynamic_cast<AlgTool*>(t);
588 if (at != 0) at->commitHandles();
589 }
590
591 }
AlgTool::m_tools
std::vector< IAlgTool * > m_tools
Definition: AlgTool.h:496
AlgTool::commitHandles
void commitHandles() override
Definition: AlgTool.cpp:579
HiveAlgSequencer.h
tuple h
Definition: HiveAlgSequencer.py:24
AlgTool::m_outputHandles
std::vector< Gaudi::DataHandle * > m_outputHandles
Definition: AlgTool.h:330
AlgTool
Base class from which all the concrete tool classes should be derived.
Definition: AlgTool.h:45

StatusCode AlgTool::configure | ( |  | ) |
| inline override

Definition at line 70 of file AlgTool.h.

70 { return StatusCode::SUCCESS; }
StatusCode::SUCCESS
Definition: StatusCode.h:30
template<class T >

void AlgTool::declareInfo | ( | const std::string & | name,
|  | const T & | var,
|  | const std::string & | desc
| ) |  | const
| inline

Declare monitoring information.

Parameters

  name | Monitoring information name known to the external system
  var | Monitoring Listener address (the item to monitor...)
  desc | Textual description of the information being monitored

Definition at line 450 of file AlgTool.h.

453 {
454 IMonitorSvc* mS = monitorSvc();
455 if ( mS ) mS->declareInfo(name, var, desc, this);
456 }
AlgTool::monitorSvc
IMonitorSvc * monitorSvc() const
Access the monitor service.
Definition: AlgTool.h:437
IMonitorSvc
Definition of the IMonitorSvc interface, which publishes Gaudi variables to outside monitoring proces...
Definition: IMonitorSvc.h:21
IMonitorSvc::declareInfo
virtual void declareInfo(const std::string &name, const bool &var, const std::string &desc, const IInterface *owner)=0
Declare monitoring information.

void AlgTool::declareInfo | ( | const std::string & | name,
|  | const std::string & | format,
|  | const void * | var,
|  | int | size,
|  | const std::string & | desc
| ) |  | const
| inline

Declare monitoring information (special case)

Parameters

  name | Monitoring information name known to the external system
  format | Format information
  var | Monitoring Listener address
  size | Monitoring Listener address size
  desc | Textual description of the information being monitored

Definition at line 465 of file AlgTool.h.

470 {
471 IMonitorSvc* mS = monitorSvc();
472 if ( mS ) mS->declareInfo(name, format, var, size, desc, this);
473 }
AlgTool::monitorSvc
IMonitorSvc * monitorSvc() const
Access the monitor service.
Definition: AlgTool.h:437
IMonitorSvc
Definition of the IMonitorSvc interface, which publishes Gaudi variables to outside monitoring proces...
Definition: IMonitorSvc.h:21
IMonitorSvc::declareInfo
virtual void declareInfo(const std::string &name, const bool &var, const std::string &desc, const IInterface *owner)=0
Declare monitoring information.

virtual void AlgTool::declareInput | ( | Gaudi::DataHandle * | im | ) |
| inline override protected virtual

Definition at line 299 of file AlgTool.h.

299 {
300 m_inputHandles.push_back(im);
301 }
AlgTool::m_inputHandles
std::vector< Gaudi::DataHandle * > m_inputHandles
Definition: AlgTool.h:330
std::vector::push_back
T push_back(T...args)
template<typename I >

void AlgTool::declareInterface | ( | I * | i | ) |
| inline protected

Definition at line 215 of file AlgTool.h.

215 { m_interfaceList.emplace_back( I::interfaceID(), i ); }
AlgTool::m_interfaceList
InterfaceList m_interfaceList
Interface list.
Definition: AlgTool.h:492
ana.i
list i
Definition: ana.py:128
std::list::emplace_back
T emplace_back(T...args)

virtual void AlgTool::declareOutput | ( | Gaudi::DataHandle * | im | ) |
| inline override protected virtual

Definition at line 303 of file AlgTool.h.

303 {
304 m_outputHandles.push_back(im);
305 }
std::vector::push_back
T push_back(T...args)
AlgTool::m_outputHandles
std::vector< Gaudi::DataHandle * > m_outputHandles
Definition: AlgTool.h:330
template<class T >

StatusCode AlgTool::declarePrivateTool | ( | ToolHandle< T > & | handle,
|  | std::string | toolTypeAndName = `""`,
|  | bool | createIf = `true`
| ) |  |
| inline

Declare used private tool.

Parameters

  handle | ToolHandle<T>
  toolTypeAndName |
  parent,default | public tool
  create | if necessary, default true

Definition at line 391 of file AlgTool.h.

393 {
394
395 if (toolTypeAndName == "")
396 toolTypeAndName = handle.typeAndName();
397
398 StatusCode sc = handle.initialize(toolTypeAndName, this, createIf);
399 if (UNLIKELY(!sc)) {
400 throw GaudiException{"Cannot create handle for private tool " + toolTypeAndName,
401 name(), sc};
402 }
403
404 m_toolHandles.push_back(&handle);
405
406 return sc;
407 }
ToolHandle::typeAndName
std::string typeAndName() const override
Definition: ToolHandle.h:199
UNLIKELY
#define UNLIKELY(x)
Definition: Kernel.h:126
AlgTool::m_toolHandles
std::vector< BaseToolHandle * > m_toolHandles
Definition: AlgTool.h:497
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:23
merge_files.sc
int sc
Definition: merge_files.py:167
std::vector::push_back
T push_back(T...args)
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
ToolHandle::initialize
StatusCode initialize(const std::string &toolTypeAndName, const IInterface *parent=nullptr, bool createIf=true)
Definition: ToolHandle.h:157
AlgTool::name
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:65
template<class T >

Property* AlgTool::declareProperty | ( | const std::string & | name,
|  | T & | property,
|  | const std::string & | doc = `"none"`
| ) |  | const
| inline

Declare the named property.

MyTool ( const std::string& type ,
const std::string& name ,
const IInterface* parent )
: AlgTool ( type , name , pSvc )
, m_property1 ( ... )
, m_property2 ( ... )
{
// declare the property
declareProperty( "Property1" , m_property1 , "Doc for property #1" ) ;
// declare the property and attach the handler to it
declareProperty( "Property2" , m_property2 , "Doc for property #2" )
-> declareUpdateHandler( &MyTool::handler_2 ) ;
}

See also
  PropertyMgr
  PropertyMgr::declareProperty

Parameters

  name | the property name
  property | the property itself,
  doc | the documentation string

Returns
  the actual property objects

Definition at line 249 of file AlgTool.h.

252 {
253 return m_propertyMgr -> declareProperty ( name , property , doc ) ;
254 }
AlgTool::m_propertyMgr
SmartIF< PropertyMgr > m_propertyMgr
Property Manager.
Definition: AlgTool.h:490
AlgTool::declareProperty
Property * declareProperty(const std::string &name, T &property, const std::string &doc="none") const
Declare the named property.
Definition: AlgTool.h:249
template<class T >

Property* AlgTool::declareProperty | ( | const std::string & | name,
|  | ToolHandle< T > & | hndl,
|  | const std::string & | doc = `"none"`
| ) |  | const
| inline

Definition at line 266 of file AlgTool.h.

268 {
269
270 AlgTool* a = const_cast<AlgTool*>(this);
271 a->declareTool(hndl).ignore();
272
273 return m_propertyMgr->declareProperty(name, hndl, doc);
274
275 }
AlgTool::m_propertyMgr
SmartIF< PropertyMgr > m_propertyMgr
Property Manager.
Definition: AlgTool.h:490
PropertyMgr::declareProperty
Property * declareProperty(const std::string &name, TYPE &value, const std::string &doc="none")
Declare a property (templated)
Definition: PropertyMgr.h:186
AlgTool::declareTool
StatusCode declareTool(ToolHandle< T > &handle, std::string toolTypeAndName="", bool createIf=true)
Definition: AlgTool.h:278
AlgTool
Base class from which all the concrete tool classes should be derived.
Definition: AlgTool.h:45
StatusCode::ignore
void ignore() const
Definition: StatusCode.h:108
template<class T >

Property* AlgTool::declareProperty | ( | const std::string & | name,
|  | ToolHandleArray< T > & | hndlArr,
|  | const std::string & | doc = `"none"`
| ) |  | const
| inline

Definition at line 291 of file AlgTool.h.

293 {
294 m_toolHandleArrays.push_back( &hndlArr );
295 return m_propertyMgr->declareProperty(name, hndlArr, doc);
296 }
std::vector::push_back
T push_back(T...args)
AlgTool::m_propertyMgr
SmartIF< PropertyMgr > m_propertyMgr
Property Manager.
Definition: AlgTool.h:490
PropertyMgr::declareProperty
Property * declareProperty(const std::string &name, TYPE &value, const std::string &doc="none")
Declare a property (templated)
Definition: PropertyMgr.h:186
AlgTool::m_toolHandleArrays
std::vector< GaudiHandleArrayBase * > m_toolHandleArrays
Definition: AlgTool.h:498
template<class T >

StatusCode AlgTool::declarePublicTool | ( | ToolHandle< T > & | handle,
|  | std::string | toolTypeAndName = `""`,
|  | bool | createIf = `true`
| ) |  |
| inline

Declare used public tool.

Parameters

  handle | ToolHandle<T>
  toolTypeAndName |
  parent,default | public tool
  create | if necessary, default true

Definition at line 365 of file AlgTool.h.

367 {
368
369 if (toolTypeAndName == "")
370 toolTypeAndName = handle.typeAndName();
371
372 StatusCode sc = handle.initialize(toolTypeAndName, 0, createIf);
373 if (UNLIKELY(!sc)) {
374 throw GaudiException{"Cannot create handle for public tool " + toolTypeAndName,
375 name(), sc};
376 }
377
378 m_toolHandles.push_back(&handle);
379
380 return sc;
381 }
ToolHandle::typeAndName
std::string typeAndName() const override
Definition: ToolHandle.h:199
UNLIKELY
#define UNLIKELY(x)
Definition: Kernel.h:126
AlgTool::m_toolHandles
std::vector< BaseToolHandle * > m_toolHandles
Definition: AlgTool.h:497
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:23
merge_files.sc
int sc
Definition: merge_files.py:167
std::vector::push_back
T push_back(T...args)
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
ToolHandle::initialize
StatusCode initialize(const std::string &toolTypeAndName, const IInterface *parent=nullptr, bool createIf=true)
Definition: ToolHandle.h:157
AlgTool::name
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:65

Property* AlgTool::declareRemoteProperty | ( | const std::string & | name,
|  | IProperty * | rsvc,
|  | const std::string & | rname = `""`
| ) |  | const
| inline

Declare remote named properties.

Definition at line 257 of file AlgTool.h.

260 {
261 return m_propertyMgr-> declareRemoteProperty ( name , rsvc , rname ) ;
262 }
AlgTool::m_propertyMgr
SmartIF< PropertyMgr > m_propertyMgr
Property Manager.
Definition: AlgTool.h:490
AlgTool::declareRemoteProperty
Property * declareRemoteProperty(const std::string &name, IProperty *rsvc, const std::string &rname="") const
Declare remote named properties.
Definition: AlgTool.h:257
template<class T >

StatusCode AlgTool::declareTool | ( | ToolHandle< T > & | handle,
|  | std::string | toolTypeAndName = `""`,
|  | bool | createIf = `true`
| ) |  |
| inline

Definition at line 278 of file AlgTool.h.

280 {
281 if (handle.isPublic()) {
282 return declarePublicTool(handle, toolTypeAndName, createIf);
283 } else {
284 return declarePrivateTool(handle, toolTypeAndName, createIf);
285 }
286 }
AlgTool::declarePrivateTool
StatusCode declarePrivateTool(ToolHandle< T > &handle, std::string toolTypeAndName="", bool createIf=true)
Declare used private tool.
Definition: AlgTool.h:391
ToolHandleInfo::isPublic
bool isPublic() const
Definition: ToolHandle.h:34
AlgTool::declarePublicTool
StatusCode declarePublicTool(ToolHandle< T > &handle, std::string toolTypeAndName="", bool createIf=true)
Declare used public tool.
Definition: AlgTool.h:365

void AlgTool::deregisterTool | ( | IAlgTool * | tool | ) | const
| inline

Definition at line 345 of file AlgTool.h.

345 {
346 auto it = std::find(m_tools.begin(), m_tools.end(), tool);
347 if (it != m_tools.end()) {
348 if (UNLIKELY(msgLevel(MSG::DEBUG)))
349 debug() << "De-Registering tool " << tool->name() << endmsg;
350 m_tools.erase(it);
351 } else {
352 if (UNLIKELY(msgLevel(MSG::DEBUG)))
353 debug() << "Could not de-register tool " << tool->name() << endmsg;
354 }
355 }
UNLIKELY
#define UNLIKELY(x)
Definition: Kernel.h:126
AlgTool::m_tools
std::vector< IAlgTool * > m_tools
Definition: AlgTool.h:496
MSG::DEBUG
Definition: IMessageSvc.h:18
std::vector::end
T end(T...args)
INamedInterface::name
virtual const std::string & name() const =0
Retrieve the name of the instance.
std::vector::erase
T erase(T...args)
std::find
T find(T...args)
CommonMessagingBase::debug
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
Definition: CommonMessaging.h:127
std::vector::begin
T begin(T...args)
CommonMessagingBase::msgLevel
MSG::Level msgLevel() const
get the output level from the embedded MsgStream
Definition: CommonMessaging.h:136
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

IDataProviderSvc * AlgTool::evtSvc | ( |  | ) | const

accessor to event service service

Returns
  pointer to detector service

Definition at line 95 of file AlgTool.cpp.

96 {
97 if ( !m_evtSvc ) {
98 m_evtSvc = service("EventDataSvc", true);
99 if ( !m_evtSvc ) {
100 throw GaudiException("Service [EventDataSvc] not found", name(), StatusCode::FAILURE);
101 }
102 }
103 return m_evtSvc.get();
104 }
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:23
SmartIF::get
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:76
StatusCode::FAILURE
Definition: StatusCode.h:29
AlgTool::service
StatusCode service(const std::string &name, T *&svc, bool createIf=true) const
Access a service by name, creating it if it doesn't already exist.
Definition: AlgTool.h:195
AlgTool::m_evtSvc
SmartIF< IDataProviderSvc > m_evtSvc
Event data service.
Definition: AlgTool.h:485
AlgTool::name
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:65

virtual const DataObjIDColl& AlgTool::extraInputDeps | ( |  | ) | const
| inline override virtual

Definition at line 313 of file AlgTool.h.

313 {
314 return m_extInputDataObjs;
315 }
AlgTool::m_extInputDataObjs
DataObjIDColl m_extInputDataObjs
Definition: AlgTool.h:333

virtual const DataObjIDColl& AlgTool::extraOutputDeps | ( |  | ) | const
| inline override virtual

Definition at line 316 of file AlgTool.h.

316 {
317 return m_extOutputDataObjs;
318 }
AlgTool::m_extOutputDataObjs
DataObjIDColl m_extOutputDataObjs
Definition: AlgTool.h:333

StatusCode AlgTool::finalize | ( |  | ) |
| override

Definition at line 360 of file AlgTool.cpp.

362 {
363 // For the time being there is nothing to be done here.
364 return StatusCode::SUCCESS;
365 }
StatusCode::SUCCESS
Definition: StatusCode.h:30

Gaudi::StateMachine::State AlgTool::FSMState | ( |  | ) | const
| inline override

Definition at line 78 of file AlgTool.h.

78 { return m_state; }
AlgTool::m_state
Gaudi::StateMachine::State m_state
state of the Tool
Definition: AlgTool.h:521

const std::vector< Property * > & AlgTool::getProperties | ( |  | ) | const
| override

Definition at line 160 of file AlgTool.cpp.

162 {
163 return m_propertyMgr->getProperties();
164 }
AlgTool::m_propertyMgr
SmartIF< PropertyMgr > m_propertyMgr
Property Manager.
Definition: AlgTool.h:490
PropertyMgr::getProperties
const std::vector< Property * > & getProperties() const override
get all properties
Definition: PropertyMgr.cpp:186

StatusCode AlgTool::getProperty | ( | Property * | p | ) | const
| override

Definition at line 140 of file AlgTool.cpp.

142 {
143 return m_propertyMgr->getProperty(p);
144 }
PropertyMgr::getProperty
StatusCode getProperty(Property *p) const override
get the property
Definition: PropertyMgr.cpp:144
AlgTool::m_propertyMgr
SmartIF< PropertyMgr > m_propertyMgr
Property Manager.
Definition: AlgTool.h:490

const Property & AlgTool::getProperty | ( | const std::string & | name | ) | const
| override

Definition at line 147 of file AlgTool.cpp.

148 {
149 return m_propertyMgr->getProperty(n);
150 }
GaudiPluginService.cpluginsvc.n
list n
Definition: cpluginsvc.py:217
PropertyMgr::getProperty
StatusCode getProperty(Property *p) const override
get the property
Definition: PropertyMgr.cpp:144
AlgTool::m_propertyMgr
SmartIF< PropertyMgr > m_propertyMgr
Property Manager.
Definition: AlgTool.h:490

StatusCode AlgTool::getProperty | ( | const std::string & | n,
|  | std::string & | v
| ) |  | const
| override

Definition at line 153 of file AlgTool.cpp.

155 {
156 return m_propertyMgr->getProperty(n,v);
157 }
PropertyMgr::getProperty
StatusCode getProperty(Property *p) const override
get the property
Definition: PropertyMgr.cpp:144
AlgTool::m_propertyMgr
SmartIF< PropertyMgr > m_propertyMgr
Property Manager.
Definition: AlgTool.h:490

PropertyMgr* AlgTool::getPropertyMgr | ( |  | ) | const
| inline

Definition at line 109 of file AlgTool.h.

109 { return m_propertyMgr; }
AlgTool::m_propertyMgr
SmartIF< PropertyMgr > m_propertyMgr
Property Manager.
Definition: AlgTool.h:490

bool AlgTool::hasProperty | ( | const std::string & | name | ) | const
| override

Definition at line 166 of file AlgTool.cpp.

166 {
167 return m_propertyMgr->hasProperty(name);
168 }
AlgTool::m_propertyMgr
SmartIF< PropertyMgr > m_propertyMgr
Property Manager.
Definition: AlgTool.h:490
PropertyMgr::hasProperty
bool hasProperty(const std::string &name) const override
Return true if we have a property with the given name.
Definition: PropertyMgr.cpp:201

StatusCode AlgTool::initialize | ( |  | ) |
| override

Definition at line 290 of file AlgTool.cpp.

292 {
293 // For the time being there is nothing to be done here.
294 // Setting the properties is done by the ToolSvc calling setProperties()
295 // explicitly.
296 return StatusCode::SUCCESS;
297 }
StatusCode::SUCCESS
Definition: StatusCode.h:30

void AlgTool::initToolHandles | ( |  | ) | const
| private

Definition at line 460 of file AlgTool.cpp.

460 {
461
462 IAlgTool* tool(0);
463 for (auto thArr : m_toolHandleArrays) {
464 if (! thArr->retrieved()) {
465 if (UNLIKELY(msgLevel(MSG::DEBUG)))
466 debug() << "ToolHandleArray " << thArr->propertyName()
467 << " not used: not registering any of its Tools" << endmsg;
468 } else {
469 if (UNLIKELY(msgLevel(MSG::DEBUG)))
470 debug() << "Registering all Tools in ToolHandleArray "
471 << thArr->propertyName() ;
472 for (auto th_name : thArr->typesAndNames()) {
473 if (UNLIKELY(msgLevel(MSG::DEBUG)))
474 debug() << std::endl << " + " << th_name;
475 if (toolSvc()->retrieveTool(th_name, tool, this).isSuccess()) {
476 if (UNLIKELY(msgLevel(MSG::DEBUG)))
477 debug() << " (private)";
478 m_tools.push_back(tool);
479 } else if (toolSvc()->retrieveTool(th_name, tool, 0).isSuccess()) {
480 if (UNLIKELY(msgLevel(MSG::DEBUG)))
481 debug() << " (public)";
482 m_tools.push_back(tool);
483 } else {
484 if (UNLIKELY(msgLevel(MSG::DEBUG)))
485 debug() << " - ERROR" << endmsg;
486 warning() << "Error retrieving Tool " << th_name
487 << " in ToolHandleArray" << thArr->propertyName()
488 << ". Not registered" << endmsg;
489 }
490 }
491 if (UNLIKELY(msgLevel(MSG::DEBUG))) debug() << endmsg;
492 }
493 }
494
495 for(auto th : m_toolHandles){
496 tool = th->get();
497 if(tool){
498 m_tools.push_back(tool);
499 if (UNLIKELY(msgLevel(MSG::DEBUG)))
500 debug() << "Adding "
501 << (th->isPublic() ? "Public" : "Private" )
502 << " ToolHandle tool " << tool->name()
503 << " (" << tool->type() << ")" << endmsg;
504 } else {
505 if (UNLIKELY(msgLevel(MSG::DEBUG)))
506 debug() << "ToolHandle " << th->typeAndName() << " not used" << endmsg;
507 }
508 }
509 m_toolHandlesInit = true;
510 }
UNLIKELY
#define UNLIKELY(x)
Definition: Kernel.h:126
AlgTool::m_tools
std::vector< IAlgTool * > m_tools
Definition: AlgTool.h:496
AlgTool::m_toolHandles
std::vector< BaseToolHandle * > m_toolHandles
Definition: AlgTool.h:497
AlgTool::m_toolHandlesInit
bool m_toolHandlesInit
Definition: AlgTool.h:499
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
MSG::DEBUG
Definition: IMessageSvc.h:18
std::endl
T endl(T...args)
AlgTool::toolSvc
IToolSvc * toolSvc() const
The standard ToolSvc service, Return a pointer to the service if present.
Definition: AlgTool.cpp:106
IToolSvc::retrieveTool
StatusCode retrieveTool(const std::string &type, T *&tool, const IInterface *parent=nullptr, bool createIf=true)
Retrieve specified tool sub-type with tool dependent part of the name automatically assigned...
Definition: IToolSvc.h:145
std::vector::push_back
T push_back(T...args)
CommonMessagingBase::warning
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
Definition: CommonMessaging.h:121
CommonMessagingBase::debug
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
Definition: CommonMessaging.h:127
IAlgTool
The interface implemented by the AlgTool base class.
Definition: IAlgTool.h:23
CommonMessagingBase::msgLevel
MSG::Level msgLevel() const
get the output level from the embedded MsgStream
Definition: CommonMessaging.h:136
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
AlgTool::m_toolHandleArrays
std::vector< GaudiHandleArrayBase * > m_toolHandleArrays
Definition: AlgTool.h:498

DataObjIDColl AlgTool::inputDataObjs | ( |  | ) | const
| inline

Definition at line 323 of file AlgTool.h.

323 { return m_inputDataObjs; }
AlgTool::m_inputDataObjs
DataObjIDColl m_inputDataObjs
Definition: AlgTool.h:331

virtual std::vector<Gaudi::DataHandle*> AlgTool::inputHandles | ( |  | ) | const
| inline override virtual

Definition at line 308 of file AlgTool.h.

308 {
309 return m_inputHandles; }
AlgTool::m_inputHandles
std::vector< Gaudi::DataHandle * > m_inputHandles
Definition: AlgTool.h:330

IMonitorSvc* AlgTool::monitorSvc | ( |  | ) | const
| inline

Access the monitor service.

Attention
  Note that this method will return a NULL pointer if no monitor service is configured to be present. You must take this possibility into account when using the pointer

Returns
  Pointer to the Monitor service

Return values

  NULL | No monitor service is present
  non-NULL | A monitor service is present and available to be used

Definition at line 437 of file AlgTool.h.

438 {
439 // If not already located try to locate it without forcing a creation
440 if ( !m_pMonitorSvc ) m_pMonitorSvc = service(m_monitorSvcName, false, true);
441 return m_pMonitorSvc.get();
442 }
AlgTool::m_pMonitorSvc
SmartIF< IMonitorSvc > m_pMonitorSvc
Online Monitoring Service.
Definition: AlgTool.h:487
SmartIF::get
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:76
AlgTool::m_monitorSvcName
std::string m_monitorSvcName
Name to use for Monitor Service.
Definition: AlgTool.h:488
AlgTool::service
StatusCode service(const std::string &name, T *&svc, bool createIf=true) const
Access a service by name, creating it if it doesn't already exist.
Definition: AlgTool.h:195

const std::string & AlgTool::name | ( |  | ) | const
| override

Retrieve full identifying name of the concrete tool object.

Definition at line 65 of file AlgTool.cpp.

67 {
68 return m_name;
69 }
AlgTool::m_name
const std::string m_name
AlgTool full name.
Definition: AlgTool.h:482

DataObjIDColl AlgTool::outputDataObjs | ( |  | ) | const
| inline

Definition at line 324 of file AlgTool.h.

324 { return m_outputDataObjs; }
AlgTool::m_outputDataObjs
DataObjIDColl m_outputDataObjs
Definition: AlgTool.h:331

virtual std::vector<Gaudi::DataHandle*> AlgTool::outputHandles | ( |  | ) | const
| inline override virtual

Definition at line 310 of file AlgTool.h.

310 {
311 return m_outputHandles; }
AlgTool::m_outputHandles
std::vector< Gaudi::DataHandle * > m_outputHandles
Definition: AlgTool.h:330

const IInterface * AlgTool::parent | ( |  | ) | const
| override

Retrieve parent of the sub-algtool.

Definition at line 79 of file AlgTool.cpp.

81 {
82 return m_parent;
83 }
AlgTool::m_parent
const IInterface * m_parent
AlgTool parent.
Definition: AlgTool.h:483

StatusCode AlgTool::queryInterface | ( | const InterfaceID & | riid,
|  | void ** | ppvUnknown
| ) |  |
| override

Query for a given interface.

Definition at line 45 of file AlgTool.cpp.

48 {
49 if ( !ppvi ) { return StatusCode::FAILURE ; } // RETURN
50 StatusCode sc = base_class::queryInterface(riid,ppvi);
51 if (sc.isSuccess()) return sc;
52 auto i = std::find_if( std::begin(m_interfaceList), std::end(m_interfaceList),
53 [&](const std::pair<InterfaceID,void*>& item) {
54 return item.first.versionMatch(riid);
55 } );
56 if ( i == std::end(m_interfaceList) ) {
57 *ppvi = nullptr ;
58 return NO_INTERFACE ; // RETURN
59 }
60 *ppvi = i->second ;
61 addRef() ;
62 return SUCCESS ; // RETURN
63 }
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
std::end
T end(T...args)
merge_files.sc
int sc
Definition: merge_files.py:167
GaudiPython.Bindings.SUCCESS
tuple SUCCESS
Definition: Bindings.py:51
StatusCode::FAILURE
Definition: StatusCode.h:29
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
std::pair< InterfaceID, void * >
std::find_if
T find_if(T...args)
std::begin
T begin(T...args)
ana.item
tuple item
print s1,s2
Definition: ana.py:146
AlgTool::m_interfaceList
InterfaceList m_interfaceList
Interface list.
Definition: AlgTool.h:492
ana.i
list i
Definition: ana.py:128

void AlgTool::registerTool | ( | IAlgTool * | tool | ) | const
| inline

Definition at line 339 of file AlgTool.h.

339 {
340 if (UNLIKELY(msgLevel(MSG::DEBUG)))
341 debug() << "Registering tool " << tool->name() << endmsg;
342 m_tools.push_back(tool);
343 }
UNLIKELY
#define UNLIKELY(x)
Definition: Kernel.h:126
AlgTool::m_tools
std::vector< IAlgTool * > m_tools
Definition: AlgTool.h:496
MSG::DEBUG
Definition: IMessageSvc.h:18
INamedInterface::name
virtual const std::string & name() const =0
Retrieve the name of the instance.
std::vector::push_back
T push_back(T...args)
CommonMessagingBase::debug
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
Definition: CommonMessaging.h:127
CommonMessagingBase::msgLevel
MSG::Level msgLevel() const
get the output level from the embedded MsgStream
Definition: CommonMessaging.h:136
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

StatusCode AlgTool::reinitialize | ( |  | ) |
| override

Definition at line 390 of file AlgTool.cpp.

392 {
393 /* @TODO
394 * MCl 2008-10-23: the implementation of reinitialize as finalize+initialize
395 * is causing too many problems
396 *
397 // Default implementation is finalize+initialize
398 StatusCode sc = finalize();
399 if (sc.isFailure()) {
400 error() << "reinitialize(): cannot be finalized" << endmsg;
401 return sc;
402 }
403 sc = initialize();
404 if (sc.isFailure()) {
405 error() << "reinitialize(): cannot be initialized" << endmsg;
406 return sc;
407 }
408 */
409 return StatusCode::SUCCESS;
410 }
StatusCode::SUCCESS
Definition: StatusCode.h:30

StatusCode AlgTool::restart | ( |  | ) |
| override

Definition at line 435 of file AlgTool.cpp.

437 {
438 // Default implementation is stop+start
439 StatusCode sc = stop();
440 if (sc.isFailure()) {
441 error() << "restart(): cannot be stopped" << endmsg;
442 return sc;
443 }
444 sc = start();
445 if (sc.isFailure()) {
446 error() << "restart(): cannot be started" << endmsg;
447 return sc;
448 }
449 return StatusCode::SUCCESS;
450 }
merge_files.sc
int sc
Definition: merge_files.py:167
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:118
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
AlgTool::stop
StatusCode stop() override
Definition: AlgTool.cpp:338
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
AlgTool::start
StatusCode start() override
Definition: AlgTool.cpp:315
template<class T >

StatusCode AlgTool::service | ( | const std::string & | name,
|  | T *& | svc,
|  | bool | createIf = `true`
| ) |  | const
| inline

Access a service by name, creating it if it doesn't already exist.

Definition at line 195 of file AlgTool.h.

195 {
196 return service_i(name, createIf, T::interfaceID(), (void**)&svc);
197 }
AlgTool::service_i
StatusCode service_i(const std::string &algName, bool createIf, const InterfaceID &iid, void **ppSvc) const
flag indicating whether ToolHandle tools have been added to m_tools
Definition: AlgTool.cpp:529
template<class T >

StatusCode AlgTool::service | ( | const std::string & | type,
|  | const std::string & | name,
|  | T *& | svc
| ) |  | const
| inline

Access a service by name, type creating it if it doesn't already exist.

Definition at line 202 of file AlgTool.h.

202 {
203 return service_i(type, name, T::interfaceID(), (void**)&svc);
204 }
AlgTool::service_i
StatusCode service_i(const std::string &algName, bool createIf, const InterfaceID &iid, void **ppSvc) const
flag indicating whether ToolHandle tools have been added to m_tools
Definition: AlgTool.cpp:529

SmartIF< IService > AlgTool::service | ( | const std::string & | name,
|  | const bool | createIf = `true`,
|  | const bool | quiet = `false`
| ) |  | const

Return a pointer to the service identified by name (or "type/name")

Definition at line 547 of file AlgTool.cpp.

547 {
548 const ServiceLocatorHelper helper(*serviceLocator(), *this);
549 return helper.service(name, quiet, createIf);
550 }
ServiceLocatorHelper
an helper to share the implementation of service() among the various kernel base classes ...
Definition: ServiceLocatorHelper.h:17
AlgTool::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: AlgTool.cpp:86
template<typename T >

SmartIF<T> AlgTool::service | ( | const std::string & | name,
|  | const bool | createIf = `true`,
|  | const bool | quiet = `false`
| ) |  | const
| inline

Definition at line 210 of file AlgTool.h.

211 { return SmartIF<T>( service(name,createIf,quiet) ); }
SmartIF
Small smart pointer class with automatic reference counting for IInterface.
Definition: IConverter.h:14
AlgTool::service
StatusCode service(const std::string &name, T *&svc, bool createIf=true) const
Access a service by name, creating it if it doesn't already exist.
Definition: AlgTool.h:195

StatusCode AlgTool::service_i | ( | const std::string & | algName,
|  | bool | createIf,
|  | const InterfaceID & | iid,
|  | void ** | ppSvc
| ) |  | const
| private

flag indicating whether ToolHandle tools have been added to m_tools

implementation of service method

Definition at line 529 of file AlgTool.cpp.

532 {
533 const ServiceLocatorHelper helper(*serviceLocator(), *this);
534 return helper.getService(svcName, createIf, iid, ppSvc);
535 }
ServiceLocatorHelper
an helper to share the implementation of service() among the various kernel base classes ...
Definition: ServiceLocatorHelper.h:17
AlgTool::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: AlgTool.cpp:86

StatusCode AlgTool::service_i | ( | const std::string & | svcType,
|  | const std::string & | svcName,
|  | const InterfaceID & | iid,
|  | void ** | ppS
| ) |  | const
| private

Definition at line 539 of file AlgTool.cpp.

542 {
543 const ServiceLocatorHelper helper(*serviceLocator(), *this);
544 return helper.createService(svcType, svcName, iid, ppSvc);
545 }
ServiceLocatorHelper
an helper to share the implementation of service() among the various kernel base classes ...
Definition: ServiceLocatorHelper.h:17
AlgTool::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: AlgTool.cpp:86

SmartIF< ISvcLocator > & AlgTool::serviceLocator | ( |  | ) | const
| override

Retrieve pointer to service locator.

Definition at line 86 of file AlgTool.cpp.

88 {
89 return m_svcLocator;
90 }
AlgTool::m_svcLocator
SmartIF< ISvcLocator > m_svcLocator
Pointer to Service Locator service.
Definition: AlgTool.h:484

StatusCode AlgTool::setProperties | ( |  | ) |

Method for setting declared properties to the values specified in the jobOptions via the job option service.

This method is called by the ToolSvc after creating the concrete tool, before passing it to the requesting parent and does not need to be called explicitly.

Definition at line 171 of file AlgTool.cpp.

173 {
174 if( !m_svcLocator ) return StatusCode::FAILURE;
175 auto jos = m_svcLocator->service<IJobOptionsSvc>("JobOptionsSvc");
176 if( !jos ) return StatusCode::FAILURE;
177
178 // set first generic Properties
179 StatusCode sc = jos->setMyProperties( getGaudiThreadGenericName(name()), this );
180 if( sc.isFailure() ) return StatusCode::FAILURE;
181
182 // set specific Properties
183 if (isGaudiThreaded(name())) {
184 if(jos->setMyProperties( name(), this ).isFailure()) {
185 return StatusCode::FAILURE;
186 }
187 }
188 updateMsgStreamOutputLevel( m_outputLevel );
189 return StatusCode::SUCCESS;
190 }
AlgTool::m_outputLevel
IntegerProperty m_outputLevel
AlgTool output level.
Definition: AlgTool.h:480
merge_files.sc
int sc
Definition: merge_files.py:167
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
isGaudiThreaded
GAUDI_API bool isGaudiThreaded(const std::string &name)
test if current Gaudi object is running /will run in a thread
Definition: ThreadGaudi.cpp:73
ISvcLocator::service
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
Definition: ISvcLocator.h:78
IJobOptionsSvc
Main interface for the JobOptions service.
Definition: IJobOptionsSvc.h:20
StatusCode::FAILURE
Definition: StatusCode.h:29
StatusCode::SUCCESS
Definition: StatusCode.h:30
CommonMessaging< implements< IAlgTool, IDataHandleHolder, IProperty, IStateful > >::updateMsgStreamOutputLevel
void updateMsgStreamOutputLevel(int level)
Update the output level of the cached MsgStream.
Definition: CommonMessaging.h:187
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
AlgTool::m_svcLocator
SmartIF< ISvcLocator > m_svcLocator
Pointer to Service Locator service.
Definition: AlgTool.h:484
AlgTool::name
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:65
getGaudiThreadGenericName
GAUDI_API std::string getGaudiThreadGenericName(const std::string &name)
helper function to extract Gaudi instance name from thread copy name
Definition: ThreadGaudi.cpp:50

StatusCode AlgTool::setProperty | ( | const Property & | p | ) |
| override

Default implementations for IProperty interface.

Definition at line 119 of file AlgTool.cpp.

121 {
122 return m_propertyMgr->setProperty(p);
123 }
PropertyMgr::setProperty
StatusCode setProperty(const Property &p) override
set the property form another property
Definition: PropertyMgr.cpp:105
AlgTool::m_propertyMgr
SmartIF< PropertyMgr > m_propertyMgr
Property Manager.
Definition: AlgTool.h:490

StatusCode AlgTool::setProperty | ( | const std::string & | s | ) |
| override

Definition at line 126 of file AlgTool.cpp.

128 {
129 return m_propertyMgr->setProperty(s);
130 }
PropertyMgr::setProperty
StatusCode setProperty(const Property &p) override
set the property form another property
Definition: PropertyMgr.cpp:105
AlgTool::m_propertyMgr
SmartIF< PropertyMgr > m_propertyMgr
Property Manager.
Definition: AlgTool.h:490

StatusCode AlgTool::setProperty | ( | const std::string & | n,
|  | const std::string & | v
| ) |  |
| override

Definition at line 133 of file AlgTool.cpp.

135 {
136 return m_propertyMgr->setProperty(n,v);
137 }
PropertyMgr::setProperty
StatusCode setProperty(const Property &p) override
set the property form another property
Definition: PropertyMgr.cpp:105
AlgTool::m_propertyMgr
SmartIF< PropertyMgr > m_propertyMgr
Property Manager.
Definition: AlgTool.h:490
template<class TYPE >

StatusCode AlgTool::setProperty | ( | const std::string & | name,
|  | const TYPE & | value
| ) |  |
| inline

set the property form the value

std::vector<double> data = ... ;
setProperty( "Data" , data ) ;
std::map<std::string,double> cuts = ... ;
setProperty( "Cuts" , cuts ) ;
std::map<std::string,std::string> dict = ... ;
setProperty( "Dictionary" , dict ) ;

Note: the interface IProperty allows setting of the properties either directly from other properties or from strings only

This is very convenient in resetting of the default properties in the derived classes. E.g. without this method one needs to convert everything into strings to use IProperty::setProperty

setProperty ( "OutputLevel" , "1" ) ;
setProperty ( "Enable" , "True" ) ;
setProperty ( "ErrorMax" , "10" ) ;

For simple cases it is more or less ok, but for complicated properties it is just ugly..

Parameters

  name | name of the property
  value | value of the property

See also
  Gaudi::Utils::setProperty

Author
  Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u

Date
  2007-05-13

Definition at line 155 of file AlgTool.h.

157 { return Gaudi::Utils::setProperty ( m_propertyMgr.get() , name , value ) ; }
Gaudi::Utils::setProperty
StatusCode setProperty(IProperty *component, const std::string &name, const TYPE &value, const std::string &doc)
simple function to set the property of the given object from the value
Definition: Property.h:1187
SmartIF::get
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:76
AlgTool::m_propertyMgr
SmartIF< PropertyMgr > m_propertyMgr
Property Manager.
Definition: AlgTool.h:490
dump_component_properties.value
list value
Definition: dump_component_properties.py:12
AlgTool::name
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:65

StatusCode AlgTool::start | ( |  | ) |
| override

Definition at line 315 of file AlgTool.cpp.

317 {
318 // For the time being there is nothing to be done here.
319 return StatusCode::SUCCESS;
320 }
StatusCode::SUCCESS
Definition: StatusCode.h:30

StatusCode AlgTool::stop | ( |  | ) |
| override

Definition at line 338 of file AlgTool.cpp.

340 {
341 // For the time being there is nothing to be done here.
342 return StatusCode::SUCCESS;
343 }
StatusCode::SUCCESS
Definition: StatusCode.h:30

ISvcLocator* AlgTool::svcLoc | ( |  | ) | const
| inline

shortcut for the method service locator

Definition at line 173 of file AlgTool.h.

173 { return serviceLocator() ; }
AlgTool::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: AlgTool.cpp:86

StatusCode AlgTool::sysFinalize | ( |  | ) |
| override

Finalize AlgTool.

Definition at line 346 of file AlgTool.cpp.

346 {
347 //-----------------------------------------------------------------------------
348 return attempt( *this, "sysFinalize", [&]() {
349 m_targetState = Gaudi::StateMachine::ChangeState( Gaudi::StateMachine::FINALIZE, m_state);
350 Gaudi::Guards::AuditorGuard guard(this,
351 // check if we want to audit the initialize
352 m_auditorFinalize ? auditorSvc() : nullptr,
353 IAuditor::Finalize);
354 StatusCode sc = finalize();
355 if (sc.isSuccess()) m_state = m_targetState;
356 return sc;
357 } );
358 }
Gaudi::StateMachine::FINALIZE
Definition: StateMachine.h:28
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
merge_files.sc
int sc
Definition: merge_files.py:167
AlgTool::finalize
StatusCode finalize() override
Definition: AlgTool.cpp:360
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
IAuditor::Finalize
Definition: IAuditor.h:30
AlgTool::m_auditorFinalize
bool m_auditorFinalize
flag for auditors in "finalize()"
Definition: AlgTool.h:517
AlgTool::m_state
Gaudi::StateMachine::State m_state
state of the Tool
Definition: AlgTool.h:521
Gaudi::StateMachine::ChangeState
State GAUDI_API ChangeState(const Transition transition, const State state)
Function to get the new state according to the required transition, checking if the transition is all...
Definition: StateMachine.cpp:8
AlgTool::m_targetState
Gaudi::StateMachine::State m_targetState
state of the Tool
Definition: AlgTool.h:522
Gaudi::Guards::AuditorGuard
It is a simple guard, which "locks" the scope for the Auditor Service is am exception-safe way...
Definition: Guards.h:214
AlgTool::auditorSvc
IAuditorSvc * auditorSvc() const
Access the auditor service.
Definition: AlgTool.cpp:553

StatusCode AlgTool::sysInitialize | ( |  | ) |
| override

Initialize AlgTool.

Definition at line 271 of file AlgTool.cpp.

271 {
272 //-----------------------------------------------------------------------------
273 return attempt( *this, "sysInitialize", [&]() {
274 m_targetState = Gaudi::StateMachine::ChangeState( Gaudi::StateMachine::INITIALIZE, m_state);
275 Gaudi::Guards::AuditorGuard guard(this,
276 // check if we want to audit the initialize
277 m_auditorInitialize ? auditorSvc() : nullptr,
278 IAuditor::Initialize);
279 StatusCode sc = initialize();
280 if (!sc) return sc;
281
282 m_state = m_targetState;
283 if (m_updateDataHandles)
284 acceptDHVisitor(m_updateDataHandles.get());
285
286 return sc;
287 } );
288 }
AlgTool::initialize
StatusCode initialize() override
Definition: AlgTool.cpp:290
merge_files.sc
int sc
Definition: merge_files.py:167
Gaudi::StateMachine::INITIALIZE
Definition: StateMachine.h:25
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
IAuditor::Initialize
Definition: IAuditor.h:25
AlgTool::acceptDHVisitor
virtual void acceptDHVisitor(IDataHandleVisitor *) const override
Definition: AlgTool.cpp:566
std::unique_ptr::get
T get(T...args)
AlgTool::m_state
Gaudi::StateMachine::State m_state
state of the Tool
Definition: AlgTool.h:521
Gaudi::StateMachine::ChangeState
State GAUDI_API ChangeState(const Transition transition, const State state)
Function to get the new state according to the required transition, checking if the transition is all...
Definition: StateMachine.cpp:8
AlgTool::m_targetState
Gaudi::StateMachine::State m_targetState
state of the Tool
Definition: AlgTool.h:522
Gaudi::Guards::AuditorGuard
It is a simple guard, which "locks" the scope for the Auditor Service is am exception-safe way...
Definition: Guards.h:214
AlgTool::m_auditorInitialize
bool m_auditorInitialize
flag for auditors in "initialize()"
Definition: AlgTool.h:514
AlgTool::auditorSvc
IAuditorSvc * auditorSvc() const
Access the auditor service.
Definition: AlgTool.cpp:553
AlgTool::m_updateDataHandles
std::unique_ptr< IDataHandleVisitor > m_updateDataHandles
Hook for for derived classes to provide a custom visitor for data handles.
Definition: AlgTool.h:416

StatusCode AlgTool::sysReinitialize | ( |  | ) |
| override

Initialize AlgTool.

Definition at line 368 of file AlgTool.cpp.

368 {
369 //-----------------------------------------------------------------------------
370
371 // Check that the current status is the correct one.
372 if ( Gaudi::StateMachine::INITIALIZED != FSMState() ) {
373 error()
374 << "sysReinitialize(): cannot reinitialize tool not initialized"
375 << endmsg;
376 return StatusCode::FAILURE;
377 }
378
379 return attempt(*this, "SysReinitialize()", [&]() {
380 Gaudi::Guards::AuditorGuard guard(this,
381 // check if we want to audit the initialize
382 m_auditorReinitialize ? auditorSvc() : nullptr,
383 IAuditor::ReInitialize);
384 return reinitialize();
385 } );
386
387 }
Gaudi::StateMachine::INITIALIZED
Definition: StateMachine.h:15
IAuditor::ReInitialize
Definition: IAuditor.h:26
AlgTool::FSMState
Gaudi::StateMachine::State FSMState() const override
Definition: AlgTool.h:78
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:118
StatusCode::FAILURE
Definition: StatusCode.h:29
AlgTool::m_auditorReinitialize
bool m_auditorReinitialize
flag for auditors in "reinitialize()"
Definition: AlgTool.h:518
AlgTool::reinitialize
StatusCode reinitialize() override
Definition: AlgTool.cpp:390
Gaudi::Guards::AuditorGuard
It is a simple guard, which "locks" the scope for the Auditor Service is am exception-safe way...
Definition: Guards.h:214
AlgTool::auditorSvc
IAuditorSvc * auditorSvc() const
Access the auditor service.
Definition: AlgTool.cpp:553
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

StatusCode AlgTool::sysRestart | ( |  | ) |
| override

Start AlgTool.

Definition at line 413 of file AlgTool.cpp.

413 {
414 //-----------------------------------------------------------------------------
415
416 // Check that the current status is the correct one.
417 if ( Gaudi::StateMachine::RUNNING != FSMState() ) {
418 error()
419 << "sysRestart(): cannot reinitialize tool not started"
420 << endmsg;
421 return StatusCode::FAILURE;
422 }
423
424 return attempt(*this, "sysRestart", [&]() {
425 m_targetState = Gaudi::StateMachine::ChangeState(Gaudi::StateMachine::START,m_state);
426 Gaudi::Guards::AuditorGuard guard(this,
427 // check if we want to audit the initialize
428 m_auditorRestart ? auditorSvc() : nullptr,
429 IAuditor::ReStart);
430 return restart();
431 } );
432 }
IAuditor::ReStart
Definition: IAuditor.h:33
AlgTool::FSMState
Gaudi::StateMachine::State FSMState() const override
Definition: AlgTool.h:78
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:118
StatusCode::FAILURE
Definition: StatusCode.h:29
AlgTool::restart
StatusCode restart() override
Definition: AlgTool.cpp:435
Gaudi::StateMachine::RUNNING
Definition: StateMachine.h:16
AlgTool::m_state
Gaudi::StateMachine::State m_state
state of the Tool
Definition: AlgTool.h:521
Gaudi::StateMachine::ChangeState
State GAUDI_API ChangeState(const Transition transition, const State state)
Function to get the new state according to the required transition, checking if the transition is all...
Definition: StateMachine.cpp:8
Gaudi::StateMachine::START
Definition: StateMachine.h:26
AlgTool::m_auditorRestart
bool m_auditorRestart
flag for auditors in "restart()"
Definition: AlgTool.h:519
AlgTool::m_targetState
Gaudi::StateMachine::State m_targetState
state of the Tool
Definition: AlgTool.h:522
Gaudi::Guards::AuditorGuard
It is a simple guard, which "locks" the scope for the Auditor Service is am exception-safe way...
Definition: Guards.h:214
AlgTool::auditorSvc
IAuditorSvc * auditorSvc() const
Access the auditor service.
Definition: AlgTool.cpp:553
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

StatusCode AlgTool::sysStart | ( |  | ) |
| override

Start AlgTool.

Definition at line 300 of file AlgTool.cpp.

300 {
301 //-----------------------------------------------------------------------------
302 return attempt( *this, "sysInitialize", [&]() {
303 m_targetState = Gaudi::StateMachine::ChangeState( Gaudi::StateMachine::START, m_state);
304 Gaudi::Guards::AuditorGuard guard(this,
305 // check if we want to audit the initialize
306 m_auditorStart ? auditorSvc() : nullptr,
307 IAuditor::Start);
308 StatusCode sc = start();
309 if (sc.isSuccess()) m_state = m_targetState;
310 return sc;
311 } );
312 }
IAuditor::Start
Definition: IAuditor.h:31
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
merge_files.sc
int sc
Definition: merge_files.py:167
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
AlgTool::m_state
Gaudi::StateMachine::State m_state
state of the Tool
Definition: AlgTool.h:521
Gaudi::StateMachine::ChangeState
State GAUDI_API ChangeState(const Transition transition, const State state)
Function to get the new state according to the required transition, checking if the transition is all...
Definition: StateMachine.cpp:8
Gaudi::StateMachine::START
Definition: StateMachine.h:26
AlgTool::m_auditorStart
bool m_auditorStart
flag for auditors in "start()"
Definition: AlgTool.h:515
AlgTool::m_targetState
Gaudi::StateMachine::State m_targetState
state of the Tool
Definition: AlgTool.h:522
Gaudi::Guards::AuditorGuard
It is a simple guard, which "locks" the scope for the Auditor Service is am exception-safe way...
Definition: Guards.h:214
AlgTool::auditorSvc
IAuditorSvc * auditorSvc() const
Access the auditor service.
Definition: AlgTool.cpp:553
AlgTool::start
StatusCode start() override
Definition: AlgTool.cpp:315

StatusCode AlgTool::sysStop | ( |  | ) |
| override

Stop AlgTool.

Definition at line 323 of file AlgTool.cpp.

323 {
324 //-----------------------------------------------------------------------------
325 return attempt( *this, "sysStop", [&]() {
326 m_targetState = Gaudi::StateMachine::ChangeState( Gaudi::StateMachine::STOP, m_state);
327 Gaudi::Guards::AuditorGuard guard(this,
328 // check if we want to audit the initialize
329 m_auditorStop ? auditorSvc() : nullptr,
330 IAuditor::Stop);
331 StatusCode sc = stop();
332 if (sc.isSuccess()) m_state = m_targetState;
333 return sc;
334 } );
335 }
IAuditor::Stop
Definition: IAuditor.h:32
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
merge_files.sc
int sc
Definition: merge_files.py:167
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
Gaudi::StateMachine::STOP
Definition: StateMachine.h:27
AlgTool::m_state
Gaudi::StateMachine::State m_state
state of the Tool
Definition: AlgTool.h:521
Gaudi::StateMachine::ChangeState
State GAUDI_API ChangeState(const Transition transition, const State state)
Function to get the new state according to the required transition, checking if the transition is all...
Definition: StateMachine.cpp:8
AlgTool::stop
StatusCode stop() override
Definition: AlgTool.cpp:338
AlgTool::m_targetState
Gaudi::StateMachine::State m_targetState
state of the Tool
Definition: AlgTool.h:522
Gaudi::Guards::AuditorGuard
It is a simple guard, which "locks" the scope for the Auditor Service is am exception-safe way...
Definition: Guards.h:214
AlgTool::m_auditorStop
bool m_auditorStop
flag for auditors in "stop()"
Definition: AlgTool.h:516
AlgTool::auditorSvc
IAuditorSvc * auditorSvc() const
Access the auditor service.
Definition: AlgTool.cpp:553

Gaudi::StateMachine::State AlgTool::targetFSMState | ( |  | ) | const
| inline override

Definition at line 79 of file AlgTool.h.

79 { return m_targetState; }
AlgTool::m_targetState
Gaudi::StateMachine::State m_targetState
state of the Tool
Definition: AlgTool.h:522

StatusCode AlgTool::terminate | ( |  | ) |
| inline override

Definition at line 75 of file AlgTool.h.

75 { return StatusCode::SUCCESS; }
StatusCode::SUCCESS
Definition: StatusCode.h:30

const std::vector< IAlgTool * > & AlgTool::tools | ( |  | ) | const

Definition at line 512 of file AlgTool.cpp.

512 {
513 if(UNLIKELY(!m_toolHandlesInit))
514 initToolHandles();
515
516 return m_tools;
517 }
UNLIKELY
#define UNLIKELY(x)
Definition: Kernel.h:126
AlgTool::m_tools
std::vector< IAlgTool * > m_tools
Definition: AlgTool.h:496
AlgTool::m_toolHandlesInit
bool m_toolHandlesInit
Definition: AlgTool.h:499
AlgTool::initToolHandles
void initToolHandles() const
Definition: AlgTool.cpp:460

std::vector< IAlgTool * > & AlgTool::tools | ( |  | ) |
| protected

Definition at line 519 of file AlgTool.cpp.

519 {
520 if(UNLIKELY(!m_toolHandlesInit))
521 initToolHandles();
522
523 return m_tools;
524 }
UNLIKELY
#define UNLIKELY(x)
Definition: Kernel.h:126
AlgTool::m_tools
std::vector< IAlgTool * > m_tools
Definition: AlgTool.h:496
AlgTool::m_toolHandlesInit
bool m_toolHandlesInit
Definition: AlgTool.h:499
AlgTool::initToolHandles
void initToolHandles() const
Definition: AlgTool.cpp:460

IToolSvc * AlgTool::toolSvc | ( |  | ) | const

The standard ToolSvc service, Return a pointer to the service if present.

Definition at line 106 of file AlgTool.cpp.

108 {
109 if ( !m_ptoolSvc ) {
110 m_ptoolSvc = service( "ToolSvc", true );
111 if( !m_ptoolSvc ) {
112 throw GaudiException("Service [ToolSvc] not found", name(), StatusCode::FAILURE);
113 }
114 }
115 return m_ptoolSvc.get();
116 }
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:23
SmartIF::get
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:76
StatusCode::FAILURE
Definition: StatusCode.h:29
AlgTool::service
StatusCode service(const std::string &name, T *&svc, bool createIf=true) const
Access a service by name, creating it if it doesn't already exist.
Definition: AlgTool.h:195
AlgTool::m_ptoolSvc
SmartIF< IToolSvc > m_ptoolSvc
Tool service.
Definition: AlgTool.h:486
AlgTool::name
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:65

const std::string & AlgTool::type | ( |  | ) | const
| override

Retrieve type (concrete class) of the sub-algtool.

Definition at line 72 of file AlgTool.cpp.

74 {
75 return m_type;
76 }
AlgTool::m_type
std::string m_type
AlgTool type (concrete class name)
Definition: AlgTool.h:481

## Member Data Documentation

BooleanProperty AlgTool::m_auditInit = false
| private

Definition at line 513 of file AlgTool.h.

bool AlgTool::m_auditorFinalize = false
| private

flag for auditors in "finalize()"

Definition at line 517 of file AlgTool.h.

bool AlgTool::m_auditorInitialize = false
| private

flag for auditors in "initialize()"

Definition at line 514 of file AlgTool.h.

bool AlgTool::m_auditorReinitialize = false
| private

flag for auditors in "reinitialize()"

Definition at line 518 of file AlgTool.h.

bool AlgTool::m_auditorRestart = false
| private

flag for auditors in "restart()"

Definition at line 519 of file AlgTool.h.

bool AlgTool::m_auditorStart = false
| private

flag for auditors in "start()"

Definition at line 515 of file AlgTool.h.

bool AlgTool::m_auditorStop = false
| private

flag for auditors in "stop()"

Definition at line 516 of file AlgTool.h.

SmartIF<IDataProviderSvc> AlgTool::m_evtSvc
| mutable private

Event data service.

Definition at line 485 of file AlgTool.h.

DataObjIDColl AlgTool::m_extInputDataObjs
| private

Definition at line 333 of file AlgTool.h.

DataObjIDColl AlgTool::m_extOutputDataObjs
| private

Definition at line 333 of file AlgTool.h.

DataObjIDColl AlgTool::m_inputDataObjs
| private

Definition at line 331 of file AlgTool.h.

std::vector<Gaudi::DataHandle*> AlgTool::m_inputHandles
| private

Definition at line 330 of file AlgTool.h.

InterfaceList AlgTool::m_interfaceList
| private

Interface list.

Definition at line 492 of file AlgTool.h.

std::string AlgTool::m_monitorSvcName
| private

Name to use for Monitor Service.

Definition at line 488 of file AlgTool.h.

const std::string AlgTool::m_name
| private

AlgTool full name.

Definition at line 482 of file AlgTool.h.

DataObjIDColl AlgTool::m_outputDataObjs
| private

Definition at line 331 of file AlgTool.h.

std::vector<Gaudi::DataHandle*> AlgTool::m_outputHandles
| private

Definition at line 330 of file AlgTool.h.

IntegerProperty AlgTool::m_outputLevel = MSG::NIL
| private

AlgTool output level.

Definition at line 480 of file AlgTool.h.

const IInterface* AlgTool::m_parent = nullptr
| private

AlgTool parent.

Definition at line 483 of file AlgTool.h.

SmartIF<IAuditorSvc> AlgTool::m_pAuditorSvc
| mutable private

Auditor Service.

Definition at line 511 of file AlgTool.h.

SmartIF<IMonitorSvc> AlgTool::m_pMonitorSvc
| mutable private

Online Monitoring Service.

Definition at line 487 of file AlgTool.h.

SmartIF<PropertyMgr> AlgTool::m_propertyMgr
| protected

Property Manager.

Definition at line 490 of file AlgTool.h.

SmartIF<IToolSvc> AlgTool::m_ptoolSvc
| mutable private

Tool service.

Definition at line 486 of file AlgTool.h.

Gaudi::StateMachine::State AlgTool::m_state = Gaudi::StateMachine::CONFIGURED
| private

state of the Tool

Definition at line 521 of file AlgTool.h.

SmartIF<ISvcLocator> AlgTool::m_svcLocator
| mutable private

Pointer to Service Locator service.

Definition at line 484 of file AlgTool.h.

Gaudi::StateMachine::State AlgTool::m_targetState = Gaudi::StateMachine::CONFIGURED
| private

state of the Tool

Definition at line 522 of file AlgTool.h.

std::string AlgTool::m_threadID
| private

Thread Id for Alg Tool.

Definition at line 493 of file AlgTool.h.

std::vector<GaudiHandleArrayBase*> AlgTool::m_toolHandleArrays
| mutable private

Definition at line 498 of file AlgTool.h.

std::vector<BaseToolHandle *> AlgTool::m_toolHandles
| mutable private

Definition at line 497 of file AlgTool.h.

bool AlgTool::m_toolHandlesInit = false
| mutable private

Definition at line 499 of file AlgTool.h.

std::vector<IAlgTool *> AlgTool::m_tools
| mutable private

Definition at line 496 of file AlgTool.h.

std::string AlgTool::m_type
| private

AlgTool type (concrete class name)

Definition at line 481 of file AlgTool.h.

std::unique_ptr<IDataHandleVisitor> AlgTool::m_updateDataHandles
| protected

Hook for for derived classes to provide a custom visitor for data handles.

Definition at line 416 of file AlgTool.h.

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

- GaudiKernel/GaudiKernel/AlgTool.h
- GaudiKernel/src/Lib/AlgTool.cpp