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
formulaVariablesExample.py
1
#!/usr/bin/env python3
2
3
# An example/test of using the formula() metavariable
4
#
5
# James Kahn and Sam Cunliffe
6
#
7
# For full documentation please refer to https://software.belle2.org
8
# Anything unclear? Ask questions at https://questions.belle2.org
9
10
import
basf2
11
from
modularAnalysis
import
inputMdstList
12
from
stdCharged
import
stdPi
13
14
mypath = basf2.Path()
# create a path
15
16
# add input data and ParticleLoader modules to the path
17
inputMdstList(
'default'
, [basf2.find_file(
'analysis/tests/mdst.root'
)], path=mypath)
18
stdPi(
'95eff'
, path=mypath)
# grab the standard pions list
19
20
# you can (and should) make this into something more sensible
21
nonsense_formula =
'formula(p+nTracks)'
22
23
# Add the VariablesToNtuple module explicitly
24
# this will write out one row per candidate in the pi+ list and evaluate
25
# the nonsense formula for all of them
26
mypath.add_module(
27
'VariablesToNtuple'
,
28
particleList=
'pi+:95eff'
,
29
variables=[
'nTracks'
,
'p'
, nonsense_formula],
30
fileName=
'formulaTest.root'
31
)
32
33
# process the data
34
basf2.process
(mypath)
35
print(basf2.statistics)
basf2.process
def process(path, max_event=0)
Definition:
__init__.py:25
analysis
examples
VariableManager
formulaVariablesExample.py
Generated on Tue Jan 4 2022 02:49:51 for Belle II Software by
1.8.17