[Gate-users] Comment line on UserSpectrum

Hiroshi Watabe watabe at cyric.tohoku.ac.jp
Wed May 6 14:23:50 CEST 2020


Dear GATE developers,

Thank you for developing the wonderful software.

Today I've struggled to solve a problem to run GATE (I'm currently
running GATE9 but I believe it happens in the previous versions).
I defined a source with user-defined energy spectrum as follows;

/gate/source/spectrumLine/gps/energytype        UserSpectrum
/gate/source/spectrumLine/gps/setSpectrumFile  DiscreteSpectrum.txt

In DiscreteSpectrum.txt, if I put # (comment out) at the beginning of
the energy-spectrum definition, Gate cannot
correctly read the energy spectrum and become all 0.

For example
DiscreteSpectrum.txt
1 0
#0.4   0.02
0.5   0.01
0.6   0.02
0.8   0.03
does not work.

I'm not sure this is correct modification but to avoid this error,
I modified physics/src/GateSPSEneDistribution.cc
as follows;
*** 177,183 ****
      inputFile.seekg(cursorPosition, inputFile.beg);  // return to the
2nd line in the file

      while(nline < mDimSpectrum) {
-       skipComment(inputFile);
        inputFile >> energyRead;
        inputFile >> probaRead;

--- 177,182 ----

Best regards,

Hiroshi

p.s. Lydia and David, thank you for organizing GATE
course in Sendai this Feb. I hope COVID-19 does not effect your work
for GATE.


-- 
--------------------------------------------------
             Hiroshi Watabe, PhD
 hwatabe at tohoku.ac.jp
Division of Radiation Protection & Safety Control,
Cyclotron and Radioisotope Center,
Tohoku University

6-3 Aoba, Aramaki, Aoba, Sendai 980-8578 Japan

Tel:+81-22-795-7803 Fax:+81-22-795-7809
--------------------------------------------------


More information about the Gate-users mailing list