5 Simple example script to reconstruct Dstart for the purpose of ARICH PID performance studies
6 Usage : basf2 reconstruct_Dstar.py exp start_run end_run
7 set up to use D* skim from proc9 (adjust line 42 to change input!
13 import modularAnalysis
as ma
16 import stdCharged
as stdc
17 from stdV0s
import stdKshorts
18 from stdPi0s
import stdPi0s
22 my_path = b2.create_path()
27 exp = argvs[1].zfill(4)
34 b2.use_central_database(
'data_reprocessing_proc9')
36 main_path = b2.create_path()
40 for i
in range(int(start_run), int(end_run) + 1):
42 fname =
'/group/belle2/dataprod/Data/release-03-02-02/DB00000654/proc9/e' + exp +
'/4S/r' + \
43 ru.zfill(5) +
'/offskim/offskim_dstar/cdst/sub00/cdst.physics.' + exp +
'.' + ru.zfill(5) +
'.HLT0.offskim_dstar.root'
44 if os.path.exists(fname):
45 inputFilename.append(fname)
48 input_module = b2.register_module(
'RootInput')
49 input_module.param(
'inputFileNames', inputFilename)
52 my_path.add_module(input_module)
68 stdc.stdPi(listtype=
'all', path=my_path)
69 stdc.stdK(listtype=
'all', path=my_path)
73 ma.reconstructDecay(decayString=
'D0:kpi -> K-:all pi+:all', cut=
'1.8 < M < 1.9', path=my_path)
80 ma.reconstructDecay(decayString=
'D*+ -> D0:kpi pi+:all', cut=
'0.0 < Q < 0.2', path=my_path)
90 'pidPairProbabilityExpert(321, 211, ARICH)',
91 'pidDeltaLogLikelihoodValueExpert(211,321,ARICH)',
92 'pidProbabilityExpert(211, ARICH)',
93 'pidProbabilityExpert(321, ARICH)']
96 dstar_vars = vc.inv_mass + vc.mc_truth + vc.kinematics
98 fs_hadron_vars = vu.create_aliases_for_selected(
99 list_of_variables=vc.pid + vc.track + vc.mc_truth + vc.kinematics + pidVars,
100 decay_string=
'D*+ -> [D0 -> ^K- ^pi+] ^pi+')
102 d0_vars = vu.create_aliases_for_selected(
103 list_of_variables=vc.inv_mass + vc.mc_truth,
104 decay_string=
'D*+ -> ^D0 pi+',
108 output_file =
'Dstar2D0Pi-PID_exp' + exp +
'_r' + start_run +
'-' + end_run +
'.root'
109 ma.variablesToNtuple(
'D*+', dstar_vars + d0_vars + fs_hadron_vars,
110 filename=output_file, treename=
'dsttree', path=my_path)
113 progress = b2.register_module(
'Progress')
114 my_path.add_module(progress)