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