Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:18:28

0001 #!/bin/bash
0002 set -Euo pipefail
0003 trap 's=$?; echo "$0: Error on line "$LINENO": $BASH_COMMAND"; exit $s' ERR
0004 IFS=$'\n\t'
0005 
0006 file=${1?Specify filename}
0007 ext=${2?Specify extension}
0008 nevents=${3:-} # allow empty
0009 n_lines_per_event=${4:-} # allow empty
0010 
0011 if [[ "${ext}" =~ ^hepmc$ ]] ; then
0012   if [ -z "$(mc ls S3rw/eictest/EPIC/EVGEN/${file}.${ext}.gz)" ] ; then
0013     echo "gzip ${file}.${ext}"
0014     mc ls S3rw/eictest/EPIC/EVGEN/${file}.${ext}
0015     mc cat S3rw/eictest/EPIC/EVGEN/${file}.${ext} | gzip -c | mc pipe S3rw/eictest/EPIC/EVGEN/${file}.${ext}.gz
0016     mc ls S3rw/eictest/EPIC/EVGEN/${file}.${ext}.gz
0017   else
0018     echo "${file}.${ext}.gz already exists; change your input file to use the compressed file"
0019   fi
0020 elif [[ "${ext}" =~ ^hepmc\.gz$ ]] ; then
0021   echo "${file}.${ext} already compressed"
0022 else
0023   echo "${file}.${ext} not recognized"
0024   exit 1
0025 fi