Belle II Software
release-05-02-19
Main Page
Modules
Namespaces
Namespace List
Namespace 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
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
z
Variables
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Typedefs
a
b
c
d
e
h
i
l
m
n
p
r
s
t
v
w
Enumerations
Enumerator
c
d
f
p
t
u
v
w
Classes
Class List
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
y
Enumerations
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
Enumerator
a
b
c
d
e
f
g
h
k
l
m
n
o
p
r
s
t
u
v
w
z
Related Functions
b
c
d
g
i
o
r
s
t
Files
File List
File Members
All
Functions
variableManager.py
1
#!/usr/bin/env python3
2
3
# The variableManager provides helpful tools for managing your variables.
4
#
5
# Contributors:
6
# Thomas Keck
7
# Kilian Lieret (2020)
8
#
9
# For full documentation please refer to https://software.belle2.org
10
# Anything unclear? Ask questions at https://questions.belle2.org
11
12
import
ROOT
13
import
variables
14
from
variables
import
variables
as
vm
# shorthand name for the VariableManager instance
15
16
# Get information about a variable:
17
var = vm.getVariable(
'M'
)
18
print(
"Name and Description of Variable M"
)
19
print(var.name)
20
print(var.description)
21
22
# Also see variablesToExtraInfo.py
23
vm.addAlias(
'sigProb'
,
'extraInfo(SignalProbability)'
)
24
var = vm.getVariable(
'sigProb'
)
25
print(
"Real name of sigProb: "
, var.name)
26
27
# We can also define collections of variables. For more on this, see usingCollections.py
28
vm.addCollection(
'Kinematics'
,
variables.std_vector
(
'px'
,
'py'
,
'pz'
))
29
var = vm.getCollection(
'Kinematics'
)
30
print(
"Collection named Kinematics: "
, list(var))
31
32
result = vm.evaluate(
'constant(123)'
,
None
)
33
print(
"Result of evaluating the variable 'constant(123)' "
, result)
34
35
# the variable names can contain special characters like (,:
36
# Therefore we have to escape the variable names before putting them into ROOT files.
37
# You can get the branch-names outputted by modules like VariablesToHistogram, VariablesToNtuple and
38
# VariablesToTree using the makeROOTCompatible function
39
var =
"extraInfo(SignalProbability)"
40
print(
"Root Compatible name of "
, var,
" is "
, ROOT.Belle2.makeROOTCompatible(var))
41
42
print(
"You can get a full list of all available variables using 'basf2 variables.py'"
)
variables.std_vector
def std_vector(*args)
Definition:
__init__.py:20
analysis
examples
VariableManager
variableManager.py
Generated on Tue Jan 4 2022 02:49:52 for Belle II Software by
1.8.17