#!/bin/csh 

if ( $# < 1 ) then
   echo "usage: FdEvent2ps.csh <eye>"
   exit 1
endif 

set texName=$argv[4]
if ( -e $texName.tex ) then
  rm -f $texName.tex
endif

cat /cvmfs/auger.egi.eu/Auger_ape_SL6/offline/v2r9p3-icrc13-final/share/auger-offline/config/adst/Event.tex |  sed -e 's/AAA/'$1'/' |  sed -e 's/BBB/'$2'/' |  sed -e 's/CCC/'$3'/' > $texName.tex
latex $texName  >& /dev/null
dvips $texName -o >& /dev/null

rm -f $texName.tex
rm -f $texName.dvi
rm -f $texName.aux
rm -f $texName.log

rm -f /tmp/tmp$1_$2_$3_event_info.eps
rm -f /tmp/tmp$1_$2_$3_profile.eps
rm -f /tmp/tmp$1_$2_$3_axis.eps
rm -f /tmp/tmp$1_$2_$3_SDP.eps
