| The Gaudi Framework v27r1

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

- File List
- File Members

PrintAlgsSequences.cpp
Go to the documentation of this file.
1 #include "GaudiKernel/IProperty.h"
2 #include "GaudiKernel/Property.h"
3 #include "GaudiKernel/IAlgManager.h"
4 #include "GaudiKernel/MsgStream.h"
5 #include "GaudiKernel/IMessageSvc.h"
6 #include "GaudiKernel/IAlgorithm.h"
7
8 namespace {
10 void printAlgsSequences(SmartIF<IAlgManager>& algmgr, const std::string& algname, MsgStream& log, int indent) {
11 using Gaudi::Utils::TypeNameString;
12 log << MSG::ALWAYS;
13 for(int i=0; i < indent; ++i) log << " ";
14 log << algname << endmsg;
15 auto prop = algmgr->algorithm<IProperty>(algname, false);
16 if (prop) {
17 // Try to get the property Members
18 StringArrayProperty p("Members", {});
19 if (prop->getProperty(&p).isSuccess()) {
20 for(auto& subalgname: p.value()) {
21 printAlgsSequences(algmgr, subalgname, log, indent+1);
22 }
23 }
24 } else {
25 log << MSG::WARNING << "Cannot get properties of " << algname << endmsg;
26 }
27 }
29 void printAlgsSequences(IInterface* app) {
30 auto prop = SmartIF<IProperty>(app);
31 auto algmgr = SmartIF<IAlgManager>(app);
32 auto msgsvc = SmartIF<IMessageSvc>(app);
33 if ( ! prop || ! algmgr ) return;
34 StringArrayProperty topalg("TopAlg", {});
35 if (prop->getProperty(&topalg).isSuccess()) {
36 MsgStream log(msgsvc, "ApplicationMgr");
37 log << MSG::ALWAYS << "****************************** Algorithm Sequence ****************************" << endmsg;
38 for(auto& algname: topalg.value()) {
39 printAlgsSequences(algmgr, algname, log, 0);
40 }
41 log << MSG::ALWAYS << "******************************************************************************" << endmsg;
42 }
43 }
44 }
45
46 #ifdef GAUDI_HASCLASSVISIBILITY
47 #pragma GCC visibility push(default)
48 #endif
49 extern "C" {
51 void py_helper_printAlgsSequences(IInterface* app) {
52 printAlgsSequences(app);
53 }
54 }
55 #ifdef GAUDI_HASCLASSVISIBILITY
56 #pragma GCC visibility pop
57 #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 >
MsgStream.h
Gaudi.Configuration.log
tuple log
Definition: Configuration.py:13
IAlgorithm.h
std::string
STL class.
SimpleProperty< std::vector< std::string > >
Gaudi::Utils::TypeNameString
Helper class to parse a string of format "type/name".
Definition: TypeNameString.h:9
py_helper_printAlgsSequences
void py_helper_printAlgsSequences(IInterface *app)
Helper to call printAlgsSequences from Pyhton ctypes.
Definition: PrintAlgsSequences.cpp:51
IInterface
Definition of the basic interface.
Definition: IInterface.h:234
IMessageSvc.h
IProperty.h
Property.h
project_manifest.indent
def indent
Definition: project_manifest.py:11
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:21
ana.i
list i
Definition: ana.py:128
AthenaScenario.app
tuple app
Definition: AthenaScenario.py:89
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