[Gate-users] understanding the ROOT file content

Dmitry Hits dmitry.hits at phys.ethz.ch
Thu Mar 4 18:31:34 CET 2021


Hi Xinjie,

Thank you very much for reply!

I didn't think the rest of macro file was important, but maybe I am missing something. I any case I am pasting it here at the bottom of the email (*).

Here is the part of the manual that talks about the levels. It is part of the chapter called "Defining a system" (https://opengate.readthedocs.io/en/latest/defining_a_system_scanner_ct_pet_spect_optical.html <https://opengate.readthedocs.io/en/latest/defining_a_system_scanner_ct_pet_spect_optical.html>)
---------------------
Each level has to be assigned to a physical volume of the geometry. A level volume has to be fully enclosed in the upper level volume. The number of levels has to be set and must conform to the specifications listed in Table 1.1 <https://opengate.readthedocs.io/en/latest/defining_a_system_scanner_ct_pet_spect_optical.html#system-tab>. The numbering of different sensitive volumes is completely set by the choice of the system and conforms to a specific output format. The maximum number of components in each level depends on the output format since it can be limited by the number of bits used for the numbering of the crystals. See Data output <https://opengate.readthedocs.io/en/latest/data_output_management.html#data-output-label> for further details.

--------------------------
I think what the passage above wants to say is: If you have a level2 then you should have a level1 to contain it, but not vice versa.  However, I am not sure that my interpretation is correct. 

Anyway, I am more concerned with the multiple volumeIDs that I get in my output. I have no idea what they signify and a search of the Manual doesn't lead to anything useful.

I am happy to provide more information or clarification to my questions if needed.  

Cheers,

Dmitry



> On 4 Mar 2021, at 17:42, Xinjie Cao <xinjie.cao at stonybrook.edu> wrote:
> 
> Hi Dmitry,
> 
> Could you share your full geometry configuration and physics list setting? That will be easier for all Gaters to see what they could do to help.
> 
> And for your following questions, for example, question 5. It would be better to snapshot the part of the GATE manual you described in your question so we could know what exactly you talked about and help you.
> 
> Hope this helps!
> 
> Best,
> Xinjie
> 
> On Wed, Mar 3, 2021 at 8:41 AM Dmitry Hits <dmitry.hits at phys.ethz.ch <mailto:dmitry.hits at phys.ethz.ch>> wrote:
> Dear Gate Users,
> 
> I am trying to understand the content of the ROOT file. 
> I have the following lines that are meant to specify what will be stored in it.
> 
> #==================================================
> # OUTPUT
> #==================================================
> /gate/output/root/enable
> /gate/output/root/setFileName TrackerHits
> /gate/output/root/setRootHitFlag            1
> /gate/output/root/setRootSinglesFlag        0
> #/gate/output/root/setRootCoincidencesFlag   0
> /gate/output/root/setRootNtupleFlag         0
> /gate/output/root/setRootOpticalFlag        0
> I commented out the CoincidencesFlag because it gives me an error.
> 
> My goal is to store "Hits" produced in a silicon sensor (see definition below).
> 
> #system
> /gate/world/daughters/name              scanner
> /gate/world/daughters/insert            box
> /gate/scanner/geometry/setXLength      20 cm
> /gate/scanner/geometry/setYLength      1 mm
> /gate/scanner/geometry/setZLength      20 cm
> /gate/scanner/placement/setTranslation 0.0 0.0 0.0 cm
> /gate/scanner/setMaterial Air
> #sensor
> /gate/scanner/daughters/name sensor1
> /gate/scanner/daughters/insert box
> /gate/sensor1/geometry/setXLength      20 cm
> /gate/sensor1/geometry/setYLength      0.174 mm
> /gate/sensor1/geometry/setZLength      20 cm
> /gate/sensor1/setMaterial Silicon
> /gate/sensor1/placement/setTranslation 0.0 0.0 0.0 cm
> /gate/systems/scanner/level1/attach sensor1
> /gate/sensor1/attachCrystalSD
> When I open my file with uproot I see the following objects inside:
> ['Hits;12',
>  'Hits;11',
>  'latest_event_ID;1',
>  'total_nb_primaries;1',
>  'pet_data;1',
>  'OpticalData;1']
> Here are my questions:
> 1. In the "Hits" tree, for each entry (event), I get 10 subentries (sub-events) (see below). Each subentry has identical info with exception of the volumeID. The volumeID have values 0, 3 and -1.
> Does someone know:
> 	- Why  there are so many subentries? 
> 	- What  is the meaning of the volumeID? I have only one sensor, shouldn't that mean only one volume?
> 2. Why is there two "Hits" trees? Comparing  them tells  me that  they are identical.
> 3. Why the cycle numbers of the trees have such high numbers? (12 and  11)  Are they re-written  many times? What determines the cycle numbers?
> 4. Even though I set setRootOpticalFlag 0 I still get OpticalData tree, why is that?
> 5. One more thing I failed to understand after reading the manual. What is the meaning of the "level" in relation to the sensor? I randomly used "level1" but I am not sure if that was a correct choice. 
> 
> PDGEncoding	trackID	parentID	trackLocalTime	time	edep	stepLength	trackLength	posX	posY	...	axialPos	rotationAngle	volumeID	processName	comptVolName	RayleighVolName	septalNb	sourceType	decayType	gammaType
> entry	subentry																					
> 0	0	2212	1	0	8.399597e-10	8.399597e-10	0.0655	0.174008	250.097992	-3.211607	-0.087	...	0.0	0.0	0	Transportation	NULL	NULL	0	0	0	0
> 1	2212	1	0	8.399597e-10	8.399597e-10	0.0655	0.174008	250.097992	-3.211607	-0.087	...	0.0	0.0	3	Transportation	NULL	NULL	0	0	0	0
> 2	2212	1	0	8.399597e-10	8.399597e-10	0.0655	0.174008	250.097992	-3.211607	-0.087	...	0.0	0.0	0	Transportation	NULL	NULL	0	0	0	0
> 3	2212	1	0	8.399597e-10	8.399597e-10	0.0655	0.174008	250.097992	-3.211607	-0.087	...	0.0	0.0	-1	Transportation	NULL	NULL	0	0	0	0
> 4	2212	1	0	8.399597e-10	8.399597e-10	0.0655	0.174008	250.097992	-3.211607	-0.087	...	0.0	0.0	-1	Transportation	NULL	NULL	0	0	0	0
> 
> 
> Sorry for the long email.
> 
> Cheers,
> 
> Dmitry
> 
> 

(*)
#=====================================================
# GEOMETRY
#=====================================================

/gate/geometry/setMaterialDatabase data/GateMaterials.db

# World
/gate/world/geometry/setXLength 50 cm
/gate/world/geometry/setYLength 50 cm
/gate/world/geometry/setZLength 50 cm
/gate/world/setMaterial Air


# Boxes
/gate/world/daughters/name              box0
/gate/world/daughters/insert            box
/gate/box0/geometry/setXLength      20 cm
/gate/box0/geometry/setYLength      2 cm
/gate/box0/geometry/setZLength      20 cm
/gate/box0/placement/setTranslation 0.0 10.0 0.0 cm
/gate/box0/setMaterial Air
/gate/box0/vis/setVisible 1
/gate/box0/vis/setColor cyan

/gate/world/daughters/name              box1
/gate/world/daughters/insert            box
/gate/box1/geometry/setXLength      20 cm
/gate/box1/geometry/setYLength      2 cm
/gate/box1/geometry/setZLength      20 cm
/gate/box1/placement/setTranslation 0.0 8.0 0.0 cm
/gate/box1/setMaterial Air
/gate/box1/vis/setVisible 1
/gate/box1/vis/setColor red

/gate/world/daughters/name              box2
/gate/world/daughters/insert            box
/gate/box2/geometry/setXLength      20 cm
/gate/box2/geometry/setYLength      2 cm
/gate/box2/geometry/setZLength      20 cm
/gate/box2/placement/setTranslation 0.0 6.0 0.0 cm
/gate/box2/setMaterial Air
/gate/box2/vis/setVisible 1
/gate/box2/vis/setColor blue

#system
/gate/world/daughters/name              scanner
/gate/world/daughters/insert            box
/gate/scanner/geometry/setXLength      20 cm
/gate/scanner/geometry/setYLength      1 mm
/gate/scanner/geometry/setZLength      20 cm
/gate/scanner/placement/setTranslation 0.0 0.0 0.0 cm
/gate/scanner/setMaterial Air
/gate/scanner/vis/setVisible 1
/gate/scanner/vis/setColor cyan

#sensor
/gate/scanner/daughters/name sensor1
/gate/scanner/daughters/insert box
/gate/sensor1/geometry/setXLength      20 cm
/gate/sensor1/geometry/setYLength      0.174 mm
/gate/sensor1/geometry/setZLength      20 cm
/gate/sensor1/setMaterial Silicon
/gate/sensor1/placement/setTranslation 0.0 0.0 0.0 cm
/gate/sensor1/vis/setVisible 1
/gate/sensor1/vis/setColor yellow
/gate/systems/scanner/level1/attach sensor1
/gate/sensor1/attachCrystalSD



# /gate/geometry/setIonisationPotential Water 75 eV
# /gate/geometry/setIonisationPotential Air 85.7 eV



#=====================================================
# PHYSICS
#=====================================================

/gate/physics/addPhysicsList QGSP_BERT_EMV

/gate/physics/Gamma/SetCutInRegion      world 1 mm
/gate/physics/Electron/SetCutInRegion   world 1 mm
/gate/physics/Positron/SetCutInRegion   world 1 mm

/gate/physics/Gamma/SetCutInRegion      box0 0.1 mm
/gate/physics/Electron/SetCutInRegion   box0 0.1 mm
/gate/physics/Positron/SetCutInRegion   box0 0.1 mm

/gate/physics/Gamma/SetCutInRegion      box1 0.1 mm
/gate/physics/Electron/SetCutInRegion   box1 0.1 mm
/gate/physics/Positron/SetCutInRegion   box1 0.1 mm

/gate/physics/Gamma/SetCutInRegion      box2 0.1 mm
/gate/physics/Electron/SetCutInRegion   box2 0.1 mm
/gate/physics/Positron/SetCutInRegion   box2 0.1 mm

/gate/physics/Gamma/SetCutInRegion      scanner 0.1 mm
/gate/physics/Electron/SetCutInRegion   scanner 0.1 mm
/gate/physics/Positron/SetCutInRegion   scanner 0.1 mm

/gate/physics/SetMaxStepSizeInRegion world 1 mm
/gate/physics/ActivateStepLimiter proton
/gate/physics/ActivateStepLimiter deuteron
/gate/physics/ActivateStepLimiter triton
/gate/physics/ActivateStepLimiter alpha
/gate/physics/ActivateStepLimiter GenericIon

/gate/physics/displayCuts

#/gate/physics/addProcess LowEnergyHadronIonisation
/gate/physics/addProcess HadronIonisation proton

#================================================================
#     ACTORS
#================================================================


/gate/actor/addActor ProtonNuclearInformationActor myNuclearInfoActor
/gate/actor/myNuclearInfoActor/attachTo            world

/gate/actor/addActor PhaseSpaceActor         tracker0
/gate/actor/tracker0/save                     tracker0.root
/gate/actor/tracker0/attachTo                 box0
/gate/actor/tracker0/enableProductionProcess  false
#/gate/actor/tracker0/useVolumeFrame           true
/gate/actor/tracker0/storeOutgoingParticles true
/gate/actor/tracker0/enableNuclearFlag          true

/gate/actor/addActor PhaseSpaceActor         tracker1
/gate/actor/tracker1/save                     tracker1.root
/gate/actor/tracker1/attachTo                 box1
/gate/actor/tracker1/enableNuclearFlag          true
/gate/actor/tracker1/enableProductionProcess  false
#/gate/actor/tracker1/useVolumeFrame           true
/gate/actor/tracker1/storeOutgoingParticles true


/gate/actor/addActor PhaseSpaceActor         tracker2
/gate/actor/tracker2/save                     tracker2.root
/gate/actor/tracker2/attachTo                 box2
/gate/actor/tracker2/enableNuclearFlag          true
/gate/actor/tracker2/enableProductionProcess  false
#/gate/actor/tracker2/useVolumeFrame           true
/gate/actor/tracker2/storeOutgoingParticles true

/gate/actor/addActor PhaseSpaceActor         tracker3
/gate/actor/tracker3/save                     tracker3.root
/gate/actor/tracker3/attachTo                 sensor1
/gate/actor/tracker3/enableNuclearFlag          true
/gate/actor/tracker3/enableProductionProcess  false
#/gate/actor/tracker3/useVolumeFrame           true
/gate/actor/tracker3/storeOutgoingParticles true
#==================================================
# OUTPUT
#==================================================
/gate/output/root/enable
/gate/output/root/setFileName TrackerHits
/gate/output/root/setRootHitFlag            1
/gate/output/root/setRootSinglesFlag        0
#/gate/output/root/setRootCoincidencesFlag   0
/gate/output/root/setRootNtupleFlag         0
/gate/output/root/setRootOpticalFlag        0

#=====================================================
# INITIALISATION
#=====================================================

/gate/run/initialize
# Enable the following lines to display available and enabled processes
# /gate/physics/processList Available
# /gate/physics/processList Enabled

#=====================================================
# BEAMS
#=====================================================
/gate/source/addSource PBS PencilBeam
/gate/source/PBS/setParticleType proton
/gate/source/PBS/setEnergy 7116 MeV
/gate/source/PBS/setSigmaEnergy 1.0 MeV
/gate/source/PBS/setPosition 0 250 0 mm
/gate/source/PBS/setSigmaX 2 mm
/gate/source/PBS/setSigmaY 2 mm
/gate/source/PBS/setSigmaTheta 3 mrad
/gate/source/PBS/setSigmaPhi 3 mrad
/gate/source/PBS/setEllipseXThetaEmittance 15 mm*mrad
#/gate/source/PBS/setEllipseXThetaRotationNorm negative
/gate/source/PBS/setEllipseYPhiEmittance 15 mm*mrad
/gate/source/PBS/setEllipseYPhiRotationNorm negative
/gate/source/PBS/setRotationAxis 1 0 0
/gate/source/PBS/setRotationAngle 90 deg
/gate/application/setTotalNumberOfPrimaries 10000

#=====================================================
# VISUALISATION
#=====================================================

/control/execute mac/visu.mac

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

# JamesRandom Ranlux64 MersenneTwister
/gate/random/setEngineName MersenneTwister
/gate/random/setEngineSeed 123456

# /gate/random/verbose 1
# /gate/source/verbose 0

# to check Steplimiter
#/tracking/verbose 1

#/gate/application/noGlobalOutput
#/gate/application/setTotalNumberOfPrimaries 200
#===============================================
# OUTPUT SETTINGS
#===============================================




/gate/application/start

exit


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


More information about the Gate-users mailing list