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