#!/bin/bash # # argument 1: run identification number # argument 2: number of events # argument 3: pT (GeV/c)) # # An example line in the job description file could look like: # # JOB 10 $HOME/scripts/runstt.sh NULL $HOME/output 2 1000 2.0 # # Setup the environmental variables to run Panda and Fair ROOT. # For this run the config.sh in the build directory of PandaRoot. # Please set the path according to your setup # PANDAROOTHOME=$VMCWORKDIR PANDAROOTBUILD=$VMCWORKDIR/../build # source $PANDAROOTBUILD/config.sh > logfile # # Copy ROOT scripts to local path # cp $PANDAROOTHOME/macro/dc1/stt/runsim.C . cp $PANDAROOTHOME/macro/dc1/stt/runreco.C . cp $PANDAROOTHOME/macro/dc1/stt/all.par . # # Run the scripts # root -l -b -q "runsim.C($2,$3,$1)" >> logfile 2>&1 root -l -b -q "runreco.C" >> logfile 2>&1 # # Validate the output and return the appropiate value # for ofile in "logfile" "runsim.C" "runreco.C" "all.par" "points_sttmvdemc.root" "tracks_sttmvdemc.root" "testparams.root" ; do [ -f $ofile ] || error="$error $ofile doesn't exist,"; done for message in "Segmentation violation" "Segmentation fault" "Abort" "Bus error" "Floating point exception" "root: command not found" "cp: cannot stat" "Error opening Input file" ; do grep -i "$message" logfile && error="$error and $message" done # # Success # if [ -z "$error" ] ; then exit 0 fi # # Failure # cat logfile echo " Validation failed with $error" exit -1