OpenGATE / Gate

Official public repository of Gate
http://www.opengatecollaboration.org
GNU Lesser General Public License v3.0
234 stars 263 forks source link

Actors are dependent of number of primaries #31

Open BishopWolf opened 9 years ago

BishopWolf commented 9 years ago

Current actors, such as Dose Actor, are now dependent of the number of histories, since you accumulate the deposited energy which increases with primary event generation. This is a really odd design in the code, since every other Monte Carlo tool, soft, whatever always divide by the current number of primaries when calculating anything, making the results non-dependent of this. Solution involves a change of paradigm, so before doing anything developers should pronounce their position regarding this issue.

Advantages Results doesn't increase with number of primaries, but oscillate around the true value, making possible the statistical analysis. Results can be easily scaled to real values by users who must multiply them by the real total number of histories (cumulated activity). (Currently I have to manually divide by number of histories first) There will be no more ambiguity when trying to run a simulation with both source activity and total number of primaries set.

Disadvantages Results will be different from what it is obtained now, so users will complain. change of mind can be traumatic.

mojca commented 9 years ago

I'm not a frequent user of Gate, but I would consider it a bit weird if deposited dose would be divided by the number of primaries, I would hate to see the final result in "atograys". Also: how would you handle situations with two radioactive sources and constant time of irradiation, with the first source producing 1173 gamma rays and the second one producing 203 alphas. What would be the number of primaries?

It might make sense to add support for a a quantity with another name that would give you the average dose per primary (the problem mentioned above remains though), but I don't think it would be acceptable to make this kind of dramatic change using the same variables.

BishopWolf commented 9 years ago

"Also: how would you handle situations with two radioactive sources and constant time of irradiation, with the first source producing 1173 gamma rays and the second one producing 203 alphas. What would be the number of primaries?"

I can easily answer to this. Sources has the setIntensity command, so you can handle different sources accordingly to this (the 1173 for the gamma and the 203 for the alphas). The energy deposited will depend on this since the Monte Carlo will produce nearly that number of primaries, so dividing by the sum you will obtain a normalization of the sources, then dividing by the number of primaries you normalize in general so you will obtain atograys per primaries, ugly? yes but logical, since you can safely multiply by the total emmission yield and by the real number of primaries (measured cumulated activity) in this case.