3 # This is the script used to apply reduce_icarus.C to all the Icarus CAFs. This
4 # takes a very long time, so we (ab)use a 64 core machine. This is definitely
5 # not the best way to write this macro, but it works well enough.
7 if [ `hostname -
s` != sbndbuild02 ]
9 echo This script is explicitly designed to run \(cheekily\) on sbndbuild02. It
runs 64 processes
in parallel. If you run it on
a machine with fewer than 64 cores you
are likely to have
a bad time.
13 INDIR=/
pnfs/icarus/persistent/users/icaruspro/SBNworkshopApril2021/CAF/corsika_nue_BNB/
14 OUTDIR=/
pnfs/sbn/persistent/analysis/CAF/202106PAC/workshop_SBNWorkshop0421_prodoverlay_corsika_cosmics_cosmics_proton_genie_nu_spill_gsimple-config_caf_icarus/reduced_cafs/
18 for vi
in '0 1 2 3' '4 5 6 7' '8 9 a b' 'c d e f'
22 for j
in `seq 0 9`
a b c d
e f
25 # macro, which makes
a big mess
and fails when 64 copies
do it all
27 # never clean them up... naughty).
29 cp $MACRODIR/reduce_icarus.C .
30 cafe -bq reduce_icarus.C $INDIR/
$i/$j/
'*.root' $OUTDIR/${i}_${j}_x.caf.root &
33 wait # Wait
for all 64
jobs to finish before starting
the next batch
void wait(std::chrono::milliseconds dur)
esac done echo Signal files are
then echo fcl sbnd_project sbnd_project sbnd_project sbnd_project production production runs
return match has_match and(match.match_pdg==11 or match.match_pdg==-11)
then echo Work directory not specified exit fi echo Work directory
if &&[-z"$BASH_VERSION"] then echo Attempting to switch to bash bash shellSwitch exit fi &&["$1"= 'shellSwitch'] shift declare a IncludeDirectives for Dir in
then echo File list $list not found else cat $list while read file do echo $file sed s