[Gate-users] addsource

Konstantinos P. Chatzipapas konhat88 at yahoo.gr
Thu Dec 23 11:20:27 CET 2021


Hello Anes,
A first problem with your code is that /gate/run/initialize   should not be in the end. It must be before the source definition. To be accurate, before these lines: # Source 1/gate/source/addSource mySource_1

Regards,Konstantinos----------------------------------------------------- Konstantinos Chatzipapas
    Medical Physicist, Ph.D.
        University of Patras


    Στις Τετάρτη, 22 Δεκεμβρίου 2021, 08:43:15 μ.μ. EET, ο χρήστης Anes Mohammed <anes.m.s.q at gmail.com> έγραψε:  
 
 Dear Gate User's
when I implementation of the attached cod#==============================================================================================
# Visualization
#==============================================================================================
/vis/open                             OGLSQt
/vis/viewer/set/background black
/vis/drawVolume
/vis/viewer/flush
/vis/viewer/set/viewpointThetaPhi 60 30
/vis/viewer/zoom 10
/tracking/storeTrajectory             1
/vis/scene/add/trajectories
/vis/scene/endOfEventAction           accumulate -1
/vis/scene/add/axes
/gate/verbose Physic    0
/gate/verbose Cuts      0
/gate/verbose SD        0
/gate/verbose Actions   0
/gate/verbose Actor     0
/gate/verbose Step      0
/gate/verbose Error     1
/gate/verbose Warning   0
/gate/verbose Output    0
/gate/verbose Beam      0
/gate/verbose Volume    0
/gate/verbose Image     0
/gate/verbose Geometry  0
/gate/verbose Core      0

/run/verbose 0
/event/verbose 0
/tracking/verbose 0  


#==============================================================================================
# Materials
#==============================================================================================

/gate/geometry/setMaterialDatabase    data/GateMaterials.db

#==============================================================================================
# Geometry (world)
#==============================================================================================
# G E O M E T R Y
#####

# World

/gate/world/geometry/setXLength 100 cm
/gate/world/geometry/setYLength 100 cm
/gate/world/geometry/setZLength 100 cm
/gate/world/vis/setColor red
/gate/world/vis/forceWireframe
/gate/world/describe
# Scanner Head
/gate/world/daughters/name SPECThead
/gate/world/daughters/insert box
/gate/SPECThead/geometry/setXLength  7. cm
/gate/SPECThead/geometry/setYLength 21. cm
/gate/SPECThead/geometry/setZLength 30. cm
#Distance bettween SPECThead box##
/gate/SPECThead/placement/setTranslation  22.0 0. 0. cm
/gate/SPECThead/setMaterial Air

/gate/SPECThead/placement/setRotationAxis 0 0 1
/gate/SPECThead/placement/setRotationAngle 180 deg
/gate/SPECThead/vis/forceWireframe


# Shielding
/gate/SPECThead/daughters/name shielding
/gate/SPECThead/daughters/insert box
/gate/shielding/geometry/setXLength  7. cm
/gate/shielding/geometry/setYLength 21. cm
/gate/shielding/geometry/setZLength 30. cm
/gate/shielding/placement/setTranslation  0. 0. 0. cm
/gate/shielding/setMaterial Lead
/gate/shielding/vis/setColor grey
/gate/shielding/vis/forceSolid
# Collimator
/gate/SPECThead/daughters/name collimator
/gate/SPECThead/daughters/insert box
/gate/collimator/geometry/setXLength 3. cm
/gate/collimator/geometry/setYLength 19. cm
/gate/collimator/geometry/setZLength 28. cm
#the loction of collimator relative to y-axes##
/gate/collimator/placement/setTranslation  -2. 0. 0. cm
/gate/collimator/setMaterial Lead
/gate/collimator/vis/setColor red
/gate/collimator/vis/forceWireframe
/gate/collimator/describe
/gate/collimator/daughters/name hole
/gate/collimator/daughters/insert hexagone
/gate/hole/geometry/setHeight 3. cm
/gate/hole/geometry/setRadius .01 cm
/gate/hole/placement/setRotationAxis 0  0  1
/gate/hole/placement/setRotationAngle 90 deg
/gate/hole/setMaterial Air
#
# Repeat the hole in an array
##
/gate/hole/repeaters/insert cubicArray
/gate/hole/cubicArray/setRepeatNumberX 1
/gate/hole/cubicArray/setRepeatNumberY 52
/gate/hole/cubicArray/setRepeatNumberZ 44
/gate/hole/cubicArray/setRepeatVector 0. 0.36  0.624 cm
#
# Repeat these holes in a linear
##
/gate/hole/repeaters/insert linear
/gate/hole/linear/setRepeatNumber 2
/gate/hole/linear/setRepeatVector 0. 0.18 0.312 cm


# CRYSTAL
/gate/SPECThead/daughters/name crystal
/gate/SPECThead/daughters/insert box
/gate/crystal/geometry/setXLength 1. cm
/gate/crystal/geometry/setYLength  19. cm
/gate/crystal/geometry/setZLength  28. cm
/gate/crystal/placement/setTranslation  0. 0. 0. cm
/gate/crystal/setMaterial NaI
/gate/crystal/vis/setColor yellow

# BACK-COMPARTMENT
/gate/SPECThead/daughters/name compartment
/gate/SPECThead/daughters/insert box
/gate/compartment/geometry/setXLength 2.5 cm
/gate/compartment/geometry/setYLength 19. cm
/gate/compartment/geometry/setZLength 28. cm
/gate/compartment/placement/setTranslation   1.75 0. 0. cm
/gate/compartment/setMaterial Glass
/gate/compartment/vis/setColor grey

# TABLE
/gate/world/daughters/name table
/gate/world/daughters/insert box
/gate/table/geometry/setXLength 40 cm
/gate/table/geometry/setYLength 4. cm
/gate/table/geometry/setZLength 40. cm
/gate/table/placement/setRotationAxis 0 1 0
/gate/table/placement/setRotationAngle 90 deg
/gate/table/placement/setTranslation  0. -14.9 0. cm
/gate/table/setMaterial  Polystyrene
/gate/table/vis/setColor white
/gate/table/vis/forceSolid

# PHANTOM
/gate/world/daughters/name Phantom
/gate/world/daughters/insert box
/gate/Phantom/geometry/setXLength 30.  cm
/gate/Phantom/geometry/setYLength 30. cm
/gate/Phantom/geometry/setZLength 30. cm
/gate/Phantom/placement/setTranslation 0. 0. 0. cm
/gate/Phantom/setMaterial Water
/gate/Phantom/vis/setColor blue
/gate/Phantom/vis/forceWireframe
# S Y S T E M
######
/gate/systems/SPECThead/crystal/attach crystal
/gate/systems/SPECThead/describe
# S E N S I T I V E   D E T E C T O R S
/gate/crystal/attachCrystalSD

# Phantom SD
/gate/Phantom/attachPhantomSD
/gate/table/attachPhantomSD
/gate/compartment/attachPhantomSD
/gate/shielding/attachPhantomSD
/gate/SPECThead/attachPhantomSD
/gate/collimator/attachPhantomSD

#  P H Y S I C S
#####
/gate/physics/addProcess PhotoElectric
/gate/physics/processes/PhotoElectric/setModel StandardModel

/gate/physics/addProcess Compton
/gate/physics/processes/Compton/setModel PenelopeModel

/gate/physics/addProcess RayleighScattering
/gate/physics/processes/RayleighScattering/setModel PenelopeModel

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

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

/gate/physics/addProcess MultipleScattering e-

/gate/physics/processList Enabled
/gate/physics/processList Initialized

#  C U T S
#####
/gate/physics/Gamma/SetCutInRegion      SPECThead 0.1 cm
/gate/physics/Electron/SetCutInRegion   SPECThead 1.0 cm
# Source 1
/gate/source/addSource mySource_1
/gate/source/mySource_1/gps/type Volume
/gate/source/mySource_1/gps/shape Cylinder
/gate/source/mySource_1/gps/radius 0.5 mm
/gate/source/mySource_1/gps/halfz 100 mm
/gate/source/mySource_1/gps/centre 0. 0. 0. cm
/gate/source/mySource_1/gps/particle gamma
/gate/source/mySource_1/gps/energy 140. keV

#  1 MBq
#/gate/source/mySource_1/setActivity 1000000 Bq
/gate/source/mySource_1/setActivity 1 Bq
# Emission angle: isotropic
/gate/source/mySource_1/gps/angtype iso
/gate/source/list
#====================================================
#DATA OUTPUT
#===================================================
/gate/output/allowNoOutput


#=====================================================
# START BEAMS
#=====================================================


/gate/random/setEngineName MersenneTwister
/gate/random/setEngineSeed auto
#/gate/application/setTotalNumberOfPrimaries 100000
/gate/application/start




#==============================================================================================
# Initialisation
#==============================================================================================

/gate/run/initialize
#==============================================================================================
# Main program
#==============================================================================================

#/gate/output/allowNoOutput

/gate/application/setTotalNumberOfPrimaries 1
/gate/application/start
This error appear for me
***** Illegal application state </gate/source/addSource mySource_1> *****
***** Batch is interrupted!! *****
thanks for your help
_______________________________________________
Gate-users mailing list
Gate-users at lists.opengatecollaboration.org
http://lists.opengatecollaboration.org/mailman/listinfo/gate-users  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opengatecollaboration.org/pipermail/gate-users/attachments/20211223/1890fc5f/attachment-0001.html>


More information about the Gate-users mailing list