Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:13:08

0001 #!/usr/bin/env bash
0002 export USER="$(id -u -n)"
0003 export LOGNAME=${USER}
0004 export HOME=/sphenix/u/${LOGNAME}
0005 export MYINSTALL="$HOME/Documents/sPHENIX/install"
0006 
0007 source /opt/sphenix/core/bin/sphenix_setup.sh -n new
0008 source /opt/sphenix/core/bin/setup_local.sh $MYINSTALL
0009 
0010 exe=${1}
0011 inputJET=${2}
0012 inputJETCALO=${3}
0013 output=${4}
0014 submitDir=${5}
0015 
0016 # extract runnumber from file name
0017 file=$(basename "$inputJET")
0018 IFS='-' read -r p1 p2 p3 <<< "$file"
0019 
0020 if [[ ! -z "$_CONDOR_SCRATCH_DIR" && -d $_CONDOR_SCRATCH_DIR ]]
0021  then
0022    cd $_CONDOR_SCRATCH_DIR
0023    # transfer the input file(s)
0024    if [[ "$inputJET" =~ \.root$ ]]; then
0025      getinputfiles.pl $inputJET
0026      getinputfiles.pl $inputJETCALO
0027      run=$(echo "$p2" | sed 's/^0*//') # Remove leading zeros using sed
0028      echo "File Transferred: $(readlink -f $inputJET)"
0029      echo "File Transferred: $(readlink -f $inputJETCALO)"
0030    else
0031      getinputfiles.pl --filelist $inputJET
0032      getinputfiles.pl --filelist $inputJETCALO
0033      run=$(echo "$p3" | sed 's/^0*//' | sed 's/\.[^.]*$//') # Remove leading zeros and extension
0034    fi
0035 else
0036   echo "condor scratch NOT set"
0037   exit -1
0038 fi
0039 
0040 # print the environment - needed for debugging
0041 printenv
0042 
0043 mkdir -p $run
0044 
0045 $exe $inputJET $inputJETCALO $run/$output
0046 
0047 echo "All Done and Transferring Files Back"
0048 cp -rv $run $submitDir
0049 
0050 echo "Finished"