Changeset 8637
- Timestamp:
- 07/17/07 11:13:32 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/scripts/preparemc
r8626 r8637 32 32 # 33 33 # variables, that have to be set by the user: 34 # - path directory, where the mc sequence and dataset files are stored 35 # be careful: don't move the sequence files afterwards, as the 36 # paths are stored in the datasetfiles 37 # - zdmin minimum zenith distance 38 # - zdmax maximum zenith distance 39 # - psf psf 40 # at the moment mc with psf 14 and 20 is available 41 # - modes observation mode 42 # the explanation for the modes can be found in 43 # /montecarlo/rawfiles/README.txt 44 # - numruns num of runs, that are in the sequence file, which are used 45 # for training (SequencesOn in $mcdataset) 34 # - path directory, where the mc sequence and dataset files are stored 35 # be careful: don't move the sequence files afterwards, as the 36 # paths are stored in the datasetfiles 37 # - zdmin minimum zenith distance 38 # - zdmax maximum zenith distance 39 # - psf psf (at the moment mc with psf 14 and 20 is available) 40 # - modes observation mode 41 # the explanation for the modes can be found in 42 # /magic/montecarlo/rawfiles/README.txt 43 # - numruns number of runs, that are in the sequence file, which are used 44 # for training (SequencesOn in $mcdataset) 46 45 # 47 46 # Remark: For the training of the RF for the energy estimation you need the 48 # macro trainengery.C in the path $path/macros in a modified version, i.e. the 49 # inputfile (mcdataset) and the outputfile (rf-root file) are given as 50 # options: $macrospath/trainenergy.C+\("\"$mcdataset\""\,"\"$rffile\""\) 47 # macro trainengery.C in the path $path/macros in a modified version, 48 # i.e. the inputfile (mcdataset) and the outputfile (rf-root file) 49 # are given as options: 50 # $macrospath/trainenergy.C+\("\"$mcdataset\""\,"\"$rffile\""\) 51 51 # 52 52 # Remark: You have to run the script in your Mars directory. … … 54 54 ############################################################################## 55 55 56 56 # to be set by the user 57 57 path=/home/dorner/final_analysis 58 # path where your mc sequence and dataset files are stored 58 59 mcoutpath=$path/mc 60 # path where you have your modified version of trainenergy.C 59 61 macrospath=$path/macros 60 mcdataset=$mcoutpath/mcdataset.txt 61 mcdataset2=$mcoutpath/mcdataset2.txt 62 62 63 # zenith range of your data 63 64 zdmin=17 64 zdmax=35 65 zdmax=36 66 # point spread function of your data 65 67 psf=14 66 modes=( "02" ) # nowobble 67 numruns=3 68 # observation mode of your data 69 # for explanations see /magic/montecarlo/rawfiles/README.txt 70 modes=( "02" ) 71 # number of runs which are in the sequence files used for training 72 # please adjust this number such, that you use about 30000 Events for training 73 numruns=1 74 75 76 77 78 # some checks 79 # checking if the given files and paths are existing 80 if ! [ -e $mcoutpath ] 81 then 82 echo "Your outpath for the mc $mcoutpathdoes not exist." 83 exit 84 fi 85 if ! [ -e $macrospath ] 86 then 87 echo "Your macros path $macrospath does not exist." 88 exit 89 fi 90 if ! [ -e $macrospath/trainenergy.C ] 91 then 92 echo "Your trainenergy.C does not exist in path $macrospath." 93 exit 94 fi 95 96 mcdatasettrain=$mcoutpath/mcdataset-for-training.txt 97 mcdatasetsponde=$mcoutpath/mcdataset-for-sponde.txt 68 98 69 99 # be careful with $date, when path changes … … 90 120 if [ "$runs" = "" ] 91 121 then 92 echo " no runs found for zbin $i"122 echo " No runs for zbin $i found. Please try to find some MC with zbin $i!" 93 123 continue 94 124 fi … … 110 140 trainsequfile=$mcoutpath/sequence$firstrunno.txt 111 141 trainsequences[$j]=$firstrunno 112 echo " writing train-sequfile "$trainsequfile142 # echo " writing train-sequfile "$trainsequfile 113 143 echo "Sequence: $firstrun" > $trainsequfile 114 144 echo "Night: $date" >> $trainsequfile … … 141 171 echo "# train sequences: ${#trainsequences[@]}" 142 172 143 echo "AnalysisNumber: 1 " > $mcdataset 144 echo "" >> $mcdataset 145 echo "SequencesOn: ${trainsequences[@]}" >> $mcdataset 146 echo "" >> $mcdataset 147 echo "SequencesOff: ${testsequences[@]}" >> $mcdataset 148 echo "" >> $mcdataset 149 echo "" >> $mcdataset 150 151 echo "AnalysisNumber: 1 " > $mcdataset 2152 echo "" >> $mcdataset 2153 echo "SequencesOn: ${testsequences[@]}" >> $mcdataset 2154 echo "" >> $mcdataset 2155 echo "" >> $mcdataset 2173 echo "AnalysisNumber: 1 " > $mcdatasettrain 174 echo "" >> $mcdatasettrain 175 echo "SequencesOn: ${trainsequences[@]}" >> $mcdatasettrain 176 echo "" >> $mcdatasettrain 177 echo "SequencesOff: ${testsequences[@]}" >> $mcdatasettrain 178 echo "" >> $mcdatasettrain 179 echo "" >> $mcdatasettrain 180 181 echo "AnalysisNumber: 1 " > $mcdatasetsponde 182 echo "" >> $mcdatasetsponde 183 echo "SequencesOn: ${testsequences[@]}" >> $mcdatasetsponde 184 echo "" >> $mcdatasetsponde 185 echo "" >> $mcdatasetsponde 156 186 157 187 for (( i=0 ; i < ${#testsequences[@]} ; i++ )) … … 159 189 numtrain=${trainsequences[$i]} 160 190 notrain=`echo $numtrain | cut -c 0-4` 161 echo "Sequence$numtrain.File: $mcoutpath/sequence$numtrain.txt" >> $mcdataset 162 echo "Sequence$numtrain.Dir: $mcpath/star/$notrain/$numtrain" >> $mcdataset 163 echo "Sequence$numtrain.File: $mcoutpath/sequence$numtrain.txt" >> $mcdataset2 164 echo "Sequence$numtrain.Dir: $mcpath/star/$notrain/$numtrain" >> $mcdataset2 191 echo "Sequence$numtrain.File: $mcoutpath/sequence$numtrain.txt" >> $mcdatasettrain 192 echo "Sequence$numtrain.Dir: $mcpath/star/$notrain/$numtrain" >> $mcdatasettrain 165 193 166 194 numtest=${testsequences[$i]} 167 195 notest=`echo $numtest | cut -c 0-4` 168 echo "Sequence$numtest.File: $mcoutpath/sequence$numtest.txt" >> $mcdataset 169 echo "Sequence$numtest.Dir: $mcpath/star/$notrain/$numtrain" >> $mcdataset 170 echo "Sequence$numtest.File: $mcoutpath/sequence$numtest.txt" >> $mcdataset 2171 echo "Sequence$numtest.Dir: $mcpath/star/$notrain/$numtrain" >> $mcdataset 2196 echo "Sequence$numtest.File: $mcoutpath/sequence$numtest.txt" >> $mcdatasettrain 197 echo "Sequence$numtest.Dir: $mcpath/star/$notrain/$numtrain" >> $mcdatasettrain 198 echo "Sequence$numtest.File: $mcoutpath/sequence$numtest.txt" >> $mcdatasetsponde 199 echo "Sequence$numtest.Dir: $mcpath/star/$notrain/$numtrain" >> $mcdatasetsponde 172 200 done 173 201 174 202 203 # train the rf for energy estimation 175 204 logfile=$mcoutpath/trainenergy.log 176 205 rffile=$mcoutpath/rf-energy.root 177 206 178 echo "mcdataset: $mcdataset" 179 echo "rffile: $rffile" 180 echo "macrospath: $macrospath" 181 root -q -b $macrospath/trainenergy.C+\("\"$mcdataset\""\,"\"$rffile\""\) | tee $logfile 182 207 echo "Your mcdataset for training: $mcdatasettrain" 208 echo "Your rffile: $rffile" 209 echo "" 210 echo "Training the RF..." 211 root -q -b $macrospath/trainenergy.C+\("\"$mcdatasettrain\""\,"\"$rffile\""\) | tee $logfile 212 213 echo "" 214 echo "Please use rf-file $rffile in your sponde.rc, in case you want to use the RF energy estimator there. "
Note:
See TracChangeset
for help on using the changeset viewer.