Warning, /geant4/examples/advanced/hadrontherapy/macro/detectorGeometry.mac is written in an unsupported language. File is not indexed.
0001 # S.E. Mazzaglia Nov 14, 2009
0002
0003 # Example macro file to show how to change geometric properties and voxelization of the phantom/detector
0004
0005 #######################
0006 # Set of the verboses #
0007 #######################
0008 #
0009 /control/verbose 1
0010 /tracking/verbose 0
0011 /run/verbose 1
0012 /event/verbose 0
0013
0014
0015 ##########################
0016 # Set of the physic models
0017 #
0018 /Physics/addPhysics HADRONTHERAPY_1
0019
0020 # Initialize geometry and physic
0021 /run/initialize
0022
0023 # Set a very high time threshold to allow all decays to happen
0024 /process/had/rdm/thresholdForVeryLongDecayTime 1.0e+60 year
0025
0026 #############################
0027 # Initialize graphic system #
0028 #############################
0029 #
0030 #/vis/scene/create
0031 #/vis/open OGL
0032 ##/vis/open ## open the default viewer
0033 /vis/viewer/flush
0034 /vis/viewer/set/viewpointThetaPhi 30 140 deg
0035 /vis/scene/add/trajectories
0036 /vis/scene/endOfEventAction accumulate -1 # this accumulate infinite tracks
0037 # zoom to phantom...
0038 /vis/viewer/panTo 1.5 0.5
0039 /vis/viewer/zoomTo 3
0040
0041 ##########################
0042 # Set here the cut and the step max for the tracking.
0043 # Suggested values of cut and step:
0044 # Set cuts OUTSIDE the detector
0045 /run/setCut 0.01 mm
0046 # Set cuts ONLY inside the detector
0047 #/run/setCutForRegion DetectorLog 0.5 mm
0048
0049 /Step/waterPhantomStepMax 0.01 mm
0050
0051 #########################
0052
0053 #########################
0054 # Set the primary particle type,
0055 # energy and position along the X direction
0056 #
0057
0058
0059 #---------------------------gps-----------------
0060 /gps/pos/shape Circle
0061 /gps/pos/centre -310. 0. 0. cm
0062 /gps/pos/radius 0. mm
0063 /gps/pos/sigma_r 2. mm
0064 /gps/particle proton
0065 /gps/pos/type Beam
0066
0067
0068 # the incident surface is in the y-z plane
0069
0070 /gps/pos/rot1 0 1 0
0071 /gps/pos/rot2 0 0 1
0072
0073 # the beam is travelling along the x-axis without any angular dispersion (angular despersion set to 0.0)
0074 #
0075
0076 /gps/ang/rot1 0 0 1
0077 /gps/ang/rot2 0 1 0
0078 /gps/ang/type beam1d
0079 /gps/ang/sigma_r 0. deg
0080
0081
0082 # the beam energy is in gaussian profile
0083 #
0084 /gps/ene/type Gauss
0085 /gps/ene/mono 62 MeV
0086 /gps/ene/sigma 0.3 MeV
0087
0088 # Copy & Paste in a new macro the previous and ONE of the following groups of commands
0089 # in order to change the Phantom & Detector geometry!
0090
0091
0092
0093
0094 ############################
0095 # Change Phantom geometry #
0096 ############################
0097 # Move Phantom 10 cm forward the default position (20, 0 , 0 cm)
0098 # Position refers to the center of the phantom box respect to the center of the World
0099 /changePhantom/position 30. 0. 0. cm
0100 /changePhantom/update
0101
0102 # Enlarge Phantom to (42, 40, 40 cm) respect to the default sizes (40, 40, 40 cm)
0103 # Null or negative parameters mean "leave it unchanged"
0104 /changePhantom/size 42. 0. 0. cm
0105 /changePhantom/update
0106 #
0107 /run/beamOn 300
0108 #
0109 ############################
0110 # Change Detector geometry #
0111 ############################
0112 # Change detector size along X dimension
0113 # "0" parameter means "leave it unchanged"
0114 /changeDetector/size 41. 0. 0. cm
0115
0116 # The following line moves the detector 1 cm forward (along the beam direction),
0117 # respect to the default position inside the phantom (0, 18, 18 cm).
0118 # Displacement parameters refer to the lower left corner of the detector respect to that of the phantom
0119 # by the point of view of the beam.
0120 # Negative parameters means "leave it unchanged"
0121 /changeDetector/displacement 1. -1. -1. cm
0122 #
0123 /run/beamOn 300
0124 #
0125 ###########################
0126 # Change Detector Voxels #
0127 ###########################
0128 #
0129 # Use the following line if you need more slabs along the X direction, leaving unchanged the other sizes
0130 # Null or negative parameters mean "leave it unchanged"
0131 /changeDetector/voxelSize 100. 0. 0. um
0132 /changePhantom/update
0133 # StepMax SHOULD not be bigger than 5% of the dose slice thickness!
0134 /Step/waterPhantomStepMax 0.005 mm
0135 #################################################################################################
0136
0137
0138 ####################################
0139 # Change Phantom/Detector geometry #
0140 ####################################
0141 ##########################################################################################
0142 # Cut & paste the following commands in order to create, starting from the default sizes,
0143 # an unique, 10 microns depth, slab in the detector,
0144 # enlarging it to fit to the phantom Y and Z sizes
0145
0146 # Set voxel size along X to 10 microns
0147 /changeDetector/voxelSize 10 0 0 um
0148 # Put detector in the lower left corner of the phantom
0149 /changeDetector/displacement 0 0 0
0150 # Resize the detector to fit voxel X size and phantom Y and Z sizes
0151 /changeDetector/size 0.01 400 400 mm
0152 # Enlarge voxel Y and Z sizes to fit to that of the phantom (in order to have a simple slab)
0153 /changeDetector/voxelSize 0 400 400 mm
0154
0155 # Optionally, fit completely the phantom to the detector
0156 /changePhantom/size 0.01 0 0 mm
0157 /changePhantom/update
0158 #########################################################################################
0159
0160 ##########################################################################################
0161 # Cut & paste the following commands in order to create, starting from the default sizes,
0162 # a full voxellized (200 by 200 by 200) detector
0163
0164
0165 /changePhantom/size 40 40 40 cm
0166 /changePhantom/position 20 0 0 cm
0167
0168
0169 /changeDetector/size 4 4 4 cm
0170 /changeDetector/voxelSize .1 40 40 mm
0171 /changeDetector/displacement 0 18 18 cm
0172 /changePhantom/update
0173
0174 /run/beamOn 300
0175 ##########################################################################################
0176