rwgt_job.sh
Go to the documentation of this file.
1 #! /bin/bash
2 
3 echo "PPFX_DIR= $PPFX_DIR"
4 cd $PPFX_DIR
5 source ./setup.sh
6 echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
7 
8 echo "_CONDOR_SCRATCH_DIR=$_CONDOR_SCRATCH_DIR"
9 cd $_CONDOR_SCRATCH_DIR
10 
11 #echo "ELOW= $ELOW"
12 #echo "EHIH= $EHIGH"
13 echo "OUTFILE= $OUTFILE"
14 echo "INFILES= $INFILES"
15 #echo "INU= $INU"
16 #echo "CUTMIPP= $CUTMIPP"
17 #echo "CUTNA49= $CUTNA49"
18 
19 echo "Now preparing to copy files"
20 echo "ls of the local working directory:"
21 echo ls -l ./
22 
23 echo "cat of the input file list:"
24 cat $CONDOR_DIR_INPUT/rwgt_file_list.txt
25 
26 #echo "List of INFILES"
27 #ls $INFILES
28 
29 #mkdir inputs
30 #ifdh cp -D $INFILES $_CONDOR_SCRATCH_DIR/inputs
31 echo "Making an inputs subdirectory and copying into it"
32 mkdir inputs
33 
34 ifdh cp -f $CONDOR_DIR_INPUT/rwgt_file_list.txt
35 
36 for f in `cat rwgt_file_list.txt`; do
37  echo "copying $f"
38  ifdh cp $f ./inputs
39 done
40 
41 
42 echo "List of the inputs subdirectory=$_CONDOR_SCRATCH_DIR/inputs"
43 echo "The list follows: "
44 echo ls -l $_CONDOR_SCRATCH_DIR/inputs
45 
46 #$PPFX_DIR/bin/CreateIMapHists $OUTFILE "inputs/*.root" $ELOW $EHIGH $INU $CUTNA49 $CUTMIPP #The actual comand we are executing
47 
48 for f in `ls $_CONDOR_SCRATCH_DIR/inputs/*.root`; do
49  FOUT="out_"`basename $f`
50  $PPFX_DIR/bin/doReweight_dk2nu $f $FOUT $PPFX_DIR/scripts/inputs_default.xml
51 done
52 
53 echo "ls -lh on working directory:"
54 ls -lh ./
55 echo "Copying files to $CONDOR_DIR_RWGT"
56 cp out_* $CONDOR_DIR_RWGT
57 cp $_CONDOR_SCRATCH_DIR/inputs/f_* $CONDOR_DIR_RWGT
58 
59 echo "Contents of CONDOR_DIR_RWGT=$CONDOR_DIR_RWGT are"
60 ls $CONDOR_DIR_RWGT
61 
62