for k, v in fits.items(): obs_fastfits[k].make_measurement(threads=4) # Set in the list the observables you want for the global fit. Usually same as individual fits but if it is not the case you can change the label line 130. global_fastfit = fastfit_obs('C7-C7p fit global', [Acp, Ad, S, BR]) global_fastfit.make_measurement(threads=4) # Scale x_max = 1 # Plotting the fits. You can change the confidence levels with n_sigma=(...) for i, f in enumerate(fits): fpl.likelihood_contour(obs_fastfits[f].log_likelihood, -x_max, x_max, -x_max, x_max, col=i+1, interpolation_factor=3, threads=4, steps=30, label=labels[f]) fpl.likelihood_contour(global_fastfit.log_likelihood, -x_max, x_max, -x_max, x_max, n_sigma=(1, 2), col=0, interpolation_factor=10, threads=4, steps=30, label='global') # You can set the title plt.title('') plt.xlabel(r'$\text{Re}(C_7^{\prime\,\text{NP}})$') plt.ylabel(r'$\text{Im}(C_7^\prime)$') plt.legend() plt.show()
fit_wc_function = wc_fct, input_scale = 4.8, ) fits = OrderedDict() fits['1'] = ['BR(B+->K*gamma)'] fits['2'] = ['BR(B->Xsgamma)'] fits['3'] = ['BR(B0->K*gamma)'] fits['4'] = ['BR(Bs->phigamma)'] obs_fastfits={} for k, v in fits.items(): obs_fastfits[k] = fastfit_obs('C7-C7p fit '+ k, v) for k, v in fits.items(): obs_fastfits[k].make_measurement(threads=4) x_max = .16 for i, f in enumerate(fits): fpl.likelihood_contour(obs_fastfits[f].log_likelihood, -x_max, x_max, -x_max, x_max, col=i+1, label=flavio.Observable.get_instance(fits[f][0]).tex, interpolation_factor=3, threads=4, steps=30) plt.xlabel(r'$\text{Re}(C_7^{\prime\,\text{NP}})$') plt.ylabel(r'$\text{Im}(C_7^\prime)$') plt.legend(loc=2, bbox_to_anchor=(1.05, 1)) plt.show()
#=============================== The plot =================================================== fig = plt.figure(figsize=(4, 4)) ax = plt.subplot(1, 1, 1) x_max = 0.75 plt.xlim([0.1, 1]) plt.ylim([0.5, 10]) mpl.rcParams['text.latex.preamble'] = [ r'\usepackage{amsmath}', r'\usepackage{hepunits}', r'\usepackage{mathpazo}' ] for i, f in enumerate(fits): likelihood_contour(obs_fastfits[f].log_likelihood, 0.1, 1, 0.5, 10, col=i + 1, label=labels[f], interpolation_factor=3, threads=4) likelihood_contour(global_fastfit.log_likelihood, 0.1, 1, 0.5, 10, n_sigma=(1), col=0, interpolation_factor=10, threads=4, label='global')