#!/bin/sh num_events=$1 simtype=$2 output_file=$3 iseed1=$4 type=$5 home=/work/halla/e93027/brash/geant_gep/ hbook_dir=$home mkdir -p $type rm -f 'error_'$type rm -f 'espace_batch_'$type rm -f 'jsub_file_'$type rm -f 'output_'$type echo $output_file > $type/geant_hbookname.dat # Write the gffgo.dat file echo 'LIST ! This is an example to test PISA interactively' > $type/gffgo.dat echo 'CUTS .010 .010 .05 .05 .05 .010 .010 1.e+4 1.e+4 .01 7.e-8 !track thresh' >> $type/gffgo.dat echo 'GEOM 1 01 06 1 06 ! Y/N INIT ! Int med ! Ext med ! Geom Print ! Hall med' >> $type/gffgo.dat echo 'RNDM '$iseed1 >> $type/gffgo.dat echo 'SWIT 0 2' >> $type/gffgo.dat echo 'ANNI 0' >> $type/gffgo.dat echo 'BREM 0' >> $type/gffgo.dat echo 'COMP 0' >> $type/gffgo.dat echo 'DRAY 0' >> $type/gffgo.dat echo 'LOSS 2' >> $type/gffgo.dat echo 'MULS 1' >> $type/gffgo.dat echo 'HADR 1' >> $type/gffgo.dat echo 'PAIR 0' >> $type/gffgo.dat echo 'PHOT 0' >> $type/gffgo.dat echo 'DCAY 0' >> $type/gffgo.dat echo 'TRIG 500' >> $type/gffgo.dat echo 'END' >> $type/gffgo.dat # #### Writes file espace_batch_#### # # echo '#!/bin/sh' > geant_gep3_batch_$type echo 'export LD_LIBRARY_PATH=/apps/lib:$LD_LIBRARY_PATH' > geant_gep3_batch_$type # echo 'env > env_output' >> geant_gep3_batch_$type # echo 'env | grep LD_LIBRARY_PATH > env_output2' >> geant_gep3_batch_$type echo $home'/bin/'$simtype 2>error_'$type' >output_'$type' << EOF' >> geant_gep3_batch_$type echo '0' >> geant_gep3_batch_$type echo 'trig '$num_events >> geant_gep3_batch_$type echo 'exit' >> geant_gep3_batch_$type echo 'EOF' >> geant_gep3_batch_$type echo 'cp error_'$type $home'/' >> geant_gep3_batch_$type echo 'cp output_'$type $home'/' >> geant_gep3_batch_$type # echo 'cp env_output '$home'/' >> geant_gep3_batch_$type # echo 'cp env_output2 '$home'/' >> geant_gep3_batch_$type echo 'cp '$output_file' ' $hbook_dir'/' >> geant_gep3_batch_$type echo 'rm -fr '$home'/'$type >> geant_gep3_batch_$type chmod a+x geant_gep3_batch_$type # #### Writes the jsub command file # echo 'PROJECT: halla_'$exp > jsub_file_$type echo 'JOBNAME: geant_gep3_batch_'$type >> jsub_file_$type echo 'MAIL : brash@jlab.org' >> jsub_file_$type echo 'COMMAND: '$home'/geant_gep3_batch_'$type >> jsub_file_$type echo 'OS: linux' >> jsub_file_$type # echo 'QUEUE:redhat52 ' >> jsub_file_$type echo 'OTHER_FILES:' >> jsub_file_$type echo $home'/shms_forward_cosy_SSA.dat '$home'/shms_forward_cosy_LSA.dat '$home'/hrs_forward_cosy_hrsr.dat '$home'/hrs_forward_cosy_hrsl.dat '$home'/recon_cosy_refit_1.576.dat '$home'/recon_cosy.dat '$home'/forward_cosy_hms.dat '$home'/forward_cosy_sos.dat '$home'/hdr_gep.dat '$home'/geant_kinematics.dat '$home'/'$type'/gffgo.dat '$home'/'$type'/geant_hbookname.dat' >> jsub_file_$type echo 'INPUT_FILES:' >> jsub_file_$type echo 'INPUT_DATA:' >> jsub_file_$type # #### Submits the job to farms # jsub jsub_file_$type