4 import modularAnalysis
as ma
5 from variables
import variables
as vm
8 from ROOT
import Belle2
11 myMain = basf2.create_path()
16 ma.inputMdst(environmentType=
'default',
17 filename=basf2.find_file(
'B02pi0D0_D2kpi_B2Dstarpi_Dstar2Dpi_D2kpi.root',
'examples',
False),
24 photons = (
'gamma',
'')
26 ma.fillParticleLists([kaons, pions, photons], path=myMain)
29 ma.reconstructDecay(
'pi0 -> gamma gamma',
'0.05 < M < 1.7', path=myMain)
32 ma.reconstructDecay(
'D0 -> K- pi+',
'1.800 < M < 1.900', path=myMain)
35 ma.reconstructDecay(
'D*+ -> D0 pi+',
'0.0 <= Q < 0.02', path=myMain)
38 ma.reconstructDecay(
'anti-B0:tag -> D*+ pi-',
'5.000 < M < 6.000', path=myMain)
41 ma.reconstructDecay(
'B0:sig -> anti-D0 pi0',
'0.000 < M < 6.000', path=myMain)
44 ma.reconstructDecay(
'Upsilon(4S):B0barB0 -> anti-B0:tag B0:sig',
'0.000 < M < 11.000', dmID=1, path=myMain)
45 ma.reconstructDecay(
'Upsilon(4S):B0B0 -> B0:tag B0:sig',
'0.000 < M < 11.000', dmID=2, path=myMain)
46 ma.copyLists(
'Upsilon(4S):all', [
'Upsilon(4S):B0barB0',
'Upsilon(4S):B0B0'], path=myMain)
49 ma.matchMCTruth(
'Upsilon(4S):all', myMain)
52 ma.buildRestOfEvent(
'B0:tag', path=myMain)
53 ma.buildRestOfEvent(
'Upsilon(4S):all', path=myMain)
56 commonVariables = vc.mc_truth + vc.deltae_mbc
57 BvariableList = commonVariables + vc.roe_multiplicities
60 Y4SvariableList = vc.mc_truth + vc.roe_multiplicities + vc.recoil_kinematics + vc.extra_energy
61 vm.addAlias(
'dmID',
'extraInfo(decayModeID)')
62 Y4SvariableList += [
'dmID']
63 Y4SvariableList += vu.create_aliases(commonVariables,
'daughter(0, {variable})',
'Btag')
64 Y4SvariableList += vu.create_aliases(commonVariables,
'daughter(1, {variable})',
'Bsig')
67 ma.variablesToNtuple(
'B0:tag', variables=BvariableList, filename=
'ROE_BtagBsig.root', treename=
'btag', path=myMain)
68 ma.variablesToNtuple(
'Upsilon(4S):all', variables=Y4SvariableList, filename=
'ROE_BtagBsig.root', treename=
'btagbsig', path=myMain)
71 print(basf2.statistics)