# 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 standard_opt3 # Electromagnetic model #/Physics/addPhysics elastic # Hadronic elastic model #/Physics/addPhysics binary # Hadronic inelastic model #/Physics/addPhysics local_ion_ion_inelastic # Hadronic inelastic model for ions (local physic list) #/Physics/addPhysics radioactive_decay # # Or alternatively: # /Physics/addPhysics QGSP_BIC_EMY /Physics/addPhysics radioactive_decay # Initialize geometry and physic /run/initialize ############################# # Initialize graphic system # ############################# # /vis/scene/create /vis/open OGL /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: # /Physics/setCuts 0.01 mm /Step/waterPhantomStepMax 0.01 mm ######################### ######################### # Set the primary particle type, # energy and position along the X direction # /gun/particle proton /beam/energy/meanEnergy 62 MeV /beam/energy/sigmaEnergy 400 keV /beam/position/Xposition -2700 mm # 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 /changeDetector/voxelSize 0 200 200 um /changeDetector/displacement 0 0 0 /changePhantom/size 4 4 4 cm /changePhantom/update ##########################################################################################