<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head><body style='font-size: 10pt; font-family: Verdana,Geneva,sans-serif'>
<p>Hi Maikol,</p>
<p>I just see, that the wiki for the EnergySpectrActor is not up to date (will be by next week). </p>
<p>Have you tried to use the command:</p>
<p><span>enableEdepHisto true </span></p>
<p><span>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?</span></p>
<p><span> best,</span><span></span></p>
<p><span>Andreas</span></p>
<p><br /></p>
<p id="reply-intro">Am 2022-02-02 08:52, schrieb Maikol Salas Ramirez:</p>
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0">
<div id="replybody1">
<div dir="ltr"><span style="font-family: arial, sans-serif;">Hi Andreas,</span>
<div><span style="font-family: arial, sans-serif;"> </span></div>
<div><span style="font-family: arial, sans-serif;">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 <span style="font-size: 13.333333015441895px;">ESpectrActor always requires some post-processing, normally it is no big deal, but it is nice to have the result without intermediate steps.</span></span></div>
<div><span style="font-size: 13.333333015441895px;"><span style="font-family: arial, sans-serif;"> </span></span></div>
<div style="text-align: left;"><span style="font-family: arial, sans-serif;">On the other hand, your approach "<span style="font-size: 13.333333015441895px;">square of the bin vector in a post processing step</span>" will not lead to the same result. The uncertainty calculation in one single simulation is a<span style="font-size: medium;"><span style="color: rgba(0,0,0,0); white-space: pre-wrap;"> </span></span>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 <span style="font-size: 13.333333015441895px;">ESpectrActor does not make this distinction. It mixes all the contributions.</span></span></div>
<div style="text-align: left;"><span style="font-family: arial, sans-serif;"><span style="font-size: 13.333333015441895px;"> </span></span></div>
<div style="text-align: left;"><span style="font-family: arial, sans-serif;"><span style="font-size: 13.333333015441895px;">From my point of view, the </span></span><span style="font-family: arial,sans-serif;">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 </span><span style="font-family: arial,sans-serif; font-size: 13.333333015441895px;">ESpectrActor it would be nice.</span></div>
<div style="text-align: left;"><span style="font-family: arial,sans-serif; font-size: 13.333333015441895px;"> </span></div>
<div style="text-align: left;"><span style="font-family: arial,sans-serif; font-size: 13.333333015441895px;">Best,</span></div>
<div style="text-align: left;"><span style="font-family: arial,sans-serif; font-size: 13.333333015441895px;">Maikol</span></div>
<div style="text-align: left;"> </div>
<div style="text-align: left;"> </div>
<div style="text-align: left;"> </div>
</div>
<br />
<div class="v1gmail_quote">
<div class="v1gmail_attr" dir="ltr">El mar, 1 feb 2022 a las 15:10, Andreas Resch (<<a href="mailto:andreas.resch@meduniwien.ac.at" rel="noreferrer">andreas.resch@meduniwien.ac.at</a>>) escribió:</div>
<blockquote class="v1gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: #cccccc; padding-left: 1ex;">
<div style="font-size: 10pt; font-family: Verdana,Geneva,sans-serif;">
<p>Hi David, Maikol,</p>
<p>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) </p>
<p>best,</p>
<p>Andreas</p>
<p id="v1gmail-m_-2943060790112167288gmail-m_4310275142251210736reply-intro">Am 2022-02-01 10:17, schrieb Maikol Salas Ramirez:</p>
<blockquote style="padding: 0px 0.4em; border-left-width: 2px; border-left-style: solid; border-left-color: #1010ff; margin: 0px;">
<div id="v1gmail-m_-2943060790112167288gmail-m_4310275142251210736replybody1">
<div dir="ltr">
<div dir="ltr">Hello David,
<div> </div>
<div>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). </div>
<div> </div>
<div>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.</div>
<div> </div>
<div>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. </div>
<div> </div>
<div>I think the GateDoseSpectrumActor could be useful for the community. But, it is not documented in the <a href="http://opengate.readthedocs.io/" target="_blank" rel="noopener noreferrer">opengate.readthedocs.io</a>, 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.</div>
<div> </div>
<div>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.</div>
<div> </div>
<div>Best regards,</div>
<div>Maikol</div>
</div>
<br />
<div>
<div dir="ltr">El mar, 1 feb 2022 a las 8:05, David Sarrut (<<a href="mailto:david.sarrut@creatis.insa-lyon.fr" rel="noreferrer">david.sarrut@creatis.insa-lyon.fr</a>>) escribió:</div>
<blockquote style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: #cccccc; padding-left: 1ex;">
<div dir="ltr">Hello Maikol,
<div> </div>
<div>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. </div>
<div>As there is no doc and I don't really get what it means compared to the EnergySpectrumActor, I would suggest to remove it. </div>
<div> </div>
<div>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.</div>
<div> </div>
<div>thanks,</div>
<div>David</div>
</div>
<br />
<div>
<div dir="ltr">On Mon, Jan 31, 2022 at 5:50 PM Maikol Salas Ramirez <<a href="mailto:mmsalas@gmail.com" rel="noreferrer">mmsalas@gmail.com</a>> wrote:</div>
<blockquote style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: #cccccc; padding-left: 1ex;">
<div dir="ltr">
<div>Dear Gate users,</div>
<div> </div>
<div>Recently I found the .cc and .hh files of a <strong>GateDoseSpectrumActor</strong>. This actor is not mentioned in <a href="http://opengate.readthedocs.io" target="_blank" rel="noopener noreferrer">opengate.readthedocs.io</a> or any webpage.</div>
<div>I would like to ask if someone is working on it. Is it a prototype?</div>
<div> </div>
<div>I tested the energy calculation using the EnergySpectrumActor and the energy units differ:</div>
<div> </div>
<div>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. <strong>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):</strong></div>
<div>#-------------------------------------------</div>
<div>/// Save data<br />void GateDoseSpectrumActor::SaveData()<br />{<br /> GateVActor::SaveData();<br /> std::ofstream DoseResponseFile;<br /> OpenFileOutput(mSaveFilename, DoseResponseFile);<br /> DoseResponseFile << "Incoming energy (<strong>keV</strong>)" << " "<br /> << "Average energy deposit (<strong>keV</strong>)" << " "<br /> << "Energy uncertainty (<strong>keV</strong>)" << Gateendl;<br /> std::map< G4double, G4double>::iterator itermEnergy;<br /> for( itermEnergy = mEnergy.begin(); itermEnergy != mEnergy.end(); itermEnergy++)<br /> {<br /> G4double energyIn = itermEnergy->first;<br /> G4double totEnergyOut = mEnergy[energyIn];<br /> G4double numPart = mNumParticPerEnergy[energyIn];<br /> G4double avgEnergyOut = totEnergyOut / numPart;<br /> G4double avgEnergySq = mEnergySquare[energyIn] / numPart;<br /> G4double error = sqrt( (1.0 / ( numPart - 1)) * ( avgEnergySq - pow( avgEnergyOut, 2)));<br /> DoseResponseFile << energyIn/<span style="color: #ff0000;"><strong>keV</strong> </span><< " "<br /> << avgEnergyOut/<span style="color: #ff0000;"><strong>keV</strong> </span><< " "<br /> << error/<span style="color: #ff0000;"><strong>keV</strong> </span> << Gateendl;<br /> }</div>
<div>#-------------------------------------------</div>
<div> </div>
<div>Is anyone working on this?</div>
<div> </div>
<div> </div>
<div> </div>
<div>Best regards</div>
<div>Maikol</div>
<div> </div>
</div>
_______________________________________________<br />Gate-users mailing list<br /><a href="mailto:Gate-users@lists.opengatecollaboration.org" rel="noreferrer">Gate-users@lists.opengatecollaboration.org</a><br /><a href="http://lists.opengatecollaboration.org/mailman/listinfo/gate-users" target="_blank" rel="noopener noreferrer">http://lists.opengatecollaboration.org/mailman/listinfo/gate-users</a></blockquote>
</div>
<br clear="all" />
<div> </div>
-- <br />
<div dir="ltr">
<div dir="ltr">
<div><span style="color: #000000;">David Sarrut, Phd</span></div>
<div><span style="color: #000000;">Directeur de recherche CNRS</span></div>
<div><span style="color: #000000;">CREATIS, UMR CNRS 5220, Inserm U1294</span></div>
<div><span style="color: #000000;">Centre de lutte contre le cancer Léon Bérard</span></div>
<div><span style="color: #000000;">28 rue Laënnec, 69373 Lyon cedex 08</span></div>
<div><span style="color: #000000;">Tel : 04 78 78 51 51 / 06 74 72 05 42</span></div>
<div><span style="color: #000000;"><a href="http://dsarrut.github.io" target="_blank" rel="noopener noreferrer">http://dsarrut.github.io</a></span></div>
<div><span style="color: #000000;">_________________________________</span></div>
<div><span style="color: #000000;"> "2 + 2 = 5, for extremely large values of 2"</span></div>
<div><span style="color: #000000;">_________________________________</span></div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
<br />
<div style="margin: 0px; padding: 0px; font-family: monospace;">_______________________________________________<br />Gate-users mailing list<br /><a href="mailto:Gate-users@lists.opengatecollaboration.org" rel="noreferrer">Gate-users@lists.opengatecollaboration.org</a><br /><a href="http://lists.opengatecollaboration.org/mailman/listinfo/gate-users" target="_blank" rel="noopener noreferrer">http://lists.opengatecollaboration.org/mailman/listinfo/gate-users</a></div>
</blockquote>
</div>
</blockquote>
</div>
</div>
</blockquote>
</body></html>