Gate icon indicating copy to clipboard operation
Gate copied to clipboard

spatial resolution digitizer checks all level of system components attached, why

Open tontyoutoure opened this issue 1 year ago • 5 comments

Since this commit, the spatial resolution digitier module begins to check whether all levels of system components are attached whenever a GateSpatialResolution::Digitize() is called. It makes the scanner system all mostly useless, since scanner has 7 levels of components, and I think nobody would try to attach all of them.

It surely is an undocumented behavior, and very unnecessary one. After disable (comment line 105 and line 106 of GateSpatialResolution.cc) it, the simulation runs correctly.

I wonder if @kochebina write this check at a wrong place? The readout module also has this check and it works correctly.

tontyoutoure avatar May 23 '23 15:05 tontyoutoure

This is a protection from a Seg Fault in case if the "mother" level is not defined but needed by the module. This is the case if the spatial resolution borders are at the level of a group of crystals and not only one crystal. In the documentation, it is discussed at the section spatial resolution, option confineInsideOfSmallestVolume (or something like this, I'm writing by memory).

Indeed, probably there is a space for an optimization of this check. I'll check

kochebina avatar May 23 '23 15:05 kochebina

Perhaps you can only show error for cases that daughters have creator while mother or grandmothers don't, otherwise a system with only one level of cyrstal will just not work.

tontyoutoure avatar May 24 '23 03:05 tontyoutoure

I mean, this raises a question, that in the documentation (of the newest version I compiled), it says "Each level has to be assigned to a physical volume of the geometry. " It seemes to means that all levels should be assigned, and assigne to a physical volume. But that is not the case in the GateContrib examples. For example, the SPECT example (which I'm working on) only attaches the crystal level not the pixel level. Since SPECT system relys on the counts of several PMTs for the positioning of gamma events, this is reasonable. Forcing user to define all levels even if they don't need that kind of granularity seems a bad idea to me.

If Gate allows user to define only higher levels of system, it should probably mention it in the documentation, not implicitly implement in GateContrib examples.

I created a PR that could fix this issue, with regards of consideration above.

tontyoutoure avatar May 26 '23 06:05 tontyoutoure

Hi @tontyoutoure, this is very interesting, could you please contact us by email to setup a zoom meeting to discuss about that ? David

dsarrut avatar May 26 '23 09:05 dsarrut

Hi @tontyoutoure, this is very interesting, could you please contact us by email to setup a zoom meeting to discuss about that ? David

Sure. Should I send emails to you? My email address is [username]at[gmail]. I'm in UTC+8 time zone btw.

tontyoutoure avatar May 26 '23 10:05 tontyoutoure