All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
reduce_all_icarus.sh
Go to the documentation of this file.
1 #!/bin/bash
2 
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.
6 
7 if [ `hostname -s` != sbndbuild02 ]
8 then
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.
10  exit 1
11 fi
12 
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/
15 
16 MACRODIR=`pwd`
17 
18 for vi in '0 1 2 3' '4 5 6 7' '8 9 a b' 'c d e f'
19 do
20  for i in $vi
21  do
22  for j in `seq 0 9` a b c d e f
23  do
24  # ROOT generates temporary files in the same directory as the
25  # macro, which makes a big mess and fails when 64 copies do it all
26  # at once. Have each process work in a seperate directory (and
27  # never clean them up... naughty).
28  cd `mktemp -d`
29  cp $MACRODIR/reduce_icarus.C .
30  cafe -bq reduce_icarus.C $INDIR/$i/$j/'*.root' $OUTDIR/${i}_${j}_x.caf.root &
31  done
32  done
33  wait # Wait for all 64 jobs to finish before starting the next batch
34 done
void wait(std::chrono::milliseconds dur)
then OUTDIR
esac done echo Signal files are
Definition: TrainMVA.sh:25
then echo fcl sbnd_project sbnd_project sbnd_project sbnd_project production production runs
#define the
process_name gaushit a
return match has_match and(match.match_pdg==11 or match.match_pdg==-11)
then shift fi
do cd
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
Definition: file_to_url.sh:60
do i e
do echo $i
Definition: TrainMVA.sh:30
pnfs
Definition: file_to_url.sh:60