Changeset 8227 for trunk/MagicSoft/Mars/scripts/preparemc
- Timestamp:
- 12/13/06 11:29:22 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/scripts/preparemc
r8206 r8227 33 33 # 34 34 # variables, that have to be set by the user: 35 # - dir directory, where the mc sequence and dataset files are stored 36 # be careful: don't move the sequence files afterwards, as the 37 # paths are stored in the datasetfiles 38 # - mars directory, where your Mars version is stored 39 # only needed, if you want to create a rf-root-file for the 40 # energy estimation 41 # - sourcefile directory, where your Mars version is stored 42 # only needed, if you want to create a rf-root-file for the 43 # energy estimation 44 # be careful, you also have to set the mars path in sourcefile 45 # - zdmin minimum zenith distance 46 # - zdmax maximum zenith distance 47 # - psf psf 48 # at the moment mc with psf 14 and 20 is available 49 # - modes observation mode 50 # the explanation for the modes can be found in 51 # /montecarlo/rawfiles/README.txt 52 # - numruns num of runs, that are in the sequence file, which are used for 53 # training (SequencesOn in $mcdataset) 35 # - dir directory, where the mc sequence and dataset files are stored 36 # be careful: don't move the sequence files afterwards, as the 37 # paths are stored in the datasetfiles 38 # - mars directory, where your Mars version is stored 39 # only needed, if you want to create a rf-root-file for the 40 # energy estimation 41 # - zdmin minimum zenith distance 42 # - zdmax maximum zenith distance 43 # - psf psf 44 # at the moment mc with psf 14 and 20 is available 45 # - modes observation mode 46 # the explanation for the modes can be found in 47 # /montecarlo/rawfiles/README.txt 48 # - numruns num of runs, that are in the sequence file, which are used 49 # for training (SequencesOn in $mcdataset) 50 # - trainenergy if set to 'yes', the rf for energy estimation is trained 54 51 # 55 # If you want to create a rf-root-file for the energy estimation, you have to56 # comment out the 'exit' before the last lines of the script.57 52 # 58 53 ############################################################################## 59 60 #function to create directory61 function makedir()62 {63 if [ ! -d $@ ]64 then65 mkdir -pv $@66 if [ ! -d $@ ]67 then68 echo "could not make dir "$@69 exit70 fi71 fi72 }73 54 74 55 75 56 76 57 #to be set by the user 77 dir=/home/ operator/mc78 mars=/home/ operator/Mars.cvs79 zdmin= 980 zdmax= 5158 dir=/home/dorner/crabspectrum 59 mars=/home/dorner/mars.cvs 60 zdmin=5 61 zdmax=35 81 62 psf=14 82 63 modes=( "02" "04" ) # e.g. nowobble 83 64 numruns=5 65 # set here if you want to train a rf-engery-estimator 66 #trainenergy= 67 trainenergy="yes" 84 68 85 makedir $dir86 69 87 #needed if not set in .bashrc or when script is e.g. executed in cronjob 88 export ROOTSYS=/opt/root_v5.12.00f 89 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ROOTSYS/lib 90 export PATH=$PATH:$ROOTSYS/bin 70 # begin of script 71 datasetdir=$dir/datasets 72 sequencedir=$dir/sequences 73 setupdir=$dir/setup 74 mcdir=/magic/montecarlo 75 mcrawdir=$mcdir/rawfiles 76 mcstardir=$mcdir/star 77 mcdataset=$datasetdir/mcdataset-test-train.txt 78 mcdataset2=$datasetdir/mcdataset-for-sponde.txt 91 79 92 mcdir=/magic/montecarlo/rawfiles 93 mcdataset=$dir/mcdataset-test-train.txt 94 mcdataset2=$dir/mcdataset-for-ganymed.txt 80 # make directories 81 mkdir -pv $dir 82 mkdir -v $sequencedir 83 mkdir -v $datasetdir 95 84 96 85 #calculation of the zbin … … 110 99 zbin=`printf %02d $i` 111 100 echo "zbin: $zbin" 112 path=$mc dir/19$zbin/$mode/$psf101 path=$mcrawdir/19$zbin/$mode/$psf 113 102 runsforfirst= 114 103 … … 130 119 unset runs[$k] 131 120 done 132 date=`echo $path | cut -c 22-31 | sed -e 's/\//-/g'` 121 mcrawdir2=`echo $mcrawdir | sed -e 's/\//\\\\\//g'` 122 date=`echo $path | sed -e "s/$mcrawdir2\///" -e 's/\//-/g'` 123 # date=`echo $path | cut -c 22-31 | sed -e 's/\//-/g'` 133 124 134 trainsequfile=$ dir/sequence$firstrunno.txt125 trainsequfile=$sequencedir/sequence$firstrunno.txt 135 126 trainsequences[$j]=$firstrunno 136 127 echo " writing train-sequfile "$trainsequfile … … 143 134 echo "" >> $trainsequfile 144 135 145 testsequfile=$ dir/sequence$secondrunno.txt136 testsequfile=$sequencedir/sequence$secondrunno.txt 146 137 testsequences[$j]=$secondrunno 147 138 echo " writing test-sequfile "$testsequfile … … 157 148 done 158 149 done 150 159 151 160 152 echo "# test sequences: ${#testsequences[@]}" … … 181 173 numtrain=${trainsequences[$i]} 182 174 notrain=`echo $numtrain | cut -c 0-4` 183 echo "Sequence$numtrain.File: $ dir/sequence$numtrain.txt" >> $mcdataset184 echo "Sequence$numtrain.Dir: /montecarlo/star/$notrain/$numtrain" >> $mcdataset185 echo "Sequence$numtrain.File: $ dir/sequence$numtrain.txt" >> $mcdataset2186 echo "Sequence$numtrain.Dir: /montecarlo/star/$notrain/$numtrain" >> $mcdataset2175 echo "Sequence$numtrain.File: $sequencedir/sequence$numtrain.txt" >> $mcdataset 176 echo "Sequence$numtrain.Dir: $mcstardir/$notrain/$numtrain" >> $mcdataset 177 echo "Sequence$numtrain.File: $sequencedir/sequence$numtrain.txt" >> $mcdataset2 178 echo "Sequence$numtrain.Dir: $mcstardir/$notrain/$numtrain" >> $mcdataset2 187 179 188 180 numtest=${testsequences[$i]} 189 181 notest=`echo $numtest | cut -c 0-4` 190 echo "Sequence$numtest.File: $ dir/sequence$numtest.txt" >> $mcdataset191 echo "Sequence$numtest.Dir: /montecarlo/star/$notrain/$numtrain" >> $mcdataset192 echo "Sequence$numtest.File: $ dir/sequence$numtest.txt" >> $mcdataset2193 echo "Sequence$numtest.Dir: /montecarlo/star/$notrain/$numtrain" >> $mcdataset2182 echo "Sequence$numtest.File: $sequencedir/sequence$numtest.txt" >> $mcdataset 183 echo "Sequence$numtest.Dir: $mcstardir/$notrain/$numtrain" >> $mcdataset 184 echo "Sequence$numtest.File: $sequencedir/sequence$numtest.txt" >> $mcdataset2 185 echo "Sequence$numtest.Dir: $mcstardir/$notrain/$numtrain" >> $mcdataset2 194 186 done 195 187 196 # put # before the 'exit' to create rf-root-file for energy-estimation197 exit198 188 199 echo "creating rf-root-file for energy-estimation..." 200 cd $mars 201 logfile=$dir/trainenergy.log 189 if [ "$trainenergy" == "yes" ] 190 then 191 echo "creating rf-root-file for energy-estimation..." 192 cd $mars 193 logfile=$setupdir/trainenergy.log 202 194 203 root -q -b $macrospath/trainenergy.C+\("\"$mcdataset\""\,"\"$dir/\""\) | tee $logfile204 195 root -q -b $mars/datacenter/macros/trainenergy.C+\("\"$mcdataset\""\,"\"$setupdir/\""\) | tee $logfile 196 fi
Note:
See TracChangeset
for help on using the changeset viewer.