diff --git a/Control/CalypsoExample/Reconstruction/scripts/submit_faser_reco.sh b/Control/CalypsoExample/Reconstruction/scripts/submit_faser_reco.sh index 6ed8b55e3a32ee556710d74915d18a2637c137ad..6bb4b895732639182709dc0d237458704ddeb4fe 100755 --- a/Control/CalypsoExample/Reconstruction/scripts/submit_faser_reco.sh +++ b/Control/CalypsoExample/Reconstruction/scripts/submit_faser_reco.sh @@ -2,11 +2,12 @@ # Used with a condor file to submit to vanilla universe # # Usage: -# submit_faser_reco.sh file_path [release_directory] [working_directory] +# submit_faser_reco.sh file_path [release_directory] [working_directory] [nevents] # # file_path - full file name (with path) # release_directory - optional path to release install directory (default pwd) # working_directory - optional path to output directory location (default pwd) +# nevents - optional number of events to process (default: -1 - all) # # The release directory must already be set up # (so an unqualified asetup can set up the release properly) @@ -20,6 +21,7 @@ file_path=${1} release_directory=${2} working_directory=${3} +nevents=${4} # # Set defaults if arguments aren't provided if [ -z "$file_path" ] @@ -37,6 +39,12 @@ if [ -z "$working_directory" ] then working_directory=`pwd` fi +# +if [ -z "$nevents" ] +then + nevents="-1" +fi +# starting_directory=`pwd` # # Now extract the run number and file stem @@ -71,7 +79,7 @@ echo "Starting: $starting_directory" # # Set up the release (do this automatically)? export ATLAS_LOCAL_ROOT_BASE=/cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase -source $ATLAS_LOCAL_ROOT_BASE/user/atlasLocalSetup.sh +source ${ATLAS_LOCAL_ROOT_BASE}/user/atlasLocalSetup.sh # # Try automatic # Always go back to the starting directory in case paths are relative @@ -98,21 +106,24 @@ cd "$starting_directory" cd "$output_directory" # # Remove any previous directory if it exists -if [[ -e "$file_stem" ]]; then - echo "Remove previous directory $file_stem" - rm -rf "$file_stem" -fi +#if [[ -e "$file_stem" ]]; then +# echo "Remove previous directory $file_stem" +# rm -rf "$file_stem" +#fi # # Make run directory -mkdir "$file_stem" +if [[ -e "$file_stem" ]]; then + echo "Directory $file_stem already exists" +else + mkdir "$file_stem" +fi cd "$file_stem" # # Run job -if [ -z "$rtag" ] -then - faser_reco.py "$file_path" +if [[ -z "$rtag" ]]; then + faser_reco.py "--nevents=$nevents" "$file_path" else - faser_reco.py "--reco=$rtag" "$file_path" + faser_reco.py "--nevents=$nevents" "--reco=$rtag" "$file_path" fi # # Print out ending time