20import modularAnalysis
as ma
21from stdCharged
import stdMu
22from stdKlongs
import stdKlongs
25from variables
import variables
26from vertex
import TagV, kFit
29main = basf2.create_path()
31ma.inputMdstList([basf2.find_file(
'B02JpsiKL_Jpsi2mumu.root',
'examples',
False)], path=main)
34main.add_module(
'ProgressBar')
36stdMu(
'loose', path=main)
39ma.reconstructDecay(
'J/psi:mumu -> mu-:loose mu+:loose', cut=
'3.08 < M < 3.12 and 1.45 < useCMSFrame(p) < 1.95', path=main)
41pcalc = basf2.register_module(
'KlongMomentumCalculatorExpert')
42pcalc.set_name(
'KlongMomentumCalculatorExpert_' +
'B0 -> J/psi:mumu K_L0:allklm')
43pcalc.param(
'decayString',
'B0 -> J/psi:mumu K_L0:allklm')
44pcalc.param(
'writeOut',
False)
45pcalc.param(
'recoList',
"_reco")
48rmake = basf2.register_module(
'KlongDecayReconstructorExpert')
49rmake.set_name(
'KlongDecayReconstructorExpert_' +
'B0 -> J/psi:mumu K_L0:allklm')
50rmake.param(
'decayString',
'B0 -> J/psi:mumu K_L0:allklm')
51rmake.param(
'cut',
'M > 0')
52rmake.param(
'decayMode', 0)
53rmake.param(
'writeOut',
False)
54rmake.param(
'recoList',
"_reco")
57ma.buildRestOfEvent(
'B0', path=main)
58ma.matchMCTruth(
'B0', path=main)
60kFit(list_name=
'B0', conf_level=-1, fit_type=
'vertex', constraint=
'iptube',
61 decay_string=
'B0 -> [J/psi -> ^mu- ^mu+] K_L0',
62 daughtersUpdate=
False,
67ma.updateKlongKinematicsExpert(
'B0', path=main)
69TagV(
'B0', constraintType=
'tube', confidenceLevel=0.0001, path=main)
71commonVariables = vc.inv_mass + vc.mc_truth
72commonVariables += vc.kinematics + vc.mc_kinematics
73commonVariables += vc.vertex + vc.mc_vertex
75variableList = [var
for var
in commonVariables]
76variableList += vc.deltae_mbc + vc.tag_vertex + vc.mc_tag_vertex + vc.reco_stats
77variableList += vu.create_aliases(commonVariables,
'daughter(0, {variable})',
'Jpsi')
78variableList += vu.create_aliases(commonVariables,
'daughter(1, {variable})',
'KL0')
79variableList += vu.create_aliases(vc.kinematics,
'useCMSFrame({variable})',
'CMS')
80variableList += vu.create_aliases(vc.kinematics,
'daughter(0, useCMSFrame({variable}))',
'Jpsi_CMS')
81variableList += vu.create_aliases(vc.kinematics,
'daughter(1, useCMSFrame({variable}))',
'KL0_CMS')
82variables.addAlias(
'dmID',
'extraInfo(decayModeID)')
83variableList += [
'dmID']
85ma.variablesToNtuple(
'B0', variables=variableList, filename=
"Reconstruct_jpsi_kl_example.root", treename=
'tree', path=main)
91print(basf2.statistics)