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(environmentType=
'default',
53 filename=b2.find_file(
'ccbar_sample_to_test.root',
'examples',
False),
59 stdPi(
'all', path=my_path)
61 stdPi(
'loose', path=my_path)
63 stdK(
'loose', path=my_path)
67 reconstructDecay(
'D0:kpi -> K-:loose pi+:loose',
'1.8 < M < 1.9', path=my_path)
71 treeFit(
'D0:kpi', 0.0, path=my_path)
75 reconstructDecay(
'D*+:all -> D0:kpi pi+:all',
'0.0 <= Q < 0.02', path=my_path)
78 matchMCTruth(
'D*+:all', path=my_path)
82 treeFit(
'D*+:all', 0.0, path=my_path)
85 buildRestOfEvent(
'D*+:all', path=my_path)
88 roe_path = b2.create_path()
89 deadEndPath = b2.create_path()
92 signalSideParticleFilter(
'D*+:all',
'', roe_path, deadEndPath)
95 fillParticleList(
'pi+:fromPV',
'isInRestOfEvent == 1', path=roe_path)
98 matchMCTruth(
'pi+:fromPV', path=roe_path)
101 WeaklyDecayingParticleNames = [
'KL0',
'KS0',
'D+',
'D0',
'D_s+',
'n0',
'Sigma-',
102 'Lambda0',
'Sigma+',
'Xi-',
'Omega-',
'Lambda_c+',
'Xi_c0',
'Xi_c+',
'Omega_c0']
103 WeaklyDecayingParticles = [
122 DepthOfDecayChain = 5
123 for i
in range(0, DepthOfDecayChain):
124 PVParticlesCuts +=
'[genMotherPDG('
125 PVParticlesCuts += str(i)
126 PVParticlesCuts +=
') == 10022'
127 for j
in range(0, i):
128 for WeaklyDecayingParticle
in WeaklyDecayingParticles:
129 PVParticlesCuts +=
' and abs(genMotherPDG('
130 PVParticlesCuts += str(j)
131 PVParticlesCuts +=
')) != '
132 PVParticlesCuts += WeaklyDecayingParticle
133 PVParticlesCuts +=
']'
134 if i < (DepthOfDecayChain - 1):
135 PVParticlesCuts +=
' or '
136 applyCuts(
'pi+:fromPV', PVParticlesCuts, path=roe_path)
139 combineAllParticles([
'pi+:fromPV'],
'vpho:PV', path=roe_path)
140 raveFit(
'vpho:PV', conf_level=0, constraint=
'iptube', path=roe_path)
143 PVVtxDictionary = {
'x':
'PVx',
146 'chiProb':
'PV_Pvalue',
147 'nParticlesInList(pi+:fromPV)':
'nPiPV'
149 variableToSignalSideExtraInfo(
'vpho:PV', PVVtxDictionary, path=roe_path)
150 variables.addAlias(
'PVXFit',
'extraInfo(PVx)')
151 variables.addAlias(
'PVYFit',
'extraInfo(PVy)')
152 variables.addAlias(
'PVZFit',
'extraInfo(PVz)')
153 variables.addAlias(
'PVFit_Pvalue',
'extraInfo(PV_Pvalue)')
154 variables.addAlias(
'nPiFromPV',
'extraInfo(nPiPV)')
156 pv_vars = [
'PVXFit',
'PVYFit',
'PVZFit',
'PVFit_Pvalue',
'nPiFromPV']
159 my_path.for_each(
'RestOfEvent',
'RestOfEvents', roe_path)
162 dstar_vars = vc.inv_mass + vc.mc_truth + pv_vars
164 fs_hadron_vars = vu.create_aliases_for_selected(
165 vc.pid + vc.track + vc.mc_truth,
166 'D*+ -> [D0 -> ^K- ^pi+] ^pi+')
168 d0_vars = vu.create_aliases_for_selected(
169 vc.inv_mass + vc.mc_truth,
170 'D*+ -> ^D0 pi+',
'D0')
173 output_file =
'B2A408-AllParticleCombiner.root'
175 filename=output_file, treename=
'dsttree', path=my_path)