Belle II Software  release-08-01-10
reconstruction.py
1 # @cond
2 import json
3 import basf2 as b2
4 import modularAnalysis as ma
5 import vertex as vx
6 
7 runningOnMC = snakemake.params.runningOnMC
8 
9 inputjson = snakemake.input.inputfileList
10 outname = snakemake.output[0]
11 
12 mypath = b2.create_path()
13 with open(inputjson) as f:
14  inputMdstList = json.load(f)
15 
16 ma.inputMdstList(filelist=inputMdstList, path=mypath)
17 
18 ma.fillParticleList(decayString='K+:my', cut="dr < 0.5 and abs(dz) < 3 and thetaInCDCAcceptance and kaonID > 0.01", path=mypath)
19 ma.fillParticleList(decayString='pi+:my', cut="dr < 0.5 and abs(dz) < 3 and thetaInCDCAcceptance", path=mypath)
20 
21 ma.reconstructDecay(decayString="D-:K2Pi -> K+:my pi-:my pi-:my", cut="1.844 < M < 1.894", path=mypath)
22 
23 ma.reconstructDecay(decayString='B0:PiD-toK2Pi -> D-:K2Pi pi+:my', cut='5.0 < Mbc and abs(deltaE) < 1.0', path=mypath)
24 vx.treeFit('B0:PiD-toK2Pi', 0, path=mypath, updateAllDaughters=False, ipConstraint=True, massConstraint=[411])
25 
26 if(runningOnMC):
27  ma.matchMCTruth(list_name='B0:PiD-toK2Pi', path=mypath)
28 
29 some_variables = ['Mbc', 'deltaE']
30 ma.variablesToNtuple(decayString='B0:PiD-toK2Pi', variables=some_variables,
31  filename=outname, path=mypath, treename='BtoPiDtoKPiPi')
32 
33 b2.process(mypath)
34 # @endcond