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',
86modePi0EtaVeto =
'standardMC16rd'
87ma.writePi0EtaVeto(particleList=
'B0',
88 decayString=
'B0 -> rho0 ^gamma',
95tableName =
'Pi0VetoEfficiencySystematics_Mar2022'
98ma.addPi0VetoEfficiencySystematics(particleList=
'B0',
99 decayString=
'B0 -> rho0 ^gamma',
115stdK(
'loose', path=my_path)
116ma.reconstructDecay(
"D0:Kpi -> K-:loose pi+:loose",
"", path=my_path)
117ma.reconstructDecay(
"B+:Dpi -> anti-D0:Kpi pi+:loose",
"useCMSFrame(daughter(1,E))>1.4", path=my_path)
118ma.matchMCTruth(
"B+:Dpi", path=my_path)
119ma.buildRestOfEvent(
"B+:Dpi", path=my_path)
123ma.writePi0EtaVeto(particleList=
'B+:Dpi',
124 decayString=
'B+ -> [anti-D0 -> K+ pi-] ^pi+',
146roe_path = b2.create_path()
154deadEndPath = b2.create_path()
159ma.signalSideParticleFilter(particleList=
'B0',
162 deadEndPath=deadEndPath)
168ma.fillParticleList(decayString=
'gamma:roe',
169 cut=
'isInRestOfEvent == 1 and E > 0.050',
176ma.fillSignalSideParticleList(outputListName=
'gamma:sig',
177 decayString=
'B0 -> rho0 ^gamma',
182ma.reconstructDecay(decayString=
'pi0:veto -> gamma:sig gamma:roe',
183 cut=
'0.080 < M < 0.200',
195ma.rankByLowest(particleList=
'pi0:veto',
202ma.variableToSignalSideExtraInfo(particleList=
'pi0:veto', varToExtraInfo={
'M':
'pi0veto'}, path=roe_path)
205my_path.for_each(
'RestOfEvent',
'RestOfEvents', roe_path)
219gamma_vars = vc.cluster + \
223rho_vars = vc.cluster + \
230b_vars = vc.kinematics + \
233 vu.create_aliases_for_selected(list_of_variables=gamma_vars,
234 decay_string=
'B0 -> rho0 ^gamma') + \
235 vu.create_aliases_for_selected(list_of_variables=rho_vars,
236 decay_string=
'B0 -> ^rho0 gamma') + \
237 vu.create_aliases_for_selected(list_of_variables=pi_vars,
238 decay_string=
'B0 -> [rho0 -> ^pi+ ^pi-] gamma') + \
239 [f
'pi0Prob({modePi0EtaVeto})', f
'etaProb({modePi0EtaVeto})',
'extraInfo(pi0veto)'] + \
240 [f
'extraInfo(Pi0VetoEfficiencySystematics_{mode}{suffix}_data_MC_ratio)',
241 f
'extraInfo(Pi0VetoEfficiencySystematics_{mode}{suffix}_data_MC_uncertainty_stat)',
242 f
'extraInfo(Pi0VetoEfficiencySystematics_{mode}{suffix}_data_MC_uncertainty_sys)',
243 f
'extraInfo(Pi0VetoEfficiencySystematics_{mode}{suffix}_data_MC_uncertainty_total)',
244 f
'extraInfo(Pi0VetoEfficiencySystematics_{mode}{suffix}_threshold)']
248rootOutputFile =
"B2A306-B02RhoGamma-withPi0EtaVeto.root"
249ma.variablesToNtuple(decayString=
'B0',
251 filename=rootOutputFile,
256b2.process(my_path, calculateStatistics=
True)