Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-11-16 09:02:48

0001 #!/bin/bash
0002 
0003 # SPDX-License-Identifier: LGPL-3.0-or-later
0004 # Copyright (C) 2023 Christopher Dilks
0005 
0006 # get generated cross section from all hepmc files found in specified directory
0007 
0008 # settings #########################
0009 limiter=50000
0010 evgenDir=S3/eictest/ATHENA/EVGEN/DIS/NC
0011 ####################################
0012 
0013 # ensure evgenDir ends with `/` (so `mc find` results are correct)
0014 evgenDir=$evgenDir/
0015 evgenDir=$(echo $evgenDir | sed 's/\/\//\//g') # remove '//'
0016 evgenDir_esc=$(echo $evgenDir | sed 's/\//\\\//g') # replace '/' -> '\/', for sed
0017 
0018 # get list of hepmc files
0019 #mc find $evgenDir --name "*.hepmc" > evgenList.tmp
0020 mc find $evgenDir --name "*.hepmc" | grep -vE 'vtxfix|novtx' > evgenList.tmp ###### matches Brian's logfile list
0021 #mc find $evgenDir --name "*.hepmc" | grep vtxfix > evgenList.tmp    ## TODO: different cross section for `vtxfix` or `novtx`?
0022 #mc find $evgenDir --name "*.hepmc" | grep novtx > evgenList.tmp     ## only `vtxfix` is in canyonlands 2.0
0023 
0024 # cull
0025 sed -i '/2_022.hepmc/d' evgenList.tmp
0026 
0027 # pretty print the list
0028 echo "pretty print of hepmc file names:"
0029 echo "----------------------------------"
0030 cat evgenList.tmp | sed 's/^.*\///g' | sed -s 's/_/ /g'| column -t
0031 echo "----------------------------------"
0032 
0033 # loop through hepmc files
0034 while read hepmc; do
0035   echo "READ $hepmc"
0036   xsecDir=$(dirname $(echo $hepmc | sed "s/$evgenDir_esc/datarec\/xsec\//g"))
0037   outFile=$xsecDir/$(basename $hepmc).xsec
0038   mkdir -p $xsecDir
0039   echo "  outFile = $outFile"
0040   s3tools/src/get-cross-section.sh $hepmc $limiter | tee $outFile
0041 done < evgenList.tmp
0042 rm evgenList.tmp
0043 #tree datarec/xsec