Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-06-26 07:06:06

0001 #!/bin/bash
0002 
0003 # SPDX-License-Identifier: LGPL-3.0-or-later
0004 # Copyright (C) 2023 Christopher Dilks
0005 
0006 # runs Delphes in a loop over all files in the directories specified in $*
0007 # - optionally runs multi-threaded: one thread per directory
0008 # - assumes input is `datagen/_____` and will output to `datarec/_____`
0009 
0010 inputs=$*
0011 
0012 function status { echo ""; echo "[+] $1"; }
0013 
0014 status "running Delphes (one thread per directory)"
0015 function runDelphes { 
0016   echo "delphes log: " > $1/delphes.log
0017   for infile in $1/*.hepmc{,.gz}; do 
0018     if [ ! -f "$infile" ]; then continue; fi
0019     echo "RUN DELPHES ON $infile" >> $1/delphes.log
0020     deps/run_delphes.sh $infile 2>&1 >> $1/delphes.log
0021   done
0022   status "DONE running Delphes on directory $1"
0023 }
0024 
0025 for input in $inputs; do
0026   status "RUNNING DELPHES on files in $input"
0027   runDelphes $input & # comment out `&` if you want to run single threaded
0028 done
0029 
0030 status "WAIT FOR DELPHES"
0031 echo "  - quit by running: while [ 1 ]; do pkill DelphesHepMC3; done"
0032 echo "  - monitor progress in log files in another window with:"
0033 echo "    find $genDir -name \"delphes.log\" | xargs tail -F"
0034 wait
0035 status "DONE RUNNING DELPHES"