32import modularAnalysis
as ma
36import stdCharged
as stdc
40my_path = b2.create_path()
43ma.inputMdst(filename=b2.find_file(
'B2pi0D_D2hh_D2hhh_B2munu.root',
'examples',
False),
49stdc.stdPi(
'all', path=my_path)
52ma.rankByLowest(particleList=
'pi+:all',
54 outputVariable=
'pi_p_rank',
57va.variables.addAlias(
'pi_p_rank',
'extraInfo(pi_p_rank)')
60stdc.stdK(listtype=
'loose', path=my_path)
63ma.reconstructDecay(decayString=
'D0 -> K-:loose pi+:all',
68ma.matchMCTruth(list_name=
'D0', path=my_path)
72vx.treeFit(list_name=
'D0',
76 updateAllDaughters=
True,
80ma.rankByLowest(particleList=
'D0',
82 outputVariable=
'abs_dM_rank',
86ma.rankByHighest(particleList=
'D0',
93va.variables.addAlias(
'D0_rank1_pi_PIDpi',
'getVariableByRank(D0, chiProb, daughter(1, pionID), 1)')
94va.variables.addAlias(
'D0_rank2_pi_PIDpi',
'getVariableByRank(D0, chiProb, daughter(1, pionID), 2)')
97ma.variablesToEventExtraInfo(
'D0', {
'formula(D0_rank1_pi_PIDpi - D0_rank2_pi_PIDpi)':
'D0_pi_PIDpi_r1_minus_r2'}, path=my_path)
98va.variables.addAlias(
'D0_pi_PIDpi_r1_minus_r2',
'eventExtraInfo(D0_pi_PIDpi_r1_minus_r2)')
106va.variables.addAlias(
'D1_pi_p_rank',
'daughter(1,pi_p_rank)')
109ma.rankByHighest(particleList=
'D0',
110 variable=
'D1_pi_p_rank',
112 outputVariable=
"first_D_rank",
114va.variables.addAlias(
'first_D_rank',
'extraInfo(first_D_rank)')
117ma.rankByHighest(particleList=
"D0",
119 cut=
"first_D_rank == 1",
120 outputVariable=
"second_D_rank",
122va.variables.addAlias(
'second_D_rank',
'extraInfo(second_D_rank)')
125va.variables.addAlias(
'dM_rank',
'extraInfo(abs_dM_rank)')
126va.variables.addAlias(
'chiProb_rank',
'extraInfo(chiProb_rank)')
129fs_hadron_vars = vu.create_aliases_for_selected(list_of_variables=vc.mc_truth, decay_string=
'D0 -> ^K- ^pi+')
131d0_vars = vc.vertex + \
135 [
'dM',
'chiProb',
'dM_rank',
'chiProb_rank',
'D1_pi_p_rank',
'first_D_rank',
'second_D_rank',
'D0_pi_PIDpi_r1_minus_r2']
139output_file =
'B2A602-BestCandidateSelection.root'
140ma.variablesToNtuple(decayString=
'D0',
142 filename=output_file,