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