21from reconstruction
import prepare_user_cdst_analysis
22import modularAnalysis
as ma
23from variables
import variables
24from vertex
import treeFit
25from ROOT
import gSystem
30ap = argparse.ArgumentParser()
31ap.add_argument(
"--mc", help=
"Input file is MC", action=
'store_true', default=
False)
32ap.add_argument(
"--exp", help=
"Experiment number, if input file is real data", default=0)
33ap.add_argument(
"--vfit", help=
"Do vertex fit", action=
'store_true', default=
False)
34ap.add_argument(
"--out", help=
"Output file", default=
"Dstar.root")
47 basf2.B2ERROR(
"Experiment number is not given. Please, provide it with --exp")
49 basf2.conditions.override_globaltags()
50 basf2.conditions.append_globaltag(
'patch_main_release-07_noTOP')
51 if int(args.exp) < 20:
52 basf2.conditions.append_globaltag(
'data_reprocessing_proc13')
54 basf2.conditions.append_globaltag(
'data_reprocessing_prompt')
55 basf2.conditions.append_globaltag(
'online')
58gSystem.Load(
'libtop.so')
61main = basf2.create_path()
64ma.inputMdstList(
'Input.root', path=main)
67prepare_user_cdst_analysis(main)
70ma.fillParticleList(
'K-:All',
'-2.0 < d0 < 2.0 and -4.0 < z0 < 4.0', path=main)
71ma.fillParticleList(
'pi+:All',
'-2.0 < d0 < 2.0 and -4.0 < z0 < 4.0', path=main)
74ma.reconstructDecay(
'D0:kpi -> K-:All pi+:All',
'1.8 < M < 1.95', path=main)
77ma.reconstructDecay(
'D*+ -> D0:kpi pi+:All',
'0.0 < Q < 0.020', path=main)
81 treeFit(
'D*+', ipConstraint=
True, path=main)
85 ma.matchMCTruth(
'D*+', path=main)
88variables.addAlias(
'isBunch',
'topBunchIsReconstructed')
89variables.addAlias(
'bunchOffset',
'topBunchOffset')
90variables.addAlias(
'M_D0',
'daughter(0, M)')
91variables.addAlias(
'p_cms',
'useCMSFrame(p)')
93variables.addAlias(
'p_K',
'daughter(0, daughter(0, p))')
94variables.addAlias(
'flag_K',
'daughter(0, daughter(0, topLogLFlag))')
95variables.addAlias(
'kaonLL_K',
'daughter(0, daughter(0, topLogLKaon))')
96variables.addAlias(
'pionLL_K',
'daughter(0, daughter(0, topLogLPion))')
97variables.addAlias(
'slotID_K',
'daughter(0, daughter(0, topSlotID))')
99variables.addAlias(
'p_pi',
'daughter(0, daughter(1, p))')
100variables.addAlias(
'flag_pi',
'daughter(0, daughter(1, topLogLFlag))')
101variables.addAlias(
'kaonLL_pi',
'daughter(0, daughter(1, topLogLKaon))')
102variables.addAlias(
'pionLL_pi',
'daughter(0, daughter(1, topLogLPion))')
103variables.addAlias(
'slotID_pi',
'daughter(0, daughter(1, topSlotID))')
105varlist = [
'M_D0',
'Q',
'dQ',
'p_cms',
'isBunch',
'bunchOffset',
'p_K',
'p_pi',
106 'kaonLL_K',
'pionLL_K',
'flag_K',
'slotID_K',
107 'kaonLL_pi',
'pionLL_pi',
'flag_pi',
'slotID_pi']
109ma.variablesToNtuple(
'D*+', varlist,
'dstar', args.out, path=main)
115print(basf2.statistics)