Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework
v36r7 (7f57a304)
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
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
g
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
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
x
Enumerations
a
c
d
e
f
i
l
m
n
o
p
r
s
t
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
s
t
v
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
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
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
HistoEx.py
Go to the documentation of this file.
1
#!/usr/bin/env python
2
13
"""
14
*******************************************************************************
15
* *
16
* Simple example which illustrate the usage of useful algorithm base class *
17
* HistoAlgo (python version of C++ GaudiHistoAlg) for "easy" histogramming. *
18
* *
19
*******************************************************************************
20
"""
21
from
__future__
import
print_function
22
23
# =============================================================================
24
__author__ =
"Vanya BELYAEV Ivan.Belyaev@lapp.in2p3.fr"
25
# =============================================================================
26
27
from
GaudiPython.GaudiAlgs
import
SUCCESS, HistoAlgo
28
29
# =============================================================================
30
# Simple algorithm which book&fill 3 histograms
31
# =============================================================================
32
33
34
class
HistoEx
(
HistoAlgo
):
35
"""Simple algorithm which implicitely book&fill three histograms"""
36
37
def
__init__
(self, name):
38
"""Constructor"""
39
HistoAlgo.__init__(self, name)
40
41
def
execute
(self):
42
"""The major method 'execute', it is invoked for each event"""
43
for
i
in
range
(0, 10):
44
self.plot1D(i,
" 1D histo "
, 0, 20, 20)
45
for
j
in
range
(0, 10):
46
self.plot2D(i, j,
" 2D histo "
, 0, 20, 0, 20, 20, 20)
47
for
k
in
range
(0, 10):
48
self.plot3D(i, j, k,
" 3D histo "
, 0, 20, 0, 20, 0, 20, 20, 20, 20)
49
50
return
SUCCESS
51
52
53
# =============================================================================
54
# job configuration
55
# =============================================================================
56
def
configure
(gaudi=None):
57
"""Configuration of the job"""
58
59
if
not
gaudi:
60
from
GaudiPython.Bindings
import
AppMgr
61
62
gaudi =
AppMgr
()
63
64
gaudi.JobOptionsType =
"NONE"
65
gaudi.EvtSel =
"NONE"
66
gaudi.HistogramPersistency =
"ROOT"
67
68
gaudi.config()
69
70
gaudi.DLLs = [
71
"GaudiAlg"
,
72
"RootHistCnv"
,
73
]
74
75
alg =
HistoEx
(
"HistoEx"
)
76
gaudi.setAlgorithms([alg])
77
alg.HistoPrint =
True
78
79
hsvc = gaudi.service(
"HistogramPersistencySvc"
)
80
hsvc.OutputFile =
"histo1.root"
81
82
# This does not harm and tests bug #50389
83
getMyalgBack = gaudi.algorithm(
"HistoEx"
)
84
85
return
SUCCESS
86
87
88
# =============================================================================
89
# The actual job excution
90
# =============================================================================
91
if
"__main__"
== __name__:
92
print(__doc__ + __author__)
93
94
from
GaudiPython.Bindings
import
AppMgr
95
96
gaudi =
AppMgr
()
97
configure
(gaudi)
98
gaudi.run(20)
99
100
import
GaudiPython.HistoUtils
101
102
alg = gaudi.algorithm(
"HistoEx"
)
103
histos = alg.Histos()
104
for
key
in
sorted(histos):
105
histo = histos[key]
106
if
hasattr(histo,
"dump"
):
107
print(histo.dump(80, 20,
True
))
108
109
# =============================================================================
110
# The END
111
# =============================================================================
GaudiPython.HistoUtils
Definition:
HistoUtils.py:1
GaudiPython.GaudiAlgs.HistoAlgo
Definition:
GaudiAlgs.py:768
GaudiPython.Bindings.AppMgr
Definition:
Bindings.py:873
GaudiPython.Bindings
Definition:
Bindings.py:1
HistoEx.configure
def configure(gaudi=None)
Definition:
HistoEx.py:56
HistoEx.HistoEx.__init__
def __init__(self, name)
Definition:
HistoEx.py:37
HistoEx.HistoEx.execute
def execute(self)
Definition:
HistoEx.py:41
GaudiPython.GaudiAlgs
Definition:
GaudiAlgs.py:1
HistoEx.HistoEx
Definition:
HistoEx.py:34
Gaudi::Functional::details::zip::range
decltype(auto) range(Args &&... args)
Zips multiple containers together to form a single range.
Definition:
FunctionalDetails.h:102
GaudiExamples
scripts
HistoEx.py
Generated on Fri Jul 29 2022 20:50:40 for The Gaudi Framework by
1.8.18