13 Simple example script to reconstruct Dstart for the purpose of ARICH PID performance studies
14 Usage : basf2 reconstruct_Dstar.py exp start_run end_run
15 set up to use D* skim from proc9 (adjust line 42 to change input!
21 import modularAnalysis
as ma
24 import stdCharged
as stdc
27 my_path = b2.create_path()
32 exp = argvs[1].zfill(4)
44 main_path = b2.create_path()
48 for i
in range(int(start_run), int(end_run) + 1):
50 fname =
'/group/belle2/dataprod/Data/release-03-02-02/DB00000654/proc9/e' + exp +
'/4S/r' + \
51 ru.zfill(5) +
'/offskim/offskim_dstar/cdst/sub00/cdst.physics.' + exp +
'.' + ru.zfill(5) +
'.HLT0.offskim_dstar.root'
52 if os.path.exists(fname):
53 inputFilename.append(fname)
56 input_module = b2.register_module(
'RootInput')
57 input_module.param(
'inputFileNames', inputFilename)
60 my_path.add_module(input_module)
76 stdc.stdPi(listtype=
'all', path=my_path)
77 stdc.stdK(listtype=
'all', path=my_path)
81 ma.reconstructDecay(decayString=
'D0:kpi -> K-:all pi+:all', cut=
'1.8 < M < 1.9', path=my_path)
88 ma.reconstructDecay(decayString=
'D*+ -> D0:kpi pi+:all', cut=
'0.0 < Q < 0.2', path=my_path)
98 'pidPairProbabilityExpert(321, 211, ARICH)',
99 'pidDeltaLogLikelihoodValueExpert(211,321,ARICH)',
100 'pidProbabilityExpert(211, ARICH)',
101 'pidProbabilityExpert(321, ARICH)']
104 dstar_vars = vc.inv_mass + vc.mc_truth + vc.kinematics
106 fs_hadron_vars = vu.create_aliases_for_selected(
107 list_of_variables=vc.pid + vc.track + vc.mc_truth + vc.kinematics + pidVars,
108 decay_string=
'D*+ -> [D0 -> ^K- ^pi+] ^pi+')
110 d0_vars = vu.create_aliases_for_selected(
111 list_of_variables=vc.inv_mass + vc.mc_truth,
112 decay_string=
'D*+ -> ^D0 pi+',
116 output_file =
'Dstar2D0Pi-PID_exp' + exp +
'_r' + start_run +
'-' + end_run +
'.root'
117 ma.variablesToNtuple(
'D*+', dstar_vars + d0_vars + fs_hadron_vars,
118 filename=output_file, treename=
'dsttree', path=my_path)
121 progress = b2.register_module(
'Progress')
122 my_path.add_module(progress)