def mres(pion_gv, etas_gv): prior = dict() prior['mres'] = gv.gvar(0.0, 1.0) x = np.arange(len(pion_gv)) c51.scatter_plot(x, pion_gv) trange = dict() T = len(pion_gv) - 2 trange['tmin'] = [2, 2] trange['tmax'] = [T, T] pionfit = c51.fitscript(trange, pion_gv, prior, c51.mres_fitfcn, result_flag='off') print "Pion" c51.stability_plot(pionfit, 'mres', 'pion') c51.scatter_plot(x, etas_gv) etasfit = c51.fitscript(trange, etas_gv, prior, c51.mres_fitfcn, result_flag='off') print "Etas" c51.stability_plot(etasfit, 'mres', 'kaon') #print kaonfit['post'] return 0
def decay(pion_ss_ps_gv, kaon_ss_ps_gv): prior = dict() prior['Z0_s'] = gv.gvar(0.025, 0.01) prior['Z1_s'] = gv.gvar(0.025, 0.035) prior['Z2_s'] = gv.gvar(0.025, 0.035) prior['Z0_p'] = gv.gvar(0.27, 0.15) prior['Z1_p'] = gv.gvar(0.27, 0.35) prior['Z2_p'] = gv.gvar(0.27, 0.35) prior['E0'] = gv.gvar(0.23, 0.2) prior['E1'] = gv.gvar(0.0, 1.0) prior['E2'] = gv.gvar(0.0, 1.0) trange = dict() trange['tmin'] = [6, 6] trange['tmax'] = [20, 20] T = len(pion_ss_ps_gv) fitfcn = c51.fit_function(T=T, nstates=2) fit = c51.fitscript(trange, pion_ss_ps_gv, prior, fitfcn.twopt_fitfcn_ss_ps, sets=2, result_flag='off') print "pion" c51.stability_plot(fit, 'Z0_p') c51.stability_plot(fit, 'E0') ml = 0.0158 ms = 0.0902 mres_pi = gv.gvar(0.0009633, 0.0000065) Z0_p = fit['post'][0]['Z0_p'] E0 = fit['post'][0]['E0'] fpi = Z0_p * np.sqrt(2.) * (2. * ml + 2. * mres_pi) / E0**(3. / 2.) print 'fpi:', fpi print "kaon" prior['Z0_s'] = gv.gvar(0.02, 0.01) prior['Z1_s'] = gv.gvar(0.02, 0.03) prior['Z2_s'] = gv.gvar(0.02, 0.03) prior['Z0_p'] = gv.gvar(0.2, 0.1) prior['Z1_p'] = gv.gvar(0.2, 0.3) prior['Z2_p'] = gv.gvar(0.2, 0.3) prior['E0'] = gv.gvar(0.404, 0.2) prior['E1'] = gv.gvar(0.0, 1.0) prior['E2'] = gv.gvar(0.0, 1.0) fit = c51.fitscript(trange, kaon_ss_ps_gv, prior, fitfcn.twopt_fitfcn_ss_ps, sets=2, result_flag='off') c51.stability_plot(fit, 'Z0_p') c51.stability_plot(fit, 'E0') mres_kaon = gv.gvar(0.0006685, 0.0000044) Z0_p = fit['post'][0]['Z0_p'] E0 = fit['post'][0]['E0'] fk = Z0_p * np.sqrt(2.) * (ml + ms + mres_pi + mres_kaon) / E0**(3. / 2.) print 'fk:', fk fkfpi = fk / fpi print 'fk/fpi:', fkfpi
def decay(pion_ss_ps_gv, kaon_ss_ps_gv): prior = dict() prior['Z0_s'] = gv.gvar(0.025, 0.01) prior['Z1_s'] = gv.gvar(0.025, 0.035) prior['Z2_s'] = gv.gvar(0.025, 0.035) prior['Z0_p'] = gv.gvar(0.27, 0.15) prior['Z1_p'] = gv.gvar(0.27, 0.35) prior['Z2_p'] = gv.gvar(0.27, 0.35) prior['E0'] = gv.gvar(0.23, 0.2) prior['E1'] = gv.gvar(0.0, 1.0) prior['E2'] = gv.gvar(0.0, 1.0) trange = dict() trange['tmin'] = [6,6] trange['tmax'] = [20,20] T = len(pion_ss_ps_gv) fitfcn = c51.fit_function(T=T, nstates=2) fit = c51.fitscript(trange, pion_ss_ps_gv, prior, fitfcn.twopt_fitfcn_ss_ps, sets=2, result_flag='off') print "pion" c51.stability_plot(fit, 'Z0_p') c51.stability_plot(fit, 'E0') ml = 0.0158 ms = 0.0902 mres_pi = gv.gvar(0.0009633, 0.0000065) Z0_p = fit['post'][0]['Z0_p'] E0 = fit['post'][0]['E0'] fpi = Z0_p*np.sqrt(2.)*(2.*ml+2.*mres_pi)/E0**(3./2.) print 'fpi:', fpi print "kaon" prior['Z0_s'] = gv.gvar(0.02, 0.01) prior['Z1_s'] = gv.gvar(0.02, 0.03) prior['Z2_s'] = gv.gvar(0.02, 0.03) prior['Z0_p'] = gv.gvar(0.2, 0.1) prior['Z1_p'] = gv.gvar(0.2, 0.3) prior['Z2_p'] = gv.gvar(0.2, 0.3) prior['E0'] = gv.gvar(0.404, 0.2) prior['E1'] = gv.gvar(0.0, 1.0) prior['E2'] = gv.gvar(0.0, 1.0) fit = c51.fitscript(trange, kaon_ss_ps_gv, prior, fitfcn.twopt_fitfcn_ss_ps, sets=2, result_flag='off') c51.stability_plot(fit, 'Z0_p') c51.stability_plot(fit, 'E0') mres_kaon = gv.gvar(0.0006685, 0.0000044) Z0_p = fit['post'][0]['Z0_p'] E0 = fit['post'][0]['E0'] fk = Z0_p*np.sqrt(2.)*(ml+ms+mres_pi+mres_kaon)/E0**(3./2.) print 'fk:', fk fkfpi = fk/fpi print 'fk/fpi:', fkfpi
def mres(pion_gv, etas_gv): prior = dict() prior['mres'] = gv.gvar(0.0, 1.0) x = np.arange(len(pion_gv)) c51.scatter_plot(x,pion_gv) trange = dict() T = len(pion_gv)-2 trange['tmin'] = [2, 2] trange['tmax'] = [T, T] pionfit = c51.fitscript(trange, pion_gv, prior, c51.mres_fitfcn, result_flag='off') print "Pion" c51.stability_plot(pionfit,'mres','pion') c51.scatter_plot(x,etas_gv) etasfit = c51.fitscript(trange, etas_gv, prior, c51.mres_fitfcn, result_flag='off') print "Etas" c51.stability_plot(etasfit,'mres','kaon') #print kaonfit['post'] return 0
#Plot effective mass T = len(data) * 0.5 meff = c51.effective_mass(data, 1) x = np.arange(len(meff)) ylim = c51.find_yrange(meff, 1, 10) #ylim = [0.47, 0.57] xr = [1, 15] c51.scatter_plot(x, meff, 'effective mass', xlim=[xr[0], xr[1]], ylim=ylim) #ylim = c51.find_yrange(meff, 65, 79) c51.scatter_plot(x, meff, 'effective mass ps', xlim=[T + xr[0], T + xr[1]], ylim=ylim) #Fit inputs = c51.read_yaml('temp.yml') prior = c51.dict_of_tuple_to_gvar(inputs['prior']) trange = inputs['trange'] fitfcn = c51.fit_function(T, nstates=2) fit = c51.fitscript(trange, data, prior, fitfcn.twopt_fitfcn_ss_ps, sets=2, result_flag='on') c51.stability_plot(fit, 'E0') c51.stability_plot(fit, 'Z0_s') c51.stability_plot(fit, 'Z0_p') plt.show()
#datapath = 'prot_w5p6_n94' filename = 'l2464f211b600m0102m0509m635a_avg.h5' datapath = 'l2464f211b600m0102m0509m635/wf1p0_m51p2_l58_a51p5_smrw5p0_n75/spectrum/ml0p0126_ms0p0693/pion/corr' data_ss = c51.read_data(filename, datapath, 0, 0) data_ps = c51.read_data(filename, datapath, 3, 0) data = np.concatenate((data_ss, data_ps), axis=1) data = c51.make_gvars(data) #data = data_ps #Plot effective mass T = len(data)*0.5 meff = c51.effective_mass(data, 1) x = np.arange(len(meff)) ylim = c51.find_yrange(meff, 1, 10) #ylim = [0.47, 0.57] xr = [1,15] c51.scatter_plot(x, meff, 'effective mass', xlim=[xr[0],xr[1]], ylim=ylim) #ylim = c51.find_yrange(meff, 65, 79) c51.scatter_plot(x, meff, 'effective mass ps', xlim=[T+xr[0],T+xr[1]], ylim=ylim) #Fit inputs = c51.read_yaml('temp.yml') prior = c51.dict_of_tuple_to_gvar(inputs['prior']) trange = inputs['trange'] fitfcn = c51.fit_function(T, nstates=2) fit = c51.fitscript(trange, data, prior, fitfcn.twopt_fitfcn_ss_ps, sets=2, result_flag='on') c51.stability_plot(fit, 'E0') c51.stability_plot(fit, 'Z0_s') plt.show()