'r_{fit} - r_{shape}: %.4f #pm %.4f' % ( t1width.getVal() - t1pdf.shapewidth, t1width.getError()), 'r_{fit}/r_{shape}: %.4f #pm %.4f' % ( t1width.getVal() / t1pdf.shapewidth, t1width.getError() / t1pdf.shapewidth), ], position=(0.2, 0.8)).draw() ## Plot fT2(t2|s,r) fitted to training data. canvases.next('t2pdf').SetGrid() t.setRange(-1, 1) t.setVal(0) t.SetTitle('log(E_{reco}^{#gamma}/E_{gen}^{#gamma})') phoScale.setVal(t2pdf.s0val) phoRes.setVal(t2pdf.r0val) t2pdf.fitTo(t2data, roo.Range(ROOT.TMath.Log(0.5), ROOT.TMath.Log(2.0))) xarange = (t2pdf.s0val - 5 * t2pdf.r0val, t2pdf.s0val + 5 * t2pdf.r0val) xarange = [math.log(1 + 0.01 * x) for x in xarange] plot = t.frame(roo.Range(*xarange)) t2data.plotOn(plot) t2pdf.plotOn(plot) plot.Draw() Latex([ 's_{shape}: %.3f %%' % t2pdf.s0val, 's_{fit}: %.3f #pm %.3f %%' % (phoScale.getVal(), phoScale.getError()), 's_{fit} - s_{shape}: %.4f #pm %.4f %%' % ( phoScale.getVal() - t2pdf.s0val, phoScale.getError() ), 'r_{shape}: %.3f %%' % t2pdf.r0val, 'r_{fit}: %.3f #pm %.3f %%' % (phoRes.getVal(), phoRes.getError()),
phoEResPdf.paramOn(plot) plot.Draw() t = w.factory('t[0,-1,1]') t.SetTitle('log(E_{reco}^{#gamma}/E_{gen}^{#gamma})') tfunc = w.factory('expr::tfunc("log(0.01 * phoERes + 1)", {phoERes})') tfunc.SetName('t') data.addColumn(tfunc) ## Build the model for log(Ereco/Egen) ft2(t2|r,s) t2pdf = LogPhoeresKeysPdf('t2pdf', 't2pdf', phoERes, t, phoScale, phoRes, data, rho=1.5) ## Fit nominal data with ft2(t2|r,s) canvases.next('t2pdf').SetGrid() t2pdf.fitTo(data, roo.Range(ROOT.TMath.Log(0.5), ROOT.TMath.Log(2.0))) plot = t.frame(roo.Range(-0.15, 0.15)) data.plotOn(plot) t2pdf.plotOn(plot) plot.Draw() Latex([ 's_{shape}: %.3f %%' % t2pdf.s0val, 's_{sfit}: %.3f #pm %.3f %%' % (phoScale.getVal(), phoScale.getError()), 's_{fit} - s_{shape}: %.4f #pm %.4f %%' % ( phoScale.getVal() - t2pdf.s0val, phoScale.getError() ), 'r_{shape}: %.3f %%' % t2pdf.r0val, 'r_{fit}: %.3f #pm %.3f %%' % (phoRes.getVal(), phoRes.getError()), 'r_{fit}/r_{shape}: %.4f #pm %.4f' % ( phoRes.getVal() / t2pdf.r0val,
canvases.next('xt1_proj_t1') t.setRange(*t1range) t.SetTitle('log(m_{#mu#mu#gamma,E_{gen}^{#gamma}}^{2} - m_{#mu#mu}^{2})') plot = t.frame() xt1data.plotOn(plot) xt1pdf.plotOn(plot) plot.Draw() ## Plot fT2(t2|s,r) fitted to training data. canvases.next('t2pdf').SetGrid() t.setRange(*t2range) t.setVal(0) t.SetTitle('log(E_{reco}^{#gamma}/E_{gen}^{#gamma})') phoScale.setVal(t2pdf.s0val) phoRes.setVal(t2pdf.r0val) t2pdf.fitTo(t2data, roo.Range(ROOT.TMath.Log(0.5), ROOT.TMath.Log(1.5))) plot = t.frame(roo.Range(-0.3, 0.3)) t2data.plotOn(plot) t2pdf.plotOn(plot) plot.Draw() Latex([ 's_{shape}: %.3f %%' % t2pdf.s0val, 's_{fit}: %.3f #pm %.3f %%' % (phoScale.getVal(), phoScale.getError()), 's_{fit} - s_{shape}: %.4f #pm %.4f %%' % ( phoScale.getVal() - t2pdf.s0val, phoScale.getError() ), 'r_{shape}: %.3f %%' % t2pdf.r0val, 'r_{fit}: %.3f #pm %.3f %%' % (phoRes.getVal(), phoRes.getError()), 'r_{fit}/r_{shape}: %.4f #pm %.4f' % ( phoRes.getVal() / t2pdf.r0val,
tfunc.SetName('t') data.addColumn(tfunc) ## Build the model for log(Ereco/Egen) ft2(t2|r,s) t2pdf = LogPhoeresKeysPdf('t2pdf', 't2pdf', phoERes, t, phoScale, phoRes, data, rho=1.5) ## Fit nominal data with ft2(t2|r,s) canvases.next('t2pdf').SetGrid() t2pdf.fitTo(data, roo.Range(ROOT.TMath.Log(0.5), ROOT.TMath.Log(2.0))) plot = t.frame(roo.Range(-0.15, 0.15)) data.plotOn(plot) t2pdf.plotOn(plot) plot.Draw() Latex([ 's_{shape}: %.3f %%' % t2pdf.s0val, 's_{sfit}: %.3f #pm %.3f %%' % (phoScale.getVal(), phoScale.getError()), 's_{fit} - s_{shape}: %.4f #pm %.4f %%' % (phoScale.getVal() - t2pdf.s0val, phoScale.getError()), 'r_{shape}: %.3f %%' % t2pdf.r0val, 'r_{fit}: %.3f #pm %.3f %%' % (phoRes.getVal(), phoRes.getError()), 'r_{fit}/r_{shape}: %.4f #pm %.4f' % (phoRes.getVal() / t2pdf.r0val, phoRes.getError() / t2pdf.r0val), ], position=(0.2, 0.75)).draw()