22 from reconstruction
import prepare_user_cdst_analysis
23 import modularAnalysis
as ma
24 from variables
import variables
25 from vertex
import treeFit
26 from ROOT
import gSystem
31 ap = argparse.ArgumentParser()
32 ap.add_argument(
"--mc", help=
"Input file is MC", action=
'store_true', default=
False)
33 ap.add_argument(
"--exp", help=
"Experiment number, if input file is real data", default=0)
34 ap.add_argument(
"--vfit", help=
"Do vertex fit", action=
'store_true', default=
False)
35 ap.add_argument(
"--out", help=
"Output file", default=
"Dstar.root")
36 args = ap.parse_args()
48 basf2.B2ERROR(
"Experiment number is not given. Please, provide it with --exp")
50 basf2.conditions.override_globaltags()
51 basf2.conditions.append_globaltag(
'patch_main_release-07_noTOP')
52 if int(args.exp) < 20:
53 basf2.conditions.append_globaltag(
'data_reprocessing_proc13')
55 basf2.conditions.append_globaltag(
'data_reprocessing_prompt')
56 basf2.conditions.append_globaltag(
'online')
59 gSystem.Load(
'libtop.so')
62 main = basf2.create_path()
65 ma.inputMdstList(
'Input.root', path=main)
68 prepare_user_cdst_analysis(main)
71 ma.fillParticleList(
'K-:All',
'-2.0 < d0 < 2.0 and -4.0 < z0 < 4.0', path=main)
72 ma.fillParticleList(
'pi+:All',
'-2.0 < d0 < 2.0 and -4.0 < z0 < 4.0', path=main)
75 ma.reconstructDecay(
'D0:kpi -> K-:All pi+:All',
'1.8 < M < 1.95', path=main)
78 ma.reconstructDecay(
'D*+ -> D0:kpi pi+:All',
'0.0 < Q < 0.020', path=main)
82 treeFit(
'D*+', ipConstraint=
True, path=main)
86 ma.matchMCTruth(
'D*+', path=main)
89 variables.addAlias(
'isBunch',
'topBunchIsReconstructed')
90 variables.addAlias(
'bunchOffset',
'topBunchOffset')
91 variables.addAlias(
'M_D0',
'daughter(0, M)')
92 variables.addAlias(
'p_cms',
'useCMSFrame(p)')
94 variables.addAlias(
'p_K',
'daughter(0, daughter(0, p))')
95 variables.addAlias(
'flag_K',
'daughter(0, daughter(0, topLogLFlag))')
96 variables.addAlias(
'kaonLL_K',
'daughter(0, daughter(0, topLogLKaon))')
97 variables.addAlias(
'pionLL_K',
'daughter(0, daughter(0, topLogLPion))')
98 variables.addAlias(
'slotID_K',
'daughter(0, daughter(0, topSlotID))')
100 variables.addAlias(
'p_pi',
'daughter(0, daughter(1, p))')
101 variables.addAlias(
'flag_pi',
'daughter(0, daughter(1, topLogLFlag))')
102 variables.addAlias(
'kaonLL_pi',
'daughter(0, daughter(1, topLogLKaon))')
103 variables.addAlias(
'pionLL_pi',
'daughter(0, daughter(1, topLogLPion))')
104 variables.addAlias(
'slotID_pi',
'daughter(0, daughter(1, topSlotID))')
106 varlist = [
'M_D0',
'Q',
'dQ',
'p_cms',
'isBunch',
'bunchOffset',
'p_K',
'p_pi',
107 'kaonLL_K',
'pionLL_K',
'flag_K',
'slotID_K',
108 'kaonLL_pi',
'pionLL_pi',
'flag_pi',
'slotID_pi']
110 ma.variablesToNtuple(
'D*+', varlist,
'dstar', args.out, path=main)
116 print(basf2.statistics)