The Gaudi Framework  master (e68eea06)
Loading...
Searching...
No Matches
ApplicationMgr Class Reference

The Application Manager class. More...

#include </builds/gaudi/Gaudi/GaudiCoreSvc/src/ApplicationMgr/ApplicationMgr.h>

Inheritance diagram for ApplicationMgr:
Collaboration diagram for ApplicationMgr:

Public Member Functions

 ApplicationMgr (IInterface *=nullptr)
 
void const * i_cast (const InterfaceID &iid) const 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
 
EventContext createEventContext () override
 implementation of IEventProcessor::createEventContext()
 
StatusCode executeEvent (EventContext &&ctx) override
 implementation of IEventProcessor::executeEvent(void*)
 
StatusCode executeRun (int evtmax) override
 implementation of IEventProcessor::executeRun(int)
 
StatusCode stopRun () override
 implementation of IEventProcessor::stopRun()
 
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 push (EventContext &&ctx) override
 
bool empty () const override
 
std::optional< Gaudi::Interfaces::IQueueingEventProcessor::ResultTypepop () override
 
- Public Member Functions inherited from PropertyHolder< CommonMessaging< implements< IAppMgrUI, Gaudi::Interfaces::IQueueingEventProcessor, IService, IStateful, INamedInterface, IProperty > > >
StatusCode setProperty (const Gaudi::Details::PropertyBase &p)
 Set the property from a property.
 
StatusCode setProperty (const std::string &name, const char *v)
 Special case for string literals.
 
StatusCode setProperty (const std::string &name, const std::string &v)
 Special case for std::string.
 
StatusCode setProperty (const std::string &name, const TYPE &value)
 set the property form the value
 
 PropertyHolder ()=default
 
Gaudi::Details::PropertyBasedeclareProperty (Gaudi::Details::PropertyBase &prop)
 Declare a property.
 
Gaudi::Details::PropertyBasedeclareProperty (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.
 
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, Gaudi::Property< TYPE, VERIFIER, HANDLERS > &prop, const std::string &doc="none")
 Declare a PropertyBase instance setting name and documentation.
 
Gaudi::Details::PropertyBasedeclareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="")
 Declare a remote property.
 
StatusCode setProperty (const std::string &name, const Gaudi::Details::PropertyBase &p) override
 set the property from another property with a different name
 
StatusCode setProperty (const std::string &s) override
 set the property from the formatted string
 
StatusCode setProperty (const Gaudi::Details::PropertyBase &p)
 Set the property from a property.
 
StatusCode setProperty (const std::string &name, const char *v)
 Special case for string literals.
 
StatusCode setProperty (const std::string &name, const std::string &v)
 Special case for std::string.
 
StatusCode setProperty (const std::string &name, const TYPE &value)
 set the property form the value
 
StatusCode setPropertyRepr (const std::string &n, const std::string &r) override
 set the property from name and value string representation
 
StatusCode getProperty (Gaudi::Details::PropertyBase *p) const override
 get the property
 
const Gaudi::Details::PropertyBasegetProperty (std::string_view name) const override
 get the property by name
 
StatusCode getProperty (std::string_view n, std::string &v) const override
 convert the property to the string
 
const std::vector< Gaudi::Details::PropertyBase * > & getProperties () const override
 get all properties
 
bool hasProperty (std::string_view name) const override
 Return true if we have a property with the given name.
 
Gaudi::Details::PropertyBaseproperty (std::string_view name) const
 \fixme property and bindPropertiesTo should be protected
 
void bindPropertiesTo (Gaudi::Interfaces::IOptionsSvc &optsSvc)
 
 PropertyHolder (const PropertyHolder &)=delete
 
PropertyHolderoperator= (const PropertyHolder &)=delete
 
- Public Member Functions inherited from CommonMessaging< implements< IAppMgrUI, Gaudi::Interfaces::IQueueingEventProcessor, IService, IStateful, INamedInterface, IProperty > >
MSG::Level msgLevel () const
 get the cached level (originally extracted from the embedded MsgStream)
 
bool msgLevel (MSG::Level lvl) const
 get the output level from the embedded MsgStream
 
- Public Member Functions inherited from CommonMessagingBase
virtual ~CommonMessagingBase ()=default
 Virtual destructor.
 
const SmartIF< IMessageSvc > & msgSvc () const
 The standard message service.
 
MsgStreammsgStream () const
 Return an uninitialized MsgStream.
 
MsgStreammsgStream (const MSG::Level level) const
 Predefined configurable message stream for the efficient printouts.
 
MsgStreamalways () const
 shortcut for the method msgStream(MSG::ALWAYS)
 
MsgStreamfatal () const
 shortcut for the method msgStream(MSG::FATAL)
 
MsgStreamerr () const
 shortcut for the method msgStream(MSG::ERROR)
 
MsgStreamerror () const
 shortcut for the method msgStream(MSG::ERROR)
 
MsgStreamwarning () const
 shortcut for the method msgStream(MSG::WARNING)
 
MsgStreaminfo () const
 shortcut for the method msgStream(MSG::INFO)
 
MsgStreamdebug () const
 shortcut for the method msgStream(MSG::DEBUG)
 
MsgStreamverbose () const
 shortcut for the method msgStream(MSG::VERBOSE)
 
MsgStreammsg () const
 shortcut for the method msgStream(MSG::INFO)
 

Gaudi::Details::PropertyBase handlers

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.
 
ManagersMap m_managers
 Map of known component managers.
 
Gaudi::Property< std::vector< std::string > > m_declaredManagers
 Property to declare the list of known managers.
 
SmartIF< ISvcManagerm_svcManager
 Cached pointer to the manager of services.
 
SmartIF< IAlgManagerm_algManager
 Cached pointer to the manager of algorithms.
 
SmartIF< ISvcLocatorm_svcLocator
 Reference to its own service locator (must be instantiated prior to any service!)
 
SmartIF< DLLClassManagerm_classManager
 Reference to the class manager.
 
Gaudi::Property< int > m_SIGo
 
Gaudi::Property< int > m_SIExit
 
Gaudi::Property< std::vector< std::string > > m_topAlgNameList
 
Gaudi::Property< std::vector< std::string > > m_outStreamNameList
 
Gaudi::Property< std::string > m_messageSvcType
 
Gaudi::Property< std::string > m_jobOptionsSvcType
 
std::string m_name = "ApplicationMgr"
 Name.
 
Gaudi::StateMachine::State m_state = Gaudi::StateMachine::OFFLINE
 Internal State.
 
Gaudi::StateMachine::State m_targetState = Gaudi::StateMachine::OFFLINE
 Internal State.
 
Gaudi::Property< std::vector< std::string > > m_svcMapping { this, "SvcMapping", {}, "Default mapping of services" }
 
Gaudi::Property< std::vector< std::string > > m_svcOptMapping
 
SmartIF< IMessageSvcm_messageSvc
 Reference to the message service.
 
SmartIF< IRunablem_runable
 Reference to the runable object.
 
SmartIF< IEventProcessorm_processingMgr
 Reference to processing manager object.
 
SmartIF< IQueueingEventProcessor > m_queueingProcessor
 Reference to a queueing processing manager object.
 
Gaudi::Monitoring::Hub m_monitoringHub
 
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
 
Gaudi::Property< bool > m_extSvcCreates
 
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", "Service:IRunable" }
 
Gaudi::Property< std::string > m_eventLoopMgr
 
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< int > m_pluginDebugLevel
 
Gaudi::Property< std::vector< std::string > > m_createSvcNameList
 
Gaudi::Property< bool > m_auditTools { this, "AuditTools", false }
 Defaults for auditors.
 
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.
 
Gaudi::Property< bool > m_propertiesPrint
 
Gaudi::Property< int > m_returnCode
 Property to record the error conditions occurring during the running.
 
Gaudi::Property< bool > m_printAlgsSequence
 
Gaudi::Property< bool > m_useMessageSvcForROOTMessages
 
bool m_useHiveAlgorithmManager
 
std::vector< std::string > m_okDlls
 names of successfully loaded dlls
 
void evtLoopPropertyHandler (Gaudi::Details::PropertyBase &theProp)
 
StatusCode decodeExtSvcNameList ()
 
StatusCode decodeCreateSvcNameList ()
 
void createSvcNameListHandler (Gaudi::Details::PropertyBase &)
 
void extSvcNameListHandler (Gaudi::Details::PropertyBase &theProp)
 
StatusCode decodeDllNameList ()
 
void dllNameListHandler (Gaudi::Details::PropertyBase &theProp)
 
void pluginDebugPropertyHandler (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.
 
void outputLevelUpdate () override
 Function to call to update the outputLevel of the components (after a change in MessageSvc).
 
Gaudi::Monitoring::HubmonitoringHub () override
 
void printAlgsSequences ()
 Print the sequence of algorithms that have been loaded.
 
void setServiceManager (ISvcManager *) override
 
StatusCode i_startup ()
 Internal startup routine.
 
StatusCode GoToState (Gaudi::StateMachine::State state, bool ignoreFailures=false)
 Reach a state from current state (whichever it is) going through the correct transitions.
 
template<typename SELF, typename PIMPL, typename METHOD, typename... ARGS>
static auto i_delegateToEvtProc (SELF *self, PIMPL &member, std::string_view method_name, METHOD &&method, ARGS &&... args)
 Helper to delegate calls to event processor implementation.
 

Additional Inherited Members

- Public Types inherited from PropertyHolder< CommonMessaging< implements< IAppMgrUI, Gaudi::Interfaces::IQueueingEventProcessor, IService, IStateful, INamedInterface, IProperty > > >
using PropertyHolderImpl
 Typedef used to refer to this class from derived classes, as in.
 
- Public Types inherited from CommonMessaging< implements< IAppMgrUI, Gaudi::Interfaces::IQueueingEventProcessor, IService, IStateful, INamedInterface, IProperty > >
using base_class
 
- Protected Member Functions inherited from CommonMessaging< implements< IAppMgrUI, Gaudi::Interfaces::IQueueingEventProcessor, IService, IStateful, INamedInterface, IProperty > >
MSG::Level setUpMessaging () const
 Set up local caches.
 
MSG::Level resetMessaging ()
 Reinitialize internal states.
 
void updateMsgStreamOutputLevel (int level)
 Update the output level of the cached MsgStream.
 

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 52 of file ApplicationMgr.h.

Member Typedef Documentation

◆ ManagersMap

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 171 of file ApplicationMgr.h.

Constructor & Destructor Documentation

◆ ApplicationMgr()

ApplicationMgr::ApplicationMgr ( IInterface * = nullptr)

Definition at line 83 of file ApplicationMgr.cpp.

83 {
84 // IInterface initialization
85 addRef(); // Initial count set to 1
86
87 // Instantiate component managers
88 m_managers[IService::interfaceID().id()] = new ServiceManager( this );
89
91
92 // Instantiate internal services
93 // SvcLocator/Factory HAS to be already instantiated
94 m_classManager = new DLLClassManager( this );
95
96 AlgorithmManager* algMgr = new AlgorithmManager( this );
98 // m_managers[IAlgorithm::interfaceID().id()] = new HiveAlgorithmManager(this);
99
100 // This property is not hosted in the ApplicationMgr instance
101 declareProperty( "AlgTypeAliases", algMgr->typeAliases(),
102 "Aliases of algorithm types, to replace an algorithm type for every instance" );
103
104 // ServiceMgr Initialization loop checking
106
107 m_svcMapping = { "EvtDataSvc/EventDataSvc",
108 "DetDataSvc/DetectorDataSvc",
109 "HistogramSvc/HistogramDataSvc",
110 "HbookCnv::PersSvc/HbookHistSvc",
111 "RootHistCnv::PersSvc/RootHistSvc",
112 "EvtPersistencySvc/EventPersistencySvc",
113 "DetPersistencySvc/DetectorPersistencySvc",
114 "HistogramPersistencySvc/HistogramPersistencySvc" };
115}
AlgTypeAliasesMap & typeAliases()
Gaudi::Property< std::vector< std::string > > m_svcMapping
SmartIF< ISvcLocator > m_svcLocator
Reference to its own service locator (must be instantiated prior to any service!)
SmartIF< DLLClassManager > m_classManager
Reference to the class manager.
Gaudi::Property< bool > m_loopCheck
ManagersMap m_managers
Map of known component managers.
SmartIF< ISvcManager > & svcManager()
virtual void setLoopCheckEnabled(bool en=true)=0
Set the value of the initialization loop check flag.
constexpr unsigned long id() const
get the interface identifier
Definition IInterface.h:47

Member Function Documentation

◆ algManager()

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

Definition at line 139 of file ApplicationMgr.h.

139 {
140 // Cache the casted pointer to IAlgManager
142 return m_algManager;
143 }
SmartIF< IComponentManager > & getManager()
SmartIF< IAlgManager > m_algManager
Cached pointer to the manager of algorithms.

◆ configure()

StatusCode ApplicationMgr::configure ( )
override

Definition at line 255 of file ApplicationMgr.cpp.

255 {
256
257 // Check if the state is compatible with the transition
258 MsgStream tlog( m_messageSvc, name() );
260 tlog << MSG::INFO << "Already Configured" << endmsg;
261 return StatusCode::SUCCESS;
262 }
264 tlog << MSG::FATAL << "configure: Invalid state \"" << m_state << "\"" << endmsg;
265 return StatusCode::FAILURE;
266 }
268
269 // Reset application return code.
271
272 StatusCode sc;
273 sc = i_startup();
274 if ( !sc.isSuccess() ) { return sc; }
275
276 {
277 MsgStream log( m_messageSvc, name() );
278 // Get my own options using the Job options service
279 if ( log.level() <= MSG::DEBUG ) log << MSG::DEBUG << "Getting my own properties" << endmsg;
280 bindPropertiesTo( serviceLocator()->getOptsSvc() );
281 }
282
283 // Make sure that the OutputLevel is in sync
284 if ( m_outputLevel != MSG::NIL && m_messageSvc ) m_messageSvc->setOutputLevel( name(), m_outputLevel );
285 MsgStream log( m_messageSvc, name() );
286
287 // Check current outputLevel to eventually inform the MessageSvc
288 if ( m_outputLevel != MSG::NIL && !m_appName.empty() ) {
289 // Print a welcome message
290 log << MSG::ALWAYS << std::endl
291 << "=================================================================="
292 << "==================================================================" << std::endl
293 << " "
294 << " Welcome to " << m_appName.value();
295
296 if ( !m_appVersion.empty() ) {
297 log << MSG::ALWAYS << " version " << m_appVersion.value();
298 } else {
299 log << MSG::ALWAYS << " (GaudiCoreSvc "
300 << "v" << GAUDI_MAJOR_VERSION << "r" << GAUDI_MINOR_VERSION
301#if GAUDI_PATCH_VERSION
302 << "p" << GAUDI_PATCH_VERSION
303#endif
304 << ")";
305 }
306
307 // Add the host name and current time to the message
308 log << MSG::ALWAYS << std::endl
309 << " "
310 << " running on " << System::hostName() << " on " << Gaudi::Time::current().format( true ) << std::endl
311 << "=================================================================="
312 << "==================================================================" << endmsg;
313 }
314
315 // print all own properties if the options "PropertiesPrint" is set to true
316 if ( m_propertiesPrint ) {
317 const auto& properties = getProperties();
318 log << MSG::ALWAYS << "List of ALL properties of " << System::typeinfoName( typeid( *this ) ) << "/" << this->name()
319 << " #properties = " << properties.size() << endmsg;
320 for ( const auto& property : properties ) { log << "Property ['Name': Value] = " << *property << endmsg; }
321 }
322
323 // set the requested environment variables
324 for ( auto& var : m_environment ) {
325 const std::string& name = var.first;
326 const std::string& value = var.second;
327 std::string old = System::getEnv( name.c_str() );
328 const MSG::Level lvl = ( !old.empty() && ( old != "UNKNOWN" ) ) ? MSG::WARNING : MSG::DEBUG;
329 if ( m_outputLevel <= lvl ) log << lvl << "Setting " << name << " = " << value << endmsg;
330 System::setEnv( name, value );
331 }
332
333 // Declare Service Types
334 for ( auto& j : m_svcMapping ) {
335 Gaudi::Utils::TypeNameString itm( j );
336 if ( svcManager()->declareSvcType( itm.name(), itm.type() ).isFailure() ) {
337 log << MSG::ERROR << "configure: declaring svc type:'" << j << "' failed." << endmsg;
338 return StatusCode::FAILURE;
339 } else {
341 log << MSG::VERBOSE << "declared service " << j << endmsg;
342 }
343 }
344 for ( auto& j : m_svcOptMapping ) {
345 Gaudi::Utils::TypeNameString itm( j );
346 if ( svcManager()->declareSvcType( itm.name(), itm.type() ).isFailure() ) {
347 log << MSG::ERROR << "declaring svc type:'" << j << "' failed." << endmsg;
348 return StatusCode::FAILURE;
349 }
350 }
351
352 //--------------------------------------------------------------------------
353 // Declare other Services and Algorithms by loading DLL's
354 sc = decodeDllNameList();
355 if ( sc.isFailure() ) {
356 log << MSG::ERROR << "Failure loading declared DLL's" << endmsg;
357 return sc;
358 }
359
360 //--------------------------------------------------------------------------
361 // Deal with the services explicitly declared by the user.
363 if ( sc.isFailure() ) {
364 log << MSG::ERROR << "Failure during external service association" << endmsg;
365 return sc;
366 }
367
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 = svcManager()->addService( evtloop_item, ServiceManager::DEFAULT_SVC_PRIORITY * 10 );
379 if ( !sc.isSuccess() ) {
380 log << MSG::FATAL << "Error adding :" << m_eventLoopMgr << endmsg;
381 return sc;
382 } else {
384 log << MSG::VERBOSE << "added service " << evtloop_item << endmsg;
385 }
386
388 if ( !m_runable ) {
389 log << MSG::FATAL << "Error retrieving Runable: " << m_runableType.value() << "\n Check option ApplicationMgr."
390 << m_runableType.name() << endmsg;
391 return sc;
392 }
393 m_processingMgr = m_svcLocator->service( evtloop_item );
394 if ( !m_processingMgr ) {
395 log << MSG::FATAL << "Error retrieving Processing manager: " << m_eventLoopMgr.value()
396 << "\n Check option ApplicationMgr." << m_eventLoopMgr.name() << "\n No events will be processed." << endmsg;
397 return sc;
398 }
399 // The IEventProcessor might also be an IQueueingEventProcessor
401
402 // Establish Update Handlers for ExtSvc and DLLs Properties
403 m_extSvcNameList.declareUpdateHandler( &ApplicationMgr::extSvcNameListHandler, this );
405 m_dllNameList.declareUpdateHandler( &ApplicationMgr::dllNameListHandler, this );
406
407 if ( m_actHistory ) {
408 // Create HistorySvc with a priority to ensure it's initialized last, finalized first
409 sc = svcManager()->addService( "HistorySvc", std::numeric_limits<int>::max() );
410 if ( sc.isFailure() ) {
411 log << MSG::FATAL << "Error adding HistorySvc" << endmsg;
412 return StatusCode::FAILURE;
413 }
414 }
415
416 log << MSG::INFO << "Application Manager Configured successfully" << endmsg;
418 return StatusCode::SUCCESS;
419}
#define ON_VERBOSE
#define GAUDI_MAJOR_VERSION
#define GAUDI_MINOR_VERSION
#define GAUDI_PATCH_VERSION
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition MsgStream.h:198
SmartIF< IRunable > m_runable
Reference to the runable object.
SmartIF< IQueueingEventProcessor > m_queueingProcessor
Reference to a queueing processing manager object.
Gaudi::Property< int > m_returnCode
Property to record the error conditions occurring during the running.
Gaudi::Property< std::vector< std::string > > m_dllNameList
Gaudi::StateMachine::State m_targetState
Internal State.
Gaudi::Property< std::string > m_runableType
Gaudi::Property< bool > m_actHistory
void createSvcNameListHandler(Gaudi::Details::PropertyBase &)
Gaudi::Property< bool > m_propertiesPrint
Gaudi::Property< std::vector< std::string > > m_extSvcNameList
SmartIF< ISvcLocator > & serviceLocator() const override
Needed to locate the message service.
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Gaudi::Property< std::vector< std::string > > m_svcOptMapping
Gaudi::Property< std::string > m_eventLoopMgr
const std::string & name() const override
Gaudi::Property< std::string > m_appVersion
StatusCode decodeDllNameList()
Gaudi::Property< std::vector< std::string > > m_createSvcNameList
Gaudi::Property< std::map< std::string, std::string > > m_environment
Gaudi::Property< std::string > m_appName
void extSvcNameListHandler(Gaudi::Details::PropertyBase &theProp)
StatusCode i_startup()
Internal startup routine.
Gaudi::StateMachine::State m_state
Internal State.
StatusCode decodeExtSvcNameList()
StatusCode decodeCreateSvcNameList()
void dllNameListHandler(Gaudi::Details::PropertyBase &theProp)
Gaudi::Property< int > m_outputLevel
SmartIF< IEventProcessor > m_processingMgr
Reference to processing manager object.
std::string format(bool local, std::string spec="%c") const
Format the time using strftime.
Definition Time.cpp:155
static Time current()
Returns the current time.
Definition Time.cpp:41
virtual StatusCode addService(IService *svc, int prio=DEFAULT_SVC_PRIORITY)=0
Add a service to the "active" list of services of the factory.
bool isFailure() const
Definition StatusCode.h:129
bool isSuccess() const
Definition StatusCode.h:314
constexpr static const auto SUCCESS
Definition StatusCode.h:99
constexpr static const auto FAILURE
Definition StatusCode.h:100
constexpr int Success
@ NIL
Definition IMessageSvc.h:22
@ WARNING
Definition IMessageSvc.h:22
@ FATAL
Definition IMessageSvc.h:22
@ DEBUG
Definition IMessageSvc.h:22
@ ERROR
Definition IMessageSvc.h:22
@ ALWAYS
Definition IMessageSvc.h:22
@ INFO
Definition IMessageSvc.h:22
@ VERBOSE
Definition IMessageSvc.h:22
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition System.cpp:260
GAUDI_API std::vector< std::string > getEnv()
get all environment variables
Definition System.cpp:356
GAUDI_API const std::string & hostName()
Host name.
Definition System.cpp:265
GAUDI_API int setEnv(const std::string &name, const std::string &value, int overwrite=1)
Set an environment variables.
Definition System.cpp:440

◆ createEventContext()

EventContext ApplicationMgr::createEventContext ( )
override

implementation of IEventProcessor::createEventContext()

Definition at line 781 of file ApplicationMgr.cpp.

781 {
783 if ( m_processingMgr ) { return m_processingMgr->createEventContext(); }
784 }
785 std::stringstream ss;
786 ss << "createEventContext: Invalid state \"" << FSMState() << '"';
787 throw GaudiException( ss.str(), name(), StatusCode::FAILURE );
788}
Gaudi::StateMachine::State FSMState() const override

◆ createSvcNameListHandler()

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

Definition at line 867 of file ApplicationMgr.cpp.

867 {
868 if ( !( decodeCreateSvcNameList() ).isSuccess() ) {
869 throw GaudiException( "Failed to create ext services", "MinimalEventLoopMgr::createSvcNameListHandler",
871 }
872}

◆ decodeCreateSvcNameList()

StatusCode ApplicationMgr::decodeCreateSvcNameList ( )

Definition at line 873 of file ApplicationMgr.cpp.

873 {
874 StatusCode result = StatusCode::SUCCESS;
875 const auto& theNames = m_createSvcNameList.value();
876 auto it = theNames.begin();
877 auto et = theNames.end();
878 while ( result.isSuccess() && it != et ) {
879 Gaudi::Utils::TypeNameString item( *it++ );
880 if ( ( result = svcManager()->addService( item, ServiceManager::DEFAULT_SVC_PRIORITY ) ).isFailure() ) {
881 MsgStream log( m_messageSvc, m_name );
882 log << MSG::ERROR << "decodeCreateSvcNameList: Cannot create service " << item.type() << "/" << item.name()
883 << endmsg;
884 } else {
885 ON_DEBUG {
886 MsgStream log( m_messageSvc, m_name );
887 log << MSG::DEBUG << "decodeCreateSvcNameList: Created service " << item.type() << "/" << item.name() << endmsg;
888 }
889 }
890 }
891 return result;
892}
#define ON_DEBUG
std::string m_name
Name.

◆ decodeDllNameList()

StatusCode ApplicationMgr::decodeDllNameList ( )

Definition at line 933 of file ApplicationMgr.cpp.

933 {
934
935 MsgStream log( m_messageSvc, m_name );
936 StatusCode result = StatusCode::SUCCESS;
937
938 // Clean up multiple entries from DLL list
939 std::vector<std::string> newList;
940 std::map<std::string, unsigned int> dllInList, duplicateList;
941 {
942 for ( const auto& it : m_dllNameList ) {
943 if ( 0 == dllInList[it] ) {
944 newList.push_back( it ); // first instance of this module
945 } else {
946 ++duplicateList[it];
947 } // module listed multiple times
948 ++dllInList[it]; // increment count for this module
949 }
950 }
951 // m_dllNameList = newList; // update primary list to new, filtered list (do not use the
952 // property itself otherwise we get called again infinitely)
953 // List modules that were in there twice..
954 ON_DEBUG if ( !duplicateList.empty() ) {
955 log << MSG::DEBUG << "Removed duplicate entries for modules : ";
956 for ( auto it = duplicateList.begin(); it != duplicateList.end(); ++it ) {
957 log << it->first << "(" << 1 + it->second << ")";
958 if ( it != --duplicateList.end() ) log << ", ";
959 }
960 log << endmsg;
961 }
962
963 const std::vector<std::string>& theNames = newList;
964
965 // only load the new dlls or previously failed dlls
966 ON_DEBUG log << MSG::DEBUG << "Loading declared DLL's" << endmsg;
967
968 std::vector<std::string> successNames, failNames;
969 for ( const auto& it : theNames ) {
970 if ( std::find( m_okDlls.rbegin(), m_okDlls.rend(), it ) == m_okDlls.rend() ) {
971 // found a new module name
972 StatusCode status = m_classManager->loadModule( it );
973 if ( status.isFailure() ) {
974 failNames.push_back( it );
975 result = StatusCode::FAILURE;
976 } else {
977 successNames.push_back( it );
978 }
979 }
980 }
981
982 // report back to the user and store the names of the succesfully loaded dlls
983 if ( !successNames.empty() ) {
984 log << MSG::INFO << "Successfully loaded modules : ";
985 for ( auto it = successNames.begin(); it != successNames.end(); it++ ) {
986 log << ( *it );
987 if ( ( it + 1 ) != successNames.end() ) log << ", ";
988 // save name
989 m_okDlls.push_back( *it );
990 }
991 log << endmsg;
992 }
993
994 if ( result == StatusCode::FAILURE ) {
995 log << MSG::WARNING << "Failed to load modules: ";
996 for ( auto it = failNames.begin(); it != failNames.end(); it++ ) {
997 log << ( *it );
998 if ( ( it + 1 ) != failNames.end() ) log << ", ";
999 }
1000 log << endmsg;
1001 }
1002 return result;
1003}
std::vector< std::string > m_okDlls
names of successfully loaded dlls

◆ decodeExtSvcNameList()

StatusCode ApplicationMgr::decodeExtSvcNameList ( )

Definition at line 901 of file ApplicationMgr.cpp.

901 {
902 StatusCode result = StatusCode::SUCCESS;
903
904 const auto& theNames = m_extSvcNameList.value();
905
906 auto it = theNames.begin();
907 auto et = theNames.end();
908 while ( result.isSuccess() && it != et ) {
909 Gaudi::Utils::TypeNameString item( *it++ );
910 if ( m_extSvcCreates ) {
911 if ( ( result = svcManager()->addService( item, ServiceManager::DEFAULT_SVC_PRIORITY ) ).isFailure() ) {
912 MsgStream log( m_messageSvc, m_name );
913 log << MSG::ERROR << "decodeExtSvcNameList: Cannot create service " << item.type() << "/" << item.name()
914 << endmsg;
915 }
916 } else {
917 if ( ( result = svcManager()->declareSvcType( item.name(), item.type() ) ).isFailure() ) {
918 MsgStream log( m_messageSvc, m_name );
919 log << MSG::ERROR << "decodeExtSvcNameList: Cannot declare service " << item.type() << "/" << item.name()
920 << endmsg;
921 }
922 }
923 }
924 return result;
925}
Gaudi::Property< bool > m_extSvcCreates

◆ dllNameListHandler()

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

Definition at line 927 of file ApplicationMgr.cpp.

927 {
928 if ( !( decodeDllNameList() ).isSuccess() ) {
929 throw GaudiException( "Failed to load DLLs.", "MinimalEventLoopMgr::dllNameListHandler", StatusCode::FAILURE );
930 }
931}

◆ empty()

bool ApplicationMgr::empty ( ) const
override

Definition at line 773 of file ApplicationMgr.cpp.

773 {
775}
static auto i_delegateToEvtProc(SELF *self, PIMPL &member, std::string_view method_name, METHOD &&method, ARGS &&... args)
Helper to delegate calls to event processor implementation.
virtual bool empty() const =0
Tell if the processor has events in the queues.

◆ evtLoopPropertyHandler()

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

Definition at line 860 of file ApplicationMgr.cpp.

860 {
861 if ( m_processingMgr ) {
862 auto props = m_processingMgr.as<IProperty>();
863 if ( props ) props->setProperty( p ).ignore();
864 }
865}

◆ executeEvent()

StatusCode ApplicationMgr::executeEvent ( EventContext && ctx)
override

implementation of IEventProcessor::executeEvent(void*)

Definition at line 759 of file ApplicationMgr.cpp.

759 {
761 if ( m_processingMgr ) { return m_processingMgr->executeEvent( std::move( ctx ) ); }
762 }
763 MsgStream log( m_messageSvc, name() );
764 log << MSG::FATAL << "executeEvent: Invalid state \"" << FSMState() << "\"" << endmsg;
765 return StatusCode::FAILURE;
766}

◆ executeRun()

StatusCode ApplicationMgr::executeRun ( int evtmax)
override

implementation of IEventProcessor::executeRun(int)

Definition at line 790 of file ApplicationMgr.cpp.

790 {
791 MsgStream log( m_messageSvc, name() );
793 if ( m_processingMgr ) { return m_processingMgr->executeRun( evtmax ); }
794 log << MSG::WARNING << "No EventLoop Manager specified " << endmsg;
795 return StatusCode::SUCCESS;
796 }
797 log << MSG::FATAL << "executeRun: Invalid state \"" << FSMState() << "\"" << endmsg;
798 return StatusCode::FAILURE;
799}

◆ extSvcNameListHandler()

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

Definition at line 894 of file ApplicationMgr.cpp.

894 {
895 if ( !( decodeExtSvcNameList() ).isSuccess() ) {
896 throw GaudiException( "Failed to declare ext services", "MinimalEventLoopMgr::extSvcNameListHandler",
898 }
899}

◆ finalize()

StatusCode ApplicationMgr::finalize ( )
override

Definition at line 550 of file ApplicationMgr.cpp.

550 {
551 MsgStream log( m_messageSvc, name() );
553 log << MSG::INFO << "Already Finalized" << endmsg;
554 return StatusCode::SUCCESS;
555 }
557 log << MSG::FATAL << "finalize: Invalid state \"" << m_state << "\"" << endmsg;
558 return StatusCode::FAILURE;
559 }
561
562 // disable message suppression in finalize
563 m_svcLocator->service<IProperty>( "MessageSvc" )
564 ->setProperty( Gaudi::Property<bool>( "enableSuppression", false ) )
565 .ignore();
566
567 // Finalize independently managed Algorithms
568 StatusCode sc = algManager()->finalize();
569 if ( sc.isFailure() ) {
570 log << MSG::WARNING << "Failed to finalize an algorithm." << endmsg;
572 }
573
574 // Finalize all Services
575 sc = svcManager()->finalize();
576 if ( sc.isFailure() ) {
577 log << MSG::WARNING << "Failed to finalize a service." << endmsg;
579 }
580
581 // svcManager()->removeService( (IService*) m_processingMgr.get() );
582 // svcManager()->removeService( (IService*) m_runable.get() );
583
584 if ( sc.isSuccess() ) {
585 log << MSG::INFO << "Application Manager Finalized successfully" << endmsg;
586 } else {
587 log << MSG::ERROR << "Application Manager failed to finalize" << endmsg;
588 }
589
591 return sc;
592}
SmartIF< IAlgManager > & algManager()
virtual StatusCode finalize()=0
Finalize (from INITIALIZED to CONFIGURED).
const StatusCode & ignore() const
Allow discarding a StatusCode without warning.
Definition StatusCode.h:139
constexpr int FinalizationFailure
Error codes for operation failures.

◆ FSMState()

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

Definition at line 813 of file ApplicationMgr.cpp.

813{ return m_state; }

◆ getManager()

template<class I>
SmartIF< IComponentManager > & ApplicationMgr::getManager ( )
inline

Definition at line 129 of file ApplicationMgr.h.

129 {
130 return m_managers[I::interfaceID().id()];
131 }

◆ GoToState()

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 653 of file ApplicationMgr.cpp.

653 {
654 StatusCode sc = StatusCode::SUCCESS;
655
656 switch ( state ) {
657
659 switch ( m_state ) {
661 return StatusCode::SUCCESS;
662 break;
664 return terminate();
665 break;
666 default: // Gaudi::StateMachine::INITIALIZED or Gaudi::StateMachine::RUNNING
668 if ( sc.isSuccess() ) { return terminate(); }
669 break;
670 }
671 break;
672
674 switch ( m_state ) {
676 return StatusCode::SUCCESS;
677 break;
679 return configure();
680 break;
682 return finalize();
683 break;
684 default: // Gaudi::StateMachine::RUNNING
686 if ( sc.isSuccess() ) { return finalize(); }
687 break;
688 }
689 break;
690
692 switch ( m_state ) {
694 return StatusCode::SUCCESS;
695 break;
697 return initialize();
698 break;
700 return stop();
701 break;
702 default: // Gaudi::StateMachine::OFFLINE
704 if ( sc.isSuccess() ) { return initialize(); }
705 break;
706 }
707 break;
708
710 switch ( m_state ) {
712 return StatusCode::SUCCESS;
713 break;
715 return start();
716 break;
717 default: // Gaudi::StateMachine::OFFLINE or Gaudi::StateMachine::CONFIGURED
719 if ( sc.isSuccess() ) { return start(); }
720 break;
721 }
722 break;
723 }
724
725 // If I get here, there has been a problem in the recursion
726
727 if ( ignoreFailures ) {
728 // force the new state
729 m_state = state;
730 return StatusCode::SUCCESS;
731 }
732
733 return sc;
734}
StatusCode GoToState(Gaudi::StateMachine::State state, bool ignoreFailures=false)
Reach a state from current state (whichever it is) going through the correct transitions.
StatusCode finalize() override
StatusCode terminate() override
StatusCode initialize() override
StatusCode stop() override
StatusCode start() override
StatusCode configure() override

◆ i_cast()

void const * ApplicationMgr::i_cast ( const InterfaceID & iid) const
override

Definition at line 117 of file ApplicationMgr.cpp.

117 {
118 // try our own interfaces
119 if ( auto output = base_class::i_cast( iid ) ) { return output; }
120 // delegate to other instances
121 if ( ISvcLocator::interfaceID().versionMatch( iid ) ) { return serviceLocator().get(); }
122 if ( ISvcManager::interfaceID().versionMatch( iid ) ) {
123 return const_cast<ApplicationMgr*>( this )->svcManager().get();
124 }
125 if ( IAlgManager::interfaceID().versionMatch( iid ) ) {
126 return const_cast<ApplicationMgr*>( this )->algManager().get();
127 }
128 if ( IClassManager::interfaceID().versionMatch( iid ) ) { return m_classManager.get(); }
129 if ( IMessageSvc::interfaceID().versionMatch( iid ) ) {
130 // Note that 0 can be a valid IMessageSvc pointer value (when used for
131 // MsgStream).
132 return m_messageSvc.get();
133 }
134 return nullptr;
135}
ApplicationMgr(IInterface *=nullptr)
static const InterfaceID & interfaceID()
Return an instance of InterfaceID identifying the interface.
Definition IInterface.h:234
TYPE * get() const
Get interface pointer.
Definition SmartIF.h:82

◆ i_delegateToEvtProc()

template<typename SELF, typename PIMPL, typename METHOD, typename... ARGS>
static auto ApplicationMgr::i_delegateToEvtProc ( SELF * self,
PIMPL & member,
std::string_view method_name,
METHOD && method,
ARGS &&... args )
inlinestaticprivate

Helper to delegate calls to event processor implementation.

Definition at line 314 of file ApplicationMgr.h.

315 {
316 if ( self->m_state == Gaudi::StateMachine::RUNNING ) {
317 if ( bool( member ) ) {
318 return std::invoke( method, *member.get(), std::forward<ARGS>( args )... );
319 } else {
320 std::stringstream s;
321 s << method_name << ": event processor is not a \""
322 << System::typeinfoName( typeid( decltype( *member.get() ) ) ) << '"';
323 throw GaudiException{ s.str(), self->name(), StatusCode::FAILURE };
324 }
325 }
326 std::stringstream s;
327 s << method_name << ": Invalid state \"" << self->FSMState() << '"';
328 throw GaudiException{ s.str(), self->name(), StatusCode::FAILURE };
329 }

◆ i_startup()

StatusCode ApplicationMgr::i_startup ( )
protected

Internal startup routine.

Definition at line 137 of file ApplicationMgr.cpp.

137 {
138
139 StatusCode sc;
140
141 // declare factories in current module
142 m_classManager->loadModule( "" ).ignore();
143
144 // Note: we cannot use CommonMessaging methods here because MessageSvc is not there yet
145 MsgStream log( nullptr, name() );
146
147 // Create the Message service
148 auto msgsvc = svcManager()->createService( Gaudi::Utils::TypeNameString( "MessageSvc", m_messageSvcType ) );
149 if ( !msgsvc ) {
150 log << MSG::FATAL << "Error creating MessageSvc of type " << m_messageSvcType << endmsg;
151 return StatusCode::FAILURE;
152 }
153 // Get the useful interface from Message services
154 m_messageSvc = m_svcLocator->service( "MessageSvc" );
155 if ( !m_messageSvc ) {
156 log << MSG::FATAL << "Error retrieving MessageSvc." << endmsg;
157 return StatusCode::FAILURE;
158 }
159 sc = m_messageSvc.as<IProperty>()->setProperty( "OutputLevel", m_outputLevel );
160 if ( !sc ) {
161 log << MSG::FATAL << "Error setting OutputLevel option of MessageSvc" << endmsg;
162 return sc;
163 }
165 if ( gROOT ) {
166 // if ROOT is already initialized (usually it is the case) we redirect messages to MessageSvc.
167 s_messageSvcInstance = m_messageSvc.get();
168 s_originalRootErrorHandler = SetErrorHandler( ROOTErrorHandlerAdapter );
169 } else {
171 << "ROOT not yet initialized, we cannot override the error handler are requested "
172 "(UseMessageSvcForROOTMessages==true)"
173 << endmsg;
174 }
175 }
176
177 auto jobsvc = svcManager()->createService( Gaudi::Utils::TypeNameString( "JobOptionsSvc", m_jobOptionsSvcType ) );
178 // Create the Job Options service
179 if ( !jobsvc ) {
180 log << MSG::FATAL << "Error creating JobOptionsSvc" << endmsg;
181 return StatusCode::FAILURE;
182 }
183
184 auto jobOptsIProp = jobsvc.as<IProperty>();
185 if ( !jobOptsIProp ) {
186 log << MSG::FATAL << "Error locating JobOptionsSvc" << endmsg;
187 return StatusCode::FAILURE;
188 }
189 sc = jobOptsIProp->setProperty( Gaudi::Property<std::string>( "TYPE", m_jobOptionsType ) );
190 if ( !sc.isSuccess() ) {
191 log << MSG::FATAL << "Error setting TYPE option in JobOptionsSvc" << endmsg;
192 return sc;
193 }
194
195 if ( !m_jobOptionsPreAction.empty() ) {
196 sc = jobOptsIProp->setProperty( Gaudi::Property<std::string>( "PYTHONPARAMS", m_jobOptionsPreAction ) );
197 if ( !sc.isSuccess() ) {
198 log << MSG::FATAL << "Error setting JobOptionsPreAction option in JobOptionsSvc" << endmsg;
199 return sc;
200 }
201 }
202
203 if ( !m_jobOptionsPostAction.empty() ) {
204 sc = jobOptsIProp->setProperty( Gaudi::Property<std::string>( "PYTHONACTION", m_jobOptionsPostAction ) );
205 if ( !sc.isSuccess() ) {
206 log << MSG::FATAL << "Error setting JobOptionsPostAction option in JobOptionsSvc" << endmsg;
207 return sc;
208 }
209 }
210
211 if ( !m_jobOptionsPath.empty() ) { // The command line takes precedence
212 sc = jobOptsIProp->setProperty( Gaudi::Property<std::string>( "PATH", m_jobOptionsPath ) );
213 if ( !sc.isSuccess() ) {
214 log << MSG::FATAL << "Error setting PATH option in JobOptionsSvc" << endmsg;
215 return sc;
216 }
217 } else if ( isEnvSet( "JOBOPTPATH" ) ) { // Otherwise the Environment JOBOPTPATH
218 sc = jobOptsIProp->setProperty( Gaudi::Property<std::string>( "PATH", getEnv( "JOBOPTPATH" ) ) );
219 if ( !sc.isSuccess() ) {
220 log << MSG::FATAL << "Error setting PATH option in JobOptionsSvc from env" << endmsg;
221 return sc;
222 }
223 } else { // Otherwise the default
224 sc = jobOptsIProp->setProperty( Gaudi::Property<std::string>( "PATH", "../options/job.opts" ) );
225 if ( !sc.isSuccess() ) {
226 log << MSG::FATAL << "Error setting PATH option in JobOptionsSvc to default" << endmsg;
227 return sc;
228 }
229 }
230 jobOptsIProp.reset();
231
232 // Sets my default the Output Level of the Message service to be
233 // the same as this
234 auto msgSvcIProp = msgsvc.as<IProperty>();
235 msgSvcIProp->setProperty( Gaudi::Property<int>( "OutputLevel", m_outputLevel ) ).ignore();
236 msgSvcIProp.reset();
237
238 sc = jobsvc->sysInitialize();
239 if ( !sc.isSuccess() ) {
240 log << MSG::FATAL << "Error initializing JobOptionsSvc" << endmsg;
241 return sc;
242 }
243 sc = msgsvc->sysInitialize();
244 if ( !sc.isSuccess() ) {
245 log << MSG::FATAL << "Error initializing MessageSvc" << endmsg;
246 return sc;
247 }
248
249 // Make sure output level caches are up to date.
251
252 return sc;
253}
GAUDI_API bool isEnvSet(const char *var)
Check if an environment variable is set or not.
Definition System.cpp:349
GAUDI_API std::string getEnv(const char *var)
get a particular environment variable (returning "UNKNOWN" if not set)
Definition System.cpp:329
Gaudi::Property< std::string > m_jobOptionsType
Gaudi::Property< bool > m_useMessageSvcForROOTMessages
Gaudi::Property< std::string > m_jobOptionsPath
Gaudi::Property< std::string > m_jobOptionsPreAction
void outputLevelUpdate() override
Function to call to update the outputLevel of the components (after a change in MessageSvc).
Gaudi::Property< std::string > m_jobOptionsSvcType
Gaudi::Property< std::string > m_jobOptionsPostAction
Gaudi::Property< std::string > m_messageSvcType
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.
SmartIF< IFace > as() const
return a new SmartIF instance to another interface
Definition SmartIF.h:110

◆ initialize()

StatusCode ApplicationMgr::initialize ( )
override

Definition at line 421 of file ApplicationMgr.cpp.

421 {
422 StatusCode sc;
423
424 MsgStream log( m_messageSvc, name() );
425
426 // Make sure output level caches are up to date.
428
429 // I cannot add these services in configure() because they are coming from GaudiUtils
430 // and it messes up genconf when rebuilding it.
431 if ( m_stopOnSignal ) {
432 // Instantiate the service that schedules a stop when a signal is received
433 std::string svcname( "Gaudi::Utils::StopSignalHandler" );
434 sc = svcManager()->addService( svcname );
435 if ( sc.isFailure() ) {
436 log << MSG::INFO << "Cannot instantiate " << svcname << "signals will be ignored" << endmsg;
437 }
438 }
439
441 log << MSG::INFO << "Already Initialized!" << endmsg;
442 return StatusCode::SUCCESS;
443 }
445 log << MSG::FATAL << "initialize: Invalid state \"" << m_state << "\"" << endmsg;
446 return StatusCode::FAILURE;
447 }
449
450 //--------------------------------------------------------------------------
451 // Initialize the list of top Services
452 //--------------------------------------------------------------------------
453 sc = svcManager()->initialize();
454 if ( !sc.isSuccess() ) return sc;
455
456 sc = algManager()->initialize();
457 if ( !sc.isSuccess() ) return sc;
458
459 //--------------------------------------------------------------------------
460 // Final steps: Inform user and change internal state
461 //--------------------------------------------------------------------------
462 log << MSG::INFO << "Application Manager Initialized successfully" << endmsg;
464
466
467 return sc;
468}
Gaudi::Property< bool > m_printAlgsSequence
void printAlgsSequences()
Print the sequence of algorithms that have been loaded.
Gaudi::Property< bool > m_stopOnSignal
Property to enable/disable the "stop on signal" service.
virtual StatusCode initialize()=0
Initialization (from CONFIGURED to INITIALIZED).

◆ monitoringHub()

Gaudi::Monitoring::Hub & ApplicationMgr::monitoringHub ( )
inlineoverride

Definition at line 151 of file ApplicationMgr.h.

151{ return m_monitoringHub; }
Gaudi::Monitoring::Hub m_monitoringHub

◆ name()

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

Definition at line 811 of file ApplicationMgr.cpp.

811{ return m_name; }

◆ nextEvent()

StatusCode ApplicationMgr::nextEvent ( int maxevt)
override

Definition at line 501 of file ApplicationMgr.cpp.

501 {
503 MsgStream log( m_messageSvc, name() );
504 log << MSG::FATAL << "nextEvent: Invalid state \"" << m_state << "\"" << endmsg;
505 return StatusCode::FAILURE;
506 }
507 if ( !m_processingMgr ) {
508 MsgStream log( m_messageSvc, name() );
509 log << MSG::FATAL << "No event processing manager specified. Check option: " << m_eventLoopMgr.name() << endmsg;
510 return StatusCode::FAILURE;
511 }
512 return m_processingMgr->nextEvent( maxevt );
513}

◆ outputLevelUpdate()

void ApplicationMgr::outputLevelUpdate ( )
override

Function to call to update the outputLevel of the components (after a change in MessageSvc).

Definition at line 1005 of file ApplicationMgr.cpp.

1005 {
1007 for ( auto& mgrItem : m_managers ) { mgrItem.second->outputLevelUpdate(); }
1008}

◆ pluginDebugPropertyHandler()

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

◆ pop()

std::optional< Gaudi::Interfaces::IQueueingEventProcessor::ResultType > ApplicationMgr::pop ( )
override

Definition at line 777 of file ApplicationMgr.cpp.

777 {
779}
virtual std::optional< ResultType > pop()=0
Get the next available result.

◆ printAlgsSequences()

void ApplicationMgr::printAlgsSequences ( )

Print the sequence of algorithms that have been loaded.

Definition at line 1031 of file ApplicationMgr.cpp.

1031 {
1032 MsgStream log( m_messageSvc, m_name );
1033 log << MSG::ALWAYS << "****************************** Algorithm Sequence ****************************" << endmsg;
1034 for ( auto& algname : m_topAlgNameList ) { printAlgsSequencesHelper( algManager(), algname, log, 0 ); }
1035 log << MSG::ALWAYS << "******************************************************************************" << endmsg;
1036}
Gaudi::Property< std::vector< std::string > > m_topAlgNameList

◆ push()

void ApplicationMgr::push ( EventContext && ctx)
override

Definition at line 768 of file ApplicationMgr.cpp.

768 {
770 std::move( ctx ) );
771}
virtual void push(EventContext &&ctx)=0
Schedule the processing of an event.

◆ reinitialize()

StatusCode ApplicationMgr::reinitialize ( )
override

Definition at line 816 of file ApplicationMgr.cpp.

816 {
817 MsgStream log( m_messageSvc, name() );
818 StatusCode retval = StatusCode::SUCCESS;
819 StatusCode sc;
821 throw GaudiException( "Cannot reinitialize application if not INITIALIZED or RUNNING",
822 "ApplicationMgr::reinitialize", StatusCode::FAILURE );
823 }
825 sc = svcManager()->reinitialize();
826 if ( sc.isFailure() ) retval = sc;
827 sc = algManager()->reinitialize();
828 if ( sc.isFailure() ) retval = sc;
829
830 sc = m_messageSvc.as<IService>()->sysReinitialize();
831 if ( sc.isFailure() ) retval = sc;
832 sc = m_svcLocator->service( "JobOptionsSvc" )->sysReinitialize();
833 if ( sc.isFailure() ) retval = sc;
834
835 log << MSG::INFO << "Application Manager Reinitialized successfully" << endmsg;
836
837 return retval;
838}
StatusCode sysReinitialize() override
virtual StatusCode reinitialize()=0
Initialization (from INITIALIZED or RUNNING to INITIALIZED, via CONFIGURED).

◆ restart()

StatusCode ApplicationMgr::restart ( )
override

Definition at line 840 of file ApplicationMgr.cpp.

840 {
841 StatusCode retval = StatusCode::SUCCESS;
842 StatusCode sc;
844 throw GaudiException( "Cannot restart application if not RUNNING", "ApplicationMgr::restart", StatusCode::FAILURE );
845 }
846
847 sc = svcManager()->restart();
848 if ( sc.isFailure() ) retval = sc;
849 sc = algManager()->restart();
850 if ( sc.isFailure() ) retval = sc;
851
852 sc = m_messageSvc.as<IService>()->sysRestart();
853 if ( sc.isFailure() ) retval = sc;
854 sc = m_svcLocator->service( "JobOptionsSvc" )->sysRestart();
855 if ( sc.isFailure() ) retval = sc;
856
857 return retval;
858}
StatusCode sysRestart() override
virtual StatusCode restart()=0
Initialization (from RUNNING to RUNNING, via INITIALIZED).

◆ run()

StatusCode ApplicationMgr::run ( )
override

Definition at line 736 of file ApplicationMgr.cpp.

736 {
737 StatusCode sc = StatusCode::SUCCESS;
738
740 if ( sc.isSuccess() ) {
741 MsgStream log( m_messageSvc, name() );
742 if ( m_runable != 0 ) { // loop over the events
743 sc = m_runable->run();
744 if ( !sc.isSuccess() ) { log << MSG::FATAL << "Application execution failed. Ending the job." << endmsg; }
745 } else {
746 log << MSG::FATAL << "Application has no runable object. Check option:" << m_runableType.name() << endmsg;
747 }
748 }
749 if ( sc.isSuccess() ) { // try to close cleanly
751 }
752 // either the runable failed of the stut-down
753 if ( sc.isFailure() ) { // try to close anyway (but keep the StatusCode unchanged)
755 }
756 return sc;
757}

◆ serviceLocator()

SmartIF< ISvcLocator > & ApplicationMgr::serviceLocator ( ) const
inlineoverride

Needed to locate the message service.

Definition at line 146 of file ApplicationMgr.h.

146{ return m_svcLocator; }

◆ setServiceManager()

void ApplicationMgr::setServiceManager ( ISvcManager * )
inlineoverrideprotected

Definition at line 158 of file ApplicationMgr.h.

158{}

◆ start()

StatusCode ApplicationMgr::start ( )
override

Definition at line 470 of file ApplicationMgr.cpp.

470 {
471
472 MsgStream log( m_messageSvc, name() );
473
475 log << MSG::INFO << "Already Initialized!" << endmsg;
476 return StatusCode::SUCCESS;
477 }
479 log << MSG::FATAL << "start: Invalid state \"" << m_state << "\"" << endmsg;
480 return StatusCode::FAILURE;
481 }
483
484 //--------------------------------------------------------------------------
485 // Initialize the list of top Services
486 //--------------------------------------------------------------------------
487 return m_svcLocator->service( "JobOptionsSvc" )
488 ->sysStart()
489 .andThen( [&]() { return m_messageSvc.as<IService>()->sysStart(); } )
490 .andThen( [&]() { return svcManager()->start(); } )
491 .andThen( [&]() { return algManager()->start(); } )
492 .andThen( [&]() {
493 //--------------------------------------------------------------------------
494 // Final steps: Inform user and change internal state
495 //--------------------------------------------------------------------------
496 log << MSG::INFO << "Application Manager Started successfully" << endmsg;
498 } );
499}
StatusCode sysStart() override
virtual StatusCode start()=0
Start (from INITIALIZED to RUNNING).

◆ stop()

StatusCode ApplicationMgr::stop ( )
override

Definition at line 515 of file ApplicationMgr.cpp.

515 {
516
517 MsgStream log( m_messageSvc, name() );
518
520 log << MSG::INFO << "Already Initialized!" << endmsg;
521 return StatusCode::SUCCESS;
522 }
524 log << MSG::FATAL << "stop: Invalid state \"" << m_state << "\"" << endmsg;
525 return StatusCode::FAILURE;
526 }
528
529 // Stop independently managed Algorithms
530 return algManager()
531 ->stop()
532 //--------------------------------------------------------------------------
533 // Stop the list of top Services
534 //--------------------------------------------------------------------------
535 .andThen( [&]() { return svcManager()->stop(); } )
536 .andThen( [&]() { return m_messageSvc.as<IService>()->sysStop(); } )
537 .andThen( [&]() { return m_svcLocator->service( "JobOptionsSvc" )->sysStop(); } )
538 //--------------------------------------------------------------------------
539 // Final steps: Inform user and change internal state
540 //--------------------------------------------------------------------------
541 .andThen( [&]() {
542 log << MSG::INFO << "Application Manager Stopped successfully" << endmsg;
544 } );
545}
StatusCode sysStop() override
virtual StatusCode stop()=0
Stop (from RUNNING to INITIALIZED).
StatusCode andThen(F &&f, ARGS &&... args) const
Chain code blocks making the execution conditional a success result.
Definition StatusCode.h:163

◆ stopRun()

StatusCode ApplicationMgr::stopRun ( )
override

implementation of IEventProcessor::stopRun()

Definition at line 801 of file ApplicationMgr.cpp.

801 {
802 MsgStream log( m_messageSvc, name() );
804 if ( m_processingMgr ) { return m_processingMgr->stopRun(); }
805 log << MSG::WARNING << "No EventLoop Manager specified " << endmsg;
806 return StatusCode::SUCCESS;
807 }
808 log << MSG::FATAL << "stopRun: Invalid state \"" << FSMState() << "\"" << endmsg;
809 return StatusCode::FAILURE;
810}

◆ svcManager()

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

Definition at line 133 of file ApplicationMgr.h.

133 {
134 // Cache the casted pointer to ISvcManager
136 return m_svcManager;
137 }
SmartIF< ISvcManager > m_svcManager
Cached pointer to the manager of services.

◆ sysFinalize()

StatusCode ApplicationMgr::sysFinalize ( )
inlineoverride

Definition at line 104 of file ApplicationMgr.h.

104{ return StatusCode::SUCCESS; }

◆ sysInitialize()

StatusCode ApplicationMgr::sysInitialize ( )
inlineoverride

Definition at line 98 of file ApplicationMgr.h.

98{ return StatusCode::SUCCESS; }

◆ sysReinitialize()

StatusCode ApplicationMgr::sysReinitialize ( )
inlineoverride

Definition at line 106 of file ApplicationMgr.h.

106{ return StatusCode::SUCCESS; }

◆ sysRestart()

StatusCode ApplicationMgr::sysRestart ( )
inlineoverride

Definition at line 108 of file ApplicationMgr.h.

108{ return StatusCode::SUCCESS; }

◆ sysStart()

StatusCode ApplicationMgr::sysStart ( )
inlineoverride

Definition at line 100 of file ApplicationMgr.h.

100{ return StatusCode::SUCCESS; }

◆ sysStop()

StatusCode ApplicationMgr::sysStop ( )
inlineoverride

Definition at line 102 of file ApplicationMgr.h.

102{ return StatusCode::SUCCESS; }

◆ targetFSMState()

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

Definition at line 814 of file ApplicationMgr.cpp.

814{ return m_targetState; }

◆ terminate()

StatusCode ApplicationMgr::terminate ( )
override

Definition at line 594 of file ApplicationMgr.cpp.

594 {
595 MsgStream log( m_messageSvc, name() );
596
598 log << MSG::INFO << "Already Offline" << endmsg;
599 return StatusCode::SUCCESS;
600 }
602 log << MSG::FATAL << "terminate: Invalid state \"" << m_state << "\"" << endmsg;
603 return StatusCode::FAILURE;
604 }
605 // release all Services
607
608 if ( m_returnCode.value() == Gaudi::ReturnCode::Success ) {
609 log << MSG::INFO << "Application Manager Terminated successfully" << endmsg;
610 } else if ( m_returnCode.value() == Gaudi::ReturnCode::ScheduledStop ) {
611 log << MSG::INFO << "Application Manager Terminated successfully with a user requested ScheduledStop" << endmsg;
612 } else {
613 log << MSG::ERROR << "Application Manager Terminated with error code " << m_returnCode.value() << endmsg;
614 }
615
616 {
617 auto& opts = m_svcLocator->getOptsSvc();
618 // Force a disable the auditing of finalize for MessageSvc
619 opts.set( "MessageSvc.AuditFinalize", "false" );
620 // Force a disable the auditing of finalize for JobOptionsSvc
621 opts.set( "JobOptionsSvc.AuditFinalize", "false" );
622 }
623
624 // if we have overriden it, restore the original ROOT error handler
625 if ( s_originalRootErrorHandler ) {
626 SetErrorHandler( s_originalRootErrorHandler );
627 s_originalRootErrorHandler = nullptr;
628 }
629 // make sure ROOTErrorHandlerAdapter (if in use) does not try to use the MessageSvc we are about to delete
630 s_messageSvcInstance = nullptr;
631 // finalize MessageSvc
632 auto svc = m_messageSvc.as<IService>();
633 if ( !svc ) {
634 log << MSG::ERROR << "Could not get the IService interface of the MessageSvc" << endmsg;
635 } else {
636 svc->sysFinalize().ignore();
637 svcManager()->removeService( svc ).ignore();
638 }
639
640 // finalize JobOptionsSvc
641 svc = m_svcLocator->service( "JobOptionsSvc" );
642 if ( !svc ) {
643 log << MSG::ERROR << "Could not get the IService interface of the JobOptionsSvc" << endmsg;
644 } else {
645 svc->sysFinalize().ignore();
646 svcManager()->removeService( svc ).ignore();
647 }
648
650 return StatusCode::SUCCESS;
651}
virtual StatusCode removeService(IService *svc)=0
Remove a service from the "active" list of services of the factory.
constexpr int ScheduledStop

Member Data Documentation

◆ m_actHistory

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

Definition at line 259 of file ApplicationMgr.h.

259{ this, "ActivateHistory", false, "Activate HistorySvc" };

◆ m_algManager

SmartIF<IAlgManager> ApplicationMgr::m_algManager
protected

Cached pointer to the manager of algorithms.

Definition at line 183 of file ApplicationMgr.h.

◆ m_appName

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

Definition at line 257 of file ApplicationMgr.h.

257{ this, "AppName", "ApplicationMgr", "The name of the application" };

◆ m_appVersion

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

Definition at line 258 of file ApplicationMgr.h.

258{ this, "AppVersion", {}, "The version of the application" };

◆ m_auditAlgs

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

Definition at line 279 of file ApplicationMgr.h.

279{ this, "AuditAlgorithms", false };

◆ m_auditSvcs

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

Definition at line 278 of file ApplicationMgr.h.

278{ this, "AuditServices", false };

◆ m_auditTools

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

Defaults for auditors.

Definition at line 277 of file ApplicationMgr.h.

277{ this, "AuditTools", false };

◆ m_classManager

SmartIF<DLLClassManager> ApplicationMgr::m_classManager
protected

Reference to the class manager.

Definition at line 188 of file ApplicationMgr.h.

◆ m_createSvcNameList

Gaudi::Property<std::vector<std::string> > ApplicationMgr::m_createSvcNameList
protected
Initial value:
{
this, "CreateSvc", {}, "List of extra services to be created" }

Definition at line 273 of file ApplicationMgr.h.

273 {
274 this, "CreateSvc", {}, "List of extra services to be created" };

◆ m_declaredManagers

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

Property to declare the list of known managers.

Definition at line 177 of file ApplicationMgr.h.

◆ m_dllNameList

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

Definition at line 244 of file ApplicationMgr.h.

244{ this, "Dlls", {}, "List of DDL's names" };

◆ m_environment

Gaudi::Property<std::map<std::string, std::string> > ApplicationMgr::m_environment
protected
Initial value:
{
this, "Environment", {}, "Environment variables to set" }

Definition at line 281 of file ApplicationMgr.h.

281 {
282 this, "Environment", {}, "Environment variables to set" };

◆ m_eventLoopMgr

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

Definition at line 252 of file ApplicationMgr.h.

252 { this, "EventLoop", "EventLoopMgr", "Processing manager type",
253 "Service:IEventProcessor" };

◆ m_evtMax

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

Definition at line 238 of file ApplicationMgr.h.

238{ this, "EvtMax", -1, "Number of events to be processed (-1 means all events)" };

◆ m_evtsel

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

Definition at line 254 of file ApplicationMgr.h.

254{ this, "EvtSel", {}, "Event selection" };

◆ m_extSvcCreates

Gaudi::Property<bool> ApplicationMgr::m_extSvcCreates
protected
Initial value:
{ this, "ExtSvcCreates", true,
"LHCb (default) or ATLAS definition of \"ExtSvc\"" }

Definition at line 241 of file ApplicationMgr.h.

241 { this, "ExtSvcCreates", true,
242 "LHCb (default) or ATLAS definition of \"ExtSvc\"" };

◆ m_extSvcNameList

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

Definition at line 239 of file ApplicationMgr.h.

239 {
240 this, "ExtSvc", {}, "List of external services names", "vector<Service>" };

◆ m_histPersName

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

Definition at line 255 of file ApplicationMgr.h.

255{ this, "HistogramPersistency", "NONE", "Name of the Hist Pers Svc" };

◆ m_jobOptionsPath

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

Definition at line 246 of file ApplicationMgr.h.

246{ this, "JobOptionsPath", {}, "The \"file\" to look for properties" };

◆ m_jobOptionsPostAction

Gaudi::Property<std::string> ApplicationMgr::m_jobOptionsPostAction
protected
Initial value:
{
this, "JobOptionsPreAction", {}, "additional command to run on config" }

Definition at line 249 of file ApplicationMgr.h.

249 {
250 this, "JobOptionsPreAction", {}, "additional command to run on config" };

◆ m_jobOptionsPreAction

Gaudi::Property<std::string> ApplicationMgr::m_jobOptionsPreAction
protected
Initial value:
{
this, "JobOptionsPostAction", {}, "additional command to run on config" }

Definition at line 247 of file ApplicationMgr.h.

247 {
248 this, "JobOptionsPostAction", {}, "additional command to run on config" };

◆ m_jobOptionsSvcType

Gaudi::Property<std::string> ApplicationMgr::m_jobOptionsSvcType
protected
Initial value:
{ this, "JobOptionsSvcType", "JobOptionsSvc", "JobOptionsSvc type",
"Service:Gaudi::Interfaces::IOptionsSvc" }

Definition at line 215 of file ApplicationMgr.h.

215 { this, "JobOptionsSvcType", "JobOptionsSvc", "JobOptionsSvc type",
216 "Service:Gaudi::Interfaces::IOptionsSvc" };

◆ m_jobOptionsType

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

Definition at line 245 of file ApplicationMgr.h.

245{ this, "JobOptionsType", "FILE", "Source type (e.g. dbase, file...)" };

◆ m_loopCheck

Gaudi::Property<bool> ApplicationMgr::m_loopCheck
protected
Initial value:
{ this, "InitializationLoopCheck", true,
[this]( auto& ) { this->svcManager()->setLoopCheckEnabled( m_loopCheck ); },
"For ServiceMgr initialization loop checking" }

Definition at line 284 of file ApplicationMgr.h.

284 { this, "InitializationLoopCheck", true,
285 [this]( auto& ) { this->svcManager()->setLoopCheckEnabled( m_loopCheck ); },
286 "For ServiceMgr initialization loop checking" };

◆ m_managers

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 175 of file ApplicationMgr.h.

◆ m_messageSvc

SmartIF<IMessageSvc> ApplicationMgr::m_messageSvc
protected

Reference to the message service.

Definition at line 226 of file ApplicationMgr.h.

◆ m_messageSvcType

Gaudi::Property<std::string> ApplicationMgr::m_messageSvcType
protected
Initial value:
{ this, "MessageSvcType", "MessageSvc", "MessageSvc type",
"Service:IMessageSvc" }

Definition at line 213 of file ApplicationMgr.h.

213 { this, "MessageSvcType", "MessageSvc", "MessageSvc type",
214 "Service:IMessageSvc" };

◆ m_monitoringHub

Gaudi::Monitoring::Hub ApplicationMgr::m_monitoringHub
protected

Definition at line 232 of file ApplicationMgr.h.

◆ m_name

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

Name.

Definition at line 218 of file ApplicationMgr.h.

◆ m_okDlls

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

names of successfully loaded dlls

Definition at line 310 of file ApplicationMgr.h.

◆ m_outputLevel

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

Definition at line 256 of file ApplicationMgr.h.

256{ this, "OutputLevel", MSG::INFO, "Message output level" };

◆ m_outStreamNameList

Gaudi::Property<std::vector<std::string> > ApplicationMgr::m_outStreamNameList
protected
Initial value:
{
this, "OutStream", {}, &ApplicationMgr::evtLoopPropertyHandler, "List of output stream names" }
void evtLoopPropertyHandler(Gaudi::Details::PropertyBase &theProp)

Definition at line 211 of file ApplicationMgr.h.

211 {
212 this, "OutStream", {}, &ApplicationMgr::evtLoopPropertyHandler, "List of output stream names" };

◆ m_pluginDebugLevel

Gaudi::Property<int> ApplicationMgr::m_pluginDebugLevel
protected
Initial value:
{ this, "PluginDebugLevel", 0,
[this]( auto& ) {
if ( m_pluginDebugLevel.value() ) {
MsgStream log( m_messageSvc, this->name() );
log << MSG::INFO
<< "Updating Gaudi::PluginService::SetDebug(level) to level="
<< m_pluginDebugLevel.value() << endmsg;
}
Gaudi::PluginService::SetDebug( m_pluginDebugLevel );
},
"Debug level for the plugin system" }
Gaudi::Property< int > m_pluginDebugLevel
Definition of the MsgStream class used to transmit messages.
Definition MsgStream.h:29

Definition at line 260 of file ApplicationMgr.h.

260 { this, "PluginDebugLevel", 0,
261 [this]( auto& ) {
262 // Setup debug level for the plugin system
263 if ( m_pluginDebugLevel.value() ) {
264 MsgStream log( m_messageSvc, this->name() );
265 log << MSG::INFO
266 << "Updating Gaudi::PluginService::SetDebug(level) to level="
267 << m_pluginDebugLevel.value() << endmsg;
268 }
269 Gaudi::PluginService::SetDebug( m_pluginDebugLevel );
270 },
271 "Debug level for the plugin system" };

◆ m_printAlgsSequence

Gaudi::Property<bool> ApplicationMgr::m_printAlgsSequence
protected
Initial value:
{ this, "PrintAlgsSequence", false,
"Print the sequence of algorithms that have been loaded." }

Definition at line 300 of file ApplicationMgr.h.

300 { this, "PrintAlgsSequence", false,
301 "Print the sequence of algorithms that have been loaded." };

◆ m_processingMgr

SmartIF<IEventProcessor> ApplicationMgr::m_processingMgr
protected

Reference to processing manager object.

Definition at line 228 of file ApplicationMgr.h.

◆ m_propertiesPrint

Gaudi::Property<bool> ApplicationMgr::m_propertiesPrint
protected
Initial value:
{ this, "PropertiesPrint", false,
"Flag to activate the printout of properties" }

Definition at line 293 of file ApplicationMgr.h.

293 { this, "PropertiesPrint", false,
294 "Flag to activate the printout of properties" };

◆ m_queueingProcessor

SmartIF<IQueueingEventProcessor> ApplicationMgr::m_queueingProcessor
protected

Reference to a queueing processing manager object.

Definition at line 230 of file ApplicationMgr.h.

◆ m_returnCode

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 297 of file ApplicationMgr.h.

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

◆ m_runable

SmartIF<IRunable> ApplicationMgr::m_runable
protected

Reference to the runable object.

Definition at line 227 of file ApplicationMgr.h.

◆ m_runableType

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

Definition at line 251 of file ApplicationMgr.h.

251{ this, "Runable", "AppMgrRunable", "Runable type", "Service:IRunable" };

◆ m_SIExit

Gaudi::Property<int> ApplicationMgr::m_SIExit
protected
Initial value:
{ this, "Exit", 0,
[this]( auto& ) {
::exit( 0 );
},
"For SI's \"Exit\" command via callback" }

Definition at line 198 of file ApplicationMgr.h.

198 { this, "Exit", 0,
199 [this]( auto& ) {
200 finalize().ignore();
201 terminate().ignore();
202 ::exit( 0 );
203 },
204 "For SI's \"Exit\" command via callback" };

◆ m_SIGo

Gaudi::Property<int> ApplicationMgr::m_SIGo
protected
Initial value:
{ this, "Go", 0,
[this]( auto& ) {
this->reinitialize().ignore();
},
"For SI's \"Go\" command via callback" }
Gaudi::Property< int > m_evtMax
StatusCode reinitialize() override
StatusCode executeRun(int evtmax) override
implementation of IEventProcessor::executeRun(int)

Definition at line 190 of file ApplicationMgr.h.

190 { this, "Go", 0,
191 [this]( auto& ) {
192 // Re-initialize everything
193 this->reinitialize().ignore();
194 // Execute a number of events
195 this->executeRun( m_evtMax ).ignore();
196 },
197 "For SI's \"Go\" command via callback" };

◆ m_state

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

Internal State.

Definition at line 219 of file ApplicationMgr.h.

◆ m_stopOnSignal

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 290 of file ApplicationMgr.h.

290 {
291 this, "StopOnSignal", false, "Flag to enable/disable the signal handler that schedule a stop of the event loop" };

◆ m_svcLocator

SmartIF<ISvcLocator> ApplicationMgr::m_svcLocator
mutableprotected

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

Definition at line 186 of file ApplicationMgr.h.

◆ m_svcManager

SmartIF<ISvcManager> ApplicationMgr::m_svcManager
protected

Cached pointer to the manager of services.

Definition at line 180 of file ApplicationMgr.h.

◆ m_svcMapping

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

Definition at line 222 of file ApplicationMgr.h.

222{ this, "SvcMapping", {}, "Default mapping of services" };

◆ m_svcOptMapping

Gaudi::Property<std::vector<std::string> > ApplicationMgr::m_svcOptMapping
protected
Initial value:
{
this, "SvcOptMapping", {}, "Default mapping of optional services" }

Definition at line 223 of file ApplicationMgr.h.

223 {
224 this, "SvcOptMapping", {}, "Default mapping of optional services" };

◆ m_targetState

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

Internal State.

Definition at line 220 of file ApplicationMgr.h.

◆ m_topAlgNameList

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

Definition at line 205 of file ApplicationMgr.h.

205 { this,
206 "TopAlg",
207 {},
209 "List of top level algorithms names",
210 "vector<Algorithm>" };

◆ m_useHiveAlgorithmManager

bool ApplicationMgr::m_useHiveAlgorithmManager
protected

Definition at line 307 of file ApplicationMgr.h.

◆ m_useMessageSvcForROOTMessages

Gaudi::Property<bool> ApplicationMgr::m_useMessageSvcForROOTMessages
protected
Initial value:
{ this, "UseMessageSvcForROOTMessages", true,
"Replace ROOT error handler with MessageSvc." }

Definition at line 303 of file ApplicationMgr.h.

303 { this, "UseMessageSvcForROOTMessages", true,
304 "Replace ROOT error handler with MessageSvc." };

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