[Gate-users] How do you get the deposited energy for each layer or crystal in a separate output/tree?
Klever, Paul
paul.klever at alumni.fh-aachen.de
Wed May 25 15:01:05 CEST 2022
Dear Users,
I am currently working on a cylindrical PET system with heterostructured scintillators. At first I am designing a one block detector and want to get a proper readout done before creating a whole scanner.
Goal of this is to simulate a couple of materials and calculate their CTRs. My problem is that eventhough I assigned the two different layers as separate sensitive detectors, I only get one root tree for the energy deposited in the singles tree.
I've tried it with one crystal for each layer, or with just one crystal for both layers. I've tried the DoseActor, but the created File seems to have as many entries as I define in the macro with the variable z in "/setResolution x y z", eventhough I dont have that many hits or singles. So I don't think thats a proper way to get the deposited energy for each layer.
There is not much to find about that topic, neither in the mailing list archive nor in the benchmarks.
I appreciate any advice.
Best regards
Paul K.
Here is my macro. I use Gate 9.1 with geant4-10-07. I've installed the precompiled version of Gate and recompiled it, to activate photons and surfaces.
# M A T E R I A L F I L E
/gate/geometry/setMaterialDatabase data/GateMaterials.db
/gate/geometry/setIonisationPotential EJ232 64.7 eV
#===============================================================
# W O R L D
/gate/world/geometry/setXLength 100. cm
/gate/world/geometry/setYLength 100. cm
/gate/world/geometry/setZLength 100. cm
#/gate/world/setMaterial Air
#==============================================================
# S Y S T E M
/gate/world/daughters/name cylindricalPET
/gate/world/daughters/systemType cylindricalPET
/gate/world/daughters/insert box
/gate/cylindricalPET/setMaterial Air
/gate/cylindricalPET/geometry/setXLength 15 mm
/gate/cylindricalPET/geometry/setYLength 2.1 mm
/gate/cylindricalPET/geometry/setZLength 3. mm
/gate/cylindricalPET/placement/setTranslation 0 0 -1.5 mm
/gate/cylindricalPET/vis/setColor gray
/gate/cylindricalPET/vis/forceWireframe
#==============================================================
# P H A N T O M
#==============================================================
# R S E C T O R
/gate/cylindricalPET/daughters/name rsector
/gate/cylindricalPET/daughters/insert box
/gate/rsector/placement/setTranslation 0 0 0 mm
/gate/rsector/geometry/setXLength 15. mm
/gate/rsector/geometry/setYLength 2.1 mm
/gate/rsector/geometry/setZLength 3. mm
/gate/rsector/vis/setColor green
/gate/rsector/vis/forceWireframe
#==============================================================
# M O D U L E
/gate/rsector/daughters/name module
/gate/rsector/daughters/insert box
/gate/module/placement/setTranslation 0 0 0 mm
/gate/module/geometry/setXLength 15. mm
/gate/module/geometry/setYLength 2.1 mm
/gate/module/geometry/setZLength 3. mm
/gate/module/vis/setColor blue
/gate/module/vis/forceWireframe
#=============================================================
# C R Y S T A L 0
/gate/module/daughters/name crystal
/gate/module/daughters/insert box
/gate/crystal/geometry/setXLength 15. mm
/gate/crystal/geometry/setYLength 2.1 mm
/gate/crystal/geometry/setZLength 3. mm
/gate/crystal/placement/setTranslation 0 0. 0 mm
/gate/crystal/setMaterial Air
/gate/crystal/vis/forceWireframe
/gate/crystal/vis/setColor yellow
/gate/crystal/vis/setVisible false
# L A Y E R 0
/gate/crystal/daughters/name LYSO
/gate/crystal/daughters/insert box
/gate/LYSO/geometry/setXLength 15. mm
/gate/LYSO/geometry/setYLength 0.1 mm
/gate/LYSO/geometry/setZLength 3. mm
/gate/LYSO/placement/setTranslation 0 0 0 mm
/gate/LYSO/setMaterial LYSO
/gate/LYSO/vis/forceSolid
/gate/LYSO/vis/setColor yellow
# L A Y E R 1
/gate/crystal/daughters/name EJ232
/gate/crystal/daughters/insert box
/gate/EJ232/geometry/setXLength 15. mm
/gate/EJ232/geometry/setYLength 0.1 mm
/gate/EJ232/geometry/setZLength 3. mm
/gate/EJ232/placement/setTranslation 0 0 0 mm
/gate/EJ232/setMaterial EJ232
/gate/EJ232/vis/forceSolid
/gate/EJ232/vis/setColor red
#=============================================================
# R E P E A T C R Y S T A L
/gate/LYSO/repeaters/insert cubicArray
/gate/LYSO/cubicArray/setRepeatNumberX 1
/gate/LYSO/cubicArray/setRepeatNumberY 11
/gate/LYSO/cubicArray/setRepeatNumberZ 1
/gate/LYSO/cubicArray/setRepeatVector 0. 0.2 0. mm
/gate/EJ232/repeaters/insert cubicArray
/gate/EJ232/cubicArray/setRepeatNumberX 1
/gate/EJ232/cubicArray/setRepeatNumberY 10
/gate/EJ232/cubicArray/setRepeatNumberZ 1
/gate/EJ232/cubicArray/setRepeatVector 0. 0.2 0. mm
#=============================================================
# R E P E A T M O D U L E
#/gate/module/repeaters/insert linear
#/gate/module/linear/setRepeatNumber 33
#/gate/module/linear/setRepeatVector 0. 0. 3.01 mm
# R E P E A T R S E C T O R
#/gate/rsector/repeaters/insert ring
#/gate/rsector/ring/setRepeatNumber 250
#/gate/cylindricalPET/placement/setRotationAxis 0 0 1
#=============================================================
# A T T A C H S Y S T E M
/gate/LYSO/attachCrystalSD
/gate/EJ232/attachCrystalSD
/gate/systems/cylindricalPET/rsector/attach rsector
/gate/systems/cylindricalPET/module/attach module
/gate/systems/cylindricalPET/crystal/attach crystal
/gate/systems/cylindricalPET/layer0/attach LYSO
/gate/systems/cylindricalPET/layer1/attach EJ232
# A C T O R
/gate/actor/addActor DoseActor MyActor0
/gate/actor/MyActor0/save EdepLYSO.txt
/gate/actor/MyActor0/attachTo LYSO
/gate/actor/MyActor0/stepHitType random
/gate/actor/MyActor0/setResolution 1 1 3000
/gate/actor/MyActor0/enableEdep true
/gate/actor/MyActor0/enableDose false
/gate/actor/addActor DoseActor MyActor1
/gate/actor/MyActor1/save EdepEJ232.txt
/gate/actor/MyActor1/attachTo EJ232
/gate/actor/MyActor1/stepHitType random
/gate/actor/MyActor1/setResolution 1 1 3000
/gate/actor/MyActor1/enableEdep true
/gate/actor/MyActor1/enableDose false
#=============================================================
#A T T A C H L A Y E R SD
#/gate/my_phantom/attachPhantomSD
#=============================================================
#=====================================================
# VISUALISATION
#=====================================================
# V I E W E R #
#/vis/open OGLSX
# set the view angle
#/vis/viewer/set/viewpointThetaPhi 45 45
# define the zoom factor
#/vis/viewer/zoom 50.
# set the drawing style
#/vis/viewer/set/style wireframe
#/vis/viewer/set/style surface
# tell the viewer to draw the volume
#/vis/drawVolume
#/vis/viewer/flush
#/tracking/verbose 2
# The trajectories for each run should be drawn together
# don't store trajectories = 0; store trajectories = 1
#/tracking/storeTrajectory 1
#/vis/scene/add/trajectories
# Requests viewer to refresh hits, tracks, etc., at end of event.
# Or to accumulate drawings. Detector remains or is redrawn.
#/vis/scene/endOfEventAction accumulate
#=====================================================
# PHYSICS
#=====================================================
/gate/physics/addPhysicsList emstandard_opt4
#/gate/physics/addPhysicsList emlivermore
/gate/physics/addProcess Scintillation
/gate/physics/addProcess OpticalAbsorption
/gate/physics/addProcess OpticalRayleigh
#/gate/physics/addProcess OpticalBoundary
#/gate/physics/addProcess OpticalMie
/gate/physics/addProcess OpticalWLS
#/gate/physics/addPhysicsList emlivermore
#/gate/physics/addProcess Scintillation
#/gate/physics/addProcess RadioactiveDecay
#/gate/physics/processList Enabled
#/gate/physics/processList Initialized
#=====================================================
# INITIALISATION
#=====================================================
/gate/run/initialize
/gate/LYSO/surfaces/name surface1
/gate/LYSO/surfaces/insert EJ232
/gate/LYSO/surfaces/surface1/setSurface perfect_apd
/gate/EJ232/surfaces/name surface2
/gate/EJ232/surfaces/insert LYSO
/gate/EJ232/surfaces/surface2/setSurface perfect_apd
#=====================================================
# D I G I T I Z E R: DETECTOR ELECTRONIC RESPONSE
#=====================================================
/gate/digitizer/Singles/insert opticaladder
/gate/digitizer/Singles/insert readout
/gate/digitizer/Singles/readout/setDepth 4 #Crystal | "5" Layer
/gate/digitizer/Singles/insert blurring
/gate/digitizer/Singles/blurring/setEnergyOfReference 511. keV
#/gate/digitizer/verbose 1
# C O I N C I D E N C E
#/gate/digitizer/Coincidences/setWindow 4. ns
#/gate/digitizer/Coincidences/setOffset 0. ns
#/gate/digitizer/Coincidences/minSectorDifference 88
#/gate/digitizer/DelCoinc/addSource prompts
#/gate/digitizer/DelCoinc/addSource delayed
#===================================================
# D E F I N E T H E S O U R C E
#===================================================
# source: opticalPhoton
/gate/source/addSource Mysource gps
#/gate/source/Mysource/setType backtoback
/gate/source/Mysource/gps/particle gamma
/gate/source/Mysource/gps/pos/shape Sphere
/gate/source/Mysource/gps/pos/radius 0.125 mm
/gate/source/Mysource/gps/pos/centre 0. 0. 10.125 mm
/gate/source/Mysource/gps/ene/type Mono
/gate/source/Mysource/gps/ene/mono 511. keV
/gate/source/Mysource/setActivity 100000. Bq
/gate/source/Mysource/gps/ang/type iso
#/gate/source/Mysource/gps/polarization 1 1 1
/gate/source/Mysource/gps/ang/mintheta 0 deg
/gate/source/Mysource/gps/ang/maxtheta 30 deg
/gate/source/Mysource/gps/ang/minphi 0 deg
/gate/source/Mysource/gps/ang/maxphi 360. deg
#=====================================================
# D A T A O U T P U T
#=====================================================
/gate/output/root/enable
/gate/output/root/setFileName LYSOEJ232CP1
#/gate/output/root/setRootSinglesAdderFlag 1
#/gate/output/root/setRootSinglesReadoutFlag 1
/gate/output/root/setRootHitFlag 1
/gate/output/root/setRootSinglesFlag 1
#/gate/output/root/setRootNtupleFlag 1
#/gate/output/root/setRootCoincidencesFlag 1
/gate/output/root/setRootOpticalFlag 1
#/gate/output/fastanalysis/enable
#/gate/output/analysis/enable
#====================================================
# R A N D O M E N G I N E A N D S E E D
#====================================================
# JamesRandom
/gate/random/setEngineName JamesRandom
/gate/random/setEngineSeed auto
/gate/random/verbose 0
#=====================================================
# 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/application/startDAQ
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opengatecollaboration.org/pipermail/gate-users/attachments/20220525/7af3e374/attachment-0001.html>
More information about the Gate-users
mailing list