set term eps color font "arial,10" enhanced size 12.9cm,14cm set output "g2X_compare_truncated.eps" set encoding utf8 # raw data mercury_data="cross_g2_mercury.dat" RGG_data="cross_g2_RGG_truncated.dat" # mercury_fit="g2_mercury_fitted.dat" # RGG_fit="g2_RGG_fitted_truncated.dat" symbols_color = "#008000" # gaussian(time,c,A,tau_c) = c + A * exp(-(time/tau_c)**2) set multiplot # time_offset = 160 #bin number # bin_size = 2 #ns # Mercury tau_c= 0.41013377# +/- 0.03423110 (8.35%) (init = 0.3) c= 13196.16 #(fixed) A= 2309.11674# +/- 142.642957 (6.18%) (init = 2106.84) mercury_normalisation=7.577962064180994e-05 mercury_normalisation_cross=7.784299004740641e-05 delay_mercury=10.3 g2_exp(x) = c + A/4 * exp(-abs(2*(x+delay_mercury)/tau_c)) + A/4 * exp(-abs(2*(x-delay_mercury)/tau_c)) set samples 10000 mercury_lower_yrange = 0.98 mercury_higher_yrange = 1.07 mercury_lower_y2range = mercury_lower_yrange/mercury_normalisation_cross mercury_higher_y2range = mercury_higher_yrange/mercury_normalisation_cross set size 1,0.5 set origin 0,0.5 #set title "30.0 mA" set xrange [-15:15] set yrange [mercury_lower_yrange:mercury_higher_yrange] set ytics nomirror #set style histogram clustered set bars large set label 1 "(a) Hg lamp" at graph 0, 1.05 set ylabel "g^{(2X)}({/Symbol t})" set xlabel "time difference {/Symbol t} (ns)" set ytics 0.98,0.02,1.07 format "%.2f" set y2tics nomirror 13000,500,136000 format "%.0f" set y2label "coincidences" set y2range [mercury_lower_y2range:mercury_higher_y2range] # set label 1 "30.0mA" at -285,0.55 # plot mercury_data using 1:3:(sqrt($2)/$2*$3) with yerrorbars linestyle 1 ps 0 linetype rgb symbols_color notitle, mercury_fit using 1:3 smooth with lines linetype rgb "#000000" notitle plot mercury_data using 1:3:(sqrt($2)/$2*$3) with yerrorbars linestyle 1 lw 2 ps 0 linetype rgb symbols_color notitle, g2_exp(x)*mercury_normalisation with lines lw 2 linetype rgb "#000000" notitle # RGG tau_c_2= 164.683048 #+/- 1.92348684 (1.17%) (init = 150) # tau_0= 0.19277236 +/- 1.39295275 (722.59%) (init = 9) c_2= 12998.2 #(fixed) A_2= 11298.4858 #+/- 128.866152 (1.14%) (init = 11713.8) RGG_normalisation=7.693373732507077e-05 RGG_normalisation_cross=7.693866588627859e-05 delay_RGG=2.2#.225 gaussian_2(x) = c_2 + A_2/4 * exp(-((x+delay_RGG)/(0.001*tau_c_2))**2) + A_2/4 * exp(-((x-delay_RGG)/(0.001*tau_c_2))**2) set samples 1000 RGG_lower_yrange = 0.95 RGG_higher_yrange = 1.3 RGG_lower_y2range = RGG_lower_yrange/RGG_normalisation_cross RGG_higher_y2range = RGG_higher_yrange/RGG_normalisation_cross unset label 1 set size 1,0.5 set origin 0,0 #set title "38.4 mA" set yrange [RGG_lower_yrange:RGG_higher_yrange] set xrange [-3.3:3.3] set label 2 "(b) RGG" at graph 0, 1.05 set ylabel "g^{(2X)}({/Symbol t})" set xlabel "time difference {/Symbol t} ({/Symbol m}s)" set ytics 0.9,0.1,1.3 format "%.2f" set y2tics nomirror 10000,2000,18000 format "%.0f" set y2label "coincidences" set y2range [RGG_lower_y2range:RGG_higher_y2range] # set label 1 "38.4mA" at -285,0.55 plot RGG_data using ($1/1000):3:(sqrt($2)/$2*$3) with yerrorbars linestyle 1 lw 2 pointsize 0 linetype rgb "#FF0000" notitle,gaussian_2(x)*RGG_normalisation with lines lw 2 linetype rgb "#000000" notitle unset multiplot