| The Gaudi Framework v28r2-patches (bc4ad17a)

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

- File List
- File Members

PrintAlgsSequences.cpp
Go to the documentation of this file.
1 #include "GaudiKernel/IAlgManager.h"
2 #include "GaudiKernel/IAlgorithm.h"
3 #include "GaudiKernel/IMessageSvc.h"
4 #include "GaudiKernel/IProperty.h"
5 #include "GaudiKernel/MsgStream.h"
6 #include "GaudiKernel/Property.h"
7
8 namespace
9 {
11 void printAlgsSequences( SmartIF<IAlgManager>& algmgr, const std::string& algname, MsgStream& log, int indent )
12 {
13 using Gaudi::Utils::TypeNameString;
14 log << MSG::ALWAYS;
15 for ( int i = 0; i < indent; ++i ) log << " ";
16 log << algname << endmsg;
17 auto prop = algmgr->algorithm<IProperty>( algname, false );
18 if ( prop ) {
19 // Try to get the property Members
20 Gaudi::Property<std::vector<std::string>> p( "Members", {} );
21 if ( prop->getProperty( &p ).isSuccess() ) {
22 for ( auto& subalgname : p.value() ) {
23 printAlgsSequences( algmgr, subalgname, log, indent + 1 );
24 }
25 }
26 } else {
27 log << MSG::WARNING << "Cannot get properties of " << algname << endmsg;
28 }
29 }
31 void printAlgsSequences( IInterface* app )
32 {
33 auto prop = SmartIF<IProperty>( app );
34 auto algmgr = SmartIF<IAlgManager>( app );
35 auto msgsvc = SmartIF<IMessageSvc>( app );
36 if ( !prop || !algmgr ) return;
37 Gaudi::Property<std::vector<std::string>> topalg( "TopAlg", {} );
38 if ( prop->getProperty( &topalg ).isSuccess() ) {
39 MsgStream log( msgsvc, "ApplicationMgr" );
40 log << MSG::ALWAYS << "****************************** Algorithm Sequence ****************************" << endmsg;
41 for ( auto& algname : topalg.value() ) {
42 printAlgsSequences( algmgr, algname, log, 0 );
43 }
44 log << MSG::ALWAYS << "******************************************************************************" << endmsg;
45 }
46 }
47 }
48
49 #ifdef GAUDI_HASCLASSVISIBILITY
50 #pragma GCC visibility push( default )
51 #endif
52 extern "C" {
54 void py_helper_printAlgsSequences( IInterface* app ) { printAlgsSequences( app ); }
55 }
56 #ifdef GAUDI_HASCLASSVISIBILITY
57 #pragma GCC visibility pop
58 #endif
IAlgManager::algorithm
virtual SmartIF< IAlgorithm > & algorithm(const Gaudi::Utils::TypeNameString &typeName, const bool createIf=true)=0
Returns a smart pointer to a service.
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
SmartIF< IAlgManager >
Gaudi::Property
Implementation of property with value of concrete type.
Definition: Property.h:314
MsgStream.h
IAlgorithm.h
std::string
STL class.
Gaudi::Utils::TypeNameString
Helper class to parse a string of format "type/name".
Definition: TypeNameString.h:12
py_helper_printAlgsSequences
void py_helper_printAlgsSequences(IInterface *app)
Helper to call printAlgsSequences from Pyhton ctypes.
Definition: PrintAlgsSequences.cpp:54
IInterface
Definition of the basic interface.
Definition: IInterface.h:234
IMessageSvc.h
IProperty.h
Property.h
BrunelScenarioForwardScheduler.app
app
Definition: BrunelScenarioForwardScheduler.py:137
IAlgManager.h
MSG::WARNING
Definition: IMessageSvc.h:20
IProperty
The IProperty is the basic interface for all components which have properties that can be set or get...
Definition: IProperty.h:20
MSG::ALWAYS
Definition: IMessageSvc.h:23
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
Gaudi.Configuration.log
log
Definition: Configuration.py:13