[Gate-users] GateDoseSpectrumActor

Maikol Salas Ramirez mmsalas at gmail.com
Wed Feb 2 15:31:03 CET 2022


Hi Andreas,

I rechecked the data and yes, it is possible to calculate the
uncertainty, using EdepHisto. In each bin is necessary to
multiple (E^2)*number of histories in the bin and sum all the bins:

SUM(E^2) = (SUM((E_i^2)*number_of_histories_i) from bin 1 to
n)/Total_number_of_histories.

Then it is necessary to apply the equation to calculate the uncertainty,
using SUM(E^2) and SUM(E):
[image: image.png]

I tested both actors, as you mentioned.

In the 1 event check, I analyzed data of Ac-225 source with 1 event
EdepHisto gave an energy of 2.86E-5 keV, and GateDoseSpectrumActor gave 0
keV (here, I think it is a matter of digits).
Uncertainty does not have any sense to calculate (1 history)

In a second check, I analyzed data of a Y-90 source with 1E9 events
EdepHisto and GateDoseSpectrumActor, gave me the same values (Deposited
Energy = 755.866, Uncertainty = 0.0156343).

In conclusion, both ways work. But sincerely, EdepHisto requires more work
to get the same. It would be nice to include the integration of the energy
spectrum and energy squared spectrum into ESpectrActor.

Best,
Maikol

El mié, 2 feb 2022 a las 9:59, Andreas Resch (<
andreas.resch at meduniwien.ac.at>) escribió:

> Hi Maikol,
>
> I just see, that the wiki for the EnergySpectrActor is not up to date
> (will be by next week).
>
> Have you tried to use the command:
>
> enableEdepHisto true
>
> this gives you the edep per history. It should be the same as in the
> DoseSpectrumActor with the difference that the latter is using
> BeginOfEventAction to score and EdepActor uses EndofEvent. Would be
> interesting to check what happens if you have a single event only. I would
> expect that DoseSpectrumActor returns no entry, but EdepActor does. Could
> you check that?
>
> best,
>
> Andreas
>
>
> Am 2022-02-02 08:52, schrieb Maikol Salas Ramirez:
>
> Hi Andreas,
>
> I see the practicality in the GateDoseSpectrumActor. As far as I know, no
> other actor calculates the energy and its uncertainty so quickly (at least
> for a logical volume). The ESpectrActor always requires some
> post-processing, normally it is no big deal, but it is nice to have the
> result without intermediate steps.
>
> On the other hand, your approach "square of the bin vector in a post
> processing step" will not lead to the same result. The
> uncertainty calculation in one single simulation is a history-by-history
> method (error = sqrt( (1.0 / ( numPart - 1)) * ( avgEnergySq - pow(
> avgEnergyOut, 2)))), it means the energy contribution (square) is scored
> per history. The ESpectrActor does not make this distinction. It mixes
> all the contributions.
>
> From my point of view, the GateDoseSpectrumActor does not cause any
> damage. It can continue inside of GATE, but if there is a change to update
> it or translate its features to the ESpectrActor it would be nice.
>
> Best,
> Maikol
>
>
>
>
> El mar, 1 feb 2022 a las 15:10, Andreas Resch (<
> andreas.resch at meduniwien.ac.at>) escribió:
>
> Hi David, Maikol,
>
> just had a brief look into the source code of DoseSpectrumActor. Looks
> fine at the first glance, but is obsolete as 1 of the two scoring results
> is also part of ESpectrActor. Would be only few lines of extra code to add
> the second option (square of energy deposit) to ESpectrActor. Although I
> wonder if it is really necessary. Shouldn't it be enough to do the square
> of the bin vector in a post processing step? (using a high resolution
> binning of course)
>
> best,
>
> Andreas
>
> Am 2022-02-01 10:17, schrieb Maikol Salas Ramirez:
>
> Hello David,
>
> Thank you for the answer. I re-check my calculation, and I found out
> that the units are well (I mean the EnergySpectrumActor and
> GateDoseSpectrumActor agree in the deposited energy calculations).
>
> To check it, I attached both actors to the same logical volume and
> calculated the deposited energy for comparison. In the case of
> EnergySpectrumActor, I summed the energy spectrum, and for
> GateDoseSpectrumActor, it provides the total energy (sum) plus the
> uncertainty directly.
>
> The GateDoseSpectrumActor has the advantage that it provides the total
> deposited energy with its uncertainty. This information is impossible to
> obtain with the EnergySpectrumActor, because it does not give the square of
> the sum of the energies.
>
> I think the GateDoseSpectrumActor could be useful for the community. But,
> it is not documented in the opengate.readthedocs.io, and the C++ classes
> are probably incomplete (probably the goal was the absorbed dose
> calculation, but its development stops with the energy calculation). At
> this moment, the GateDoseSpectrumActor help me resolve my
> task straightforwardly. I think it is better to keep it. Hopefully, it will
> be a chance to improve it in the future.
>
> I am finalizing some details of the simulation (blood irradiation with
> radionuclides); if it would interest you, I can share it for the GATE
> examples with some documentation.
>
> Best regards,
> Maikol
>
> El mar, 1 feb 2022 a las 8:05, David Sarrut (<
> david.sarrut at creatis.insa-lyon.fr>) escribió:
>
> Hello Maikol,
>
> I don't know this actor and, looking at the history, it was started before
> we started the git version (2015), so the original author is lost.
> As there is no doc and I don't really get what it means compared to the
> EnergySpectrumActor, I would suggest to remove it.
>
> However, if you think it could be useful for you, please let us know. The
> idea would be to propose some docs and use case.
>
> thanks,
> David
>
> On Mon, Jan 31, 2022 at 5:50 PM Maikol Salas Ramirez <mmsalas at gmail.com>
> wrote:
>
> Dear Gate users,
>
> Recently I found the .cc and .hh files of a *GateDoseSpectrumActor*. This
> actor is not mentioned in opengate.readthedocs.io or any webpage.
> I would like to ask if someone is working on it. Is it a prototype?
>
> I tested the energy calculation using the EnergySpectrumActor and the
> energy units differ:
>
> I simulated a Ac-225 source using the Ion source definition. I scored the
> deposited energy with both actors (EnergySpectrumActor and
> GateDoseSpectrumActor). The deposited energy differs by a factor of 1000. *The
> only justification that I can find is that, in the GateDoseSpectrumActor,
> the deposited energy is expressed in keV/(1000 events) OR (eV/event) and
> there is a typo in the code (the units shoud be eV instead of keV):*
> #-------------------------------------------
> /// Save data
> void GateDoseSpectrumActor::SaveData()
> {
>   GateVActor::SaveData();
>   std::ofstream DoseResponseFile;
>   OpenFileOutput(mSaveFilename, DoseResponseFile);
>   DoseResponseFile << "Incoming energy (*keV*)" << " "
>                    << "Average energy deposit (*keV*)" << " "
>                    << "Energy uncertainty (*keV*)"  << Gateendl;
>   std::map< G4double, G4double>::iterator itermEnergy;
>   for( itermEnergy = mEnergy.begin(); itermEnergy != mEnergy.end();
> itermEnergy++)
>   {
>     G4double energyIn = itermEnergy->first;
>     G4double totEnergyOut = mEnergy[energyIn];
>     G4double numPart = mNumParticPerEnergy[energyIn];
>     G4double avgEnergyOut = totEnergyOut / numPart;
>     G4double avgEnergySq  = mEnergySquare[energyIn] / numPart;
>     G4double error = sqrt( (1.0 / ( numPart - 1)) * ( avgEnergySq - pow(
> avgEnergyOut, 2)));
>     DoseResponseFile << energyIn/*keV* << " "
>                      << avgEnergyOut/*keV* << " "
>                      << error/*keV*  << Gateendl;
>   }
> #-------------------------------------------
>
> Is anyone working on this?
>
>
>
> Best regards
> Maikol
>
> _______________________________________________
> Gate-users mailing list
> Gate-users at lists.opengatecollaboration.org
> http://lists.opengatecollaboration.org/mailman/listinfo/gate-users
>
>
>
> --
> David Sarrut, Phd
> Directeur de recherche CNRS
> CREATIS, UMR CNRS 5220, Inserm U1294
> Centre de lutte contre le cancer Léon Bérard
> 28 rue Laënnec, 69373 Lyon cedex 08
> Tel : 04 78 78 51 51 / 06 74 72 05 42
> http://dsarrut.github.io
> _________________________________
>  "2 + 2 = 5,  for extremely large values of 2"
> _________________________________
>
>
> _______________________________________________
> Gate-users mailing list
> Gate-users at lists.opengatecollaboration.org
> http://lists.opengatecollaboration.org/mailman/listinfo/gate-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opengatecollaboration.org/pipermail/gate-users/attachments/20220202/29a49379/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 6998 bytes
Desc: not available
URL: <http://lists.opengatecollaboration.org/pipermail/gate-users/attachments/20220202/29a49379/attachment-0001.png>


More information about the Gate-users mailing list