

# SETING UP VISUALISATION

/vis/open OGLIX 800
/vis/viewer/reset 
/vis/viewer/set/viewpointThetaPhi 60 60
/vis/viewer/zoom 1
/vis/viewer/set/style surface     
/vis/drawVolume

/tracking/storeTrajectory 1
/vis/scene/add/trajectories
/vis/scene/endOfEventAction accumulate -1

# /vis/filtering/trajectories/create/particleFilter
# /vis/filtering/trajectories/particleFilter-0/add gamma

#MATERIAL

/gate/geometry/setMaterialDatabase GateMaterials.db

# /gate/geometry/setMaterialDatabase Desktop/PROJECT/XRAYTUBE/Data/GateMaterials.db
#WORLD 
/gate/world/geometry/setXLength 80. cm
/gate/world/geometry/setYLength 80. cm
/gate/world/geometry/setZLength 80. cm
/gate/world/setMaterial Vacuum
/gate/world/vis/forceWireframe
/vis/scene/add/axes


# C R E A T I N G   A N O D E 2 #
/gate/world/daughters/name anode
/gate/world/daughters/insert box
/gate/anode/geometry/setXLength 3.5 cm
/gate/anode/geometry/setYLength 3.5 cm
/gate/anode/geometry/setZLength 1 cm
/gate/anode/setMaterial Tungsten
#/gate/anode/vis/forceSolid
/gate/anode/vis/setColor blue
#/gate/anode/placement/setTranslation 0.1  0  1.5 cm
#/gate/anode/placement/setRotationAxis -1 0 0
#/gate/anode/placement/setRotationAngle 70 deg
/gate/anode/vis/setVisible 1
/gate/anode/placement/setTranslation    0.1  15    1.5  cm
/vis/viewer/zoom 4
/gate/application/noGlobalOutput
/gate/run/enableGlobalOutput                      false
/gate/output/allowNoOutput
/gate/geometry/rebuild

/gate/physics/addPhysicsList empenelope

/gate/physics/addProcess PhotoElectric
/gate/physics/processes/PhotoElectric/setModel PenelopeModel

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

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

/gate/physics/addProcess ElectronIonisation
/gate/physics/processes/ElectronIonisation/setModel PenelopeModel


/gate/physics/addProcess Bremsstrahlung
/gate/physics/processes/Bremsstrahlung/setModel PenelopeModel


/gate/physics/processes/Bremsstrahlung/activateSplitting e- 100

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

/gate/physics/Gamma/SetCutInRegion anode 10 um

/gate/run/initialize


##### S O U R C E  B E A M #####

/gate/source/addSource electron_beam gps
/gate/source/electron_beam/gps/particle e-

# Energy
/gate/source/electron_beam/gps/ene/type Gauss
/gate/source/electron_beam/gps/ene/mono  120. keV
/gate/source/electron_beam/gps/ene/sigma 1. keV

# Geometry

/gate/source/electron_beam/gps/angtype iso
#/gate/source/electron_beam/gps/posrot1 1 0 0
#####To rotate the source geometry####
/gate/source/electron_beam/gps/posrot2 0 0 1 
####This can also rotate the geometry####   
#/gate/source/electron_beam/gps/angrot1 0 0 -1
/gate/source/electron_beam/gps/mintheta 0 deg
/gate/source/electron_beam/gps/maxtheta 180 deg
/gate/source/electron_beam/gps/minphi 90 deg
/gate/source/electron_beam/gps/maxphi 90 deg
/gate/source/electron_beam/gps/type Plane
#/gate/source/electron_beam/gps/type Point
/gate/source/electron_beam/gps/shape Circle
/gate/source/electron_beam/gps/radius 50 micrometer

/gate/source/electron_beam/gps/centre 0.1  15 -5 cm

# START SIMULATION
#==============================

/gate/random/setEngineName MersenneTwister
/gate/random/setEngineSeed 123456789

#   M E A S U R E M E N T   S E T T I N G S   
#=====================================================#

#/gate/application/setTimeSlice   1 s
#/gate/application/setTimeStart   0 s
#/gate/application/setTimeStop    1 s


/gate/source/electron_beam/visualize 1 yellow 10 mm


/gate/application/setTotalNumberOfPrimaries 1e3
# /gate/application/setTotalNumberOfPrimaries 1e3



/gate/physics/displayCuts

# /gate/application/startDAQ



