# gnuplot
#
# use UTF-8 encoding for special characters
set encoding utf8
# create SVG output
set terminal svg enhanced size 1000 800 fsize 14
set output 'KATRIN Spectrum.svg'
reset
# set aspect ratio to y:x = 0.8
set size ratio 0.8
# erase top and right borders (only show x- and y-axis)
set border 3
set xtics nomirror
set ytics nomirror
# set line styles for the three graphs
set style line 1 lt 1 lw 1.5 lc rgb "#cf0000"
set style line 2 lt 1 lw 1.5 lc rgb "#00cf00"
set style line 3 lt 1 lw 1.5 lc rgb "#0000cf"
## Constants
# alpha - fine-structure constant
# me - electron rest mass
# E0 - endpoint of the Tritium beta-decay spectrum
# c - speed of light
# hbar - reduced Planck constant
# GF - Fermi coupling constant
# thetaC - Cabibbo angle
# Mnuc2 - squared nuclear matrix element of Tritium beta-decay
# K - arbitrary scale factor
#
alpha = 1/137.0
me = 511.0e3
E0 = 18.6e3
#c = 2.99792458e8
#hbar = 6.58211928e-16
#GF = 1.16637e-5 * (hbar*c)**3
#thetaC = 13.4 * pi/180.0
#Mnuc2 = 5.55
#K = 1/1.31529e74
K = 1/1.03503e19
# the energy distribution for Tritium beta decay
# E - kinetic Energy
# E0 - Endpoint Energy
# me - electron rest mass
# mn - neutrino rest mass
#
#
p(E) = sqrt((E+me)**2 - me**2)
beta(E) = p(E)/(E+me)
A(E,Z) = 2*pi*alpha*(Z+1) / beta(E)
F(E,Z) = A(E,Z) / (1 - exp(-A(E,Z)))
R(E) = F(E,1) * p(E) * (E+me) * (E0-E)
N(E,mn) = K * R(E) * sqrt((E0-E)**2-mn**2)
###############################################################################
set multiplot
# first multiplot piece -------------------------------------------------------
# use full frame for this plot
set origin 0.0,0.0
set size 1.0,1.0
# put legend in upper-left corner
set key right top
# use thinner lines for both axis
set border lw 0.5
# set zero threshold
set zero 1e-2
# set x-axis parameters
set xrange [0:19]
set xtics 2
set mxtics 2
set format x "%.0f"
set xlabel "Energy [keV]"
# set y-axis parameters
set yrange [0:1]
set ytics 0.2
set mytics 2
set format y "%.0l⋅10^{%L}"
set ylabel "Intensity (count rate, arbitrary units)"
# set arrow showing the connection between the second multiplot and this graph
set arrow 1 from graph 0.64,0.10 to graph 0.85,0.03 lw 1.5
# plot the graph for three neutrino masses
set samples 500
plot N(1000*x,1.0) title "m_ν = 1.0 eV" ls 1,\
N(1000*x,0.3) title "m_ν = 0.3 eV" ls 2,\
N(1000*x,0.0) title "m_ν = 0.0 eV" ls 3
# second multiplot piece ------------------------------------------------------
# use half size of the diagram and put this plot inside the first one
set origin 0.12,0.12
set size 0.52,0.52
# disable legend here
unset key
# set x-axis parameters: here we use three decimal places and no label
set xrange [18.598:18.600]
set xtics 0.001
set mxtics 4
set format x "%.3f"
set xlabel ""
# set y-axis parameters
set yrange [0:4e-8]
set ytics 1e-8
set mytics 2
set format y "%.0l⋅10^{%L}"
set ylabel ""
# disable arrow from the first multiplot
set noarrow 1
# create a distance arrow between the end-points for m=0eV and m=1eV
set arrow 11 nohead from 18.599,0.0 to 18.599,1.2e-8 lw 1
set arrow 12 nohead from 18.600,0.0 to 18.600,1.2e-8 lw 1
set arrow 13 from 18.600,1e-8 to 18.599,1e-8 lw 1
set arrow 14 from 18.599,1e-8 to 18.600,1e-8 lw 1
set label "ΔE = 1.0 eV" at 18.5995,1.2e-8 center
# replot the graph with much higher sampling
set samples 1000
replot
#------------------------------------------------------------------------------
set nomultiplot
unset output
## END OF FILE