Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework
master (f31105fd)
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Typedefs
a
b
c
d
e
f
h
i
l
m
o
p
r
s
t
u
v
w
x
Enumerations
Enumerator
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
y
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Enumerations
a
c
d
e
f
i
l
m
n
o
p
q
r
s
t
v
Enumerator
a
b
c
d
e
f
i
j
k
l
m
n
o
p
r
s
t
u
v
w
Properties
Related Functions
:
a
b
c
d
e
g
h
i
m
o
p
r
s
t
v
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Functions
_
b
c
e
f
g
h
i
l
m
n
o
p
r
s
t
u
z
Variables
a
b
c
d
e
g
h
i
m
o
p
q
r
s
t
v
x
Typedefs
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
w
Enumerations
Enumerator
c
e
f
p
u
v
Macros
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
•
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
* (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations *
3
* *
4
* This software is distributed under the terms of the Apache version 2 licence, *
5
* copied verbatim in the file "LICENSE". *
6
* *
7
* In applying this licence, CERN does not waive the privileges and immunities *
8
* granted to it by virtue of its status as an Intergovernmental Organization *
9
* or submit itself to any jurisdiction. *
10
\***********************************************************************************/
11
//------------------------------------------------------------------------------
12
//
13
// Description: Main Program for Gaudi applications
14
//
15
//------------------------------------------------------------------------------
16
#include <
Gaudi/Application.h
>
17
#include <gsl/span>
18
#include <iostream>
19
#include <string_view>
20
#include <type_traits>
21
22
extern
"C"
GAUDI_API
int
GaudiMain
(
int
argc
,
char
**
argv
) {
23
Gaudi::Application::Options
opts
;
24
25
std::string_view appType{
"Gaudi::Application"
};
26
std::string_view optsFile;
27
28
gsl::span
args
{
argv
,
static_cast<
std::remove_cv_t<decltype( gsl::dynamic_extent )
>
>(
argc
) };
29
30
auto
usage
= [
name
=
args
[0]](
std::ostream
&
out
) ->
std::ostream
& {
31
return
out
<<
"usage: "
<<
name
<<
" [options] option_file\n"
;
32
};
33
34
auto
arg =
args
.begin();
35
++arg;
// ignore application name
36
while
( arg !=
args
.end() ) {
37
std::string_view opt{ *arg };
38
if
( opt ==
"--application"
)
39
appType = *++arg;
40
else
if
( opt ==
"-h"
|| opt ==
"--help"
) {
41
usage
(
std::cout
);
42
std::cout
<< R
"(
43
Options:
44
-h, --help show this help message and exit
45
--application APPLICATION
46
name of the application class to use [default: Gaudi::Application]
47
)";
48
return
EXIT_SUCCESS;
49
}
else
if
( opt[0] ==
'-'
) {
50
std::cerr
<<
"error: unknown option "
<< opt <<
'\n'
;
51
usage
(
std::cerr
);
52
return
EXIT_FAILURE;
53
}
else
{
54
optsFile = *arg++;
55
break
;
// we stop after the first positional argument
56
}
57
++arg;
58
}
59
if
( arg !=
args
.end() ) {
std::cerr
<<
"warning: ignoring extra positional arguments\n"
; }
60
if
( optsFile.empty() ) {
61
std::cerr
<<
"error: missing option file argument\n"
;
62
usage
(
std::cerr
);
63
return
EXIT_FAILURE;
64
}
65
66
if
( optsFile.size() > 3 && optsFile.substr( optsFile.size() - 3 ) ==
".py"
) {
67
opts
[
"ApplicationMgr.EvtSel"
] =
"NONE"
;
68
opts
[
"ApplicationMgr.JobOptionsType"
] =
"NONE"
;
69
opts
[
"ApplicationMgr.DLLs"
] =
"['GaudiPython']"
;
70
opts
[
"ApplicationMgr.Runable"
] =
"PythonScriptingSvc"
;
71
}
else
{
72
opts
[
"ApplicationMgr.JobOptionsPath"
] = optsFile;
73
}
74
75
auto
app
=
Gaudi::Application::create
( appType,
std::move
(
opts
) );
76
if
( !
app
) {
77
std::cerr
<<
"error: failure creating "
<< appType <<
'\n'
;
78
return
EXIT_FAILURE;
79
}
80
81
return
app
->run();
82
}
Gaudi.Application.create
def create(cls, appType, opts)
Definition:
__init__.py:127
Read.app
app
Definition:
Read.py:36
std::move
T move(T... args)
plotBacklogPyRoot.argc
argc
Definition:
plotBacklogPyRoot.py:173
gaudirun.opts
opts
Definition:
gaudirun.py:336
std::ostream
STL class.
Application.h
std::map< std::string, std::string >
ConditionsStallTest.name
name
Definition:
ConditionsStallTest.py:77
GaudiMain
GAUDI_API int GaudiMain(int argc, char **argv)
Definition:
GaudiMain.cpp:22
usage
void usage(const std::string &argv0)
Definition:
listcomponents.cpp:40
gaudirun.args
args
Definition:
gaudirun.py:336
GAUDI_API
#define GAUDI_API
Definition:
Kernel.h:81
gaudirun.argv
list argv
Definition:
gaudirun.py:327
Gaudi::Functional::details::out
OptOut && out
Definition:
details.h:174
GaudiKernel
src
Lib
GaudiMain.cpp
Generated on Mon Apr 7 2025 16:26:23 for The Gaudi Framework by
1.8.18