[Gate-users] how to generate simulation statistics, track length, in positron range simulation?

Ashok Tiwari tiwarias at yahoo.com
Fri May 11 00:14:54 CEST 2018


Dear Gate users, 

I have been trying to simulate positron range in water. I have defined a PET scanner and phantom, I filled phantom with water and put F-18 line source at the center of phantom. My simulation is running, but I was not able to get simulation statistics, track length of positron, production and stopping particle position using  the TrackLengthActor and Production and Stopping Particle Actor. 

Can anyone tell me where is the problem in my macro and how could I get that information? I am copy-pasting my code below: 

####  POSITRON RANGE CALCULATION USING GATE, SIMULATION SETUP MACRO #####

#      VISUALIZATION SETUP

#/vis/disable
#/vis/open OGLSQt
/vis/viewer/set/viewpointThetaPhi 60 60
/vis/viewer/zoom 5
/vis/drawVolume
/vis/viewer/flush
/tracking/verbose 0
/tracking/storeTrajectory 1
/vis/scene/add/trajectories


#      SET PATH TO THE MATERIAL DATABASE
/gate/geometry/setMaterialDatabase   /Users/ashoktiwari/gate/Gate/gate_v7.2/GateMaterials.db

#      WORLD DEFINITION

/gate/world/geometry/setXLength 150 cm
/gate/world/geometry/setYLength 150 cm
/gate/world/geometry/setZLength 150 cm

#       SCANNER GEOMETRY
#       CYLINDRICAL SCANNER

/gate/world/daughters/name cylindricalPET
/gate/world/daughters/insert cylinder
/gate/cylindricalPET/placement/setTranslation 0.0 0.0 0.0 cm
/gate/cylindricalPET/geometry/setRmax 100 mm
/gate/cylindricalPET/geometry/setRmin 86 mm
/gate/cylindricalPET/geometry/setHeight 18 mm
/gate/cylindricalPET/setMaterial Air
/gate/cylindricalPET/vis/forceWireframe
/gate/cylindricalPET/vis/setColor blue
/vis/viewer/zoom 3

#       FIRST LEVEL OF THE SYSTEM

/gate/cylindricalPET/daughters/name box1
/gate/cylindricalPET/daughters/insert box
/gate/box1/placement/setTranslation 91.0 0.0 0.0 mm
/gate/box1/geometry/setXLength  10.0 mm
/gate/box1/geometry/setYLength 17.75 mm
/gate/box1/geometry/setZLength 17.75 mm
/gate/box1/setMaterial Air
/gate/box1/vis/setColor yellow
/gate/cylindricalPET/vis/forceWireframe

#       CRYSTAL

/gate/box1/daughters/name box2
/gate/box1/daughters/insert box
/gate/box2/geometry/setXLength  10. mm
/gate/box2/geometry/setYLength 2.0 mm
/gate/box2/geometry/setZLength 2.0 mm
/gate/box2/setMaterial Air
/gate/box2/vis/setColor red
/gate/box2/vis/forceWireframe
/vis/viewer/zoom 4
/vis/viewer/panTo 60 -40 mm

#        REPEAT CRYSTAL
/gate/box2/repeaters/insert cubicArray
/gate/box2/cubicArray/setRepeatNumberX 1
/gate/box2/cubicArray/setRepeatNumberY 8
/gate/box2/cubicArray/setRepeatNumberZ 8
/gate/box2/cubicArray/setRepeatVector 0.0 2.25 2.25 mm

#       REPEAT R-SECTOR
/gate/box1/repeaters/insert ring
/gate/box1/ring/setRepeatNumber 30
/vis/viewer/zoom 0.25
/vis/viewer/panTo 0 0 mm


#      ATTACH SYSTEM
/gate/systems/cylindricalPET/rsector/attach box1
/gate/systems/cylindricalPET/module/attach box2

/gate/box2/attachCrystalSD
/gate/systems/cylindricalPET/describe


#        PHANTOM  DEFINITION (my_phantom)
/gate/world/daughters/name my_phantom
/gate/world/daughters/insert cylinder
/gate/my_phantom/setMaterial Water
/gate/my_phantom/geometry/setRmax 20. mm
/gate/my_phantom/geometry/setHeight 40. mm
/gate/my_phantom/vis/forceSolid
/gate/my_phantom/vis/setColor grey
/gate/my_phantom/attachPhantomSD

#         PHYSICS Process involved in Positron emission from F-18 source:
# addProcess Radioactive decay or Positron annihilation?

/gate/physics/addProcess PhotoElectric
/gate/physics/processes/PhotoElectric/setModel StandardModel

/gate/physics/addProcess Compton
/gate/physics/processes/Compton/setModel StandardModel

/gate/physics/addProcess RayleighScattering
/gate/physics/processes/RayleighScattering/setModel LivermoreModel

/gate/physics/addProcess ElectronIonisation
/gate/physics/processes/ElectronIonisation/setModel StandardModel e+
/gate/physics/processes/ElectronIonisation/setModel StandardModel e-

/gate/physics/addProcess Bremsstrahlung
/gate/physics/processes/Bremsstrahlung/setModel StandardModel e+
/gate/physics/processes/Bremsstrahlung/setModel StandardModel e-

/gate/physics/addProcess PositronAnnihilation


/gate/physics/addProcess eMultipleScattering
/gate/physics/processes/eMultipleScattering/setGeometricalStepLimiterType e- distanceToBoundary
/gate/physics/processes/eMultipleScattering/setGeometricalStepLimiterType e+ distanceToBoundary

/gate/physics/addProcess RadioactiveDecay
/gate/physics/processList Enabled
/gate/physics/processList Initialized

# ELECTROMAGNETIC OPTIONS
/gate/physics/setEMin 0.1 keV
/gate/physics/setEMax 1 GeV

# CUTS for particle in Water phantom cylinder

/gate/physics/SetMaxStepSizeInRegion my_phantom 1 mm

#/gate/physics/Gamma/SetCutInRegion 2 mm
#/gate/physics/Electron/SetCutInRegion 2 mm
#/gate/physics/Positron/SetCutInRegion 10 mm
#/gate/physics/Proton/SetCutInRegion 2 mm


#       I N I T I A L I Z E
/gate/run/initialize

#       D I G I T I Z E R
/gate/digitizer/Singles/insert                          adder
/gate/digitizer/Singles/insert                          readout
/gate/digitizer/Singles/readout/setDepth                1
/gate/digitizer/Singles/insert                          blurring
/gate/digitizer/Singles/blurring/setResolution          0.00
/gate/digitizer/Singles/blurring/setEnergyOfReference   511 keV
/gate/digitizer/Singles/insert                          thresholder
/gate/digitizer/Singles/thresholder/setThreshold        5 keV
/gate/digitizer/Singles/insert                          upholder
/gate/digitizer/Singles/upholder/setUphold              3000 keV


#       S O U R C E
# Take F-18 in water, put water inside the phantom and source is placed
# at the center of the phantom.
# POSITRON EMISSION SOURCE (F18-LineSource)

/gate/source/addSource F18LineSource
/gate/source/F18LineSource/setActivity 100000. becquerel
/gate/source/F18LineSource/gps/particle e+
#/gate/source/F18LineSource/gps/ion 9 18 0 0

/gate/source/F18LineSource/setForcedUnstableFlag true
/gate/source/F18LineSource/setForcedHalfLife 6586.2 s
/gate/source/F18LineSource/gps/energytype Fluor18
/gate/source/F18LineSource/gps/type Volume
/gate/source/F18LineSource/gps/shape Sphere
/gate/source/F18LineSource/gps/radius 5. mm
#/gate/source/F18LineSource/gps/halfz 30.0 mm
/gate/source/F18LineSource/gps/angtype iso
/gate/source/F18LineSource/gps/centre 0. 0. 0. cm

#Visualizing the source in the phantom:
/gate/source/F18LineSource/visualize 100 red 3

/gate/source/list


#        VERBOSITY
/gate/verbose Physic    2
/gate/verbose Cuts      0
/gate/verbose SD        2
/gate/verbose Actions   0
/gate/verbose Actor     2
/gate/verbose Step      2
/gate/verbose Error     2
/gate/verbose Warning   2
/gate/verbose Output    2
/gate/verbose Beam      0
/gate/verbose Volume    2
/gate/verbose Image     0
/gate/verbose Geometry  2
/gate/verbose Core      0
/run/verbose 2
/event/verbose 2
/tracking/verbose 2


#      ROOT OUTPUT 

/gate/output/root/enable
/gate/output/root/setFileName    Output
/gate/output/root/setRootHitFlag 1
/gate/output/root/setRootSinglesFlag 1
/gate/output/root/setRootCoincidencesFlag 1
/gate/output/root/setRootNtupleFlag 1
/gate/output/verbose 2


#       SIMULATION STATISTICS

/gate/actor/addActor SimulationStatisticActor SSA
/gate/actor/SSA/save  SSA.txt
/gate/actor/SSA/attachTo     my_phantom

#       TRACKLENGTH ACTOR

/gate/actor/addActor  TrackLengthActor  TLA
/gate/actor/TLA/save  TLA.txt
/gate/actor/TLA/setLmin 0 mm
/gate/actor/TLA/setLmax 1 cm
/gate/actor/TLA/setNumberOfBins 200
/gate/actor/TLA/attachTo     my_phantom
 
#      PRODUCTION AND STOPPING PARTICLE POSITION ACTOR
/gate/actor/addActor ProductionAndStoppingActor  PASA
/gate/actor/PASA/save         PASA.txt
/gate/actor/PASA/saveEveryNEvents 100
/gate/actor/PASA/attachTo     my_phantom
/gate/actor/PASA/setResolution 10 10 100
/gate/actor/PASA/stepHitType   post


#       Filter on particle type
#/gate/actor/MyActor/addFilter particleFilter
#/gate/actor/MyActor/particleFilter/addParticle e+


#        RANDOM number generator
/gate/random/setEngineName MersenneTwister
/gate/random/setEngineSeed 123456789
/gate/random/verbose 2


#         START SIMULATION
/gate/application/setTimeSlice     1. s
/gate/application/setTimeStart     0. s
/gate/application/setTimeStop      1. s

/gate/application/startDAQ


Thank you in advance. 

Regards, 
Ashok Tiwari
PhD student
Univ. of Iowa, Iowa city, IA



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opengatecollaboration.org/pipermail/gate-users/attachments/20180510/bee53f2e/attachment-0001.html>


More information about the Gate-users mailing list