12import modularAnalysis
as ma
13from variables
import variables
as vm
18myMain = basf2.create_path()
23ma.inputMdst(filename=basf2.find_file(
'B02pi0D0_D2kpi_B2Dstarpi_Dstar2Dpi_D2kpi.root',
'examples',
False),
30photons = (
'gamma',
'')
32ma.fillParticleLists([kaons, pions, photons], path=myMain)
35ma.reconstructDecay(
'pi0 -> gamma gamma',
'0.05 < M < 1.7', path=myMain)
38ma.reconstructDecay(
'D0 -> K- pi+',
'1.800 < M < 1.900', path=myMain)
41ma.reconstructDecay(
'D*+ -> D0 pi+',
'0.0 <= Q < 0.02', path=myMain)
44ma.reconstructDecay(
'anti-B0:tag -> D*+ pi-',
'5.000 < M < 6.000', path=myMain)
47ma.reconstructDecay(
'B0:sig -> anti-D0 pi0',
'0.000 < M < 6.000', path=myMain)
50ma.reconstructDecay(
'Upsilon(4S):B0barB0 -> anti-B0:tag B0:sig',
'0.000 < M < 11.000', dmID=1, path=myMain)
51ma.reconstructDecay(
'Upsilon(4S):B0B0 -> B0:tag B0:sig',
'0.000 < M < 11.000', dmID=2, path=myMain)
52ma.copyLists(
'Upsilon(4S):all', [
'Upsilon(4S):B0barB0',
'Upsilon(4S):B0B0'], path=myMain)
55ma.matchMCTruth(
'Upsilon(4S):all', myMain)
58ma.buildRestOfEvent(
'B0:tag', path=myMain)
59ma.buildRestOfEvent(
'Upsilon(4S):all', path=myMain)
62commonVariables = vc.mc_truth + vc.deltae_mbc
63BvariableList = commonVariables + vc.roe_multiplicities
66Y4SvariableList = vc.mc_truth + vc.roe_multiplicities + vc.recoil_kinematics + vc.extra_energy
67vm.addAlias(
'dmID',
'extraInfo(decayModeID)')
68Y4SvariableList += [
'dmID']
69Y4SvariableList += vu.create_aliases(commonVariables,
'daughter(0, {variable})',
'Btag')
70Y4SvariableList += vu.create_aliases(commonVariables,
'daughter(1, {variable})',
'Bsig')
73ma.variablesToNtuple(
'B0:tag', variables=BvariableList, filename=
'ROE_BtagBsig.root', treename=
'btag', path=myMain)
74ma.variablesToNtuple(
'Upsilon(4S):all', variables=Y4SvariableList, filename=
'ROE_BtagBsig.root', treename=
'btagbsig', path=myMain)
77print(basf2.statistics)