[Gate-users] Report of GATEv8.2 bugs (PETscanner "level5" is NOT working)
Etienne Auger
Etienne.Auger at USherbrooke.ca
Wed Mar 11 21:38:09 CET 2020
Hi Zhengzhi,
Yes, indeed, there is a way to kind of easily get the exact position of all the elements in your scanner. You just have to use the VRML visualization option in your Gate script with the following command:
/vis/open VRML2FILE
With this, Gate will save a file named g4_XX.wrl, where XX is a two-digit numerical index automatically increasing when you run it multiple times (00, 01, 02, ...).
This file contains instructions to visually render the geometry of your setup (with view3dscene, for example : https://castle-engine.io/view3dscene.php).
Furthermore, and more interestingly for you, this g4_XX.wrl file is a text file that can be parsed (for example with a python script). If you open it with a text editor, you will see its content. It will look somewhat like this:
#VRML V2.0 utf8
# Generated by VRML 2.0 driver of GEANT4
#---------- CAMERA
Viewpoint {
position 0 0 10.7182
}
#---------- SOLID: crystal_phys.0
Shape {
appearance Appearance {
material Material {
diffuseColor 0 0 1
}
}
geometry IndexedFaceSet {
coord Coordinate {
point [
39.1445 -0.56125 -0.56125,
49.7445 -0.56125 -0.56125,
49.7445 0.56125 -0.56125,
39.1445 0.56125 -0.56125,
39.1445 -0.56125 0.56125,
49.7445 -0.56125 0.56125,
49.7445 0.56125 0.56125,
39.1445 0.56125 0.56125,
]
}
coordIndex [
0, 3, 2, 1, -1,
4, 7, 3, 0, -1,
7, 6, 2, 3, -1,
6, 5, 1, 2, -1,
5, 4, 0, 1, -1,
4, 5, 6, 7, -1,
]
solid FALSE
}
}
#End of file.
So you see in this simple example, in the first array-like structure, the exact coordinates (x, y, z) of the eight corners of the crystal (parallelepiped) are listed, as you wanted.
In the hope that this will help you, and do not hesitate if you have any questions,
Étienne
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opengatecollaboration.org/pipermail/gate-users/attachments/20200311/f91b1c02/attachment-0001.html>
More information about the Gate-users
mailing list