#!/bin/bash
 
elegant twiss.ele
 
elegant makeBunch.ele

elegant makeBeam.ele
 
# Track w/o RFmode
elegant track.ele

# Track w/ RFmode
elegant track_h.ele

# Plotting of bunch length and energy spread
sddsplot -layout=1,2 -join=x -col=Pass,Sdelta -col=Pass,St track.w1 -sep=1
# Plot phase space
sddsplot -col=dt,p -graph=dot -split=page -sep=page -same track.w2 -title=@Pass
# Plot energy (delta) and time (dCt) centroid
sddsplot -layout=1,2 -join=x -col=Pass,Cdelta -col=Pass,dCt track.w1 -sep=1
# Plot longitudinal histogram
sddsplot -column=dt,dtFrequency track.h1
