unset multiplot #set term postscript color 'Times-Roman' 14 set terminal pdf enhanced fontscale 0.75 size 6.0in, 6.0in #!rm BACKLEG_START_phase_space.dat_hist.ps outputfile = filename.'_hist.pdf' print outputfile set output outputfile #set term aqua size 400, 600 #set term x11 size 400, 600 # inputs required: filename = (phase space file), events = 'number of events in histogram' reset set key right inside samplen 1 stats filename u 10 Y_MIN=0 nturns = 100 set multiplot set size 1.,0.23 set origin 0.,0. n=100 #number of intervals scale=(events/n) if(scale == 0){scale = 1} max=100. #max value min=-100. #min value width=(max-min)/n #interval width #function used to map a value to the intervals hist(x,width)=width*floor(x/width)+width/2.0 set xrange [min:max] #set yrange [0:10] #to put an empty boundary around the #data inside an autoscaled graph. #set offset graph 0.05,0.05,0.05,0.0 set xtics min,(max-min)/10,max set boxwidth width*0.9 set style fill solid 0.5 #fillstyle set tics out nomirror #set xlabel "x[mm]" #set ylabel "Events" #count and plot unset label 1 set label 1 "x[mm]" at graph 0.05,0.8 plot filename u (hist(($4)*1.e3,width)):(1.0) smooth freq w boxes lc rgb"green" not clear print GPVAL_Y_MAX, scale Y_MAX = (floor(GPVAL_Y_MAX/scale)) * scale set ytics 0,(Y_MAX-Y_MIN)/5.,GPVAL_Y_MAX replot set origin 0.,0.23 max=50. #max value min=-50. #min value width=(max-min)/n #interval width set xrange [min:max] #set yrange [0:10] #to put an empty boundary around the #data inside an autoscaled graph. #set offset graph 0.05,0.05,0.05,0.0 set xtics min,(max-min)/10,max set boxwidth width*0.9 set style fill solid 0.5 #fillstyle set tics out nomirror #set xlabel "y[mm]" #set ylabel "Scale" #count and plot unset label 1 set label 1 "y[mm]" at graph 0.05,0.8 plot filename u (hist(($6)*1.e3,width)):(1.0) smooth freq w boxes lc rgb"green" not "y[mm]" clear scale=5 print GPVAL_Y_MAX, scale Y_MAX = (0+floor(GPVAL_Y_MAX/scale)) * scale Y_MAX = int(GPVAL_Y_MAX/scale)*scale + scale print Y_MAX, GPVAL_Y_MAX, scale set ytics 0,(Y_MAX-Y_MIN)/scale replot set origin 0.,0.46 max=1. #max value min = -1. #min value width=(max-min)/n #interval width set xrange [min:max] #set yrange [0:] #to put an empty boundary around the #data inside an autoscaled graph. #set offset graph 0.05,0.05,0.05,0.0 set xtics min,(max-min)/10,max set boxwidth width*0.9 set style fill solid 0.5 #fillstyle set tics out nomirror #set xlabel "dp/p[%]" #set ylabel "Events" #count and plot unset label 1 set label 1 "dp/p[%]" at graph 0.05,0.8 plot filename u (hist(($9)*1.e2,width)):(1.0) smooth freq w boxes lc rgb"green" not "dp/p[%]" clear Y_MAX = (0+floor(GPVAL_Y_MAX/5)) * 5 set ytics Y_MIN,(Y_MAX-Y_MIN)/5.,GPVAL_Y_MAX replot set origin 0.,0.69 set size 1.,0.3 max=200. #max value min=-200. #min value width=(max-min)/n #interval width set xrange [min:max] #set autoscale #set yrange [0:] #to put an empty boundary around the #data inside an autoscaled graph. #set offset graph 0.05,0.05,0.05,0.0 set xtics min,(max-min)/10,max set xtics min,40 set boxwidth width*0.9 set style fill solid 0.5 #fillstyle set tics out nomirror #set xlabel "t[ns]" #set ylabel "Events" #count and plot set title filename noenhanced unset label 1 set label 1 "t[ns]" at graph 0.05,0.8 plot filename u (hist(($10-STATS_mean)*1.e9,width)):(1.0) smooth freq w boxes lc rgb "green" not "t[ns]" clear xdif = (GPVAL_DATA_X_MAX-GPVAL_DATA_X_MIN)/5 #set xtics int(GPVAL_DATA_X_MIN/10)*10, int(xdif/10)*10, int(GPVAL_DATA_X_MAX/10)*10 nomirror Y_MAX = (0+floor(GPVAL_Y_MAX/10)) * 10 #set ytics Y_MIN,(Y_MAX-Y_MIN)/2.,GPVAL_Y_MAX #incr = (GPVAL_Y_MAX-GPVAL_Y_MIN)/4. #set ytics autofreq incr = Y_MAX/4 #set ytics 0,incr replot #