The Gaudi Framework  master (181af51f)
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>
17
18namespace {
20 void printAlgsSequences( SmartIF<IAlgManager>& algmgr, const std::string& algname, MsgStream& log, int indent ) {
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
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
55extern "C" {
57void py_helper_printAlgsSequences( IInterface* app ) { printAlgsSequences( app ); }
58}
59#ifdef GAUDI_HASCLASSVISIBILITY
60# pragma GCC visibility pop
61#endif
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition MsgStream.h:198
void py_helper_printAlgsSequences(IInterface *app)
Helper to call printAlgsSequences from Pyhton ctypes.
Implementation of property with value of concrete type.
Definition PropertyFwd.h:27
Helper class to parse a string of format "type/name".
Definition of the basic interface.
Definition IInterface.h:225
The IProperty is the basic interface for all components which have properties that can be set or get.
Definition IProperty.h:32
Definition of the MsgStream class used to transmit messages.
Definition MsgStream.h:29
Small smart pointer class with automatic reference counting for IInterface.
Definition SmartIF.h:28
@ WARNING
Definition IMessageSvc.h:22
@ ALWAYS
Definition IMessageSvc.h:22