Hello, I am a beginner trying to learn GEANT. So my question may be too basic and naive. Hope you can understand.
I would like to simulate a PET scan, and I would like to count the number of particles traveling at certain position x in certain direction θ with energy E. As far as I know, this particle density, also called radiance intensity, and is a component in radiative transport equation. It cannot be directly measured in PET scanning scenarios, so I wonder if it can be known in simulations. Is there any document/tool that I can refer to?
Presumably “certain position x” is really “through a small voxel or area pixel centered on x”? The information you would want to accumulate is momentum direction (px,py,pz) and kinetic energy. I don’t recall whether there’s a built-in scorer that will do this for you.
If I were doing it myself, I’d attach a SensitiveDetector to my volume, and use it to fill an N-tuple with the momentum, energy and position of each step. Then, in my analysis code, I can compute theta from (px,py,pz), and histogram it vs. position, with cuts, or in energy bins, or whatever.
Well, since SD’s are user code, that depends on how absurdly complex you want it to be
If you’re doing the usual simple thing of extracting data from G4Step and storing it to a hit, or an N-tuple, or something, even with if conditions, it’ll be perfectly fine compared to the rest of the tracking.
If you’re doing some sort of fit or complex interpolation as part of the SD, that could have an impact.
Hi @mkelsey, sorry for the belated response, but in my trials which use hits to record particle interactions, the recorded positions don’t seem to be within the FOV. E.g., after reading the posX/Y/Z from the hits files, I try to filter out the positions within region [-200~200, -200~200, -132~132], but no position is returned - all interactions recorded seem to be outside this region, which is not what I want. What could possibly be the reason? And any workaround? Attached are the definition macros for the PET scanner geometry and phantom setup.
If you run with visualization, do you see tracks going where you expect them to go?
I’m not at all familar with how GATE wraps up regular Geant4 stuff. In G4, the positions you get from G4Step are always in the World coordinate system. If your target is offset from (0,0,0) in the world, then the coordinates might not be what you expect them to be.
It is a bit difficult to visualize the simulation script since it is designed for running HPC server that has no GUI. And tbh I don’t think it’s a problem of target’s deviation from center of the world coordinates, since image reconstructed from the simulation output does show that the phantom is at the center. But will try your suggestions - many thanks, and maybe I should also turn to GATE’s forum for help.
In Geant4, you’d look to record the primary vertex coordinates (i.e. the original primary that resulted in the hit in your detector). GATE is a bit different with how they have chosen to do this. The coordinates you are looking at are likely those of the events inside your sensitive detector volume and thus why they are not inside the FOV.
However, if you have conventional hit outputs from GATE then one of the fields probably already has this information for you. Using the ASCII as a reference:
Hi jrellin. The [-200~200, -200~200, -132~132] filtering was exactly applied to hit outputs from GATE and no count was returned. Based on GATE’s documentation, I suspect that the hits output only records full interactions inside the crystal; for phantomSD, it seems to merely store information related to scattering (nPhantomCompton and compVolName).