Belle II Software development
test7_treeFitterFitResolution_Fit.py
1#!/usr/bin/env python
2
3
10
11"""
12<header>
13 <output>../TreeFitted_B0ToJPsiKs.root</output>
14 <contact>Frank Meier; frank.meier@duke.edu</contact>
15 <interval>nightly</interval>
16</header>
17"""
18
19# Reconstruct B0 to J/PsiKs using the TreeFitter. Use the ..._Plot.py
20# to plot the resolutions.
21
22from basf2 import create_path, process, statistics, set_random_seed
23
24from modularAnalysis import inputMdst, reconstructDecay, fillParticleList, matchMCTruth
25import os
26from vertex import treeFit
27
28import sys
29
30path = create_path()
31set_random_seed('#BAADF00D')
32
33if 'BELLE2_VALIDATION_DATA_DIR' not in os.environ:
34 sys.exit(0)
35inputFile = os.path.join(os.environ['BELLE2_VALIDATION_DATA_DIR'], 'analysis/prerel04_eph3_BGx1_b2jpsiks.root')
36inputMdst(inputFile, path=path)
37
38
39fillParticleList('pi+:all', '', path=path)
40fillParticleList('mu+:all', '', path=path)
41
42reconstructDecay('K_S0:pipi -> pi+:all pi-:all', 'dM<0.25', path=path)
43reconstructDecay('J/psi:mumu -> mu+:all mu-:all', 'dM<0.11', path=path)
44reconstructDecay('B0:jpsiks -> J/psi:mumu K_S0:pipi', 'Mbc > 5.27 and abs(deltaE)<0.2', path=path)
45
46matchMCTruth('B0:jpsiks', path=path)
47
49 list_name='B0:jpsiks',
50 conf_level=-1,
51 updateAllDaughters=True,
52 path=path,
53)
54
55variables = [
56 'isSignal', # B0
57 'M',
58 'InvM',
59 'chiProb',
60
61 'p',
62 'mcP',
63 'pErr',
64 'E',
65 'mcE',
66 'E_uncertainty',
67
68 'x',
69 'y',
70 'z',
71 'x_uncertainty',
72 'y_uncertainty',
73 'z_uncertainty',
74 'mcDecayVertexX',
75 'mcDecayVertexY',
76 'mcDecayVertexZ',
77]
78
79path.add_module('VariablesToNtuple',
80 treeName='B0TreeFit',
81 particleList='B0:jpsiks',
82 variables=variables,
83 fileName='../TreeFitted_B0ToJPsiKs.root')
84
85path.add_module('Progress')
86process(path)
87
88print(statistics)