35import modularAnalysis
as ma
38from stdCharged
import stdK
41my_path = b2.create_path()
44b2.conditions.prepend_globaltag(ma.getAnalysisGlobaltag())
47ma.inputMdst(filename=b2.find_file(
'B2rhogamma_rho2pipi.root',
'examples',
False),
50ma.fillParticleList(decayString=
'gamma:highE',
53ma.fillParticleList(decayString=
'pi+:loose',
54 cut=
'abs(d0) < 0.5 and abs(z0) < 0.5 and pionID > 0.002',
59ma.reconstructDecay(decayString=
'rho0 -> pi+:loose pi-:loose',
66ma.reconstructDecay(decayString=
'B0 -> rho0 gamma:highE',
67 cut=
'5.2 < Mbc and abs(deltaE) < 2.0',
71ma.matchMCTruth(list_name=
'B0',
76ma.buildRestOfEvent(target_list_name=
'B0',
89ma.writePi0EtaVeto(particleList=
'B0',
90 decayString=
'B0 -> rho0 ^gamma',
96tableName =
'Pi0VetoEfficiencySystematics_Mar2022'
97ma.addPi0VetoEfficiencySystematics(particleList=
'B0',
98 decayString=
'B0 -> rho0 ^gamma',
114stdK(
'loose', path=my_path)
115ma.reconstructDecay(
"D0:Kpi -> K-:loose pi+:loose",
"", path=my_path)
116ma.reconstructDecay(
"B+:Dpi -> anti-D0:Kpi pi+:loose",
"useCMSFrame(daughter(1,E))>1.4", path=my_path)
117ma.matchMCTruth(
"B+:Dpi", path=my_path)
118ma.buildRestOfEvent(
"B+:Dpi", path=my_path)
122ma.writePi0EtaVeto(particleList=
'B+:Dpi',
123 decayString=
'B+ -> [anti-D0 -> K+ pi-] ^pi+',
145roe_path = b2.create_path()
153deadEndPath = b2.create_path()
158ma.signalSideParticleFilter(particleList=
'B0',
161 deadEndPath=deadEndPath)
167ma.fillParticleList(decayString=
'gamma:roe',
168 cut=
'isInRestOfEvent == 1 and E > 0.050',
175ma.fillSignalSideParticleList(outputListName=
'gamma:sig',
176 decayString=
'B0 -> rho0 ^gamma',
181ma.reconstructDecay(decayString=
'pi0:veto -> gamma:sig gamma:roe',
182 cut=
'0.080 < M < 0.200',
194ma.rankByLowest(particleList=
'pi0:veto',
201ma.variableToSignalSideExtraInfo(particleList=
'pi0:veto', varToExtraInfo={
'M':
'pi0veto'}, path=roe_path)
204my_path.for_each(
'RestOfEvent',
'RestOfEvents', roe_path)
218gamma_vars = vc.cluster + \
222rho_vars = vc.cluster + \
229b_vars = vc.kinematics + \
232 vu.create_aliases_for_selected(list_of_variables=gamma_vars,
233 decay_string=
'B0 -> rho0 ^gamma') + \
234 vu.create_aliases_for_selected(list_of_variables=rho_vars,
235 decay_string=
'B0 -> ^rho0 gamma') + \
236 vu.create_aliases_for_selected(list_of_variables=pi_vars,
237 decay_string=
'B0 -> [rho0 -> ^pi+ ^pi-] gamma') + \
238 [
'pi0Prob(standard)',
'etaProb(standard)',
'extraInfo(pi0veto)'] + \
239 [f
'extraInfo(Pi0VetoEfficiencySystematics_{mode}{suffix}_data_MC_ratio)',
240 f
'extraInfo(Pi0VetoEfficiencySystematics_{mode}{suffix}_data_MC_uncertainty_stat)',
241 f
'extraInfo(Pi0VetoEfficiencySystematics_{mode}{suffix}_data_MC_uncertainty_sys)',
242 f
'extraInfo(Pi0VetoEfficiencySystematics_{mode}{suffix}_data_MC_uncertainty_total)',
243 f
'extraInfo(Pi0VetoEfficiencySystematics_{mode}{suffix}_threshold)']
247rootOutputFile =
"B2A306-B02RhoGamma-withPi0EtaVeto.root"
248ma.variablesToNtuple(decayString=
'B0',
250 filename=rootOutputFile,