#!/bin/bash

elegant makeBunches.ele
sddsprocess makeBunches.out -pipe=out -process=t,ave,%sAve | sddscombine -pipe -merge | sddsprocess -pipe=in makeBunches.out1 -redefine=col,t,"t tAve -",units=s
sddsprocess makeBunches.out1 makeBunches.out0 -filter=col,particleID,1,1 -redefine=col,x,0,units=m -redefine=col,y,0,units=m -redefine=col,xp,0 -redefine=col,yp,0 -redefine=col,t,0,units=s -redefine=col,p,pCentral
sddscombine makeBunches.out0 makeBunches.out1 -overwrite inputBeam.sdds
\rm makeBunches.out0 makeBunches.out1

mpiexec -np 16 Pelegant parTrack.ele

./postProcess
