Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework
v31r0 (aeb156f0)
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
GaudiMain.cpp
Go to the documentation of this file.
1
//------------------------------------------------------------------------------
2
//
3
// Description: Main Program for Gaudi applications
4
//
5
//------------------------------------------------------------------------------
6
#include "
GaudiKernel/Bootstrap.h
"
7
#include "
GaudiKernel/IAppMgrUI.h
"
8
#include "
GaudiKernel/IProperty.h
"
9
#include "
GaudiKernel/Property.h
"
10
#include "
GaudiKernel/SmartIF.h
"
11
#include "
GaudiKernel/StatusCode.h
"
12
#include <iostream>
13
14
extern
"C"
GAUDI_API
int
GaudiMain
(
int
argc
,
char
**
argv
) {
15
IInterface
* iface =
Gaudi::createApplicationMgr
();
16
SmartIF<IAppMgrUI>
appMgr
( iface );
17
auto
propMgr = appMgr.
as
<
IProperty
>();
18
19
if
( !appMgr || !propMgr ) {
20
std::cout
<<
"Fatal error while creating the ApplicationMgr "
<<
std::endl
;
21
return
1;
22
}
23
24
// Get the input configuration file from arguments
25
std::string
opts
= ( argc > 1 ) ? argv[1] :
"jobOptions.txt"
;
26
27
propMgr->setProperty(
"JobOptionsPath"
, opts ).ignore();
28
29
if
( opts.
compare
( opts.
length
() - 3, 3,
".py"
) == 0 ) {
30
propMgr->setProperty(
"EvtSel"
,
"NONE"
).ignore();
31
propMgr->setProperty(
"JobOptionsType"
,
"NONE"
).ignore();
32
propMgr->setProperty(
"DLLs"
,
"['GaudiPython']"
).ignore();
33
propMgr->setProperty(
"Runable"
,
"PythonScriptingSvc"
).ignore();
34
}
35
36
// Run the application manager and process events
37
StatusCode
sc = appMgr->
run
();
38
Gaudi::Property<int>
returnCode(
"ReturnCode"
, 0 );
39
propMgr->getProperty( &returnCode ).ignore();
40
// Release Application Manager
41
propMgr.reset();
42
appMgr.
reset
();
43
// All done - exit
44
if
( sc.
isFailure
() && returnCode == 0 ) {
45
// propagate a valid error code in case of failure
46
returnCode.
setValue
( 1 );
47
}
48
return
returnCode.
value
();
49
}
SmartIF< IAppMgrUI >
IAppMgrUI::run
virtual StatusCode run()=0
Run the complete job (from initialize to terminate)
Gaudi::Property::setValue
bool setValue(const ValueType &v)
Definition:
Property.h:527
Gaudi::Property
Implementation of property with value of concrete type.
Definition:
Property.h:352
IAppMgrUI.h
gaudirun.argv
list argv
Definition:
gaudirun.py:294
std::endl
T endl(T...args)
Bootstrap.h
StatusCode::isFailure
bool isFailure() const
Definition:
StatusCode.h:130
gaudirun.opts
opts
Definition:
gaudirun.py:303
std::string
STL class.
SmartIF::as
SmartIF< IFace > as() const
return a new SmartIF instance to another interface
Definition:
SmartIF.h:107
StatusCode
This class is used for returning status codes from appropriate routines.
Definition:
StatusCode.h:50
IInterface
Definition of the basic interface.
Definition:
IInterface.h:244
SmartIF.h
plotBacklogPyRoot.argc
argc
Definition:
plotBacklogPyRoot.py:142
std::string::length
T length(T...args)
IProperty.h
Property.h
IOTest.appMgr
appMgr
Definition:
IOTest.py:92
GaudiMain
GAUDI_API int GaudiMain(int argc, char **argv)
Definition:
GaudiMain.cpp:14
SmartIF::reset
void reset(TYPE *ptr=nullptr)
Set the internal pointer to the passed one disposing of the old one.
Definition:
SmartIF.h:86
Gaudi::Property::value
const ValueType & value() const
Backward compatibility (.
Definition:
Property.h:525
StatusCode.h
IProperty
The IProperty is the basic interface for all components which have properties that can be set or get...
Definition:
IProperty.h:20
GAUDI_API
#define GAUDI_API
Definition:
Kernel.h:71
std::cout
std::string::compare
T compare(T...args)
Gaudi::createApplicationMgr
GAUDI_API IAppMgrUI * createApplicationMgr(const std::string &dllname, const std::string &factname)
GaudiKernel
src
Lib
GaudiMain.cpp
Generated on Mon Feb 11 2019 17:48:17 for The Gaudi Framework by
1.8.11