The Gaudi Framework
master (bdbe7744)
Toggle main menu visibility
Loading...
Searching...
No Matches
PrintAlgsSequences.cpp
Go to the documentation of this file.
1
/***********************************************************************************\
2
* (c) Copyright 1998-2024 CERN for the benefit of the LHCb and ATLAS collaborations *
3
* *
4
* This software is distributed under the terms of the Apache version 2 licence, *
5
* copied verbatim in the file "LICENSE". *
6
* *
7
* In applying this licence, CERN does not waive the privileges and immunities *
8
* granted to it by virtue of its status as an Intergovernmental Organization *
9
* or submit itself to any jurisdiction. *
10
\***********************************************************************************/
11
#include <
Gaudi/Property.h
>
12
#include <
GaudiKernel/IAlgManager.h
>
13
#include <
GaudiKernel/IAlgorithm.h
>
14
#include <
GaudiKernel/IMessageSvc.h
>
15
#include <
GaudiKernel/IProperty.h
>
16
#include <
GaudiKernel/MsgStream.h
>
17
18
namespace
{
20
void
printAlgsSequences(
SmartIF<IAlgManager>
& algmgr,
const
std::string& algname,
MsgStream
& log,
int
indent ) {
21
using
Gaudi::Utils::TypeNameString
;
22
log
<<
MSG::ALWAYS
;
23
for
(
int
i = 0; i < indent; ++i ) log <<
" "
;
24
log
<< algname <<
endmsg
;
25
auto
prop = algmgr->algorithm<
IProperty
>( algname, false );
26
if
( prop ) {
27
// Try to get the property Members
28
Gaudi::Property<std::vector<std::string>
> p(
"Members"
, {} );
29
if
( prop->getProperty( &p ).isSuccess() ) {
30
for
(
auto
& subalgname : p.value() ) { printAlgsSequences( algmgr, subalgname, log, indent + 1 ); }
31
}
32
}
else
{
33
log
<<
MSG::WARNING
<<
"Cannot get properties of "
<< algname <<
endmsg
;
34
}
35
}
37
void
printAlgsSequences(
IInterface
* app ) {
38
auto
prop =
SmartIF<IProperty>
( app );
39
auto
algmgr =
SmartIF<IAlgManager>
( app );
40
auto
msgsvc =
SmartIF<IMessageSvc>
( app );
41
if
( !prop || !algmgr )
return
;
42
Gaudi::Property<std::vector<std::string>
> topalg(
"TopAlg"
, {} );
43
if
( prop->getProperty( &topalg ).isSuccess() ) {
44
MsgStream
log
( msgsvc,
"ApplicationMgr"
);
45
log
<<
MSG::ALWAYS
<<
"****************************** Algorithm Sequence ****************************"
<<
endmsg
;
46
for
(
auto
& algname : topalg.value() ) { printAlgsSequences( algmgr, algname, log, 0 ); }
47
log
<<
MSG::ALWAYS
<<
"******************************************************************************"
<<
endmsg
;
48
}
49
}
50
}
// namespace
51
52
#ifdef GAUDI_HASCLASSVISIBILITY
53
# pragma GCC visibility push( default )
54
#endif
55
extern
"C"
{
57
void
py_helper_printAlgsSequences
(
IInterface
* app ) { printAlgsSequences( app ); }
58
}
59
#ifdef GAUDI_HASCLASSVISIBILITY
60
# pragma GCC visibility pop
61
#endif
Property.h
IAlgManager.h
IAlgorithm.h
IMessageSvc.h
IProperty.h
MsgStream.h
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition
MsgStream.h:198
py_helper_printAlgsSequences
void py_helper_printAlgsSequences(IInterface *app)
Helper to call printAlgsSequences from Pyhton ctypes.
Definition
PrintAlgsSequences.cpp:57
Gaudi::Property
Implementation of property with value of concrete type.
Definition
Property.h:35
Gaudi::Utils::TypeNameString
Helper class to parse a string of format "type/name".
Definition
TypeNameString.h:19
IInterface
Definition of the basic interface.
Definition
IInterface.h:225
IProperty
The IProperty is the basic interface for all components which have properties that can be set or get.
Definition
IProperty.h:32
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition
MsgStream.h:29
SmartIF
Small smart pointer class with automatic reference counting for IInterface.
Definition
SmartIF.h:28
Gaudi.Configuration.log
log
Definition
Configuration.py:28
MSG::WARNING
@ WARNING
Definition
IMessageSvc.h:22
MSG::ALWAYS
@ ALWAYS
Definition
IMessageSvc.h:22
GaudiKernel
src
Lib
PrintAlgsSequences.cpp
Generated on
for The Gaudi Framework by
1.17.0