| The Gaudi Framework v28r2-patches (bc4ad17a)

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

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

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

The Application Manager class. More...

`#include <src/ApplicationMgr/ApplicationMgr.h>`

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

## Public Member Functions
| ApplicationMgr (IInterface *=nullptr)
| ~ApplicationMgr () override=default
StatusCode | queryInterface (const InterfaceID &iid, void **pinterface) override
StatusCode | run () override
StatusCode | configure () override
StatusCode | terminate () override
StatusCode | initialize () override
StatusCode | start () override
StatusCode | stop () override
StatusCode | finalize () override
StatusCode | nextEvent (int maxevt) override
const std::string & | name () const override
StatusCode | executeEvent (void *par) override
| implementation of IEventProcessor::executeEvent(void*) More...
StatusCode | executeRun (int evtmax) override
| implementation of IEventProcessor::executeRun(int) More...
StatusCode | stopRun () override
| implementation of IEventProcessor::stopRun() More...
Gaudi::StateMachine::State | FSMState () const override
Gaudi::StateMachine::State | targetFSMState () const override
StatusCode | reinitialize () override
StatusCode | restart () override
StatusCode | sysInitialize () override
StatusCode | sysStart () override
StatusCode | sysStop () override
StatusCode | sysFinalize () override
StatusCode | sysReinitialize () override
StatusCode | sysRestart () override
void | SIGoHandler (Gaudi::Details::PropertyBase &theProp)
void | SIExitHandler (Gaudi::Details::PropertyBase &theProp)
template<class I >
SmartIF< IComponentManager > & | getManager ()
SmartIF< ISvcManager > & | svcManager ()
SmartIF< IAlgManager > & | algManager ()
SmartIF< ISvcLocator > & | serviceLocator () const override
| Needed to locate the message service. More...
Gaudi::Details::PropertyBase handlers
void | evtLoopPropertyHandler (Gaudi::Details::PropertyBase &theProp)
StatusCode | decodeExtSvcNameList ()
StatusCode | decodeCreateSvcNameList ()
void | createSvcNameListHandler (Gaudi::Details::PropertyBase &)
void | extSvcNameListHandler (Gaudi::Details::PropertyBase &theProp)
StatusCode | decodeMultiThreadSvcNameList ()
void | multiThreadSvcNameListHandler (Gaudi::Details::PropertyBase &theProp)
StatusCode | decodeDllNameList ()
void | dllNameListHandler (Gaudi::Details::PropertyBase &theProp)
void | pluginDebugPropertyHandler (Gaudi::Details::PropertyBase &theProp)
void | initLoopCheckHndlr (Gaudi::Details::PropertyBase &)
Public Member Functions inherited from PropertyHolder< CommonMessaging< implements< IAppMgrUI, IEventProcessor, IService, IStateful, INamedInterface, IProperty > > >
| PropertyHolder ()=default
| ~PropertyHolder () override=default
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Details::PropertyBase &prop)
| Declare a property. More...
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, TYPE &value, const std::string &doc="none")
| Helper to wrap a regular data member and use it as a regular property. More...
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, TYPE &value, const std::string &doc="none") const
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, Gaudi::Property< TYPE, VERIFIER, HANDLERS > &prop, const std::string &doc="none")
| Declare a PropertyBase instance setting name and documentation. More...
Gaudi::Details::PropertyBase * | declareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="")
| Declare a remote property. More...
StatusCode | setProperty (const Gaudi::Details::PropertyBase &p) override
| set the property form another property More...
StatusCode | setProperty (const std::string &s) override
| set the property from the formatted string More...
StatusCode | setProperty (const std::string &n, const std::string &v) override
| set the property from name and the value More...
StatusCode | setProperty (const std::string &name, const TYPE &value)
| set the property form the value More...
StatusCode | getProperty (Gaudi::Details::PropertyBase *p) const override
| get the property More...
const Gaudi::Details::PropertyBase & | getProperty (const std::string &name) const override
| get the property by name More...
StatusCode | getProperty (const std::string &n, std::string &v) const override
| convert the property to the string More...
const std::vector< Gaudi::Details::PropertyBase * > & | getProperties () const override
| get all properties More...
bool | hasProperty (const std::string &name) const override
| Return true if we have a property with the given name. More...
| PropertyHolder (const PropertyHolder &)=delete
PropertyHolder & | operator= (const PropertyHolder &)=delete
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, GaudiHandleBase &ref, const std::string &doc="none")
| Specializations for various GaudiHandles. More...
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, GaudiHandleArrayBase &ref, const std::string &doc="none")
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, DataObjectHandleBase &ref, const std::string &doc="none")
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 Types
typedef std::map< unsigned long, SmartIF< IComponentManager > > | ManagersMap
| Typedef for the map of component managers, the key is the "id" field of the basic InterfaceID of the managed components. More...

## Protected Member Functions
StatusCode | declareMultiSvcType (const std::string &name, const std::string &type)
| declare one or more copies of svc type/name as determined by NoOfThreads More...
StatusCode | addMultiSvc (const Gaudi::Utils::TypeNameString &typeName, int prio)
| add one or more copies of svc type/name as determined by NoOfThreads More...
void | setServiceManager (ISvcManager *) override
StatusCode | i_startup ()
| Internal startup routine. More...
StatusCode | GoToState (Gaudi::StateMachine::State state, bool ignoreFailures=false)
| Reach a state from current state (whichever it is) going through the correct transitions. More...
Protected Member Functions inherited from PropertyHolder< CommonMessaging< implements< IAppMgrUI, IEventProcessor, IService, IStateful, INamedInterface, IProperty > > >
Gaudi::Details::PropertyBase * | property (const std::string &name) const
Protected Member Functions inherited from CommonMessaging< implements< IAppMgrUI, IEventProcessor, IService, IStateful, INamedInterface, IProperty > >
void | updateMsgStreamOutputLevel (int level)
| Update the output level of the cached MsgStream. More...

## Protected Attributes
ManagersMap | m_managers
| Map of known component managers. More...
Gaudi::Property< std::vector< std::string > > | m_declaredManagers
| Property to declare the list of known managers. More...
SmartIF< ISvcManager > | m_svcManager
| Cached pointer to the manager of services. More...
SmartIF< IAlgManager > | m_algManager
| Cached pointer to the manager of algorithms. More...
SmartIF< ISvcLocator > | m_svcLocator
| Reference to its own service locator (must be instantiated prior to any service!) More...
SmartIF< DLLClassManager > | m_classManager
| Reference to the class manager. More...
Gaudi::Property< int > | m_SIGo {this, "Go", 0, "For SI's \"Go\" command via callback"}
Gaudi::Property< int > | m_SIExit {this, "Exit", 0, "For SI's \"Exit\" command via callback"}
Gaudi::Property< std::vector< std::string > > | m_topAlgNameList {this, "TopAlg", {}, "List of top level algorithms names"}
Gaudi::Property< std::vector< std::string > > | m_outStreamNameList {this, "OutStream", {}, "List of output stream names"}
Gaudi::Property< std::string > | m_outStreamType
Gaudi::Property< std::string > | m_messageSvcType {this, "MessageSvcType", "MessageSvc", "MessageSvc type"}
Gaudi::Property< std::string > | m_jobOptionsSvcType {this, "JobOptionsSvcType", "JobOptionsSvc", "JobOptionsSvc type"}
std::string | m_name = "ApplicationMgr"
| Name. More...
Gaudi::StateMachine::State | m_state = Gaudi::StateMachine::OFFLINE
| Internal State. More...
Gaudi::StateMachine::State | m_targetState = Gaudi::StateMachine::OFFLINE
| Internal State. More...
Gaudi::Property< std::vector< std::string > > | m_svcMapping {this, "SvcMapping", {}, "Default mapping of services"}
Gaudi::Property< std::vector< std::string > > | m_svcOptMapping
SmartIF< IMessageSvc > | m_messageSvc
| Reference to the message service. More...
SmartIF< IRunable > | m_runable
| Reference to the runable object. More...
SmartIF< IEventProcessor > | m_processingMgr
| Reference to processing manager object. More...
SmartIF< IJobOptionsSvc > | m_jobOptionsSvc
| Reference to JobOption service. More...
Gaudi::Property< int > | m_evtMax {this, "EvtMax", -1, "Number of events to be processed (-1 means all events)"}
Gaudi::Property< std::vector< std::string > > | m_extSvcNameList {this, "ExtSvc", {}, "List of external services names"}
Gaudi::Property< bool > | m_extSvcCreates
Gaudi::Property< std::vector< std::string > > | m_multiThreadSvcNameList {this, "MultiThreadExtSvc"}
| List of external services names for which we want a copy per evt thread. More...
Gaudi::Property< int > | m_noOfEvtThreads {this, "NoOfThreads", 0, "MultiThreadSvc copies"}
Gaudi::Property< std::vector< std::string > > | m_dllNameList {this, "Dlls", {}, "List of DDL's names"}
Gaudi::Property< std::string > | m_jobOptionsType {this, "JobOptionsType", "FILE", "Source type (e.g. dbase, file...)"}
Gaudi::Property< std::string > | m_jobOptionsPath {this, "JobOptionsPath", {}, "The \"file\" to look for properties"}
Gaudi::Property< std::string > | m_jobOptionsPreAction
Gaudi::Property< std::string > | m_jobOptionsPostAction
Gaudi::Property< std::string > | m_runableType {this, "Runable", "AppMgrRunable", "Runable type"}
Gaudi::Property< std::string > | m_eventLoopMgr {this, "EventLoop", "EventLoopMgr", "Processing manager type"}
Gaudi::Property< std::string > | m_evtsel {this, "EvtSel", {}, "Event selection"}
Gaudi::Property< std::string > | m_histPersName {this, "HistogramPersistency", "NONE", "Name of the Hist Pers Svc"}
Gaudi::Property< int > | m_outputLevel {this, "OutputLevel", MSG::INFO, "Message output level"}
Gaudi::Property< std::string > | m_appName {this, "AppName", "ApplicationMgr", "The name of the application"}
Gaudi::Property< std::string > | m_appVersion {this, "AppVersion", {}, "The version of the application"}
Gaudi::Property< bool > | m_actHistory {this, "ActivateHistory", false, "Activate HistorySvc"}
Gaudi::Property< bool > | m_codeCheck {this, "StatusCodeCheck", false, "Activate StatusCode checking"}
Gaudi::Property< int > | m_pluginDebugLevel {this, "PluginDebugLevel", 0, "Debug level for the plugin system"}
Gaudi::Property< std::vector< std::string > > | m_createSvcNameList
Gaudi::Property< bool > | m_auditTools {this, "AuditTools", false}
| Defaults for auditors. More...
Gaudi::Property< bool > | m_auditSvcs {this, "AuditServices", false}
Gaudi::Property< bool > | m_auditAlgs {this, "AuditAlgorithms", false}
Gaudi::Property< std::map< std::string, std::string > > | m_environment
Gaudi::Property< bool > | m_loopCheck
Gaudi::Property< bool > | m_stopOnSignal
| Property to enable/disable the "stop on signal" service. More...
Gaudi::Property< bool > | m_stalledEventMonitoring
| Property to enable/disable the monitoring and reporting of stalled events. More...
Gaudi::Property< bool > | m_propertiesPrint
Gaudi::Property< int > | m_returnCode
| Property to record the error conditions occurring during the running. More...
bool | m_useHiveAlgorithmManager

## Private Attributes
std::vector< std::string > | m_okDlls
| names of successfully loaded dlls More...

## Additional Inherited Members
Public Types inherited from PropertyHolder< CommonMessaging< implements< IAppMgrUI, IEventProcessor, IService, IStateful, INamedInterface, IProperty > > >
using | PropertyHolderImpl = PropertyHolder< CommonMessaging< implements< IAppMgrUI, IEventProcessor, IService, IStateful, INamedInterface, IProperty > > >
| Typedef used to refer to this class from derived classes, as in. More...
Public Types inherited from CommonMessaging< implements< IAppMgrUI, IEventProcessor, IService, IStateful, INamedInterface, IProperty > >
using | base_class = CommonMessaging

## Detailed Description

The Application Manager class.

The main purpose of the Application Manager is to steer any data processing application. This includes all data processing applications for LHCb data in all stages: simulation, reconstruction, analysis, high level triggers, etc. Specific implementations of the ApplicationMgr will be developed to cope with the different environments (on-line, off-line, interactive, batch, etc.).

Author
  Pere Mato

Definition at line 47 of file ApplicationMgr.h.

## Member Typedef Documentation

typedef std::map<unsigned long, SmartIF<IComponentManager> > ApplicationMgr::ManagersMap
| protected

Typedef for the map of component managers, the key is the "id" field of the basic InterfaceID of the managed components.

Definition at line 173 of file ApplicationMgr.h.

## Constructor & Destructor Documentation

ApplicationMgr::ApplicationMgr | ( | IInterface * | = `nullptr` | ) |

Definition at line 47 of file ApplicationMgr.cpp.

48 {
49 // IInterface initialization
50 addRef(); // Initial count set to 1
51
52 // Instantiate component managers
53 m_managers[IService::interfaceID().id()] = new ServiceManager( this );
54
55 m_svcLocator = svcManager();
56
57 // Instantiate internal services
58 // SvcLocator/Factory HAS to be already instantiated
59 m_classManager = new DLLClassManager( this );
60
61 AlgorithmManager* algMgr = new AlgorithmManager( this );
62 m_managers[IAlgorithm::interfaceID().id()] = algMgr;
63 // m_managers[IAlgorithm::interfaceID().id()] = new HiveAlgorithmManager(this);
64
65 // This property is not hosted in the ApplicationMgr instance
66 declareProperty( "AlgTypeAliases", algMgr->typeAliases(),
67 "Aliases of algorithm types, to replace an algorithm type for every instance" );
68
69 // Add action handlers to the appropriate properties
70 m_SIGo.declareUpdateHandler( &ApplicationMgr::SIGoHandler, this );
71 m_SIExit.declareUpdateHandler( &ApplicationMgr::SIExitHandler, this );
72 m_topAlgNameList.declareUpdateHandler( &ApplicationMgr::evtLoopPropertyHandler, this );
73 m_outStreamNameList.declareUpdateHandler( &ApplicationMgr::evtLoopPropertyHandler, this );
74 m_outStreamType.declareUpdateHandler( &ApplicationMgr::evtLoopPropertyHandler, this );
75 m_pluginDebugLevel.declareUpdateHandler( &ApplicationMgr::pluginDebugPropertyHandler, this );
76 // ServiceMgr Initialization loop checking
77 m_loopCheck.declareUpdateHandler( &ApplicationMgr::initLoopCheckHndlr, this );
78 svcManager()->setLoopCheckEnabled( m_loopCheck );
79
80 m_svcMapping = {"EvtDataSvc/EventDataSvc",
81 "DetDataSvc/DetectorDataSvc",
82 "HistogramSvc/HistogramDataSvc",
83 "HbookCnv::PersSvc/HbookHistSvc",
84 "RootHistCnv::PersSvc/RootHistSvc",
85 "EvtPersistencySvc/EventPersistencySvc",
86 "DetPersistencySvc/DetectorPersistencySvc",
87 "HistogramPersistencySvc/HistogramPersistencySvc"};
88 }
ServiceManager
The ServiceManager class is in charge of the creation of concrete instances of Services.
Definition: ServiceManager.h:36
AlgorithmManager
The AlgorithmManager class is in charge of the creation of concrete instances of Algorithms.
Definition: AlgorithmManager.h:31
ApplicationMgr::SIExitHandler
void SIExitHandler(Gaudi::Details::PropertyBase &theProp)
Definition: ApplicationMgr.cpp:920
ApplicationMgr::SIGoHandler
void SIGoHandler(Gaudi::Details::PropertyBase &theProp)
Definition: ApplicationMgr.cpp:903
ApplicationMgr::m_managers
ManagersMap m_managers
Map of known component managers.
Definition: ApplicationMgr.h:177
ApplicationMgr::m_outStreamType
Gaudi::Property< std::string > m_outStreamType
Definition: ApplicationMgr.h:196
ApplicationMgr::m_SIGo
Gaudi::Property< int > m_SIGo
Definition: ApplicationMgr.h:192
PropertyHolder< CommonMessaging< implements< IAppMgrUI, IEventProcessor, IService, IStateful, INamedInterface, IProperty > > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Details::PropertyBase &prop)
Declare a property.
Definition: PropertyHolder.h:99
AlgorithmManager::typeAliases
AlgTypeAliasesMap & typeAliases()
Definition: AlgorithmManager.h:91
ApplicationMgr::m_outStreamNameList
Gaudi::Property< std::vector< std::string > > m_outStreamNameList
Definition: ApplicationMgr.h:195
ApplicationMgr::svcManager
SmartIF< ISvcManager > & svcManager()
Definition: ApplicationMgr.h:132
ApplicationMgr::evtLoopPropertyHandler
void evtLoopPropertyHandler(Gaudi::Details::PropertyBase &theProp)
Definition: ApplicationMgr.cpp:931
ApplicationMgr::m_topAlgNameList
Gaudi::Property< std::vector< std::string > > m_topAlgNameList
Definition: ApplicationMgr.h:194
ApplicationMgr::initLoopCheckHndlr
void initLoopCheckHndlr(Gaudi::Details::PropertyBase &)
Definition: ApplicationMgr.cpp:1220
ApplicationMgr::m_svcLocator
SmartIF< ISvcLocator > m_svcLocator
Reference to its own service locator (must be instantiated prior to any service!) ...
Definition: ApplicationMgr.h:188
DLLClassManager
Definition: DLLClassManager.h:26
ApplicationMgr::m_SIExit
Gaudi::Property< int > m_SIExit
Definition: ApplicationMgr.h:193
ApplicationMgr::m_svcMapping
Gaudi::Property< std::vector< std::string > > m_svcMapping
Definition: ApplicationMgr.h:205
ApplicationMgr::m_classManager
SmartIF< DLLClassManager > m_classManager
Reference to the class manager.
Definition: ApplicationMgr.h:190
ApplicationMgr::pluginDebugPropertyHandler
void pluginDebugPropertyHandler(Gaudi::Details::PropertyBase &theProp)
Definition: ApplicationMgr.cpp:1209
ISvcManager::setLoopCheckEnabled
virtual void setLoopCheckEnabled(bool en=true)=0
Set the value of the initialization loop check flag.
ApplicationMgr::m_pluginDebugLevel
Gaudi::Property< int > m_pluginDebugLevel
Definition: ApplicationMgr.h:243
ApplicationMgr::m_loopCheck
Gaudi::Property< bool > m_loopCheck
Definition: ApplicationMgr.h:256

ApplicationMgr::~ApplicationMgr | ( |  | ) |
| override default

## Member Function Documentation

StatusCode ApplicationMgr::addMultiSvc | ( | const Gaudi::Utils::TypeNameString & | typeName,
|  | int | prio
| ) |  |
| protected

add one or more copies of svc type/name as determined by NoOfThreads

Definition at line 1087 of file ApplicationMgr.cpp.

1088 {
1089 using Gaudi::Utils::TypeNameString;
1090 StatusCode result = StatusCode::SUCCESS;
1091 MsgStream log( m_messageSvc, m_name );
1092 if ( 0 == m_noOfEvtThreads ) {
1093 result = svcManager()->addService( typeName, prio );
1094 // result = svcManager()->addService(name, type, prio); // CHECKME???
1095 if ( result.isFailure() ) {
1096 log << MSG::ERROR << "addMultiSvc: Cannot add service " << typeName.type() << "/" << typeName.name() << endmsg;
1097 } else {
1098 ON_VERBOSE
1099 log << MSG::VERBOSE << "addMultiSvc: added service " << typeName.type() << "/" << typeName.name() << endmsg;
1100 }
1101 } else {
1102 for ( int iCopy = 0; iCopy < m_noOfEvtThreads; ++iCopy ) {
1103 const std::string& type = typeName.type();
1104 std::string thrName( typeName.name() + getGaudiThreadIDfromID( iCopy ) );
1105 result = svcManager()->addService( TypeNameString( thrName, type ), prio );
1106 if ( result.isFailure() ) {
1107 log << MSG::ERROR << "addMultiSvc: Cannot add service " << type << "/" << thrName << endmsg;
1108 } else {
1109 ON_VERBOSE
1110 log << MSG::VERBOSE << "addMultiSvc: added service " << type << "/" << thrName << endmsg;
1111 }
1112 }
1113 }
1114 return result;
1115 }
ISvcManager::addService
virtual StatusCode addService(IService *svc, int prio=DEFAULT_SVC_PRIORITY)=0
Add a service to the "active" list of services of the factory.
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
StatusCode::SUCCESS
Definition: StatusCode.h:30
MSG::VERBOSE
Definition: IMessageSvc.h:17
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:84
ApplicationMgr::svcManager
SmartIF< ISvcManager > & svcManager()
Definition: ApplicationMgr.h:132
std::string
STL class.
Gaudi::Utils::TypeNameString
Helper class to parse a string of format "type/name".
Definition: TypeNameString.h:12
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
gaudirun.type
type
Definition: gaudirun.py:125
getGaudiThreadIDfromID
GAUDI_API std::string getGaudiThreadIDfromID(int iCopy)
helper function to extract Gaudi Thread ID from thread copy number
Definition: ThreadGaudi.cpp:16
Gaudi::Utils::TypeNameString::type
const std::string & type() const
Definition: TypeNameString.h:39
ApplicationMgr::m_name
std::string m_name
Name.
Definition: ApplicationMgr.h:201
MSG::ERROR
Definition: IMessageSvc.h:21
ON_VERBOSE
#define ON_VERBOSE
Definition: ApplicationMgr.cpp:35
Gaudi::Utils::TypeNameString::name
const std::string & name() const
Definition: TypeNameString.h:40
ApplicationMgr::m_noOfEvtThreads
Gaudi::Property< int > m_noOfEvtThreads
Definition: ApplicationMgr.h:225
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:209
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

SmartIF<IAlgManager>& ApplicationMgr::algManager | ( |  | ) |
| inline

Definition at line 141 of file ApplicationMgr.h.

142 {
143 // Cache the casted pointer to IAlgManager
144 if ( !m_algManager ) {
145 m_algManager = getManager<IAlgorithm>();
146 }
147 return m_algManager;
148 }
ApplicationMgr::m_algManager
SmartIF< IAlgManager > m_algManager
Cached pointer to the manager of algorithms.
Definition: ApplicationMgr.h:185

StatusCode ApplicationMgr::configure | ( |  | ) |
| override

Definition at line 234 of file ApplicationMgr.cpp.

235 {
236
237 // Check if the state is compatible with the transition
238 MsgStream tlog( m_messageSvc, name() );
239 if ( Gaudi::StateMachine::CONFIGURED == m_state ) {
240 tlog << MSG::INFO << "Already Configured" << endmsg;
241 return StatusCode::SUCCESS;
242 }
243 if ( Gaudi::StateMachine::OFFLINE != m_state ) {
244 tlog << MSG::FATAL << "configure: Invalid state \"" << m_state << "\"" << endmsg;
245 return StatusCode::FAILURE;
246 }
247 m_targetState = Gaudi::StateMachine::CONFIGURED;
248
249 // Reset application return code.
250 m_returnCode = Gaudi::ReturnCode::Success;
251
252 StatusCode sc;
253 sc = i_startup();
254 if ( !sc.isSuccess() ) {
255 return sc;
256 }
257
258 MsgStream log( m_messageSvc, name() );
259
260 // Get my own options using the Job options service
261 if ( log.level() <= MSG::DEBUG ) log << MSG::DEBUG << "Getting my own properties" << endmsg;
262 sc = m_jobOptionsSvc->setMyProperties( name(), this );
263 if ( !sc.isSuccess() ) {
264 log << MSG::WARNING << "Problems getting my properties from JobOptionsSvc" << endmsg;
265 return sc;
266 }
267
268 // Check current outputLevel to eventually inform the MessageSvc
269 if ( m_outputLevel != MSG::NIL && !m_appName.empty() ) {
270 assert( m_messageSvc );
271 m_messageSvc->setOutputLevel( name(), m_outputLevel );
272 // Print a welcome message
273 log << MSG::ALWAYS << std::endl
274 << "=================================================================="
275 << "==================================================================" << std::endl
276 << " "
277 << " Welcome to " << m_appName.value();
278
279 if ( !m_appVersion.empty() ) {
280 log << MSG::ALWAYS << " version " << m_appVersion.value();
281 } else {
282 log << MSG::ALWAYS << " (GaudiCoreSvc "
283 << "v" << GAUDICORESVC_MAJOR_VERSION << "r" << GAUDICORESVC_MINOR_VERSION
284 #if GAUDICORESVC_PATCH_VERSION
285 << "p" << GAUDICORESVC_PATCH_VERSION
286 #endif
287 << ")";
288 }
289
290 // Add the host name and current time to the message
291 log << MSG::ALWAYS << std::endl
292 << " "
293 << " running on " << System::hostName() << " on " << Gaudi::Time::current().format( true ) << std::endl
294 << "=================================================================="
295 << "==================================================================" << endmsg;
296 }
297
298 // print all own properties if the options "PropertiesPrint" is set to true
299 if ( m_propertiesPrint ) {
300 const auto& properties = getProperties();
301 log << MSG::ALWAYS << "List of ALL properties of " << System::typeinfoName( typeid( *this ) ) << "/" << this->name()
302 << " #properties = " << properties.size() << endmsg;
303 for ( const auto& property : properties ) {
304 log << "Property ['Name': Value] = " << *property << endmsg;
305 }
306 }
307
308 // Check if StatusCode need to be checked
309 if ( m_codeCheck ) {
310 StatusCode::enableChecking();
311 sc = addMultiSvc( "StatusCodeSvc", -9999 );
312 if ( sc.isFailure() ) {
313 log << MSG::FATAL << "Error adding StatusCodeSvc for multiple threads" << endmsg;
314 return StatusCode::FAILURE;
315 }
316 } else {
317 StatusCode::disableChecking();
318 }
319
320 // set the requested environment variables
321 for ( auto& var : m_environment ) {
322 const std::string& name = var.first;
323 const std::string& value = var.second;
324 std::string old = System::getEnv( name.c_str() );
325 const MSG::Level lvl = ( !old.empty() && ( old != "UNKNOWN" ) ) ? MSG::WARNING : MSG::DEBUG;
326 if ( UNLIKELY( m_outputLevel <= lvl ) ) log << lvl << "Setting " << name << " = " << value << endmsg;
327 System::setEnv( name, value );
328 }
329
330 // Declare Service Types
331 for ( auto& j : m_svcMapping ) {
332 Gaudi::Utils::TypeNameString itm( j );
333 if ( declareMultiSvcType( itm.name(), itm.type() ).isFailure() ) {
334 log << MSG::ERROR << "configure: declaring svc type:'" << j << "' failed." << endmsg;
335 return StatusCode::FAILURE;
336 }
337 }
338 for ( auto& j : m_svcOptMapping ) {
339 Gaudi::Utils::TypeNameString itm( j );
340 if ( declareMultiSvcType( itm.name(), itm.type() ).isFailure() ) {
341 log << MSG::ERROR << "configure: declaring svc type:'" << j << "' failed." << endmsg;
342 return StatusCode::FAILURE;
343 }
344 }
345
346 //--------------------------------------------------------------------------
347 // Declare other Services and Algorithms by loading DLL's
348 sc = decodeDllNameList();
349 if ( sc.isFailure() ) {
350 log << MSG::ERROR << "Failure loading declared DLL's" << endmsg;
351 return sc;
352 }
353
354 //--------------------------------------------------------------------------
355 // Deal with the services explicitly declared by the user.
356 sc = decodeExtSvcNameList();
357 if ( sc.isFailure() ) {
358 log << MSG::ERROR << "Failure during external service association" << endmsg;
359 return sc;
360 }
361
362 sc = decodeMultiThreadSvcNameList();
363 if ( sc.isFailure() ) {
364 log << MSG::ERROR << "Failure during multi thread service creation" << endmsg;
365 return sc;
366 }
367
368 sc = decodeCreateSvcNameList();
369 if ( sc.isFailure() ) {
370 log << MSG::ERROR << "Failure during external service creation" << endmsg;
371 return sc;
372 }
373
374 //--------------------------------------------------------------------------
375 // Retrieve intrinsic services. If needed configure them.
376 //--------------------------------------------------------------------------
377 const Gaudi::Utils::TypeNameString evtloop_item( m_eventLoopMgr );
378 sc = addMultiSvc( evtloop_item, ServiceManager::DEFAULT_SVC_PRIORITY * 10 );
379 if ( !sc.isSuccess() ) {
380 log << MSG::FATAL << "Error adding :" << m_eventLoopMgr << endmsg;
381 return sc;
382 }
383
384 if ( m_noOfEvtThreads == 0 ) {
385 m_runable = m_svcLocator->service( m_runableType );
386 if ( !m_runable ) {
387 log << MSG::FATAL << "Error retrieving Runable: " << m_runableType.value() << "\n Check option ApplicationMgr."
388 << m_runableType.name() << endmsg;
389 return sc;
390 }
391 m_processingMgr = m_svcLocator->service( evtloop_item );
392 if ( !m_processingMgr ) {
393 log << MSG::FATAL << "Error retrieving Processing manager: " << m_eventLoopMgr.value()
394 << "\n Check option ApplicationMgr." << m_eventLoopMgr.name() << "\n No events will be processed." << endmsg;
395 return sc;
396 }
397 }
398
399 // Establish Update Handlers for ExtSvc and DLLs Properties
400 m_extSvcNameList.declareUpdateHandler( &ApplicationMgr::extSvcNameListHandler, this );
401 m_createSvcNameList.declareUpdateHandler( &ApplicationMgr::createSvcNameListHandler, this );
402 m_multiThreadSvcNameList.declareUpdateHandler( &ApplicationMgr::multiThreadSvcNameListHandler, this );
403 m_dllNameList.declareUpdateHandler( &ApplicationMgr::dllNameListHandler, this );
404
405 if ( m_actHistory ) {
406 // Create HistorySvc with a priority to ensure it's initialized last, finalized first
407 sc = svcManager()->addService( "HistorySvc", std::numeric_limits<int>::max() );
408 if ( sc.isFailure() ) {
409 log << MSG::FATAL << "Error adding HistorySvc" << endmsg;
410 return StatusCode::FAILURE;
411 }
412
413 if ( m_noOfEvtThreads > 0 ) {
414 sc = addMultiSvc( "HistorySvc", std::numeric_limits<int>::max() );
415 if ( sc.isFailure() ) {
416 log << MSG::FATAL << "Error adding HistorySvc for multiple threads" << endmsg;
417 return StatusCode::FAILURE;
418 }
419 }
420 }
421
422 log << MSG::INFO << "Application Manager Configured successfully" << endmsg;
423 m_state = m_targetState;
424 return StatusCode::SUCCESS;
425 }
ApplicationMgr::m_targetState
Gaudi::StateMachine::State m_targetState
Internal State.
Definition: ApplicationMgr.h:203
System::getEnv
GAUDI_API std::string getEnv(const char *var)
get a particular environment variable (returning "UNKNOWN" if not set)
Definition: System.cpp:550
ISvcManager::addService
virtual StatusCode addService(IService *svc, int prio=DEFAULT_SVC_PRIORITY)=0
Add a service to the "active" list of services of the factory.
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
StatusCode::SUCCESS
Definition: StatusCode.h:30
ApplicationMgr::m_propertiesPrint
Gaudi::Property< bool > m_propertiesPrint
Definition: ApplicationMgr.h:269
std::string::empty
T empty(T...args)
ApplicationMgr::decodeDllNameList
StatusCode decodeDllNameList()
Definition: ApplicationMgr.cpp:1130
ApplicationMgr::m_returnCode
Gaudi::Property< int > m_returnCode
Property to record the error conditions occurring during the running.
Definition: ApplicationMgr.h:273
System::setEnv
GAUDI_API int setEnv(const std::string &name, const std::string &value, int overwrite=1)
Set an environment variables.
Definition: System.cpp:678
Gaudi::StateMachine::CONFIGURED
Definition: StateMachine.h:14
ApplicationMgr::m_codeCheck
Gaudi::Property< bool > m_codeCheck
Definition: ApplicationMgr.h:242
ApplicationMgr::m_runable
SmartIF< IRunable > m_runable
Reference to the runable object.
Definition: ApplicationMgr.h:210
StatusCode::FAILURE
Definition: StatusCode.h:29
PropertyHolder< CommonMessaging< implements< IAppMgrUI, IEventProcessor, IService, IStateful, INamedInterface, IProperty > > >::property
Gaudi::Details::PropertyBase * property(const std::string &name) const
Definition: PropertyHolder.h:345
PropertyHolder< CommonMessaging< implements< IAppMgrUI, IEventProcessor, IService, IStateful, INamedInterface, IProperty > > >::getProperties
const std::vector< Gaudi::Details::PropertyBase * > & getProperties() const override
get all properties
Definition: PropertyHolder.h:331
System::typeinfoName
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:299
Gaudi::Time::current
static Time current(void)
Returns the current time.
Definition: Time.cpp:113
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:74
ApplicationMgr::name
const std::string & name() const override
Definition: ApplicationMgr.cpp:855
MSG::DEBUG
Definition: IMessageSvc.h:18
std::endl
T endl(T...args)
ApplicationMgr::multiThreadSvcNameListHandler
void multiThreadSvcNameListHandler(Gaudi::Details::PropertyBase &theProp)
Definition: ApplicationMgr.cpp:1019
ApplicationMgr::m_environment
Gaudi::Property< std::map< std::string, std::string > > m_environment
Definition: ApplicationMgr.h:253
UNLIKELY
#define UNLIKELY(x)
Definition: Kernel.h:126
ApplicationMgr::m_multiThreadSvcNameList
Gaudi::Property< std::vector< std::string > > m_multiThreadSvcNameList
List of external services names for which we want a copy per evt thread.
Definition: ApplicationMgr.h:224
ApplicationMgr::m_appVersion
Gaudi::Property< std::string > m_appVersion
Definition: ApplicationMgr.h:240
StatusCode::enableChecking
static GAUDI_API void enableChecking()
Definition: StatusCode.cpp:19
ApplicationMgr::m_jobOptionsSvc
SmartIF< IJobOptionsSvc > m_jobOptionsSvc
Reference to JobOption service.
Definition: ApplicationMgr.h:212
ApplicationMgr::createSvcNameListHandler
void createSvcNameListHandler(Gaudi::Details::PropertyBase &)
Definition: ApplicationMgr.cpp:942
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:84
ApplicationMgr::m_processingMgr
SmartIF< IEventProcessor > m_processingMgr
Reference to processing manager object.
Definition: ApplicationMgr.h:211
ApplicationMgr::svcManager
SmartIF< ISvcManager > & svcManager()
Definition: ApplicationMgr.h:132
ApplicationMgr::m_eventLoopMgr
Gaudi::Property< std::string > m_eventLoopMgr
Definition: ApplicationMgr.h:235
std::string
STL class.
ApplicationMgr::addMultiSvc
StatusCode addMultiSvc(const Gaudi::Utils::TypeNameString &typeName, int prio)
add one or more copies of svc type/name as determined by NoOfThreads
Definition: ApplicationMgr.cpp:1087
MSG::FATAL
Definition: IMessageSvc.h:22
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
MSG::Level
Level
Definition: IMessageSvc.h:15
ApplicationMgr::m_outputLevel
Gaudi::Property< int > m_outputLevel
Definition: ApplicationMgr.h:238
Gaudi::Utils::TypeNameString
Helper class to parse a string of format "type/name".
Definition: TypeNameString.h:12
ApplicationMgr::extSvcNameListHandler
void extSvcNameListHandler(Gaudi::Details::PropertyBase &theProp)
Definition: ApplicationMgr.cpp:978
ApplicationMgr::m_svcLocator
SmartIF< ISvcLocator > m_svcLocator
Reference to its own service locator (must be instantiated prior to any service!) ...
Definition: ApplicationMgr.h:188
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
IJobOptionsSvc::setMyProperties
virtual StatusCode setMyProperties(const std::string &client, IProperty *me)=0
Override default properties of the calling client.
ApplicationMgr::m_extSvcNameList
Gaudi::Property< std::vector< std::string > > m_extSvcNameList
Definition: ApplicationMgr.h:219
ApplicationMgr::dllNameListHandler
void dllNameListHandler(Gaudi::Details::PropertyBase &theProp)
Definition: ApplicationMgr.cpp:1120
ApplicationMgr::m_runableType
Gaudi::Property< std::string > m_runableType
Definition: ApplicationMgr.h:234
MSG::NIL
Definition: IMessageSvc.h:16
ApplicationMgr::m_svcOptMapping
Gaudi::Property< std::vector< std::string > > m_svcOptMapping
Definition: ApplicationMgr.h:206
ApplicationMgr::m_svcMapping
Gaudi::Property< std::vector< std::string > > m_svcMapping
Definition: ApplicationMgr.h:205
ApplicationMgr::m_dllNameList
Gaudi::Property< std::vector< std::string > > m_dllNameList
Definition: ApplicationMgr.h:227
ApplicationMgr::m_actHistory
Gaudi::Property< bool > m_actHistory
Definition: ApplicationMgr.h:241
ApplicationMgr::decodeExtSvcNameList
StatusCode decodeExtSvcNameList()
Definition: ApplicationMgr.cpp:989
System::hostName
GAUDI_API const std::string & hostName()
Host name.
Definition: System.cpp:371
ApplicationMgr::m_createSvcNameList
Gaudi::Property< std::vector< std::string > > m_createSvcNameList
Definition: ApplicationMgr.h:245
gaudiComponentHelp.properties
properties
Definition: gaudiComponentHelp.py:37
ApplicationMgr::decodeCreateSvcNameList
StatusCode decodeCreateSvcNameList()
Definition: ApplicationMgr.cpp:952
std::string::c_str
T c_str(T...args)
ApplicationMgr::i_startup
StatusCode i_startup()
Internal startup routine.
Definition: ApplicationMgr.cpp:130
MSG::ERROR
Definition: IMessageSvc.h:21
StatusCode::disableChecking
static GAUDI_API void disableChecking()
Definition: StatusCode.cpp:23
MSG::WARNING
Definition: IMessageSvc.h:20
ApplicationMgr::m_state
Gaudi::StateMachine::State m_state
Internal State.
Definition: ApplicationMgr.h:202
ApplicationMgr::m_appName
Gaudi::Property< std::string > m_appName
Definition: ApplicationMgr.h:239
Gaudi::ReturnCode::Success
constexpr int Success
Definition: AppReturnCode.h:18
MSG::INFO
Definition: IMessageSvc.h:19
ApplicationMgr::decodeMultiThreadSvcNameList
StatusCode decodeMultiThreadSvcNameList()
Definition: ApplicationMgr.cpp:1030
Gaudi::StateMachine::OFFLINE
Definition: StateMachine.h:13
ApplicationMgr::m_noOfEvtThreads
Gaudi::Property< int > m_noOfEvtThreads
Definition: ApplicationMgr.h:225
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:209
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
IMessageSvc::setOutputLevel
virtual void setOutputLevel(int new_level)=0
Set new global output level threshold.
Gaudi::Time::format
std::string format(bool local, std::string spec="%c") const
Format the time using strftime.
Definition: Time.cpp:279
Gaudi.Configuration.log
log
Definition: Configuration.py:13
std::numeric_limits
ApplicationMgr::declareMultiSvcType
StatusCode declareMultiSvcType(const std::string &name, const std::string &type)
declare one or more copies of svc type/name as determined by NoOfThreads
Definition: ApplicationMgr.cpp:1058

void ApplicationMgr::createSvcNameListHandler | ( | Gaudi::Details::PropertyBase & |  | ) |

Definition at line 942 of file ApplicationMgr.cpp.

943 {
944 if ( !( decodeCreateSvcNameList() ).isSuccess() ) {
945 throw GaudiException( "Failed to create ext services", "MinimalEventLoopMgr::createSvcNameListHandler",
946 StatusCode::FAILURE );
947 }
948 }
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:23
StatusCode::FAILURE
Definition: StatusCode.h:29
ApplicationMgr::decodeCreateSvcNameList
StatusCode decodeCreateSvcNameList()
Definition: ApplicationMgr.cpp:952

StatusCode ApplicationMgr::declareMultiSvcType | ( | const std::string & | name,
|  | const std::string & | type
| ) |  |
| protected

declare one or more copies of svc type/name as determined by NoOfThreads

Definition at line 1058 of file ApplicationMgr.cpp.

1059 {
1060 StatusCode result = StatusCode::SUCCESS;
1061 MsgStream log( m_messageSvc, m_name );
1062 if ( 0 == m_noOfEvtThreads ) {
1063 result = svcManager()->declareSvcType( name, type );
1064 if ( result.isFailure() ) {
1065 log << MSG::ERROR << "declareMultiSvcType: Cannot declare service " << type << "/" << name << endmsg;
1066 } else {
1067 ON_VERBOSE
1068 log << MSG::VERBOSE << "declareMultiSvcType: declared service " << type << "/" << name << endmsg;
1069 }
1070 } else {
1071 for ( int iCopy = 0; iCopy < m_noOfEvtThreads; ++iCopy ) {
1072 std::string thrName( name + getGaudiThreadIDfromID( iCopy ) );
1073 result = svcManager()->declareSvcType( thrName, type );
1074 if ( result.isFailure() ) {
1075 log << MSG::ERROR << "declareMultiSvcType: Cannot declare service " << type << "/" << thrName << endmsg;
1076 } else {
1077 ON_VERBOSE
1078 log << MSG::VERBOSE << "declareMultiSvcType: declared service " << type << "/" << thrName << endmsg;
1079 }
1080 }
1081 }
1082 return result;
1083 }
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
StatusCode::SUCCESS
Definition: StatusCode.h:30
MSG::VERBOSE
Definition: IMessageSvc.h:17
ISvcManager::declareSvcType
virtual StatusCode declareSvcType(const std::string &svcname, const std::string &svctype)=0
Declare the type of the service to be used when crating a given service name.
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:84
ApplicationMgr::svcManager
SmartIF< ISvcManager > & svcManager()
Definition: ApplicationMgr.h:132
std::string
STL class.
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
getGaudiThreadIDfromID
GAUDI_API std::string getGaudiThreadIDfromID(int iCopy)
helper function to extract Gaudi Thread ID from thread copy number
Definition: ThreadGaudi.cpp:16
ApplicationMgr::m_name
std::string m_name
Name.
Definition: ApplicationMgr.h:201
MSG::ERROR
Definition: IMessageSvc.h:21
ON_VERBOSE
#define ON_VERBOSE
Definition: ApplicationMgr.cpp:35
ApplicationMgr::m_noOfEvtThreads
Gaudi::Property< int > m_noOfEvtThreads
Definition: ApplicationMgr.h:225
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:209
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

StatusCode ApplicationMgr::decodeCreateSvcNameList | ( |  | ) |

Definition at line 952 of file ApplicationMgr.cpp.

953 {
954 StatusCode result = StatusCode::SUCCESS;
955 const auto& theNames = m_createSvcNameList.value();
956 auto it = theNames.begin();
957 auto et = theNames.end();
958 while ( result.isSuccess() && it != et ) {
959 Gaudi::Utils::TypeNameString item( *it++ );
960 if ( ( result = svcManager()->addService( item, ServiceManager::DEFAULT_SVC_PRIORITY ) ).isFailure() ) {
961 MsgStream log( m_messageSvc, m_name );
962 log << MSG::ERROR << "decodeCreateSvcNameList: Cannot create service " << item.type() << "/" << item.name()
963 << endmsg;
964 } else {
965 ON_DEBUG
966 {
967 MsgStream log( m_messageSvc, m_name );
968 log << MSG::DEBUG << "decodeCreateSvcNameList: Created service " << item.type() << "/" << item.name() << endmsg;
969 }
970 }
971 }
972 return result;
973 }
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:74
MSG::DEBUG
Definition: IMessageSvc.h:18
ApplicationMgr::svcManager
SmartIF< ISvcManager > & svcManager()
Definition: ApplicationMgr.h:132
Gaudi::Utils::TypeNameString
Helper class to parse a string of format "type/name".
Definition: TypeNameString.h:12
ON_DEBUG
#define ON_DEBUG
Definition: ApplicationMgr.cpp:34
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
ApplicationMgr::m_createSvcNameList
Gaudi::Property< std::vector< std::string > > m_createSvcNameList
Definition: ApplicationMgr.h:245
ApplicationMgr::m_name
std::string m_name
Name.
Definition: ApplicationMgr.h:201
MSG::ERROR
Definition: IMessageSvc.h:21
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:209
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

StatusCode ApplicationMgr::decodeDllNameList | ( |  | ) |

Definition at line 1130 of file ApplicationMgr.cpp.

1131 {
1132
1133 MsgStream log( m_messageSvc, m_name );
1134 StatusCode result = StatusCode::SUCCESS;
1135
1136 // Clean up multiple entries from DLL list
1137 // -------------------------------------------------------------------------
1138 std::vector<std::string> newList;
1139 std::map<std::string, unsigned int> dllInList, duplicateList;
1140 {
1141 for ( const auto it : m_dllNameList ) {
1142 if ( 0 == dllInList[it] ) {
1143 newList.push_back( it ); // first instance of this module
1144 } else {
1145 ++duplicateList[it];
1146 } // module listed multiple times
1147 ++dllInList[it]; // increment count for this module
1148 }
1149 }
1150 // m_dllNameList = newList; // update primary list to new, filtered list (do not use the
1151 // property itself otherwise we get called again infinitely)
1152 // List modules that were in there twice..
1153 ON_DEBUG if ( !duplicateList.empty() )
1154 {
1155 log << MSG::DEBUG << "Removed duplicate entries for modules : ";
1156 for ( auto it = duplicateList.begin(); it != duplicateList.end(); ++it ) {
1157 log << it->first << "(" << 1 + it->second << ")";
1158 if ( it != --duplicateList.end() ) log << ", ";
1159 }
1160 log << endmsg;
1161 }
1162 // -------------------------------------------------------------------------
1163
1164 const std::vector<std::string>& theNames = newList;
1165
1166 // only load the new dlls or previously failed dlls
1167 ON_DEBUG log << MSG::DEBUG << "Loading declared DLL's" << endmsg;
1168
1169 std::vector<std::string> successNames, failNames;
1170 for ( const auto& it : theNames ) {
1171 if ( std::find( m_okDlls.rbegin(), m_okDlls.rend(), it ) == m_okDlls.rend() ) {
1172 // found a new module name
1173 StatusCode status = m_classManager->loadModule( it );
1174 if ( status.isFailure() ) {
1175 failNames.push_back( it );
1176 result = StatusCode::FAILURE;
1177 } else {
1178 successNames.push_back( it );
1179 }
1180 }
1181 }
1182
1183 // report back to the user and store the names of the succesfully loaded dlls
1184 if ( !successNames.empty() ) {
1185 log << MSG::INFO << "Successfully loaded modules : ";
1186 for ( auto it = successNames.begin(); it != successNames.end(); it++ ) {
1187 log << ( *it );
1188 if ( ( it + 1 ) != successNames.end() ) log << ", ";
1189 // save name
1190 m_okDlls.push_back( *it );
1191 }
1192 log << endmsg;
1193 }
1194
1195 if ( result == StatusCode::FAILURE ) {
1196 log << MSG::WARNING << "Failed to load modules: ";
1197 for ( auto it = failNames.begin(); it != failNames.end(); it++ ) {
1198 log << ( *it );
1199 if ( ( it + 1 ) != failNames.end() ) log << ", ";
1200 }
1201 log << endmsg;
1202 }
1203 return result;
1204 }
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
StatusCode::SUCCESS
Definition: StatusCode.h:30
std::map::empty
T empty(T...args)
DLLClassManager::loadModule
StatusCode loadModule(const std::string &module, bool fireIncident=true) override
Definition: DLLClassManager.cpp:29
StatusCode::FAILURE
Definition: StatusCode.h:29
std::vector::rend
T rend(T...args)
MSG::DEBUG
Definition: IMessageSvc.h:18
std::map::end
T end(T...args)
ApplicationMgr::m_okDlls
std::vector< std::string > m_okDlls
names of successfully loaded dlls
Definition: ApplicationMgr.h:280
std::map< std::string, unsigned int >
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:84
std::vector::push_back
T push_back(T...args)
ON_DEBUG
#define ON_DEBUG
Definition: ApplicationMgr.cpp:34
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
ApplicationMgr::m_dllNameList
Gaudi::Property< std::vector< std::string > > m_dllNameList
Definition: ApplicationMgr.h:227
std::find
T find(T...args)
std::vector< std::string >
ApplicationMgr::m_classManager
SmartIF< DLLClassManager > m_classManager
Reference to the class manager.
Definition: ApplicationMgr.h:190
std::map::begin
T begin(T...args)
ApplicationMgr::m_name
std::string m_name
Name.
Definition: ApplicationMgr.h:201
MSG::WARNING
Definition: IMessageSvc.h:20
MSG::INFO
Definition: IMessageSvc.h:19
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:209
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
std::vector::rbegin
T rbegin(T...args)

StatusCode ApplicationMgr::decodeExtSvcNameList | ( |  | ) |

Definition at line 989 of file ApplicationMgr.cpp.

990 {
991 StatusCode result = StatusCode::SUCCESS;
992
993 const auto& theNames = m_extSvcNameList.value();
994
995 auto it = theNames.begin();
996 auto et = theNames.end();
997 while ( result.isSuccess() && it != et ) {
998 Gaudi::Utils::TypeNameString item( *it++ );
999 if ( m_extSvcCreates ) {
1000 if ( ( result = svcManager()->addService( item, ServiceManager::DEFAULT_SVC_PRIORITY ) ).isFailure() ) {
1001 MsgStream log( m_messageSvc, m_name );
1002 log << MSG::ERROR << "decodeExtSvcNameList: Cannot create service " << item.type() << "/" << item.name()
1003 << endmsg;
1004 }
1005 } else {
1006 if ( ( result = svcManager()->declareSvcType( item.name(), item.type() ) ).isFailure() ) {
1007 MsgStream log( m_messageSvc, m_name );
1008 log << MSG::ERROR << "decodeExtSvcNameList: Cannot declare service " << item.type() << "/" << item.name()
1009 << endmsg;
1010 }
1011 }
1012 }
1013 return result;
1014 }
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:74
ApplicationMgr::svcManager
SmartIF< ISvcManager > & svcManager()
Definition: ApplicationMgr.h:132
Gaudi::Utils::TypeNameString
Helper class to parse a string of format "type/name".
Definition: TypeNameString.h:12
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
ApplicationMgr::m_extSvcNameList
Gaudi::Property< std::vector< std::string > > m_extSvcNameList
Definition: ApplicationMgr.h:219
ApplicationMgr::m_extSvcCreates
Gaudi::Property< bool > m_extSvcCreates
Definition: ApplicationMgr.h:220
ApplicationMgr::m_name
std::string m_name
Name.
Definition: ApplicationMgr.h:201
MSG::ERROR
Definition: IMessageSvc.h:21
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:209
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

StatusCode ApplicationMgr::decodeMultiThreadSvcNameList | ( |  | ) |

Definition at line 1030 of file ApplicationMgr.cpp.

1031 {
1032 StatusCode result = StatusCode::SUCCESS;
1033 const auto& theNames = m_multiThreadSvcNameList.value();
1034 for ( int iCopy = 0; iCopy < m_noOfEvtThreads; ++iCopy ) {
1035 for ( const auto& it : theNames ) {
1036 Gaudi::Utils::TypeNameString item( it );
1037 result = addMultiSvc( item, ServiceManager::DEFAULT_SVC_PRIORITY );
1038 // FIXME SHOULD CLONE?
1039 if ( result.isFailure() ) {
1040 MsgStream log( m_messageSvc, m_name );
1041 log << MSG::ERROR << "decodeMultiThreadSvcNameList: Cannot create service " << item.type() << "/" << item.name()
1042 << endmsg;
1043 } else {
1044 ON_VERBOSE
1045 {
1046 MsgStream log( m_messageSvc, m_name );
1047 log << MSG::VERBOSE << "decodeMultiThreadSvcNameList: created service " << item.type() << "/" << item.name()
1048 << endmsg;
1049 }
1050 }
1051 }
1052 }
1053 return result;
1054 }
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
StatusCode::SUCCESS
Definition: StatusCode.h:30
ApplicationMgr::m_multiThreadSvcNameList
Gaudi::Property< std::vector< std::string > > m_multiThreadSvcNameList
List of external services names for which we want a copy per evt thread.
Definition: ApplicationMgr.h:224
MSG::VERBOSE
Definition: IMessageSvc.h:17
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:84
ApplicationMgr::addMultiSvc
StatusCode addMultiSvc(const Gaudi::Utils::TypeNameString &typeName, int prio)
add one or more copies of svc type/name as determined by NoOfThreads
Definition: ApplicationMgr.cpp:1087
Gaudi::Utils::TypeNameString
Helper class to parse a string of format "type/name".
Definition: TypeNameString.h:12
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
ApplicationMgr::m_name
std::string m_name
Name.
Definition: ApplicationMgr.h:201
MSG::ERROR
Definition: IMessageSvc.h:21
ON_VERBOSE
#define ON_VERBOSE
Definition: ApplicationMgr.cpp:35
ApplicationMgr::m_noOfEvtThreads
Gaudi::Property< int > m_noOfEvtThreads
Definition: ApplicationMgr.h:225
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:209
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

void ApplicationMgr::dllNameListHandler | ( | Gaudi::Details::PropertyBase & | theProp | ) |

Definition at line 1120 of file ApplicationMgr.cpp.

1121 {
1122 if ( !( decodeDllNameList() ).isSuccess() ) {
1123 throw GaudiException( "Failed to load DLLs.", "MinimalEventLoopMgr::dllNameListHandler", StatusCode::FAILURE );
1124 }
1125 }
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:23
ApplicationMgr::decodeDllNameList
StatusCode decodeDllNameList()
Definition: ApplicationMgr.cpp:1130
StatusCode::FAILURE
Definition: StatusCode.h:29

void ApplicationMgr::evtLoopPropertyHandler | ( | Gaudi::Details::PropertyBase & | theProp | ) |

Definition at line 931 of file ApplicationMgr.cpp.

932 {
933 if ( m_processingMgr ) {
934 auto props = m_processingMgr.as<IProperty>();
935 if ( props ) props->setProperty( p ).ignore();
936 }
937 }
ApplicationMgr::m_processingMgr
SmartIF< IEventProcessor > m_processingMgr
Reference to processing manager object.
Definition: ApplicationMgr.h:211
IProperty::setProperty
virtual StatusCode setProperty(const Gaudi::Details::PropertyBase &p)=0
Set the property by property.
SmartIF::as
SmartIF< IFace > as() const
return a new SmartIF instance to another interface
Definition: SmartIF.h:110
StatusCode::ignore
void ignore() const
Definition: StatusCode.h:106
IProperty
The IProperty is the basic interface for all components which have properties that can be set or get...
Definition: IProperty.h:20

StatusCode ApplicationMgr::executeEvent | ( | void * | par | ) |
| override

implementation of IEventProcessor::executeEvent(void*)

Definition at line 809 of file ApplicationMgr.cpp.

810 {
811 MsgStream log( m_messageSvc, name() );
812 if ( m_state == Gaudi::StateMachine::RUNNING ) {
813 if ( m_processingMgr ) {
814 return m_processingMgr->executeEvent( par );
815 }
816 }
817 log << MSG::FATAL << "executeEvent: Invalid state \"" << FSMState() << "\"" << endmsg;
818 return StatusCode::FAILURE;
819 }
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
StatusCode::FAILURE
Definition: StatusCode.h:29
ApplicationMgr::name
const std::string & name() const override
Definition: ApplicationMgr.cpp:855
IEventProcessor::executeEvent
virtual StatusCode executeEvent(void *par=0)=0
Process single event.
ApplicationMgr::m_processingMgr
SmartIF< IEventProcessor > m_processingMgr
Reference to processing manager object.
Definition: ApplicationMgr.h:211
MSG::FATAL
Definition: IMessageSvc.h:22
compareOutputFiles.par
string par
Definition: compareOutputFiles.py:386
Gaudi::StateMachine::RUNNING
Definition: StateMachine.h:16
ApplicationMgr::m_state
Gaudi::StateMachine::State m_state
Internal State.
Definition: ApplicationMgr.h:202
ApplicationMgr::FSMState
Gaudi::StateMachine::State FSMState() const override
Definition: ApplicationMgr.cpp:858
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:209
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

StatusCode ApplicationMgr::executeRun | ( | int | evtmax | ) |
| override

implementation of IEventProcessor::executeRun(int)

Definition at line 824 of file ApplicationMgr.cpp.

825 {
826 MsgStream log( m_messageSvc, name() );
827 if ( m_state == Gaudi::StateMachine::RUNNING ) {
828 if ( m_processingMgr ) {
829 return m_processingMgr->executeRun( evtmax );
830 }
831 log << MSG::WARNING << "No EventLoop Manager specified " << endmsg;
832 return StatusCode::SUCCESS;
833 }
834 log << MSG::FATAL << "executeRun: Invalid state \"" << FSMState() << "\"" << endmsg;
835 return StatusCode::FAILURE;
836 }
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode::FAILURE
Definition: StatusCode.h:29
ApplicationMgr::name
const std::string & name() const override
Definition: ApplicationMgr.cpp:855
ApplicationMgr::m_processingMgr
SmartIF< IEventProcessor > m_processingMgr
Reference to processing manager object.
Definition: ApplicationMgr.h:211
MSG::FATAL
Definition: IMessageSvc.h:22
Gaudi::StateMachine::RUNNING
Definition: StateMachine.h:16
MSG::WARNING
Definition: IMessageSvc.h:20
ApplicationMgr::m_state
Gaudi::StateMachine::State m_state
Internal State.
Definition: ApplicationMgr.h:202
ApplicationMgr::FSMState
Gaudi::StateMachine::State FSMState() const override
Definition: ApplicationMgr.cpp:858
IEventProcessor::executeRun
virtual StatusCode executeRun(int maxevt)=0
Process the maxevt events as a Run (beginRun() and endRun() called)
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:209
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

void ApplicationMgr::extSvcNameListHandler | ( | Gaudi::Details::PropertyBase & | theProp | ) |

Definition at line 978 of file ApplicationMgr.cpp.

979 {
980 if ( !( decodeExtSvcNameList() ).isSuccess() ) {
981 throw GaudiException( "Failed to declare ext services", "MinimalEventLoopMgr::extSvcNameListHandler",
982 StatusCode::FAILURE );
983 }
984 }
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:23
StatusCode::FAILURE
Definition: StatusCode.h:29
ApplicationMgr::decodeExtSvcNameList
StatusCode decodeExtSvcNameList()
Definition: ApplicationMgr.cpp:989

StatusCode ApplicationMgr::finalize | ( |  | ) |
| override

Definition at line 574 of file ApplicationMgr.cpp.

575 {
576 MsgStream log( m_messageSvc, name() );
577 if ( m_state == Gaudi::StateMachine::CONFIGURED ) {
578 log << MSG::INFO << "Already Finalized" << endmsg;
579 return StatusCode::SUCCESS;
580 }
581 if ( m_state != Gaudi::StateMachine::INITIALIZED ) {
582 log << MSG::FATAL << "finalize: Invalid state \"" << m_state << "\"" << endmsg;
583 return StatusCode::FAILURE;
584 }
585 m_targetState = Gaudi::StateMachine::CONFIGURED;
586
587 // disable message suppression in finalize
588 m_svcLocator->service<IProperty>( "MessageSvc" )
589 ->setProperty( Gaudi::Property<bool>( "enableSuppression", false ) )
590 .ignore();
591
592 // Finalize independently managed Algorithms
593 StatusCode sc = algManager()->finalize();
594 if ( sc.isFailure() ) {
595 log << MSG::WARNING << "Failed to finalize an algorithm." << endmsg;
596 m_returnCode = Gaudi::ReturnCode::FinalizationFailure;
597 }
598
599 // Finalize all Services
600 sc = svcManager()->finalize();
601 if ( sc.isFailure() ) {
602 log << MSG::WARNING << "Failed to finalize a service." << endmsg;
603 m_returnCode = Gaudi::ReturnCode::FinalizationFailure;
604 }
605
606 // svcManager()->removeService( (IService*) m_processingMgr.get() );
607 // svcManager()->removeService( (IService*) m_runable.get() );
608
609 if ( m_codeCheck ) {
610 StatusCode::disableChecking();
611 }
612
613 if ( sc.isSuccess() ) {
614 log << MSG::INFO << "Application Manager Finalized successfully" << endmsg;
615 } else {
616 log << MSG::ERROR << "Application Manager failed to finalize" << endmsg;
617 }
618
619 m_state = m_targetState;
620 return sc;
621 }
ApplicationMgr::m_targetState
Gaudi::StateMachine::State m_targetState
Internal State.
Definition: ApplicationMgr.h:203
Gaudi::ReturnCode::FinalizationFailure
constexpr int FinalizationFailure
Error codes for operation failures.
Definition: AppReturnCode.h:34
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
Gaudi::StateMachine::INITIALIZED
Definition: StateMachine.h:15
StatusCode::SUCCESS
Definition: StatusCode.h:30
ApplicationMgr::m_returnCode
Gaudi::Property< int > m_returnCode
Property to record the error conditions occurring during the running.
Definition: ApplicationMgr.h:273
Gaudi::StateMachine::CONFIGURED
Definition: StateMachine.h:14
ApplicationMgr::m_codeCheck
Gaudi::Property< bool > m_codeCheck
Definition: ApplicationMgr.h:242
StatusCode::FAILURE
Definition: StatusCode.h:29
Gaudi::Property
Implementation of property with value of concrete type.
Definition: Property.h:314
PropertyHolder< CommonMessaging< implements< IAppMgrUI, IEventProcessor, IService, IStateful, INamedInterface, IProperty > > >::setProperty
StatusCode setProperty(const Gaudi::Details::PropertyBase &p) override
set the property form another property
Definition: PropertyHolder.h:210
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:74
ApplicationMgr::name
const std::string & name() const override
Definition: ApplicationMgr.cpp:855
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:84
ApplicationMgr::svcManager
SmartIF< ISvcManager > & svcManager()
Definition: ApplicationMgr.h:132
MSG::FATAL
Definition: IMessageSvc.h:22
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
ApplicationMgr::m_svcLocator
SmartIF< ISvcLocator > m_svcLocator
Reference to its own service locator (must be instantiated prior to any service!) ...
Definition: ApplicationMgr.h:188
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
IStateful::finalize
virtual StatusCode finalize()=0
Finalize (from INITIALIZED to CONFIGURED).
MSG::ERROR
Definition: IMessageSvc.h:21
StatusCode::disableChecking
static GAUDI_API void disableChecking()
Definition: StatusCode.cpp:23
MSG::WARNING
Definition: IMessageSvc.h:20
ApplicationMgr::m_state
Gaudi::StateMachine::State m_state
Internal State.
Definition: ApplicationMgr.h:202
MSG::INFO
Definition: IMessageSvc.h:19
IProperty
The IProperty is the basic interface for all components which have properties that can be set or get...
Definition: IProperty.h:20
ApplicationMgr::algManager
SmartIF< IAlgManager > & algManager()
Definition: ApplicationMgr.h:141
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:209
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

Gaudi::StateMachine::State ApplicationMgr::FSMState | ( |  | ) | const
| override

Definition at line 858 of file ApplicationMgr.cpp.

858 { return m_state; }
ApplicationMgr::m_state
Gaudi::StateMachine::State m_state
Internal State.
Definition: ApplicationMgr.h:202
template<class I >

SmartIF<IComponentManager>& ApplicationMgr::getManager | ( |  | ) |
| inline

Definition at line 127 of file ApplicationMgr.h.

128 {
129 return m_managers[I::interfaceID().id()];
130 }
ApplicationMgr::m_managers
ManagersMap m_managers
Map of known component managers.
Definition: ApplicationMgr.h:177

StatusCode ApplicationMgr::GoToState | ( | Gaudi::StateMachine::State | state,
|  | bool | ignoreFailures = `false`
| ) |  |
| protected

Reach a state from current state (whichever it is) going through the correct transitions.

By default, if a transition fails, the chain is interrupted, but the behavior can be changed with the parameter "gnoreFailures"

Definition at line 685 of file ApplicationMgr.cpp.

686 {
687 StatusCode sc = StatusCode( StatusCode::SUCCESS, true );
688
689 switch ( state ) {
690
691 case Gaudi::StateMachine::OFFLINE:
692 switch ( m_state ) {
693 case Gaudi::StateMachine::OFFLINE:
694 return StatusCode::SUCCESS;
695 break;
696 case Gaudi::StateMachine::CONFIGURED:
697 return terminate();
698 break;
699 default: // Gaudi::StateMachine::INITIALIZED or Gaudi::StateMachine::RUNNING
700 sc = GoToState( Gaudi::StateMachine::CONFIGURED );
701 if ( sc.isSuccess() ) {
702 return terminate();
703 }
704 break;
705 }
706 break;
707
708 case Gaudi::StateMachine::CONFIGURED:
709 switch ( m_state ) {
710 case Gaudi::StateMachine::CONFIGURED:
711 return StatusCode::SUCCESS;
712 break;
713 case Gaudi::StateMachine::OFFLINE:
714 return configure();
715 break;
716 case Gaudi::StateMachine::INITIALIZED:
717 return finalize();
718 break;
719 default: // Gaudi::StateMachine::RUNNING
720 sc = GoToState( Gaudi::StateMachine::INITIALIZED );
721 if ( sc.isSuccess() ) {
722 return finalize();
723 }
724 break;
725 }
726 break;
727
728 case Gaudi::StateMachine::INITIALIZED:
729 switch ( m_state ) {
730 case Gaudi::StateMachine::INITIALIZED:
731 return StatusCode::SUCCESS;
732 break;
733 case Gaudi::StateMachine::CONFIGURED:
734 return initialize();
735 break;
736 case Gaudi::StateMachine::RUNNING:
737 return stop();
738 break;
739 default: // Gaudi::StateMachine::OFFLINE
740 sc = GoToState( Gaudi::StateMachine::CONFIGURED );
741 if ( sc.isSuccess() ) {
742 return initialize();
743 }
744 break;
745 }
746 break;
747
748 case Gaudi::StateMachine::RUNNING:
749 switch ( m_state ) {
750 case Gaudi::StateMachine::RUNNING:
751 return StatusCode::SUCCESS;
752 break;
753 case Gaudi::StateMachine::INITIALIZED:
754 return start();
755 break;
756 default: // Gaudi::StateMachine::OFFLINE or Gaudi::StateMachine::CONFIGURED
757 sc = GoToState( Gaudi::StateMachine::INITIALIZED );
758 if ( sc.isSuccess() ) {
759 return start();
760 }
761 break;
762 }
763 break;
764 }
765
766 // If I get here, there has been a problem in the recursion
767
768 if ( ignoreFailures ) {
769 // force the new state
770 m_state = state;
771 return StatusCode::SUCCESS;
772 }
773
774 return sc;
775 }
ApplicationMgr::initialize
StatusCode initialize() override
Definition: ApplicationMgr.cpp:430
Gaudi::StateMachine::INITIALIZED
Definition: StateMachine.h:15
StatusCode::SUCCESS
Definition: StatusCode.h:30
Gaudi::StateMachine::CONFIGURED
Definition: StateMachine.h:14
compareRootHistos.state
state
Definition: compareRootHistos.py:348
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:74
ApplicationMgr::terminate
StatusCode terminate() override
Definition: ApplicationMgr.cpp:626
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
ApplicationMgr::GoToState
StatusCode GoToState(Gaudi::StateMachine::State state, bool ignoreFailures=false)
Reach a state from current state (whichever it is) going through the correct transitions.
Definition: ApplicationMgr.cpp:685
ApplicationMgr::finalize
StatusCode finalize() override
Definition: ApplicationMgr.cpp:574
Gaudi::StateMachine::RUNNING
Definition: StateMachine.h:16
ApplicationMgr::start
StatusCode start() override
Definition: ApplicationMgr.cpp:484
ApplicationMgr::configure
StatusCode configure() override
Definition: ApplicationMgr.cpp:234
ApplicationMgr::stop
StatusCode stop() override
Definition: ApplicationMgr.cpp:536
ApplicationMgr::m_state
Gaudi::StateMachine::State m_state
Internal State.
Definition: ApplicationMgr.h:202
Gaudi::StateMachine::OFFLINE
Definition: StateMachine.h:13

StatusCode ApplicationMgr::i_startup | ( |  | ) |
| protected

Internal startup routine.

Definition at line 130 of file ApplicationMgr.cpp.

131 {
132
133 StatusCode sc;
134
135 // declare factories in current module
136 m_classManager->loadModule( "" ).ignore();
137
138 // Create the Message service
139 auto msgsvc = svcManager()->createService( Gaudi::Utils::TypeNameString( "MessageSvc", m_messageSvcType ) );
140 if ( !msgsvc ) {
141 fatal() << "Error creating MessageSvc of type " << m_messageSvcType << endmsg;
142 return sc;
143 }
144 // Create the Job Options service
145 auto jobsvc = svcManager()->createService( Gaudi::Utils::TypeNameString( "JobOptionsSvc", m_jobOptionsSvcType ) );
146 if ( !jobsvc ) {
147 fatal() << "Error creating JobOptionsSvc" << endmsg;
148 return sc;
149 }
150
151 auto jobOptsIProp = jobsvc.as<IProperty>();
152 if ( !jobOptsIProp ) {
153 fatal() << "Error locating JobOptionsSvc" << endmsg;
154 return sc;
155 }
156 sc = jobOptsIProp->setProperty( Gaudi::Property<std::string>( "TYPE", m_jobOptionsType ) );
157 if ( !sc.isSuccess() ) {
158 fatal() << "Error setting TYPE option in JobOptionsSvc" << endmsg;
159 return sc;
160 }
161
162 if ( !m_jobOptionsPreAction.empty() ) {
163 sc = jobOptsIProp->setProperty( Gaudi::Property<std::string>( "PYTHONPARAMS", m_jobOptionsPreAction ) );
164 if ( !sc.isSuccess() ) {
165 fatal() << "Error setting JobOptionsPreAction option in JobOptionsSvc" << endmsg;
166 return sc;
167 }
168 }
169
170 if ( !m_jobOptionsPostAction.empty() ) {
171 sc = jobOptsIProp->setProperty( Gaudi::Property<std::string>( "PYTHONACTION", m_jobOptionsPostAction ) );
172 if ( !sc.isSuccess() ) {
173 fatal() << "Error setting JobOptionsPostAction option in JobOptionsSvc" << endmsg;
174 return sc;
175 }
176 }
177
178 if ( !m_jobOptionsPath.empty() ) { // The command line takes precedence
179 sc = jobOptsIProp->setProperty( Gaudi::Property<std::string>( "PATH", m_jobOptionsPath ) );
180 if ( !sc.isSuccess() ) {
181 fatal() << "Error setting PATH option in JobOptionsSvc" << endmsg;
182 return sc;
183 }
184 } else if ( isEnvSet( "JOBOPTPATH" ) ) { // Otherwise the Environment JOBOPTPATH
185 sc = jobOptsIProp->setProperty( Gaudi::Property<std::string>( "PATH", getEnv( "JOBOPTPATH" ) ) );
186 if ( !sc.isSuccess() ) {
187 fatal() << "Error setting PATH option in JobOptionsSvc from env" << endmsg;
188 return sc;
189 }
190 } else { // Otherwise the default
191 sc = jobOptsIProp->setProperty( Gaudi::Property<std::string>( "PATH", "../options/job.opts" ) );
192 if ( !sc.isSuccess() ) {
193 fatal() << "Error setting PATH option in JobOptionsSvc to default" << endmsg;
194 return sc;
195 }
196 }
197 jobOptsIProp.reset();
198
199 // Sets my default the Output Level of the Message service to be
200 // the same as this
201 auto msgSvcIProp = msgsvc.as<IProperty>();
202 msgSvcIProp->setProperty( Gaudi::Property<int>( "OutputLevel", m_outputLevel ) ).ignore();
203 msgSvcIProp.reset();
204
205 sc = jobsvc->sysInitialize();
206 if ( !sc.isSuccess() ) {
207 fatal() << "Error initializing JobOptionsSvc" << endmsg;
208 return sc;
209 }
210 sc = msgsvc->sysInitialize();
211 if ( !sc.isSuccess() ) {
212 fatal() << "Error initializing MessageSvc" << endmsg;
213 return sc;
214 }
215
216 // Get the useful interface from Message and JobOptions services
217 m_messageSvc = m_svcLocator->service( "MessageSvc" );
218 if ( !m_messageSvc ) {
219 fatal() << "Error retrieving MessageSvc." << endmsg;
220 return sc;
221 }
222 m_jobOptionsSvc = m_svcLocator->service( "JobOptionsSvc" );
223 if ( !m_jobOptionsSvc ) {
224 fatal() << "Error retrieving JobOptionsSvc." << endmsg;
225 return sc;
226 }
227
228 return sc;
229 }
System::getEnv
GAUDI_API std::string getEnv(const char *var)
get a particular environment variable (returning "UNKNOWN" if not set)
Definition: System.cpp:550
DLLClassManager::loadModule
StatusCode loadModule(const std::string &module, bool fireIncident=true) override
Definition: DLLClassManager.cpp:29
Gaudi::Property
Implementation of property with value of concrete type.
Definition: Property.h:314
ApplicationMgr::m_jobOptionsType
Gaudi::Property< std::string > m_jobOptionsType
Definition: ApplicationMgr.h:228
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:74
ApplicationMgr::m_jobOptionsSvc
SmartIF< IJobOptionsSvc > m_jobOptionsSvc
Reference to JobOption service.
Definition: ApplicationMgr.h:212
ApplicationMgr::svcManager
SmartIF< ISvcManager > & svcManager()
Definition: ApplicationMgr.h:132
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
IProperty::setProperty
virtual StatusCode setProperty(const Gaudi::Details::PropertyBase &p)=0
Set the property by property.
ApplicationMgr::m_outputLevel
Gaudi::Property< int > m_outputLevel
Definition: ApplicationMgr.h:238
Gaudi::Utils::TypeNameString
Helper class to parse a string of format "type/name".
Definition: TypeNameString.h:12
ApplicationMgr::m_svcLocator
SmartIF< ISvcLocator > m_svcLocator
Reference to its own service locator (must be instantiated prior to any service!) ...
Definition: ApplicationMgr.h:188
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
ISvcManager::createService
virtual SmartIF< IService > & createService(const Gaudi::Utils::TypeNameString &nametype)=0
Creates and instance of a service type that has been declared beforehand and assigns it a name...
ApplicationMgr::m_jobOptionsPreAction
Gaudi::Property< std::string > m_jobOptionsPreAction
Definition: ApplicationMgr.h:230
System::isEnvSet
GAUDI_API bool isEnvSet(const char *var)
Check if an environment variable is set or not.
Definition: System.cpp:570
ApplicationMgr::m_classManager
SmartIF< DLLClassManager > m_classManager
Reference to the class manager.
Definition: ApplicationMgr.h:190
ApplicationMgr::m_jobOptionsSvcType
Gaudi::Property< std::string > m_jobOptionsSvcType
Definition: ApplicationMgr.h:199
ApplicationMgr::m_jobOptionsPostAction
Gaudi::Property< std::string > m_jobOptionsPostAction
Definition: ApplicationMgr.h:232
ApplicationMgr::m_messageSvcType
Gaudi::Property< std::string > m_messageSvcType
Definition: ApplicationMgr.h:198
CommonMessagingBase::fatal
MsgStream & fatal() const
shortcut for the method msgStream(MSG::FATAL)
Definition: CommonMessaging.h:111
StatusCode::ignore
void ignore() const
Definition: StatusCode.h:106
IProperty
The IProperty is the basic interface for all components which have properties that can be set or get...
Definition: IProperty.h:20
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:209
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
ApplicationMgr::m_jobOptionsPath
Gaudi::Property< std::string > m_jobOptionsPath
Definition: ApplicationMgr.h:229

StatusCode ApplicationMgr::initialize | ( |  | ) |
| override

Definition at line 430 of file ApplicationMgr.cpp.

431 {
432
433 MsgStream log( m_messageSvc, name() );
434 StatusCode sc;
435
436 // I cannot add these services in configure() because they are coming from GaudiUtils
437 // and it messes up genconf when rebuilding it.
438 if ( m_stopOnSignal ) {
439 // Instantiate the service that schedules a stop when a signal is received
440 std::string svcname( "Gaudi::Utils::StopSignalHandler" );
441 sc = svcManager()->addService( svcname );
442 if ( sc.isFailure() ) {
443 log << MSG::INFO << "Cannot instantiate " << svcname << "signals will be ignored" << endmsg;
444 }
445 }
446
447 if ( m_stalledEventMonitoring ) {
448 // Instantiate the service that schedules a stop when a signal is received
449 std::string svcname( "StalledEventMonitor" );
450 sc = svcManager()->addService( svcname );
451 if ( sc.isFailure() ) {
452 log << MSG::INFO << "Cannot instantiate " << svcname << "signals will be ignored" << endmsg;
453 }
454 }
455
456 if ( m_state == Gaudi::StateMachine::INITIALIZED ) {
457 log << MSG::INFO << "Already Initialized!" << endmsg;
458 return StatusCode::SUCCESS;
459 }
460 if ( m_state != Gaudi::StateMachine::CONFIGURED ) {
461 log << MSG::FATAL << "initialize: Invalid state \"" << m_state << "\"" << endmsg;
462 return StatusCode::FAILURE;
463 }
464 m_targetState = Gaudi::StateMachine::INITIALIZED;
465
466 //--------------------------------------------------------------------------
467 // Initialize the list of top Services
468 //--------------------------------------------------------------------------
469 sc = svcManager()->initialize();
470 if ( !sc.isSuccess() ) return sc;
471
472 //--------------------------------------------------------------------------
473 // Final steps: Inform user and change internal state
474 //--------------------------------------------------------------------------
475 log << MSG::INFO << "Application Manager Initialized successfully" << endmsg;
476 m_state = m_targetState;
477
478 return sc;
479 }
ApplicationMgr::m_targetState
Gaudi::StateMachine::State m_targetState
Internal State.
Definition: ApplicationMgr.h:203
ISvcManager::addService
virtual StatusCode addService(IService *svc, int prio=DEFAULT_SVC_PRIORITY)=0
Add a service to the "active" list of services of the factory.
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
Gaudi::StateMachine::INITIALIZED
Definition: StateMachine.h:15
StatusCode::SUCCESS
Definition: StatusCode.h:30
ApplicationMgr::m_stopOnSignal
Gaudi::Property< bool > m_stopOnSignal
Property to enable/disable the "stop on signal" service.
Definition: ApplicationMgr.h:261
Gaudi::StateMachine::CONFIGURED
Definition: StateMachine.h:14
StatusCode::FAILURE
Definition: StatusCode.h:29
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:74
ApplicationMgr::name
const std::string & name() const override
Definition: ApplicationMgr.cpp:855
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:84
ApplicationMgr::svcManager
SmartIF< ISvcManager > & svcManager()
Definition: ApplicationMgr.h:132
std::string
STL class.
MSG::FATAL
Definition: IMessageSvc.h:22
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
ApplicationMgr::m_stalledEventMonitoring
Gaudi::Property< bool > m_stalledEventMonitoring
Property to enable/disable the monitoring and reporting of stalled events.
Definition: ApplicationMgr.h:266
IStateful::initialize
virtual StatusCode initialize()=0
Initialization (from CONFIGURED to INITIALIZED).
ApplicationMgr::m_state
Gaudi::StateMachine::State m_state
Internal State.
Definition: ApplicationMgr.h:202
MSG::INFO
Definition: IMessageSvc.h:19
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:209
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

void ApplicationMgr::initLoopCheckHndlr | ( | Gaudi::Details::PropertyBase & |  | ) |

Definition at line 1220 of file ApplicationMgr.cpp.

1221 {
1222 svcManager()->setLoopCheckEnabled( m_loopCheck );
1223 }
ApplicationMgr::svcManager
SmartIF< ISvcManager > & svcManager()
Definition: ApplicationMgr.h:132
ISvcManager::setLoopCheckEnabled
virtual void setLoopCheckEnabled(bool en=true)=0
Set the value of the initialization loop check flag.
ApplicationMgr::m_loopCheck
Gaudi::Property< bool > m_loopCheck
Definition: ApplicationMgr.h:256

void ApplicationMgr::multiThreadSvcNameListHandler | ( | Gaudi::Details::PropertyBase & | theProp | ) |

Definition at line 1019 of file ApplicationMgr.cpp.

1020 {
1021 if ( !( decodeMultiThreadSvcNameList() ).isSuccess() ) {
1022 throw GaudiException( "Failed to create copies of mt services",
1023 "MinimalEventLoopMgr::multiThreadSvcNameListHandler", StatusCode::FAILURE );
1024 }
1025 }
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:23
StatusCode::FAILURE
Definition: StatusCode.h:29
ApplicationMgr::decodeMultiThreadSvcNameList
StatusCode decodeMultiThreadSvcNameList()
Definition: ApplicationMgr.cpp:1030

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

Definition at line 855 of file ApplicationMgr.cpp.

855 { return m_name; }
ApplicationMgr::m_name
std::string m_name
Name.
Definition: ApplicationMgr.h:201

StatusCode ApplicationMgr::nextEvent | ( | int | maxevt | ) |
| override

Definition at line 518 of file ApplicationMgr.cpp.

519 {
520 if ( m_state != Gaudi::StateMachine::RUNNING ) {
521 MsgStream log( m_messageSvc, name() );
522 log << MSG::FATAL << "nextEvent: Invalid state \"" << m_state << "\"" << endmsg;
523 return StatusCode::FAILURE;
524 }
525 if ( !m_processingMgr ) {
526 MsgStream log( m_messageSvc, name() );
527 log << MSG::FATAL << "No event processing manager specified. Check option: " << m_eventLoopMgr.name() << endmsg;
528 return StatusCode::FAILURE;
529 }
530 return m_processingMgr->nextEvent( maxevt );
531 }
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
StatusCode::FAILURE
Definition: StatusCode.h:29
ApplicationMgr::name
const std::string & name() const override
Definition: ApplicationMgr.cpp:855
ApplicationMgr::m_processingMgr
SmartIF< IEventProcessor > m_processingMgr
Reference to processing manager object.
Definition: ApplicationMgr.h:211
ApplicationMgr::m_eventLoopMgr
Gaudi::Property< std::string > m_eventLoopMgr
Definition: ApplicationMgr.h:235
IEventProcessor::nextEvent
virtual StatusCode nextEvent(int maxevt)=0
Process the next maxevt events.
MSG::FATAL
Definition: IMessageSvc.h:22
Gaudi::StateMachine::RUNNING
Definition: StateMachine.h:16
ApplicationMgr::m_state
Gaudi::StateMachine::State m_state
Internal State.
Definition: ApplicationMgr.h:202
maxevt
int maxevt
Definition: Bootstrap.cpp:279
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:209
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

void ApplicationMgr::pluginDebugPropertyHandler | ( | Gaudi::Details::PropertyBase & | theProp | ) |

Definition at line 1209 of file ApplicationMgr.cpp.

1210 {
1211 // Setup debug level for the plugin system
1212 MsgStream log( m_messageSvc, name() );
1213 log << MSG::INFO << "Updating Gaudi::PluginService::SetDebug(level) to level=" << m_pluginDebugLevel << endmsg;
1214 Gaudi::PluginService::SetDebug( m_pluginDebugLevel );
1215 }
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
ApplicationMgr::name
const std::string & name() const override
Definition: ApplicationMgr.cpp:855
Gaudi::PluginService::SetDebug
GAUDIPS_API void SetDebug(int debugLevel)
Backward compatibility with Reflex.
Definition: PluginService.cpp:349
MSG::INFO
Definition: IMessageSvc.h:19
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:209
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
ApplicationMgr::m_pluginDebugLevel
Gaudi::Property< int > m_pluginDebugLevel
Definition: ApplicationMgr.h:243
Gaudi.Configuration.log
log
Definition: Configuration.py:13

StatusCode ApplicationMgr::queryInterface | ( | const InterfaceID & | iid,
|  | void ** | pinterface
| ) |  |
| override

Definition at line 93 of file ApplicationMgr.cpp.

94 {
95 if ( !ppvi ) {
96 return StatusCode::FAILURE;
97 }
98
99 // try to find own/direct interfaces:
100 StatusCode sc = base_class::queryInterface( iid, ppvi );
101 if ( sc.isSuccess() ) return sc;
102
103 // find indirect interfaces :
104 if ( ISvcLocator::interfaceID().versionMatch( iid ) ) {
105 return serviceLocator()->queryInterface( iid, ppvi );
106 }
107 if ( ISvcManager::interfaceID().versionMatch( iid ) ) {
108 return svcManager()->queryInterface( iid, ppvi );
109 }
110 if ( IAlgManager::interfaceID().versionMatch( iid ) ) {
111 return algManager()->queryInterface( iid, ppvi );
112 }
113 if ( IClassManager::interfaceID().versionMatch( iid ) ) {
114 return m_classManager->queryInterface( iid, ppvi );
115 }
116 if ( IMessageSvc::interfaceID().versionMatch( iid ) ) {
117 *ppvi = reinterpret_cast<void*>( m_messageSvc.get() );
118 if ( m_messageSvc ) m_messageSvc->addRef();
119 // Note that 0 can be a valid IMessageSvc pointer value (when used for
120 // MsgStream).
121 return StatusCode::SUCCESS;
122 }
123 *ppvi = nullptr;
124 return StatusCode::FAILURE;
125 }
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode::FAILURE
Definition: StatusCode.h:29
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:74
ApplicationMgr::svcManager
SmartIF< ISvcManager > & svcManager()
Definition: ApplicationMgr.h:132
SmartIF::get
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:76
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DLLClassManager::queryInterface
StatusCode queryInterface(const InterfaceID &iid, void **pinterface) override
implementation of IInterface::queryInterface
Definition: DLLClassManager.cpp:78
InterfaceID::versionMatch
constexpr bool versionMatch(const InterfaceID &iid) const
check compatibility.
Definition: IInterface.h:59
ApplicationMgr::m_classManager
SmartIF< DLLClassManager > m_classManager
Reference to the class manager.
Definition: ApplicationMgr.h:190
IInterface::addRef
virtual unsigned long addRef()=0
Increment the reference count of Interface instance.
ApplicationMgr::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Needed to locate the message service.
Definition: ApplicationMgr.h:151
queryInterface
StatusCode queryInterface(const InterfaceID &iid, void **pinterface) override
ApplicationMgr::algManager
SmartIF< IAlgManager > & algManager()
Definition: ApplicationMgr.h:141
IInterface::interfaceID
static const InterfaceID & interfaceID()
Return an instance of InterfaceID identifying the interface.
Definition: IInterface.h:243
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:209
IInterface::queryInterface
virtual StatusCode queryInterface(const InterfaceID &ti, void **pp)=0
Set the void** to the pointer to the requested interface of the instance.

StatusCode ApplicationMgr::reinitialize | ( |  | ) |
| override

Definition at line 865 of file ApplicationMgr.cpp.

866 {
867 StatusCode retval = StatusCode::SUCCESS;
868 StatusCode sc;
869 if ( m_state < Gaudi::StateMachine::INITIALIZED ) {
870 throw GaudiException( "Cannot reinitialize application if not INITIALIZED or RUNNING",
871 "ApplicationMgr::reinitialize", StatusCode::FAILURE );
872 }
873 if ( m_state == Gaudi::StateMachine::RUNNING ) {
874 retval = GoToState( Gaudi::StateMachine::INITIALIZED );
875 }
876 sc = svcManager()->reinitialize();
877 if ( sc.isFailure() ) retval = sc;
878 sc = algManager()->reinitialize();
879 if ( sc.isFailure() ) retval = sc;
880 return retval;
881 }
Gaudi::StateMachine::INITIALIZED
Definition: StateMachine.h:15
StatusCode::SUCCESS
Definition: StatusCode.h:30
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:23
StatusCode::FAILURE
Definition: StatusCode.h:29
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:84
ApplicationMgr::svcManager
SmartIF< ISvcManager > & svcManager()
Definition: ApplicationMgr.h:132
compareRootHistos.retval
retval
Definition: compareRootHistos.py:351
IStateful::reinitialize
virtual StatusCode reinitialize()=0
Initialization (from INITIALIZED or RUNNING to INITIALIZED, via CONFIGURED).
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
ApplicationMgr::GoToState
StatusCode GoToState(Gaudi::StateMachine::State state, bool ignoreFailures=false)
Reach a state from current state (whichever it is) going through the correct transitions.
Definition: ApplicationMgr.cpp:685
Gaudi::StateMachine::RUNNING
Definition: StateMachine.h:16
ApplicationMgr::m_state
Gaudi::StateMachine::State m_state
Internal State.
Definition: ApplicationMgr.h:202
ApplicationMgr::algManager
SmartIF< IAlgManager > & algManager()
Definition: ApplicationMgr.h:141

StatusCode ApplicationMgr::restart | ( |  | ) |
| override

Definition at line 886 of file ApplicationMgr.cpp.

887 {
888 StatusCode retval = StatusCode::SUCCESS;
889 StatusCode sc;
890 if ( m_state != Gaudi::StateMachine::RUNNING ) {
891 throw GaudiException( "Cannot restart application if not RUNNING", "ApplicationMgr::restart", StatusCode::FAILURE );
892 }
893 sc = svcManager()->restart();
894 if ( sc.isFailure() ) retval = sc;
895 sc = algManager()->restart();
896 if ( sc.isFailure() ) retval = sc;
897 return retval;
898 }
StatusCode::SUCCESS
Definition: StatusCode.h:30
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:23
StatusCode::FAILURE
Definition: StatusCode.h:29
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:84
ApplicationMgr::svcManager
SmartIF< ISvcManager > & svcManager()
Definition: ApplicationMgr.h:132
compareRootHistos.retval
retval
Definition: compareRootHistos.py:351
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
Gaudi::StateMachine::RUNNING
Definition: StateMachine.h:16
IStateful::restart
virtual StatusCode restart()=0
Initialization (from RUNNING to RUNNING, via INITIALIZED).
ApplicationMgr::m_state
Gaudi::StateMachine::State m_state
Internal State.
Definition: ApplicationMgr.h:202
ApplicationMgr::algManager
SmartIF< IAlgManager > & algManager()
Definition: ApplicationMgr.h:141

StatusCode ApplicationMgr::run | ( |  | ) |
| override

Definition at line 780 of file ApplicationMgr.cpp.

781 {
782 StatusCode sc = StatusCode::SUCCESS;
783
784 sc = GoToState( Gaudi::StateMachine::RUNNING );
785 if ( sc.isSuccess() ) {
786 MsgStream log( m_messageSvc, name() );
787 if ( m_runable != 0 ) { // loop over the events
788 sc = m_runable->run();
789 if ( !sc.isSuccess() ) {
790 log << MSG::FATAL << "Application execution failed. Ending the job." << endmsg;
791 }
792 } else {
793 log << MSG::FATAL << "Application has no runable object. Check option:" << m_runableType.name() << endmsg;
794 }
795 }
796 if ( sc.isSuccess() ) { // try to close cleanly
797 sc = GoToState( Gaudi::StateMachine::OFFLINE );
798 }
799 // either the runable failed of the stut-down
800 if ( sc.isFailure() ) { // try to close anyway (but keep the StatusCode unchanged)
801 GoToState( Gaudi::StateMachine::OFFLINE, true ).ignore();
802 }
803 return sc;
804 }
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
StatusCode::SUCCESS
Definition: StatusCode.h:30
IRunable::run
virtual StatusCode run()=0
Run the class implementation.
ApplicationMgr::m_runable
SmartIF< IRunable > m_runable
Reference to the runable object.
Definition: ApplicationMgr.h:210
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:74
ApplicationMgr::name
const std::string & name() const override
Definition: ApplicationMgr.cpp:855
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:84
MSG::FATAL
Definition: IMessageSvc.h:22
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
ApplicationMgr::m_runableType
Gaudi::Property< std::string > m_runableType
Definition: ApplicationMgr.h:234
ApplicationMgr::GoToState
StatusCode GoToState(Gaudi::StateMachine::State state, bool ignoreFailures=false)
Reach a state from current state (whichever it is) going through the correct transitions.
Definition: ApplicationMgr.cpp:685
Gaudi::StateMachine::RUNNING
Definition: StateMachine.h:16
StatusCode::ignore
void ignore() const
Definition: StatusCode.h:106
Gaudi::StateMachine::OFFLINE
Definition: StateMachine.h:13
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:209
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

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

Needed to locate the message service.

Definition at line 151 of file ApplicationMgr.h.

151 { return m_svcLocator; }
ApplicationMgr::m_svcLocator
SmartIF< ISvcLocator > m_svcLocator
Reference to its own service locator (must be instantiated prior to any service!) ...
Definition: ApplicationMgr.h:188

void ApplicationMgr::setServiceManager | ( | ISvcManager * |  | ) |
| inline override protected

Definition at line 160 of file ApplicationMgr.h.

160 {}

void ApplicationMgr::SIExitHandler | ( | Gaudi::Details::PropertyBase & | theProp | ) |

Definition at line 920 of file ApplicationMgr.cpp.

921 {
922 StatusCode status;
923 status = finalize();
924 status = terminate();
925 ::exit( 0 );
926 }
ApplicationMgr::terminate
StatusCode terminate() override
Definition: ApplicationMgr.cpp:626
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
ApplicationMgr::finalize
StatusCode finalize() override
Definition: ApplicationMgr.cpp:574

void ApplicationMgr::SIGoHandler | ( | Gaudi::Details::PropertyBase & | theProp | ) |

Definition at line 903 of file ApplicationMgr.cpp.

904 {
905
906 MsgStream log( m_messageSvc, name() );
907 StatusCode sc;
908
909 // Re-initialize everything
910 sc = reinitialize();
911 // Execute a number of events
912 executeRun( m_evtMax );
913
914 return;
915 }
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
ApplicationMgr::m_evtMax
Gaudi::Property< int > m_evtMax
Definition: ApplicationMgr.h:218
ApplicationMgr::name
const std::string & name() const override
Definition: ApplicationMgr.cpp:855
ApplicationMgr::executeRun
StatusCode executeRun(int evtmax) override
implementation of IEventProcessor::executeRun(int)
Definition: ApplicationMgr.cpp:824
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
ApplicationMgr::reinitialize
StatusCode reinitialize() override
Definition: ApplicationMgr.cpp:865
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:209
Gaudi.Configuration.log
log
Definition: Configuration.py:13

StatusCode ApplicationMgr::start | ( |  | ) |
| override

Definition at line 484 of file ApplicationMgr.cpp.

485 {
486
487 MsgStream log( m_messageSvc, name() );
488 StatusCode sc;
489
490 if ( m_state == Gaudi::StateMachine::RUNNING ) {
491 log << MSG::INFO << "Already Initialized!" << endmsg;
492 return StatusCode::SUCCESS;
493 }
494 if ( m_state != Gaudi::StateMachine::INITIALIZED ) {
495 log << MSG::FATAL << "start: Invalid state \"" << m_state << "\"" << endmsg;
496 return StatusCode::FAILURE;
497 }
498 m_targetState = Gaudi::StateMachine::RUNNING;
499
500 //--------------------------------------------------------------------------
501 // Initialize the list of top Services
502 //--------------------------------------------------------------------------
503 sc = svcManager()->start();
504 if ( !sc.isSuccess() ) return sc;
505
506 //--------------------------------------------------------------------------
507 // Final steps: Inform user and change internal state
508 //--------------------------------------------------------------------------
509 log << MSG::INFO << "Application Manager Started successfully" << endmsg;
510 m_state = m_targetState;
511
512 return sc;
513 }
ApplicationMgr::m_targetState
Gaudi::StateMachine::State m_targetState
Internal State.
Definition: ApplicationMgr.h:203
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
Gaudi::StateMachine::INITIALIZED
Definition: StateMachine.h:15
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode::FAILURE
Definition: StatusCode.h:29
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:74
ApplicationMgr::name
const std::string & name() const override
Definition: ApplicationMgr.cpp:855
ApplicationMgr::svcManager
SmartIF< ISvcManager > & svcManager()
Definition: ApplicationMgr.h:132
IStateful::start
virtual StatusCode start()=0
Start (from INITIALIZED to RUNNING).
MSG::FATAL
Definition: IMessageSvc.h:22
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
Gaudi::StateMachine::RUNNING
Definition: StateMachine.h:16
ApplicationMgr::m_state
Gaudi::StateMachine::State m_state
Internal State.
Definition: ApplicationMgr.h:202
MSG::INFO
Definition: IMessageSvc.h:19
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:209
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

StatusCode ApplicationMgr::stop | ( |  | ) |
| override

Definition at line 536 of file ApplicationMgr.cpp.

537 {
538
539 MsgStream log( m_messageSvc, name() );
540 StatusCode sc;
541
542 if ( m_state == Gaudi::StateMachine::INITIALIZED ) {
543 log << MSG::INFO << "Already Initialized!" << endmsg;
544 return StatusCode::SUCCESS;
545 }
546 if ( m_state != Gaudi::StateMachine::RUNNING ) {
547 log << MSG::FATAL << "stop: Invalid state \"" << m_state << "\"" << endmsg;
548 return StatusCode::FAILURE;
549 }
550 m_targetState = Gaudi::StateMachine::INITIALIZED;
551
552 // Stop independently managed Algorithms
553 sc = algManager()->stop();
554 if ( !sc.isSuccess() ) return sc;
555
556 //--------------------------------------------------------------------------
557 // Stop the list of top Services
558 //--------------------------------------------------------------------------
559 sc = svcManager()->stop();
560 if ( !sc.isSuccess() ) return sc;
561
562 //--------------------------------------------------------------------------
563 // Final steps: Inform user and change internal state
564 //--------------------------------------------------------------------------
565 log << MSG::INFO << "Application Manager Stopped successfully" << endmsg;
566 m_state = m_targetState;
567
568 return sc;
569 }
ApplicationMgr::m_targetState
Gaudi::StateMachine::State m_targetState
Internal State.
Definition: ApplicationMgr.h:203
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
Gaudi::StateMachine::INITIALIZED
Definition: StateMachine.h:15
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode::FAILURE
Definition: StatusCode.h:29
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:74
ApplicationMgr::name
const std::string & name() const override
Definition: ApplicationMgr.cpp:855
ApplicationMgr::svcManager
SmartIF< ISvcManager > & svcManager()
Definition: ApplicationMgr.h:132
MSG::FATAL
Definition: IMessageSvc.h:22
IStateful::stop
virtual StatusCode stop()=0
Stop (from RUNNING to INITIALIZED).
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
Gaudi::StateMachine::RUNNING
Definition: StateMachine.h:16
ApplicationMgr::m_state
Gaudi::StateMachine::State m_state
Internal State.
Definition: ApplicationMgr.h:202
MSG::INFO
Definition: IMessageSvc.h:19
ApplicationMgr::algManager
SmartIF< IAlgManager > & algManager()
Definition: ApplicationMgr.h:141
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:209
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

StatusCode ApplicationMgr::stopRun | ( |  | ) |
| override

implementation of IEventProcessor::stopRun()

Definition at line 841 of file ApplicationMgr.cpp.

842 {
843 MsgStream log( m_messageSvc, name() );
844 if ( m_state == Gaudi::StateMachine::RUNNING ) {
845 if ( m_processingMgr ) {
846 return m_processingMgr->stopRun();
847 }
848 log << MSG::WARNING << "No EventLoop Manager specified " << endmsg;
849 return StatusCode::SUCCESS;
850 }
851 log << MSG::FATAL << "stopRun: Invalid state \"" << FSMState() << "\"" << endmsg;
852 return StatusCode::FAILURE;
853 }
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
StatusCode::SUCCESS
Definition: StatusCode.h:30
IEventProcessor::stopRun
virtual StatusCode stopRun()=0
Schedule a stop of the current event processing.
StatusCode::FAILURE
Definition: StatusCode.h:29
ApplicationMgr::name
const std::string & name() const override
Definition: ApplicationMgr.cpp:855
ApplicationMgr::m_processingMgr
SmartIF< IEventProcessor > m_processingMgr
Reference to processing manager object.
Definition: ApplicationMgr.h:211
MSG::FATAL
Definition: IMessageSvc.h:22
Gaudi::StateMachine::RUNNING
Definition: StateMachine.h:16
MSG::WARNING
Definition: IMessageSvc.h:20
ApplicationMgr::m_state
Gaudi::StateMachine::State m_state
Internal State.
Definition: ApplicationMgr.h:202
ApplicationMgr::FSMState
Gaudi::StateMachine::State FSMState() const override
Definition: ApplicationMgr.cpp:858
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:209
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

SmartIF<ISvcManager>& ApplicationMgr::svcManager | ( |  | ) |
| inline

Definition at line 132 of file ApplicationMgr.h.

133 {
134 // Cache the casted pointer to ISvcManager
135 if ( !m_svcManager ) {
136 m_svcManager = getManager<IService>();
137 }
138 return m_svcManager;
139 }
ApplicationMgr::m_svcManager
SmartIF< ISvcManager > m_svcManager
Cached pointer to the manager of services.
Definition: ApplicationMgr.h:182

StatusCode ApplicationMgr::sysFinalize | ( |  | ) |
| inline override

Definition at line 100 of file ApplicationMgr.h.

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

StatusCode ApplicationMgr::sysInitialize | ( |  | ) |
| inline override

Definition at line 94 of file ApplicationMgr.h.

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

StatusCode ApplicationMgr::sysReinitialize | ( |  | ) |
| inline override

Definition at line 102 of file ApplicationMgr.h.

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

StatusCode ApplicationMgr::sysRestart | ( |  | ) |
| inline override

Definition at line 104 of file ApplicationMgr.h.

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

StatusCode ApplicationMgr::sysStart | ( |  | ) |
| inline override

Definition at line 96 of file ApplicationMgr.h.

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

StatusCode ApplicationMgr::sysStop | ( |  | ) |
| inline override

Definition at line 98 of file ApplicationMgr.h.

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

Gaudi::StateMachine::State ApplicationMgr::targetFSMState | ( |  | ) | const
| override

Definition at line 860 of file ApplicationMgr.cpp.

860 { return m_targetState; }
ApplicationMgr::m_targetState
Gaudi::StateMachine::State m_targetState
Internal State.
Definition: ApplicationMgr.h:203

StatusCode ApplicationMgr::terminate | ( |  | ) |
| override

Definition at line 626 of file ApplicationMgr.cpp.

627 {
628 MsgStream log( m_messageSvc, name() );
629
630 if ( m_state == Gaudi::StateMachine::OFFLINE ) {
631 log << MSG::INFO << "Already Offline" << endmsg;
632 return StatusCode::SUCCESS;
633 }
634 if ( m_state != Gaudi::StateMachine::CONFIGURED ) {
635 log << MSG::FATAL << "terminate: Invalid state \"" << m_state << "\"" << endmsg;
636 return StatusCode::FAILURE;
637 }
638 // release all Services
639 m_targetState = Gaudi::StateMachine::OFFLINE;
640
641 if ( m_returnCode.value() == Gaudi::ReturnCode::Success ) {
642 log << MSG::INFO << "Application Manager Terminated successfully" << endmsg;
643 } else if ( m_returnCode.value() == Gaudi::ReturnCode::ScheduledStop ) {
644 log << MSG::INFO << "Application Manager Terminated successfully with a user requested ScheduledStop" << endmsg;
645 } else {
646 log << MSG::ERROR << "Application Manager Terminated with error code " << m_returnCode.value() << endmsg;
647 }
648
649 { // Force a disable the auditing of finalize for MessageSvc
650 auto prop = m_messageSvc.as<IProperty>();
651 if ( prop ) {
652 prop->setProperty( Gaudi::Property<bool>( "AuditFinalize", false ) ).ignore();
653 }
654 }
655 { // Force a disable the auditing of finalize for JobOptionsSvc
656 auto prop = m_jobOptionsSvc.as<IProperty>();
657 if ( prop ) {
658 prop->setProperty( Gaudi::Property<bool>( "AuditFinalize", false ) ).ignore();
659 }
660 }
661
662 // finalize MessageSvc
663 auto svc = m_messageSvc.as<IService>();
664 if ( !svc ) {
665 log << MSG::ERROR << "Could not get the IService interface of the MessageSvc" << endmsg;
666 } else {
667 svc->sysFinalize().ignore();
668 }
669
670 // finalize JobOptionsSvc
671 svc = m_jobOptionsSvc.as<IService>();
672 if ( !svc ) {
673 log << MSG::ERROR << "Could not get the IService interface of the JobOptionsSvc" << endmsg;
674 } else {
675 svc->sysFinalize().ignore();
676 }
677
678 m_state = m_targetState;
679 return StatusCode::SUCCESS;
680 }
ApplicationMgr::m_targetState
Gaudi::StateMachine::State m_targetState
Internal State.
Definition: ApplicationMgr.h:203
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
StatusCode::SUCCESS
Definition: StatusCode.h:30
ApplicationMgr::m_returnCode
Gaudi::Property< int > m_returnCode
Property to record the error conditions occurring during the running.
Definition: ApplicationMgr.h:273
Gaudi::StateMachine::CONFIGURED
Definition: StateMachine.h:14
StatusCode::FAILURE
Definition: StatusCode.h:29
Gaudi::Property
Implementation of property with value of concrete type.
Definition: Property.h:314
ApplicationMgr::name
const std::string & name() const override
Definition: ApplicationMgr.cpp:855
ApplicationMgr::m_jobOptionsSvc
SmartIF< IJobOptionsSvc > m_jobOptionsSvc
Reference to JobOption service.
Definition: ApplicationMgr.h:212
Gaudi::ReturnCode::ScheduledStop
constexpr int ScheduledStop
Definition: AppReturnCode.h:27
MSG::FATAL
Definition: IMessageSvc.h:22
IProperty::setProperty
virtual StatusCode setProperty(const Gaudi::Details::PropertyBase &p)=0
Set the property by property.
SmartIF::as
SmartIF< IFace > as() const
return a new SmartIF instance to another interface
Definition: SmartIF.h:110
IService
General service interface definition.
Definition: IService.h:18
MSG::ERROR
Definition: IMessageSvc.h:21
ApplicationMgr::m_state
Gaudi::StateMachine::State m_state
Internal State.
Definition: ApplicationMgr.h:202
StatusCode::ignore
void ignore() const
Definition: StatusCode.h:106
Gaudi::ReturnCode::Success
constexpr int Success
Definition: AppReturnCode.h:18
MSG::INFO
Definition: IMessageSvc.h:19
IProperty
The IProperty is the basic interface for all components which have properties that can be set or get...
Definition: IProperty.h:20
Gaudi::StateMachine::OFFLINE
Definition: StateMachine.h:13
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:209
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

## Member Data Documentation

Gaudi::Property<bool> ApplicationMgr::m_actHistory {this, "ActivateHistory", false, "Activate HistorySvc"}
| protected

Definition at line 241 of file ApplicationMgr.h.

SmartIF<IAlgManager> ApplicationMgr::m_algManager
| protected

Cached pointer to the manager of algorithms.

Definition at line 185 of file ApplicationMgr.h.

Gaudi::Property<std::string> ApplicationMgr::m_appName {this, "AppName", "ApplicationMgr", "The name of the application"}
| protected

Definition at line 239 of file ApplicationMgr.h.

Gaudi::Property<std::string> ApplicationMgr::m_appVersion {this, "AppVersion", {}, "The version of the application"}
| protected

Definition at line 240 of file ApplicationMgr.h.

Gaudi::Property<bool> ApplicationMgr::m_auditAlgs {this, "AuditAlgorithms", false}
| protected

Definition at line 251 of file ApplicationMgr.h.

Gaudi::Property<bool> ApplicationMgr::m_auditSvcs {this, "AuditServices", false}
| protected

Definition at line 250 of file ApplicationMgr.h.

Gaudi::Property<bool> ApplicationMgr::m_auditTools {this, "AuditTools", false}
| protected

Defaults for auditors.

Definition at line 249 of file ApplicationMgr.h.

SmartIF<DLLClassManager> ApplicationMgr::m_classManager
| protected

Reference to the class manager.

Definition at line 190 of file ApplicationMgr.h.

Gaudi::Property<bool> ApplicationMgr::m_codeCheck {this, "StatusCodeCheck", false, "Activate StatusCode checking"}
| protected

Definition at line 242 of file ApplicationMgr.h.

Gaudi::Property<std::vector<std::string> > ApplicationMgr::m_createSvcNameList
| protected

Initial value:
{
this, "CreateSvc", {}, "List of extra services to be created"}

Definition at line 245 of file ApplicationMgr.h.

Gaudi::Property<std::vector<std::string> > ApplicationMgr::m_declaredManagers
| protected

Property to declare the list of known managers.

Definition at line 179 of file ApplicationMgr.h.

Gaudi::Property<std::vector<std::string> > ApplicationMgr::m_dllNameList {this, "Dlls", {}, "List of DDL's names"}
| protected

Definition at line 227 of file ApplicationMgr.h.

Gaudi::Property<std::map<std::string, std::string> > ApplicationMgr::m_environment
| protected

Initial value:
{
this, "Environment", {}, "Environment variables to set"}

Definition at line 253 of file ApplicationMgr.h.

Gaudi::Property<std::string> ApplicationMgr::m_eventLoopMgr {this, "EventLoop", "EventLoopMgr", "Processing manager type"}
| protected

Definition at line 235 of file ApplicationMgr.h.

Gaudi::Property<int> ApplicationMgr::m_evtMax {this, "EvtMax", -1, "Number of events to be processed (-1 means all events)"}
| protected

Definition at line 218 of file ApplicationMgr.h.

Gaudi::Property<std::string> ApplicationMgr::m_evtsel {this, "EvtSel", {}, "Event selection"}
| protected

Definition at line 236 of file ApplicationMgr.h.

Gaudi::Property<bool> ApplicationMgr::m_extSvcCreates
| protected

Initial value:
{this, "ExtSvcCreates", true,
"LHCb (default) or ATLAS definition of \"ExtSvc\""}

Definition at line 220 of file ApplicationMgr.h.

Gaudi::Property<std::vector<std::string> > ApplicationMgr::m_extSvcNameList {this, "ExtSvc", {}, "List of external services names"}
| protected

Definition at line 219 of file ApplicationMgr.h.

Gaudi::Property<std::string> ApplicationMgr::m_histPersName {this, "HistogramPersistency", "NONE", "Name of the Hist Pers Svc"}
| protected

Definition at line 237 of file ApplicationMgr.h.

Gaudi::Property<std::string> ApplicationMgr::m_jobOptionsPath {this, "JobOptionsPath", {}, "The \"file\" to look for properties"}
| protected

Definition at line 229 of file ApplicationMgr.h.

Gaudi::Property<std::string> ApplicationMgr::m_jobOptionsPostAction
| protected

Initial value:
{
this, "JobOptionsPreAction", {}, "additional command to run on config"}

Definition at line 232 of file ApplicationMgr.h.

Gaudi::Property<std::string> ApplicationMgr::m_jobOptionsPreAction
| protected

Initial value:
{
this, "JobOptionsPostAction", {}, "additional command to run on config"}

Definition at line 230 of file ApplicationMgr.h.

SmartIF<IJobOptionsSvc> ApplicationMgr::m_jobOptionsSvc
| protected

Reference to JobOption service.

Definition at line 212 of file ApplicationMgr.h.

Gaudi::Property<std::string> ApplicationMgr::m_jobOptionsSvcType {this, "JobOptionsSvcType", "JobOptionsSvc", "JobOptionsSvc type"}
| protected

Definition at line 199 of file ApplicationMgr.h.

Gaudi::Property<std::string> ApplicationMgr::m_jobOptionsType {this, "JobOptionsType", "FILE", "Source type (e.g. dbase, file...)"}
| protected

Definition at line 228 of file ApplicationMgr.h.

Gaudi::Property<bool> ApplicationMgr::m_loopCheck
| protected

Initial value:
{this, "InitializationLoopCheck", true,
"For ServiceMgr initialization loop checking"}

Definition at line 256 of file ApplicationMgr.h.

ManagersMap ApplicationMgr::m_managers
| protected

Map of known component managers.

It contains (at least) the managers for IService and IAlgorithm. IAlgTool and IAuditor are not mandatory (but a missing manager for IAlgTool will probably not allow any job to run).

Definition at line 177 of file ApplicationMgr.h.

SmartIF<IMessageSvc> ApplicationMgr::m_messageSvc
| protected

Reference to the message service.

Definition at line 209 of file ApplicationMgr.h.

Gaudi::Property<std::string> ApplicationMgr::m_messageSvcType {this, "MessageSvcType", "MessageSvc", "MessageSvc type"}
| protected

Definition at line 198 of file ApplicationMgr.h.

Gaudi::Property<std::vector<std::string> > ApplicationMgr::m_multiThreadSvcNameList {this, "MultiThreadExtSvc"}
| protected

List of external services names for which we want a copy per evt thread.

Definition at line 224 of file ApplicationMgr.h.

std::string ApplicationMgr::m_name = "ApplicationMgr"
| protected

Name.

Definition at line 201 of file ApplicationMgr.h.

Gaudi::Property<int> ApplicationMgr::m_noOfEvtThreads {this, "NoOfThreads", 0, "MultiThreadSvc copies"}
| protected

Definition at line 225 of file ApplicationMgr.h.

std::vector<std::string> ApplicationMgr::m_okDlls
| private

names of successfully loaded dlls

Definition at line 280 of file ApplicationMgr.h.

Gaudi::Property<int> ApplicationMgr::m_outputLevel {this, "OutputLevel", MSG::INFO, "Message output level"}
| protected

Definition at line 238 of file ApplicationMgr.h.

Gaudi::Property<std::vector<std::string> > ApplicationMgr::m_outStreamNameList {this, "OutStream", {}, "List of output stream names"}
| protected

Definition at line 195 of file ApplicationMgr.h.

Gaudi::Property<std::string> ApplicationMgr::m_outStreamType
| protected

Initial value:
{this, "OutStreamType", "OutputStream",
"[[deprecated]] Output stream type"}

Definition at line 196 of file ApplicationMgr.h.

Gaudi::Property<int> ApplicationMgr::m_pluginDebugLevel {this, "PluginDebugLevel", 0, "Debug level for the plugin system"}
| protected

Definition at line 243 of file ApplicationMgr.h.

SmartIF<IEventProcessor> ApplicationMgr::m_processingMgr
| protected

Reference to processing manager object.

Definition at line 211 of file ApplicationMgr.h.

Gaudi::Property<bool> ApplicationMgr::m_propertiesPrint
| protected

Initial value:
{this, "PropertiesPrint", false,
"Flag to activate the printout of properties"}

Definition at line 269 of file ApplicationMgr.h.

Gaudi::Property<int> ApplicationMgr::m_returnCode
| protected

Initial value:
{this, "ReturnCode", Gaudi::ReturnCode::Success,
"Return code of the application. Set internally in case of error conditions."}

Property to record the error conditions occurring during the running.

Definition at line 273 of file ApplicationMgr.h.

SmartIF<IRunable> ApplicationMgr::m_runable
| protected

Reference to the runable object.

Definition at line 210 of file ApplicationMgr.h.

Gaudi::Property<std::string> ApplicationMgr::m_runableType {this, "Runable", "AppMgrRunable", "Runable type"}
| protected

Definition at line 234 of file ApplicationMgr.h.

Gaudi::Property<int> ApplicationMgr::m_SIExit {this, "Exit", 0, "For SI's \"Exit\" command via callback"}
| protected

Definition at line 193 of file ApplicationMgr.h.

Gaudi::Property<int> ApplicationMgr::m_SIGo {this, "Go", 0, "For SI's \"Go\" command via callback"}
| protected

Definition at line 192 of file ApplicationMgr.h.

Gaudi::Property<bool> ApplicationMgr::m_stalledEventMonitoring
| protected

Initial value:
{
this, "StalledEventMonitoring", false, "Flag to enable/disable the monitoring and reporting of stalled events"}

Property to enable/disable the monitoring and reporting of stalled events.

See also
  StalledEventMonitor

Definition at line 266 of file ApplicationMgr.h.

Gaudi::StateMachine::State ApplicationMgr::m_state = Gaudi::StateMachine::OFFLINE
| protected

Internal State.

Definition at line 202 of file ApplicationMgr.h.

Gaudi::Property<bool> ApplicationMgr::m_stopOnSignal
| protected

Initial value:
{
this, "StopOnSignal", false, "Flag to enable/disable the signal handler that schedule a stop of the event loop"}

Property to enable/disable the "stop on signal" service.

See also
  Gaudi::Utils::StopSignalHandler

Definition at line 261 of file ApplicationMgr.h.

SmartIF<ISvcLocator> ApplicationMgr::m_svcLocator
| mutable protected

Reference to its own service locator (must be instantiated prior to any service!)

Definition at line 188 of file ApplicationMgr.h.

SmartIF<ISvcManager> ApplicationMgr::m_svcManager
| protected

Cached pointer to the manager of services.

Definition at line 182 of file ApplicationMgr.h.

Gaudi::Property<std::vector<std::string> > ApplicationMgr::m_svcMapping {this, "SvcMapping", {}, "Default mapping of services"}
| protected

Definition at line 205 of file ApplicationMgr.h.

Gaudi::Property<std::vector<std::string> > ApplicationMgr::m_svcOptMapping
| protected

Initial value:
{
this, "SvcOptMapping", {}, "Default mapping of optional services"}

Definition at line 206 of file ApplicationMgr.h.

Gaudi::StateMachine::State ApplicationMgr::m_targetState = Gaudi::StateMachine::OFFLINE
| protected

Internal State.

Definition at line 203 of file ApplicationMgr.h.

Gaudi::Property<std::vector<std::string> > ApplicationMgr::m_topAlgNameList {this, "TopAlg", {}, "List of top level algorithms names"}
| protected

Definition at line 194 of file ApplicationMgr.h.

bool ApplicationMgr::m_useHiveAlgorithmManager
| protected

Definition at line 277 of file ApplicationMgr.h.

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

- GaudiCoreSvc/src/ApplicationMgr/ApplicationMgr.h
- GaudiCoreSvc/src/ApplicationMgr/ApplicationMgr.cpp