Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework
v36r16 (ea80daf8)
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
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
w
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 python3
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
# =============================================================================
22
__author__ =
"Vanya BELYAEV Ivan.Belyaev@lapp.in2p3.fr"
23
# =============================================================================
24
25
from
GaudiPython.GaudiAlgs
import
SUCCESS, HistoAlgo
26
27
# =============================================================================
28
# Simple algorithm which book&fill 3 histograms
29
# =============================================================================
30
31
32
class
HistoEx
(
HistoAlgo
):
33
"""Simple algorithm which implicitely book&fill three histograms"""
34
35
def
__init__
(self, name):
36
"""Constructor"""
37
HistoAlgo.__init__(self, name)
38
39
def
execute
(self):
40
"""The major method 'execute', it is invoked for each event"""
41
for
i
in
range
(0, 10):
42
self.plot1D(i,
" 1D histo "
, 0, 20, 20)
43
for
j
in
range
(0, 10):
44
self.plot2D(i, j,
" 2D histo "
, 0, 20, 0, 20, 20, 20)
45
for
k
in
range
(0, 10):
46
self.plot3D(i, j, k,
" 3D histo "
, 0, 20, 0, 20, 0, 20, 20, 20, 20)
47
48
return
SUCCESS
49
50
51
# =============================================================================
52
# job configuration
53
# =============================================================================
54
def
configure
(gaudi=None):
55
"""Configuration of the job"""
56
57
if
not
gaudi:
58
from
GaudiPython.Bindings
import
AppMgr
59
60
gaudi =
AppMgr
()
61
62
gaudi.JobOptionsType =
"NONE"
63
gaudi.EvtSel =
"NONE"
64
gaudi.HistogramPersistency =
"ROOT"
65
66
gaudi.config()
67
68
gaudi.DLLs = [
69
"GaudiAlg"
,
70
"RootHistCnv"
,
71
]
72
73
alg =
HistoEx
(
"HistoEx"
)
74
gaudi.setAlgorithms([alg])
75
alg.HistoPrint =
True
76
77
hsvc = gaudi.service(
"HistogramPersistencySvc"
)
78
hsvc.OutputFile =
"histoex.root"
79
80
# This does not harm and tests bug #50389
81
_ = gaudi.algorithm(
"HistoEx"
)
82
83
return
SUCCESS
84
85
86
# =============================================================================
87
# The actual job excution
88
# =============================================================================
89
if
"__main__"
== __name__:
90
print(__doc__ + __author__)
91
92
from
GaudiPython.Bindings
import
AppMgr
93
94
gaudi =
AppMgr
()
95
configure
(gaudi)
96
gaudi.run(20)
97
98
import
GaudiPython.HistoUtils
# noqa: F401 (adds dump method)
99
100
alg = gaudi.algorithm(
"HistoEx"
)
101
histos = alg.Histos()
102
for
key
in
sorted(histos):
103
histo = histos[key]
104
if
hasattr(histo,
"dump"
):
105
print(histo.dump(80, 20,
True
))
106
107
# =============================================================================
108
# The END
109
# =============================================================================
GaudiPython.HistoUtils
Definition:
HistoUtils.py:1
GaudiPython.GaudiAlgs.HistoAlgo
Definition:
GaudiAlgs.py:768
GaudiPython.Bindings.AppMgr
Definition:
Bindings.py:869
GaudiPython.Bindings
Definition:
Bindings.py:1
HistoEx.configure
def configure(gaudi=None)
Definition:
HistoEx.py:54
HistoEx.HistoEx.__init__
def __init__(self, name)
Definition:
HistoEx.py:35
HistoEx.HistoEx.execute
def execute(self)
Definition:
HistoEx.py:39
GaudiPython.GaudiAlgs
Definition:
GaudiAlgs.py:1
HistoEx.HistoEx
Definition:
HistoEx.py:32
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 28 2023 16:22:53 for The Gaudi Framework by
1.8.18