31 from modularAnalysis
import applyCuts
32 from modularAnalysis
import buildRestOfEvent
33 from modularAnalysis
import combineAllParticles
34 from modularAnalysis
import fillParticleList
35 from modularAnalysis
import inputMdst
36 from modularAnalysis
import reconstructDecay
37 from modularAnalysis
import matchMCTruth
38 from modularAnalysis
import signalSideParticleFilter
39 from modularAnalysis
import variablesToNtuple
40 from modularAnalysis
import variableToSignalSideExtraInfo
41 from vertex
import raveFit
42 from vertex
import treeFit
43 from stdCharged
import stdPi, stdK
44 from variables
import variables
49 my_path = b2.create_path()
52 inputMdst(filename=b2.find_file(
'ccbar_sample_to_test.root',
'examples',
False),
58 stdPi(
'all', path=my_path)
60 stdPi(
'loose', path=my_path)
62 stdK(
'loose', path=my_path)
66 reconstructDecay(
'D0:kpi -> K-:loose pi+:loose',
'1.8 < M < 1.9', path=my_path)
70 treeFit(
'D0:kpi', 0.0, path=my_path)
74 reconstructDecay(
'D*+:all -> D0:kpi pi+:all',
'0.0 <= Q < 0.02', path=my_path)
77 matchMCTruth(
'D*+:all', path=my_path)
81 treeFit(
'D*+:all', 0.0, path=my_path)
84 buildRestOfEvent(
'D*+:all', path=my_path)
87 roe_path = b2.create_path()
88 deadEndPath = b2.create_path()
91 signalSideParticleFilter(
'D*+:all',
'', roe_path, deadEndPath)
94 fillParticleList(
'pi+:fromPV',
'isInRestOfEvent == 1', path=roe_path)
97 matchMCTruth(
'pi+:fromPV', path=roe_path)
100 WeaklyDecayingParticleNames = [
'KL0',
'KS0',
'D+',
'D0',
'D_s+',
'n0',
'Sigma-',
101 'Lambda0',
'Sigma+',
'Xi-',
'Omega-',
'Lambda_c+',
'Xi_c0',
'Xi_c+',
'Omega_c0']
102 WeaklyDecayingParticles = [
121 DepthOfDecayChain = 5
122 for i
in range(0, DepthOfDecayChain):
123 PVParticlesCuts +=
'[genMotherPDG('
124 PVParticlesCuts += str(i)
125 PVParticlesCuts +=
') == 10022'
126 for j
in range(0, i):
127 for WeaklyDecayingParticle
in WeaklyDecayingParticles:
128 PVParticlesCuts +=
' and abs(genMotherPDG('
129 PVParticlesCuts += str(j)
130 PVParticlesCuts +=
')) != '
131 PVParticlesCuts += WeaklyDecayingParticle
132 PVParticlesCuts +=
']'
133 if i < (DepthOfDecayChain - 1):
134 PVParticlesCuts +=
' or '
135 applyCuts(
'pi+:fromPV', PVParticlesCuts, path=roe_path)
138 combineAllParticles([
'pi+:fromPV'],
'vpho:PV', path=roe_path)
139 raveFit(
'vpho:PV', conf_level=0, constraint=
'iptube', path=roe_path)
142 PVVtxDictionary = {
'x':
'PVx',
145 'chiProb':
'PV_Pvalue',
146 'nParticlesInList(pi+:fromPV)':
'nPiPV'
148 variableToSignalSideExtraInfo(
'vpho:PV', PVVtxDictionary, path=roe_path)
149 variables.addAlias(
'PVXFit',
'extraInfo(PVx)')
150 variables.addAlias(
'PVYFit',
'extraInfo(PVy)')
151 variables.addAlias(
'PVZFit',
'extraInfo(PVz)')
152 variables.addAlias(
'PVFit_Pvalue',
'extraInfo(PV_Pvalue)')
153 variables.addAlias(
'nPiFromPV',
'extraInfo(nPiPV)')
155 pv_vars = [
'PVXFit',
'PVYFit',
'PVZFit',
'PVFit_Pvalue',
'nPiFromPV']
158 my_path.for_each(
'RestOfEvent',
'RestOfEvents', roe_path)
161 dstar_vars = vc.inv_mass + vc.mc_truth + pv_vars
163 fs_hadron_vars = vu.create_aliases_for_selected(
164 vc.pid + vc.track + vc.mc_truth,
165 'D*+ -> [D0 -> ^K- ^pi+] ^pi+')
167 d0_vars = vu.create_aliases_for_selected(
168 vc.inv_mass + vc.mc_truth,
169 'D*+ -> ^D0 pi+',
'D0')
172 output_file =
'B2A408-AllParticleCombiner.root'
174 filename=output_file, treename=
'dsttree', path=my_path)