28 from modularAnalysis
import applyCuts
29 from modularAnalysis
import buildRestOfEvent
30 from modularAnalysis
import combineAllParticles
31 from modularAnalysis
import fillParticleList
32 from modularAnalysis
import inputMdst
33 from modularAnalysis
import reconstructDecay
34 from modularAnalysis
import matchMCTruth
35 from modularAnalysis
import signalSideParticleFilter
36 from modularAnalysis
import variablesToNtuple
37 from modularAnalysis
import variableToSignalSideExtraInfo
38 from vertex
import raveFit
39 from vertex
import treeFit
40 from stdCharged
import stdPi, stdK
41 from variables
import variables
46 my_path = b2.create_path()
49 inputMdst(environmentType=
'default',
50 filename=b2.find_file(
'ccbar_sample_to_test.root',
'examples',
False),
56 stdPi(
'all', path=my_path)
58 stdPi(
'loose', path=my_path)
60 stdK(
'loose', path=my_path)
64 reconstructDecay(
'D0:kpi -> K-:loose pi+:loose',
'1.8 < M < 1.9', path=my_path)
68 treeFit(
'D0:kpi', 0.0, path=my_path)
72 reconstructDecay(
'D*+:all -> D0:kpi pi+:all',
'0.0 <= Q < 0.02', path=my_path)
75 matchMCTruth(
'D*+:all', path=my_path)
79 treeFit(
'D*+:all', 0.0, path=my_path)
82 buildRestOfEvent(
'D*+:all', path=my_path)
85 roe_path = b2.create_path()
86 deadEndPath = b2.create_path()
89 signalSideParticleFilter(
'D*+:all',
'', roe_path, deadEndPath)
92 fillParticleList(
'pi+:fromPV',
'isInRestOfEvent == 1', path=roe_path)
95 matchMCTruth(
'pi+:fromPV', path=roe_path)
98 WeaklyDecayingParticleNames = [
'KL0',
'KS0',
'D+',
'D0',
'D_s+',
'n0',
'Sigma-',
99 'Lambda0',
'Sigma+',
'Xi-',
'Omega-',
'Lambda_c+',
'Xi_c0',
'Xi_c+',
'Omega_c0']
100 WeaklyDecayingParticles = [
119 DepthOfDecayChain = 5
120 for i
in range(0, DepthOfDecayChain):
121 PVParticlesCuts +=
'[genMotherPDG('
122 PVParticlesCuts += str(i)
123 PVParticlesCuts +=
') == 10022'
124 for j
in range(0, i):
125 for WeaklyDecayingParticle
in WeaklyDecayingParticles:
126 PVParticlesCuts +=
' and abs(genMotherPDG('
127 PVParticlesCuts += str(j)
128 PVParticlesCuts +=
')) != '
129 PVParticlesCuts += WeaklyDecayingParticle
130 PVParticlesCuts +=
']'
131 if i < (DepthOfDecayChain - 1):
132 PVParticlesCuts +=
' or '
133 applyCuts(
'pi+:fromPV', PVParticlesCuts, path=roe_path)
136 combineAllParticles([
'pi+:fromPV'],
'vpho:PV', path=roe_path)
137 raveFit(
'vpho:PV', conf_level=0, constraint=
'iptube', path=roe_path)
140 PVVtxDictionary = {
'x':
'PVx',
143 'chiProb':
'PV_Pvalue',
144 'nParticlesInList(pi+:fromPV)':
'nPiPV'
146 variableToSignalSideExtraInfo(
'vpho:PV', PVVtxDictionary, path=roe_path)
147 variables.addAlias(
'PVXFit',
'extraInfo(PVx)')
148 variables.addAlias(
'PVYFit',
'extraInfo(PVy)')
149 variables.addAlias(
'PVZFit',
'extraInfo(PVz)')
150 variables.addAlias(
'PVFit_Pvalue',
'extraInfo(PV_Pvalue)')
151 variables.addAlias(
'nPiFromPV',
'extraInfo(nPiPV)')
153 pv_vars = [
'PVXFit',
'PVYFit',
'PVZFit',
'PVFit_Pvalue',
'nPiFromPV']
156 my_path.for_each(
'RestOfEvent',
'RestOfEvents', roe_path)
159 dstar_vars = vc.inv_mass + vc.mc_truth + pv_vars
161 fs_hadron_vars = vu.create_aliases_for_selected(
162 vc.pid + vc.track + vc.mc_truth,
163 'D*+ -> [D0 -> ^K- ^pi+] ^pi+')
165 d0_vars = vu.create_aliases_for_selected(
166 vc.inv_mass + vc.mc_truth,
167 'D*+ -> ^D0 pi+',
'D0')
170 output_file =
'B2A408-AllParticleCombiner.root'
172 filename=output_file, treename=
'dsttree', path=my_path)