Changeset 9585 for trunk/MagicSoft/Mars/datacenter/scripts/runcorsika
- Timestamp:
- 06/11/10 17:36:11 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/scripts/runcorsika
r9355 r9585 18 18 # 19 19 # 20 # Author(s): Daniela Dorner 05/2007 <mailto:d orner@astro.uni-wuerzburg.de>21 # 22 # Copyright: MAGIC Software Development, 2000-20 0820 # Author(s): Daniela Dorner 05/2007 <mailto:daniela.dorner@unige.ch> 21 # 22 # Copyright: MAGIC Software Development, 2000-2010 23 23 # 24 24 # … … 31 31 printprocesslog "INFO starting $0" 32 32 program=corsika 33 column=fCorsikaFileAvail 33 step=Corsika 34 34 35 35 set -C … … 41 41 { 42 42 # Run number 43 echo "RUNNR "$ corsikarunno43 echo "RUNNR "$file 44 44 # Starting event number 45 45 echo "EVTNR 1" … … 60 60 echo "FIXCHI "$startalt 61 61 # Observation level, magnetic field, atmosphere 62 echo "OBSLEV 2200.E2"62 echo "OBSLEV "$obslev".E2" 63 63 # From www.noaa.gov/geomagmodels roughly for January 2009. (was 29.5 and 23.0) 64 64 # MAGNET BX BZ (BX is the horizontal component (muT) to the x-direction of 65 65 # the detector, BZ is the vertical component (muT) downwards) 66 echo "MAGNET 30.3 24.1"66 echo "MAGNET "$magnet 67 67 # Rotation angle between array x-direction and magnetic north direction 68 68 # positive if array x-direction points to the west 69 echo "ARRANG -7.0"69 echo "ARRANG "$magnetrot 70 70 # Atmosphere (model, true/false for atmospheric refraction of cer-photons) 71 71 # Atmosphere read from atmprof11.dat 72 72 # My current understanding is that only refraction (bending of light 73 73 # but no absorption of photons is taken into account) setting T. 74 echo "ATMOSPHERE 11 T" 74 echo "ATMOSPHERE "$atm" T" 75 76 # Current boundaries in reflector program 77 # echo "ATMLAY 400000 1000000 4000000 10000000" 78 79 # Boundaries as determined by CORSIKA 80 # Until we can read the result from the corsika fit we fix the 81 # values which come out of the fit. This is not ideal but forces 82 # things to be consistent. Be careful is using a different model - 83 # the fit might not be ideal. 84 echo "ATMLAY 775000 1650000 5000000 10500000" 85 75 86 # Other parameters 76 87 echo "RADNKG 200.E2" … … 82 93 # Enable muon multiple scattering 83 94 echo "MUMULT T" 84 # Cherenkov telescope options 85 echo "CWAVLG 290. 600." 86 echo "CSCAT "$reuse" 0. "$impactmax 95 # Wavelength range (was originally 600) 96 echo "CWAVLG "$wavelengths 97 # MMCS 98 echo "CSCAT 1 0. "$impactmax 99 # CORSIKA 100 # echo "CSCAT "$reuse" "$impactmax" 0." 87 101 echo "CERSIZ 1." 102 # Write Cherenkov photons to cer-file 88 103 echo "CERFIL T" 104 # Number of telescopes 89 105 echo "CERTEL 1" 90 echo " 0. 0. 0. 0. 0. "$diameter" 1700." 106 # MMCS 107 echo " 0. 0. 0. 0. 0. "$diameter" "$diameter 108 # CORSIKA (x, y, z, r) 109 # echo "TELESCOPE 0. 0. 0. "$diameter 110 # This keyword has no relevance but allows to store the 111 # maximum simulated impact parameter. The "magic" is that 112 # ceres interpretes the third and fourth argument as 113 # maximum simulated impact if they are identical and 114 # the other four arguments are 1 115 # echo "CERARY 1 1 "$diameter" "$diameter" 1 1" 91 116 # How the longitudinal shower development is sampled 92 117 # echo "LONGI T 10. T F" … … 103 128 # Output path 104 129 echo "DIRECT "$outpath 105 # User and host (for convinience) 130 # DIRECT /dev/null 131 # TELFIL filename 132 # TELFIL | gzip 133 # TELESCOPE X Y Z R 134 # User and host (for convenience) 106 135 echo "USER "`whoami` 107 136 echo "HOST "`hostname` … … 114 143 gettodo "1" 115 144 run=${primaries[0]} 116 # get corsika runno 117 query="SELECT fCorsikaRunNumber FROM MCRunData where fMCRunNumber="$run 118 # to be changed later again, when additional tables are available 119 #corsikarunno=`sendquery` 120 corsikarunno=$run 145 file=${primaries[1]} 121 146 122 147 # lock sequ 123 lockfile=$lockpath/lock-$ table-$column-$corsikarunno.txt148 lockfile=$lockpath/lock-$step-$run.$file.txt 124 149 checklock 125 150 126 printprocesslog "INFO starting $program for run $run "151 printprocesslog "INFO starting $program for run $run and file $file" 127 152 128 153 setstatus "start" 129 154 130 printprocesslog "INFO run $program for run $run "131 printprocesslog "INFO create input card ..."155 printprocesslog "INFO run $program for run $run and file $file" 156 printprocesslog "INFO create input card for run $run and file $file" 132 157 133 158 # get values for inputcard 134 query="SELECT fParticleTypeKEY FROM MCCorsikaRunData where fCorsikaRunNumber="$corsikarunno159 query="SELECT fParticleTypeKEY FROM CorsikaInfo WHERE fRunNumber=$run AND fFileNumber=$file" 135 160 primparticle=`sendquery` 136 query="SELECT fEnergyMin, fEnergyMax FROM MCCorsikaRunData where fCorsikaRunNumber="$corsikarunno161 query="SELECT fEnergyMin, fEnergyMax FROM CorsikaInfo WHERE fRunNumber=$run AND fFileNumber=$file" 137 162 erange=`sendquery` 138 query="SELECT fNumEvents FROM MCCorsikaRunData where fCorsikaRunNumber="$corsikarunno163 query="SELECT fNumEvents FROM CorsikaInfo WHERE fRunNumber=$run AND fFileNumber=$file" 139 164 numevts=`sendquery` 140 query="SELECT fEnergySlope FROM MCCorsikaRunData where fCorsikaRunNumber="$corsikarunno165 query="SELECT fEnergySlope FROM CorsikaInfo WHERE fRunNumber=$run AND fFileNumber=$file" 141 166 slope=`sendquery` 142 query="SELECT fZenithDistanceMin, fZenithDistanceMax FROM MCCorsikaRunData where fCorsikaRunNumber="$corsikarunno167 query="SELECT fZenithDistanceMin, fZenithDistanceMax FROM CorsikaInfo WHERE fRunNumber=$run AND fFileNumber=$file" 143 168 zdrange=`sendquery` 144 169 # Change from the MARS definition (Az=90 -> East) to Corsika (Az=90 -> West) 145 query="SELECT 180-fAzimuthMin, 180-fAzimuthMax FROM MCCorsikaRunData where fCorsikaRunNumber="$corsikarunno170 query="SELECT 180-fAzimuthMin, 180-fAzimuthMax FROM CorsikaInfo WHERE fRunNumber=$run AND fFileNumber=$file" 146 171 azrange=`sendquery` 147 query="SELECT DATE_FORMAT(fRunStart, '%Y/%m/%d') FROM MCCorsikaRunData where fCorsikaRunNumber="$corsikarunno 148 date=`sendquery` 149 outpath=$mcpath"/"$program"/"$date 150 query="SELECT fCorsikaSeed FROM MCCorsikaRunData where fCorsikaRunNumber="$corsikarunno 172 query="SELECT fCorsikaSeed1 FROM CorsikaInfo WHERE fRunNumber=$run AND fFileNumber=$file" 151 173 seed1=`sendquery` 152 query="SELECT fCorsikaSeed +1 FROM MCCorsikaRunData where fCorsikaRunNumber="$corsikarunno174 query="SELECT fCorsikaSeed2 FROM CorsikaInfo WHERE fRunNumber=$run AND fFileNumber=$file" 153 175 seed2=`sendquery` 154 query="SELECT fCorsikaSeed +2 FROM MCCorsikaRunData where fCorsikaRunNumber="$corsikarunno176 query="SELECT fCorsikaSeed3 FROM CorsikaInfo WHERE fRunNumber=$run AND fFileNumber=$file" 155 177 seed3=`sendquery` 156 query="SELECT fImpactMax FROM MCCorsikaRunData where fCorsikaRunNumber="$corsikarunno178 query="SELECT fImpactMax FROM CorsikaInfo WHERE fRunNumber=$run AND fFileNumber=$file" 157 179 impactmax=`sendquery` 158 query="SELECT fViewConeMax FROM MCCorsikaRunData where fCorsikaRunNumber="$corsikarunno180 query="SELECT fViewConeMax FROM CorsikaInfo WHERE fRunNumber=$run AND fFileNumber=$file" 159 181 viewconemax=`sendquery` 160 query="SELECT fNumReUseShower FROM MCCorsikaRunData where fCorsikaRunNumber="$corsikarunno 161 reuse=`sendquery` 162 query="SELECT fStartingAltitude FROM MCCorsikaRunData where fCorsikaRunNumber="$corsikarunno 182 query="SELECT fStartingAltitude FROM CorsikaInfo WHERE fRunNumber=$run AND fFileNumber=$file" 163 183 startalt=`sendquery` 164 query="SELECT fMirrorDiameter FROM MCCorsikaRunData where fCorsikaRunNumber="$corsikarunno184 query="SELECT fMirrorDiameter FROM CorsikaInfo WHERE fRunNumber=$run AND fFileNumber=$file" 165 185 diameter=`sendquery` 166 167 logfile=$outpath/$program"-"`printf %06d $corsikarunno`".log" 186 query="SELECT fAtmosphericModelKEY FROM CorsikaInfo WHERE fRunNumber=$run AND fFileNumber=$file" 187 atm=`sendquery` 188 query="SELECT fObsLevel FROM CorsikaInfo LEFT JOIN Observatory USING(fObservatoryKEY) WHERE fRunNumber=$run AND fFileNumber=$file" 189 obslev=`sendquery` 190 query="SELECT fMagnetBX, fMagnetBZ FROM CorsikaInfo LEFT JOIN Observatory USING(fObservatoryKEY) WHERE fRunNumber=$run AND fFileNumber=$file" 191 magnet=`sendquery` 192 query="SELECT fMagnetRotation FROM CorsikaInfo LEFT JOIN Observatory USING(fObservatoryKEY) WHERE fRunNumber=$run AND fFileNumber=$file" 193 magnetrot=`sendquery` 194 query="SELECT fWavelengthMin, fWavelengthMax FROM CorsikaInfo WHERE fRunNumber=$run AND fFileNumber=$file" 195 wavelengths=`sendquery` 196 197 outpath=$mcpath"/"$program"/"`printf %08d $run | cut -c 0-4`/`printf %08d $run | cut -c 5-8` 168 198 makedir $outpath 199 logfile=$outpath/cer000`printf %06d $file | cut -c 4-6`".log" 169 200 170 201 cd $corsikapath 171 202 172 echo "INPUTCARD:" >| $logfile 2>&1 173 printinputcard >> $logfile 2>&1 174 echo "" >> $logfile 2>&1 175 echo "" >> $logfile 2>&1 176 printinputcard | ./cc6501p-linux >> $logfile 2>&1 177 178 rm -f $outpath/dat`printf %06d $corsikarunno` 203 printinputcard | ./cc6501p-linux >| $logfile 2>&1 179 204 180 205 check1=$? 181 182 206 case $check1 in 183 0) printprocesslog "INFO $program finished successfully for corsika run number $corsikarunno(check1=$check1)"207 0) printprocesslog "INFO $program finished successfully for run $run file $file (check1=$check1)" 184 208 ;; 185 *) printprocesslog "ERROR $program failed for corsika run number $corsikarunno(check1=$check1)"209 *) printprocesslog "ERROR $program failed for run $run file $file (check1=$check1)" 186 210 com=$Fcorsika 187 211 check=$check1 … … 189 213 esac 190 214 215 # removing empty datnnnnnn file 216 rm -f $outpath/dat`printf %06d $file` 217 191 218 setstatus "stop" 192 219
Note:
See TracChangeset
for help on using the changeset viewer.