177 lines
5.2 KiB
Plaintext
177 lines
5.2 KiB
Plaintext
# S.E. Mazzaglia Nov 14, 2009
|
|
|
|
# Example macro file to show how to change geometric properties and voxelization of the phantom/detector
|
|
|
|
#######################
|
|
# Set of the verboses #
|
|
#######################
|
|
#
|
|
/control/verbose 1
|
|
/tracking/verbose 0
|
|
/run/verbose 1
|
|
/event/verbose 0
|
|
|
|
|
|
##########################
|
|
# Set of the physic models
|
|
#
|
|
/Physics/addPhysics HADRONTHERAPY_1
|
|
|
|
# Initialize geometry and physic
|
|
/run/initialize
|
|
|
|
# Set a very high time threshold to allow all decays to happen
|
|
/process/had/rdm/thresholdForVeryLongDecayTime 1.0e+60 year
|
|
|
|
#############################
|
|
# Initialize graphic system #
|
|
#############################
|
|
#
|
|
#/vis/scene/create
|
|
#/vis/open OGL
|
|
##/vis/open ## open the default viewer
|
|
/vis/viewer/flush
|
|
/vis/viewer/set/viewpointThetaPhi 30 140 deg
|
|
/vis/scene/add/trajectories
|
|
/vis/scene/endOfEventAction accumulate -1 # this accumulate infinite tracks
|
|
# zoom to phantom...
|
|
/vis/viewer/panTo 1.5 0.5
|
|
/vis/viewer/zoomTo 3
|
|
|
|
##########################
|
|
# Set here the cut and the step max for the tracking.
|
|
# Suggested values of cut and step:
|
|
# Set cuts OUTSIDE the detector
|
|
/run/setCut 0.01 mm
|
|
# Set cuts ONLY inside the detector
|
|
#/run/setCutForRegion DetectorLog 0.5 mm
|
|
|
|
/Step/waterPhantomStepMax 0.01 mm
|
|
|
|
#########################
|
|
|
|
#########################
|
|
# Set the primary particle type,
|
|
# energy and position along the X direction
|
|
#
|
|
|
|
|
|
#---------------------------gps-----------------
|
|
/gps/pos/shape Circle
|
|
/gps/pos/centre -310. 0. 0. cm
|
|
/gps/pos/radius 0. mm
|
|
/gps/pos/sigma_r 2. mm
|
|
/gps/particle proton
|
|
/gps/pos/type Beam
|
|
|
|
|
|
# the incident surface is in the y-z plane
|
|
|
|
/gps/pos/rot1 0 1 0
|
|
/gps/pos/rot2 0 0 1
|
|
|
|
# the beam is travelling along the x-axis without any angular dispersion (angular despersion set to 0.0)
|
|
#
|
|
|
|
/gps/ang/rot1 0 0 1
|
|
/gps/ang/rot2 0 1 0
|
|
/gps/ang/type beam1d
|
|
/gps/ang/sigma_r 0. deg
|
|
|
|
|
|
# the beam energy is in gaussian profile
|
|
#
|
|
/gps/ene/type Gauss
|
|
/gps/ene/mono 62 MeV
|
|
/gps/ene/sigma 0.3 MeV
|
|
|
|
# Copy & Paste in a new macro the previous and ONE of the following groups of commands
|
|
# in order to change the Phantom & Detector geometry!
|
|
|
|
|
|
|
|
|
|
############################
|
|
# Change Phantom geometry #
|
|
############################
|
|
# Move Phantom 10 cm forward the default position (20, 0 , 0 cm)
|
|
# Position refers to the center of the phantom box respect to the center of the World
|
|
/changePhantom/position 30. 0. 0. cm
|
|
/changePhantom/update
|
|
|
|
# Enlarge Phantom to (42, 40, 40 cm) respect to the default sizes (40, 40, 40 cm)
|
|
# Null or negative parameters mean "leave it unchanged"
|
|
/changePhantom/size 42. 0. 0. cm
|
|
/changePhantom/update
|
|
#
|
|
/run/beamOn 300
|
|
#
|
|
############################
|
|
# Change Detector geometry #
|
|
############################
|
|
# Change detector size along X dimension
|
|
# "0" parameter means "leave it unchanged"
|
|
/changeDetector/size 41. 0. 0. cm
|
|
|
|
# The following line moves the detector 1 cm forward (along the beam direction),
|
|
# respect to the default position inside the phantom (0, 18, 18 cm).
|
|
# Displacement parameters refer to the lower left corner of the detector respect to that of the phantom
|
|
# by the point of view of the beam.
|
|
# Negative parameters means "leave it unchanged"
|
|
/changeDetector/displacement 1. -1. -1. cm
|
|
#
|
|
/run/beamOn 300
|
|
#
|
|
###########################
|
|
# Change Detector Voxels #
|
|
###########################
|
|
#
|
|
# Use the following line if you need more slabs along the X direction, leaving unchanged the other sizes
|
|
# Null or negative parameters mean "leave it unchanged"
|
|
/changeDetector/voxelSize 100. 0. 0. um
|
|
/changePhantom/update
|
|
# StepMax SHOULD not be bigger than 5% of the dose slice thickness!
|
|
/Step/waterPhantomStepMax 0.005 mm
|
|
#################################################################################################
|
|
|
|
|
|
####################################
|
|
# Change Phantom/Detector geometry #
|
|
####################################
|
|
##########################################################################################
|
|
# Cut & paste the following commands in order to create, starting from the default sizes,
|
|
# an unique, 10 microns depth, slab in the detector,
|
|
# enlarging it to fit to the phantom Y and Z sizes
|
|
|
|
# Set voxel size along X to 10 microns
|
|
/changeDetector/voxelSize 10 0 0 um
|
|
# Put detector in the lower left corner of the phantom
|
|
/changeDetector/displacement 0 0 0
|
|
# Resize the detector to fit voxel X size and phantom Y and Z sizes
|
|
/changeDetector/size 0.01 400 400 mm
|
|
# Enlarge voxel Y and Z sizes to fit to that of the phantom (in order to have a simple slab)
|
|
/changeDetector/voxelSize 0 400 400 mm
|
|
|
|
# Optionally, fit completely the phantom to the detector
|
|
/changePhantom/size 0.01 0 0 mm
|
|
/changePhantom/update
|
|
#########################################################################################
|
|
|
|
##########################################################################################
|
|
# Cut & paste the following commands in order to create, starting from the default sizes,
|
|
# a full voxellized (200 by 200 by 200) detector
|
|
|
|
|
|
/changePhantom/size 40 40 40 cm
|
|
/changePhantom/position 20 0 0 cm
|
|
|
|
|
|
/changeDetector/size 4 4 4 cm
|
|
/changeDetector/voxelSize .1 40 40 mm
|
|
/changeDetector/displacement 0 18 18 cm
|
|
/changePhantom/update
|
|
|
|
/run/beamOn 300
|
|
##########################################################################################
|
|
|