OpenGATE / opengate

Gate 10
http://www.opengatecollaboration.org
GNU Lesser General Public License v3.0
53 stars 45 forks source link

EM calculator (for use in dose actor) #151

Open djboersma opened 1 year ago

djboersma commented 1 year ago

This issue serves to document and organize actions around EM actor during the 2023-04-24 hackathon in Cracow.

From @andiresch I got the following problem description:

multithreading for LET Actor / Dose 2 Water calculation does not work yet.
Problem with the G4EMcalculator;
I want to make a GateEMcalculator class that gives us also the possibility to load our own stopping power tables
(e.g. Janni tables, …)

Currently the G4EMcalculator is only used in the LET actor, namely here: https://github.com/OpenGATE/opengate/blob/master/core/opengate_core/opengate_lib/GateLETActor.cpp#L136 and here: https://github.com/OpenGATE/opengate/blob/master/core/opengate_core/opengate_lib/GateLETActor.cpp#L146

The code shows some attempts to make it thread safe (SetPixelMutex), which are commented out with "TODO" promises, there should be some backstory to that. What went wrong when you tried to uncomment and run this?

There is no EM calculator usage in the regular dose actor yet, it does not seem to offer "dose to water" functionality in any other way either. It does use the G4AutoLock mechanism, so I guess that it can run in MT mode.

dsarrut commented 1 year ago

We finally understand with @andiresch what the issue was: the instance of the G4EMcalculator in the actor must be thread local. PR in progress ;) I keep the issue for the second goal: make it possible to load your own SP table.