3 from __future__
import division
4 from __future__
import print_function
7 from array
import array
20 def MyChi2 (npar, g, chi2, x, iflag):
22 s11 = 1./ezxsection**2/(1.-corrZEff**2)
23 s22 = 1./sysEff**2/(1.-corrZEff**2)
24 s12 = -corrZEff/(1.-corrZEff**2)/ezxsection/sysEff
30 chi2[0] = (wxsFit*(1.+effFit)-wxsection)*(wxsFit*(1.+effFit)-wxsection)/ewxsection/ewxsection
31 chi2[0] += (zxsFit-zxsection)*(zxsFit-zxsection) *s11
32 chi2[0] += effFit*effFit * s22
33 chi2[0] += 2*(zxsFit-zxsection)*effFit * s12
37 gMinuit.SetPrintLevel(-1)
38 gMinuit.SetFCN(MyChi2)
42 gMinuit.mnparm(0,
"W/Z ratio Mu", 10.0, 1.e-3, 0, 0, ier)
43 gMinuit.mnparm(1,
"Zsigma [nb] Mu", 1.0, 1.e-3, 0, 0, ier)
44 gMinuit.mnparm(2,
"DeltaEffRel Mu", 0.0, 1.e-4, 0, 0, ier)
46 arglist[0] = 1000.; arglist[1] = 0.1
47 gMinuit.mnexcm(
"MINIMIZE", arglist, 2, ier)
50 gMinuit.mnprin(3,finalChi2)
54 gMinuit.GetParameter(0,par0,errpar0)
57 print(
"\n*** Statistical uncertainty on W/Z (including eff. unc.): %.4f" % (errpar0))