32import modularAnalysis
as ma
33import flavorTagger
as ft
40cp_val_path = b2.Path()
43environmentType =
"default"
59ma.inputMdst(environmentType=environmentType,
60 filename=b2.find_file(
'analysis/mdst11_BGx1_b2jpsiks.root',
'validation',
False),
65ma.fillParticleList(decayString=
'mu+:all', cut=
'', path=cp_val_path)
69ma.reconstructDecay(decayString=
'J/psi:mumu -> mu+:all mu-:all', cut=
'dM<0.11', path=cp_val_path)
78ma.fillParticleList(decayString=
'pi+:all', cut=
'', path=cp_val_path)
79ma.reconstructDecay(decayString=
'K_S0:pipi -> pi+:all pi-:all', cut=
'dM<0.25', path=cp_val_path)
82ma.reconstructDecay(decayString=
'B0:sig -> J/psi:mumu K_S0:pipi', cut=
'Mbc > 5.2 and abs(deltaE)<0.15', path=cp_val_path)
85ma.matchMCTruth(list_name=
'B0:sig', path=cp_val_path)
88ma.buildRestOfEvent(target_list_name=
'B0:sig', fillWithMostLikely=
True,
91b2.conditions.append_globaltag(ma.getAnalysisGlobaltag())
104weightfiles =
'B2nunubarBGx1'
108 particleLists=[
'B0:sig'],
109 weightFiles=weightfiles,
152ma.applyCuts(list_name=
'B0:sig',
153 cut=
'isNAN(qrOutput(FBDT)) < 1',
157ma.rankByHighest(particleList=
'B0:sig',
158 variable=
'abs(qrOutput(FBDT))',
160 outputVariable=
'Dilution_rank',
164vx.kFit(list_name=
'B0:sig', conf_level=0.0, decay_string=
'B0:sig -> [J/psi:mumu -> ^mu+ ^mu-] K_S0',
165 constraint=
'', path=cp_val_path)
169vx.TagV(list_name=
'B0:sig', MCassociation=
'breco', path=cp_val_path)
172fs_vars = vc.pid + vc.track + vc.track_hits + vc.mc_truth
173jpsiandk0s_vars = vc.mc_truth
174vertex_vars = vc.vertex + vc.mc_vertex + vc.kinematics + vc.mc_kinematics
175bvars = vc.reco_stats + \
178 vc.roe_multiplicities + \
184bvars += ft.flavor_tagging
188 vu.create_aliases_for_selected(list_of_variables=fs_vars,
189 decay_string=
'B0 -> [J/psi -> ^mu+ ^mu-] [K_S0 -> ^pi+ ^pi-]') + \
190 vu.create_aliases_for_selected(list_of_variables=jpsiandk0s_vars,
191 decay_string=
'B0 -> [^J/psi -> mu+ mu-] [^K_S0 -> pi+ pi-]') + \
192 vu.create_aliases_for_selected(list_of_variables=vertex_vars,
193 decay_string=
'B0 -> [^J/psi -> ^mu+ ^mu-] [^K_S0 -> ^pi+ ^pi-]')
196output_file =
'B2A801-FlavorTagger.root'
197ma.variablesToNtuple(decayString=
'B0:sig',
199 filename=output_file,
204ma.summaryOfLists(particleLists=[
'J/psi:mumu',
'B0:sig'],
208b2.process(cp_val_path)