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