#!/bin/csh 

if ( $# < 1 ) then
   echo "usage: Auger2ps.csh <eps files from EventBrowser>"
   exit 1
endif 

set texName=$argv[2]

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/Auger.tex |  sed -e 's/AAA/'$1'/' > $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*.eps

exit 0

