00001 00002 00003 # 00004 # Copyright: Mathieu Trocme, mathieu.trocme@gmail.com (21 september 2009) 00005 # 00006 # This software is a computer program whose purpose is to: provide a universal Hit/SD output method in Geant4 with a proper Root coupling 00007 # 00008 # This software is governed by the CeCILL license under French law and abiding by the rules of distribution of free software. 00009 # You can use, modify and/or redistribute the software under the terms of the CeCILL license as circulated by CEA, CNRS and INRIA at the following URL "http://www.cecill.info". 00010 # As a counterpart to the access to the source code and rights to copy, modify and redistribute granted by the license, users are provided only with a limited warranty and the software's author, the holder of the economic rights, and the successive licensors have only limited liability. 00011 # In this respect, the user's attention is drawn to the risks associated with loading, using, modifying and/or developing or reproducing the software by the user in light of its specific status of free software, that may mean that it is complicated to manipulate, and that also therefore means that it is reserved for developers and experienced professionals having in-depth computer knowledge. 00012 # Users are therefore encouraged to load and test the software's suitability as regards their requirements in conditions enabling the security of their systems and/or data to be ensured and, more generally, to use and operate it in the same conditions as regards security. 00013 # 00014 # The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. 00015 # 00016 00017 00018 00019 # 00020 # Program : alpharad_new.cc 00021 # Task : Simulation of the alpharad device 00022 # Location : $G4MYSIMU (See https://sbgtrac.in2p3.fr/projects/ramses/wiki/G4_MyTuto for the list of environment variables used) 00023 # Compilation : 'cd $G4MYSIMU && make -j $NPROC' or 'rm -rf $G4TMPDIR/$G4MYSIMU_DIR $G4BINDIR/$G4MYSIMU_EXE && cd $G4MYSIMU && make -j $NPROC' # export NPROC=$(cat /proc/cpuinfo | grep "processor.*:" | wc -l) 00024 # Execution : 'cd $G4BINDIR ; [ ! -a $G4MYSIMU_MAC ] && ln -s $G4MYSIMU/$G4MYSIMU_MAC ; ./$G4MYSIMU_EXE $G4MYSIMU_MAC' 00025 # Output : See $G4BINDIR/test.root, $G4BINDIR/alpharad_new.heprep.zip 00026 # Documentation : See $G4MYSIMU/doc.html 00027 # Help : http://www.lcsim.org/software/geant4/doxygen/html/classes.html 00028 # Author : Mathieu Trocme (mathieu.trocme@ires.in2p3.fr) 00029 # Date : 21 September 2009 00030 # Framework : PhD thesis, CNRS/IPHC/DRS/RAMSES, Strasbourg, France 00031 # 00032 00033 00034 # /* ****************************************************************************************************************************** 00035 00036 00037 ############################################################################################################################################ 00038 # VISUALISATION 00039 ############################################################################################################################################ 00040 00041 # Choose the driver you want. (To be used for debug purposes) 00042 00043 ## DRIVER: Any VRML player, http://cic.nist.gov/vrml/vbdetect.html 00044 # /vis/open VRML2FILE 00045 # /vis/scene/create 00046 # /vis/viewer/set/style wireframe 00047 # /vis/drawVolume 00048 # /vis/scene/endOfEventAction accumulate 00049 # /tracking/storeTrajectory 1 00050 00051 ## DRIVER: Wired3, http://www.slac.stanford.edu/~perl/HepRApp/ 00052 # /vis/open HepRepFile 00053 # /vis/scene/create 00054 # /vis/heprep/setEventNumberSuffix -000 00055 # /vis/scene/add/volume 00056 # /vis/scene/add/trajectories 00057 # /vis/scene/add/hits 00058 # /vis/sceneHandler/attach 00059 # /vis/viewer/flush 00060 # /tracking/storeTrajectory 1 00061 00062 ## DRIVER: Wired4, http://jas.freehep.org/jas3/ (differences between Wired3 and Wired4: http://wired.freehep.org/manual/Comparison.html) 00063 /vis/open HepRepXML 00064 /vis/scene/create alpharad_new.heprep.zip 00065 /vis/scene/add/volume 00066 /vis/scene/add/trajectories 00067 /vis/scene/add/hits 00068 /vis/sceneHandler/attach 00069 /vis/viewer/flush 00070 /tracking/storeTrajectory 1 00071 /vis/scene/endOfEventAction accumulate 00072 00073 00074 ############################################################################################################################################ 00075 # PHYSICS 00076 ############################################################################################################################################ 00077 00078 #################################################### 00079 # Activation/Inactivation of physics processes 00080 #################################################### 00081 00082 #/process/inactivate phot 00083 #/process/inactivate compt 00084 #/process/inactivate conv 00085 ##/process/inactivate LowEnPhotoElec # In case you'd like to use LowEnergy classes (not recommended since they are meant to be completly removed from G4) 00086 ##/process/inactivate LowEnCompton # ... 00087 ##/process/inactivate LowEnConversion # ... 00088 ##/process/inactivate LowEnRayleigh # ... 00089 ##/process/inactivate PenPhotoElec # In case you'd like to use Penelope physics 00090 ##/process/inactivate PenCompton # ... 00091 ##/process/inactivate PenConversion # ... 00092 ##/process/inactivate PenRayleigh # ... 00093 00094 #/process/inactivate msc e- 00095 #/process/inactivate eIoni e- 00096 #/process/inactivate eBrem e- 00097 ##/process/inactivate LowEnergyIoni e- # In case you'd like to use LowEnergy classes (not recommended since they are meant to be completly removed from G4) 00098 ##/process/inactivate LowEnBrem e- # ... 00099 ##/process/inactivate PenelopeIoni e- # In case you'd like to use Penelope physics 00100 ##/process/inactivate PenelopeBrem e- # ... 00101 00102 #/process/inactivate msc e+ 00103 #/process/inactivate eIoni e+ 00104 #/process/inactivate eBrem e+ 00105 #/process/inactivate annihil e+ 00106 ##/process/inactivate LowEnergyIoni e+ # In case you'd like to use LowEnergy classes (not recommended since they are meant to be completly removed from G4) 00107 ##/process/inactivate LowEnBrem e+ # ... 00108 ##/process/inactivate PenelopeIoni e+ # In case you'd like to use Penelope physics 00109 ##/process/inactivate PenelopeBrem e+ # ... 00110 ##/process/inactivate PenAnnih e+ # ... 00111 00112 ## Watch out! Only one of the following ionisation line should be uncommented 00113 ## Choose between hLowEIoni OR {ion,h}Ioni 00114 00115 /process/inactivate msc proton 00116 #/process/inactivate hLowEIoni proton # In case you'd like to use LowEnergy classes (not recommended since they are meant to be completly removed from G4) 00117 /process/inactivate hIoni proton 00118 /process/inactivate hElastic proton 00119 /process/inactivate ProtonInelastic 00120 00121 /process/inactivate msc alpha 00122 /process/inactivate hLowEIoni alpha # In case you'd like to use LowEnergy classes (not recommended since they are meant to be completly removed from G4) 00123 #/process/inactivate ionIoni alpha 00124 /process/inactivate hElastic alpha 00125 /process/inactivate AlphaInelastic 00126 00127 /process/inactivate msc GenericIon 00128 /process/inactivate hLowEIoni GenericIon # In case you'd like to use LowEnergy classes (not recommended since they are meant to be completly removed from G4) 00129 #/process/inactivate ionIoni GenericIon 00130 /process/inactivate hElastic GenericIon 00131 /process/inactivate IonInelastic 00132 00133 00134 #################################################### 00135 # EM options 00136 #################################################### 00137 00138 # See $G4SOURCE/processes/electromagnetic/utils/src/G4EnergyLossMessenger.cc) 00139 00140 #/process/eLoss/rndmStep true # default=false 00141 #/process/eLoss/fluct true 00142 #/process/eLoss/subsec true 00143 ##/process/eLoss/minsubsec 0.1 # default=?? 00144 # 00145 #/process/eLoss/StepFunction 0.20 0.1 mm # dRoverR[0;1] finalRange mm (default=0.20 1. mm) 00146 #/process/eLoss/linLossLimit 0.5 00147 # 00148 #/process/eLoss/integral true 00149 #/process/eLoss/CSDARange true 00150 #/process/em/spline true 00151 # 00152 #/process/eLoss/binsDEDX 1200 # default=120 00153 # 00154 #/process/eLoss/minKinEnergy 10. eV # default=? 00155 #/process/eLoss/maxKinEnergy 10. MeV # default=? 00156 00157 /process/eLoss/linLossLimit 1e-6 # Necessary to avoid the following effect: http://hypernews.slac.stanford.edu/HyperNews/geant4/get/phys-list/253/1/1/1/1/1/3/2/1/1/1/1.html 00158 00159 00160 #################################################### 00161 # Cuts 00162 #################################################### 00163 00164 # See TAlphaRad_PhysicsList_Messenger (which might be ) 00165 00166 /run/setCutForAGivenParticle gamma 1. mm 00167 #/run/setCutForAGivenParticle e- 10. mm # to discard electrons 00168 /run/setCutForAGivenParticle e- 1. mm 00169 /run/setCutForAGivenParticle e+ 1. mm 00170 /run/setCutForAGivenParticle proton 1. mm 00171 /run/setCutForAGivenParticle alpha 0.001 mm 00172 /run/setCutForAGivenParticle GenericIon 1. mm 00173 00174 00175 #################################################### 00176 # Checks 00177 #################################################### 00178 00179 /run/physicsModified # seems useless... 00180 00181 00182 ############################################################################################################################################ 00183 # VERBOSITY 00184 ############################################################################################################################################ 00185 00186 #/run/verbose 2 00187 #/physics/verbose 2 00188 #/process/eLoss/verbose 1 00189 #/control/verbose 2 00190 #/tracking/verbose 2 00191 #/hits/verbose 2 00192 #/event/verbose 2 00193 00194 /process/list 00195 /particle/list all 00196 00197 00198 ############################################################################################################################################ 00199 # GEOMETRY (See TAlphaRad_DetectorConstruction_Messenger.cc) 00200 ############################################################################################################################################ 00201 00202 # For a material list, see: http://www.lcsim.org/software/geant4/doxygen/html/G4NistMaterialBuilder_8cc-source.html 00203 # But WATCH OUT!!! 00204 # The following materials should not be used with LowEnergy classes: G4_ALUMINUM_OXIDE, G4_CARBON_DIOXIDE, G4_POLYETHYLENE, G4_POLYPROPYLENE, G4_SILICON_DIOXIDE, G4_WATER, G4_WATER_VAPOR, G4_GRAPHITE 00205 # http://hypernews.slac.stanford.edu/HyperNews/geant4/get/phys-list/253/1/1/1/1/1/3.html 00206 00207 00208 /setup/material/world G4_AIR 00209 #/setup/material/world G4_Galactic 00210 00211 /setup/material/source G4_Am 00212 00213 ##/setup/material/SiO2 G4_SILICON_DIOXIDE # Should not be used if you're using G4hLowEnergyIonisation!!!! 00214 #/setup/material/SiO2 G4_Galactic 00215 /setup/material/Siepi G4_Si 00216 #/setup/material/Siepi G4_Galactic 00217 00218 /setup/geometry/SourcetoDetectorDistance 20. mm 00219 /setup/geometry/source/thickness 1. mm 00220 /setup/geometry/source/radius 10. mm 00221 00222 /setup/update 00223 00224 00225 ############################################################################################################################################ 00226 # GPS (General Particle Source) 00227 ############################################################################################################################################ 00228 00229 # See http://reat.space.qinetiq.com/gps/new_gps_sum_files/gps_sum.htm 00230 00231 #################################################### 00232 # Particle 00233 #################################################### 00234 00235 /gps/particle alpha 00236 00237 00238 #################################################### 00239 # Energy distribution 00240 #################################################### 00241 00242 /gps/energy 5.5 MeV 00243 00244 #/gps/ene/type User 00245 #/gps/hist/type energy 00246 #/gps/hist/point 5.38799 0. 00247 #/gps/hist/point 5.388 0.01 00248 #/gps/hist/point 5.38801 0. 00249 #/gps/hist/point 5.44299 0. 00250 #/gps/hist/point 5.443 0.14 00251 #/gps/hist/point 5.44301 0. 00252 #/gps/hist/point 5.48599 0. 00253 #/gps/hist/point 5.486 0.85 00254 #/gps/hist/point 5.48601 0. 00255 ## 10 eV precision necessary to have Dirac like peak for 1 keV resolution histogram 00256 ## Real spectrum? Test with a surface barrier diode in vacuum! 00257 00258 # POSITION (Redefined below, see the RUN section) 00259 00260 # /gps/pos/type Point 00261 # /gps/pos/centre 0. 0. -2. cm 00262 00263 # /gps/pos/type Plane 00264 # /gps/pos/shape Square 00265 # /gps/pos/halfx 0.2 cm 00266 # /gps/pos/halfy 0.2 cm 00267 # /gps/pos/centre 0. 0. -2. cm 00268 00269 # /gps/pos/type Plane 00270 # /gps/pos/shape Annulus 00271 # /gps/pos/radius 0.3 cm 00272 # /gps/pos/inner_radius 0.2 cm 00273 # /gps/pos/centre 0. 0. -2. cm 00274 00275 # /gps/pos/type Volume 00276 # /gps/pos/shape Cylinder 00277 # /gps/pos/radius 10. mm 00278 # /gps/pos/halfz 0.1 mm 00279 # /gps/pos/centre 0. 0. -10. mm 00280 00281 00282 #################################################### 00283 # Angular distribution 00284 #################################################### 00285 00286 /gps/direction 0. 0. 1. 00287 00288 ## Uncomment the following lines to throw particles in a 10 deg cone along the +z direction 00289 00290 #/gps/direction 0. 0. 1. 00291 #/gps/ang/type iso 00292 #/gps/ang/mintheta 0. deg 00293 #/gps/ang/maxtheta 10. deg 00294 #/gps/ang/rot1 -1. 0. 0. 00295 00296 00297 #################################################### 00298 ## MISC (tips) 00299 #################################################### 00300 ## 00301 ## /gps/source/intensity 1 00302 ## /gps/particle alpha 00303 ## /gps/energy 5.5 MeV 00304 ## /gps/direction 0. 0. 1. 00305 ## /gps/pos/type Point 00306 ## /gps/pos/centre 0.3 0.3 -2 mm 00307 ## 00308 ## /gps/source/add 1 00309 ## /gps/particle gamma 00310 ## /gps/energy 59. keV 00311 ## /gps/direction 0. 0. 1. 00312 ## /gps/pos/type Point 00313 ## /gps/pos/centre 0.3 0.3 -2 mm 00314 ## 00315 ## /gps/source/multiplevertex 1 00316 ## 00317 00318 00319 ############################################################################################################################################ 00320 # RUN (Uncomment one of the following scenari) 00321 ############################################################################################################################################ 00322 00323 00324 #################################################### 00325 # Scenario 1: Air absorption / Surfacic source (Source infinitely thin -> The source geometry is not taken into account) 00326 #################################################### 00327 00328 /setup/material/world G4_AIR 00329 #/setup/material/world G4_Galactic 00330 /setup/update 00331 00332 /gps/pos/type Surface 00333 /gps/pos/shape Cylinder 00334 /gps/pos/radius 0.005 mm 00335 00336 ### for i in $(seq 4 2 34) ; do echo -e "\n/gps/pos/centre 1.280 0. -$i. mm\n/run/beamOn 100" ; done 00337 00338 #/analysis/rootfilename test_scenario1.root 00339 /analysis/rootfilename test.root 00340 /gps/pos/centre 1.280 0. -4. mm 00341 /run/beamOn 100 00342 #/control/shell mv alpharad_new.heprep.zip test_scenario1.heprep.zip 00343 00344 #/gps/pos/centre 1.280 0. -6. mm 00345 #/run/beamOn 10000 00346 # 00347 ##... 00348 # 00349 00350 00351 #################################################### 00352 # Scenario 2: Air absorption / Volumic source 00353 #################################################### 00354 00355 #/gps/pos/type Volume 00356 #/gps/pos/shape Cylinder 00357 #/setup/geometry/source/radius 1. mm 00358 #/gps/pos/radius 1. mm 00359 #/setup/geometry/source/thickness 0.010000 mm 00360 #/gps/pos/halfz 0.005000 mm 00361 #/gps/pos/confine fSource_phy 00362 #/setup/update 00363 # 00364 ### for i in $(seq 3 1 13) ; do echo -e "\n/setup/geometry/SourcetoDetectorDistance $i. mm\n/gps/pos/centre 0. 0. -$i.0005 mm\n/setup/update\n/run/beamOn 10000" ; done 00365 # 00366 #/analysis/rootfilename test_scenario2.root 00367 #/setup/geometry/SourcetoDetectorDistance 2. mm 00368 #/gps/pos/centre 0. 0. -2.000035 mm 00369 #/setup/update 00370 #/run/beamOn 100 00371 #/control/shell mv alpharad_new.heprep.zip test_scenario2.heprep.zip 00372 # 00373 ##/setup/geometry/SourcetoDetectorDistance 4. mm 00374 ##/gps/pos/centre 0. 0. -4.000035 mm 00375 ##/setup/update 00376 ##/run/beamOn 10000 00377 ## 00378 ### .... 00379 ## 00380 00381 00382 #################################################### 00383 # Scenario 3: Auto-Abs study 00384 #################################################### 00385 00386 #/gps/pos/type Volume 00387 #/gps/pos/shape Para 00388 #/setup/geometry/source/radius 5. mm 00389 #/gps/pos/halfx 0.5 mm 00390 #/gps/pos/halfy 1.5 mm 00391 # 00392 ##/setup/material/world G4_AIR 00393 #/setup/material/world G4_Galactic 00394 #/setup/material/source G4_Pb 00395 ##/setup/material/source G4_Galactic 00396 #/setup/material/SiO2 G4_Galactic # in order to only look at Si-sub (thick enough to stop most MeV particles) 00397 #/setup/material/Siepi G4_Galactic 00398 # 00399 #/analysis/rootfilename test_scenario3.root 00400 #/setup/geometry/source/thickness 0.010000 mm 00401 #/gps/pos/halfz 0.005000 mm 00402 #/setup/geometry/SourcetoDetectorDistance 1. mm 00403 #/gps/pos/centre 1.280 0. -1.005000 mm 00404 #/gps/pos/confine fSource_phy 00405 #/setup/update 00406 #/run/beamOn 100 00407 #/control/shell mv alpharad_new.heprep.zip test_scenario3.heprep.zip 00408 # 00409 ##/setup/geometry/source/thickness 0.100000 mm 00410 ##/gps/pos/halfz 0.100000 mm 00411 ##/gps/pos/centre 0. 0. -1.050000 mm 00412 ##/setup/update 00413 ##/run/beamOn 1000000 00414 ## 00415 ##/setup/geometry/source/thickness 0.010000 mm 00416 ##/gps/pos/halfz 0.010000 mm 00417 ##/gps/pos/centre 0. 0. -1.005000 mm 00418 ##/setup/update 00419 ##/run/beamOn 1000000 00420 ## 00421 ## ... *0.1 until 1 mum is reached 00422 ## 00423 00424 00425 #################################################### 00426 # MISC 00427 #################################################### 00428 00429 ##/control/shell mv *.heprep $G4MYSIMU/z_heprep/ 00430 ##/control/shell mv *.log $G4MYSIMU/z_analysis/results/ 00431 ##/control/shell mv *.root $G4MYSIMU/z_analysis/data/ 00432 00433 00434 # ****************************************************************************************************************************** */