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',
99pi0VetoWeightTable =
'Pi0VetoEfficiencySystematics_Mar2022_standard30'
100my_path.add_module(
'ParticleWeighting',
102 selectedDaughters=
'B0 -> rho0 ^gamma',
103 tableName=pi0VetoWeightTable)
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 + \
230pi0veto_weight_vars = [f
'extraInfo({pi0VetoWeightTable}_{name})' for name
in
231 [
'data_MC_ratio',
'data_MC_uncertainty_stat',
'data_MC_uncertainty_sys',
232 'data_MC_uncertainty_total',
'threshold']]
234b_vars = vc.kinematics + \
237 vu.create_aliases_for_selected(list_of_variables=gamma_vars,
238 decay_string=
'B0 -> rho0 ^gamma') + \
239 vu.create_aliases_for_selected(list_of_variables=rho_vars,
240 decay_string=
'B0 -> ^rho0 gamma') + \
241 vu.create_aliases_for_selected(list_of_variables=pi_vars,
242 decay_string=
'B0 -> [rho0 -> ^pi+ ^pi-] gamma') + \
243 [f
'pi0Prob({modePi0EtaVeto})', f
'etaProb({modePi0EtaVeto})',
'extraInfo(pi0veto)'] + \
244 vu.create_aliases_for_selected(list_of_variables=pi0veto_weight_vars,
245 decay_string=
'B0 -> rho0 ^gamma')
249rootOutputFile =
"B2A306-B02RhoGamma-withPi0EtaVeto.root"
250ma.variablesToNtuple(decayString=
'B0',
252 filename=rootOutputFile,
257b2.process(my_path, calculateStatistics=
True)