Belle II Software  release-05-01-25
test2_Dz2BodyHadronic.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 """
5 <header>
6  <input>./WG6_DstToD0ToKpi.udst.root</input>
7  <output>./WG6_DstToD0ToKpi.ntup.root</output>
8  <contact>lilongke@ihep.ac.cn</contact>
9 </header>
10 """
11 
12 import basf2 as b2
13 import modularAnalysis as ma
14 
15 from variables import variables as vm
16 
17 # create path
18 myAna_Main = b2.create_path()
19 
20 # load input ROOT file
21 ma.inputMdst('default', '../WG6_DstToD0ToKpi.udst.root', path=myAna_Main)
22 
23 # --------------------------------------------------
24 # write out useful information to a ROOT file
25 # --------------------------------------------------
26 vm.addAlias('ps_Dst', 'useCMSFrame(p)')
27 vm.addAlias('M_D0', 'daughter(0,InvM)')
28 vm.addAlias('ps_D0', 'daughter(0,useCMSFrame(p))')
29 vm.addAlias('ps_spi', 'daughter(1,useCMSFrame(p))')
30 
31 DstTree = ['Q', 'M_D0', 'ps_Dst', 'ps_D0', 'ps_spi']
32 
33 ma.copyLists('D*+:sig', ['D*+:HpJm0', 'D*+:HpJm1', 'D*+:HpJm2'], writeOut=True, path=myAna_Main)
34 
35 ma.variablesToNtuple(filename='WG6_DstToD0ToKpi.ntup.root',
36  decayString='D*+:sig', treename='hrec',
37  variables=DstTree, path=myAna_Main)
38 
39 # --------------------------------------------------
40 # Process the events and print call statistics
41 # --------------------------------------------------
42 myAna_Main.add_module('Progress')
43 
44 b2.process(myAna_Main)
45 
46 print(b2.statistics)