Belle II Software
light-2409-toyger
Toggle main menu visibility
Main Page
Modules
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
z
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
Variables
Typedefs
a
b
c
d
l
m
n
p
r
s
w
Enumerations
Enumerator
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
_
c
d
e
f
h
i
m
o
p
r
s
t
v
w
Enumerations
b
c
e
g
h
m
p
s
t
v
Enumerator
b
c
k
t
Related Functions
Files
File List
File Members
All
Functions
formulaVariablesExample.py
1
#!/usr/bin/env python3
2
3
10
11
# An example/test of using the formula() metavariable
12
#
13
# For full documentation please refer to https://software.belle2.org
14
# Anything unclear? Ask questions at https://questions.belle2.org
15
16
import
basf2
17
from
modularAnalysis
import
inputMdstList
18
from
stdCharged
import
stdPi
19
20
mypath = basf2.Path()
# create a path
21
22
# add input data and ParticleLoader modules to the path
23
inputMdstList([basf2.find_file(
'analysis/tests/mdst.root'
)], path=mypath)
24
stdPi(
'95eff'
, path=mypath)
# grab the standard pions list
25
26
# you can (and should) make this into something more sensible
27
nonsense_formula =
'formula(p+nTracks)'
28
29
# Add the VariablesToNtuple module explicitly
30
# this will write out one row per candidate in the pi+ list and evaluate
31
# the nonsense formula for all of them
32
mypath.add_module(
33
'VariablesToNtuple'
,
34
particleList=
'pi+:95eff'
,
35
variables=[
'nTracks'
,
'p'
, nonsense_formula],
36
fileName=
'formulaTest.root'
37
)
38
39
# process the data
40
basf2.process(mypath)
41
print(basf2.statistics)
analysis
examples
VariableManager
formulaVariablesExample.py
Generated on Sat Sep 28 2024 03:40:27 for Belle II Software by
1.9.6