[Gate-users] Can't use IAEA phase space

Stathis Kamperis ekamperi at gmail.com
Tue Oct 28 01:57:43 CET 2014


Hi Davis,

I also suggest that you just use .root. The IAEA code has many issues...

That said, I think that the problem you are encountering isn't related
to the errors I analyzed in my previous emails. I think that your
problem might be just a typographic error in the code (I'm using Gate
6.2):

stathis:Downloads/gate_v6.2% cat -n
./source/digits_hits/src/GatePhaseSpaceActor.cc | grep -A5 '// gamma'
   279      if( pdg == 22) pIAEARecordType->particle = 1; // gamma
   280      else if( pdg == 11) pIAEARecordType->particle = 2; // electron
   281      else if( pdg == -11) pIAEARecordType->particle = 3; // positron
   282      else if( pdg == 2112) pIAEARecordType->particle = 4; // neutron
   283      else if( pdg == 2122) pIAEARecordType->particle = 5; // proton
   284      else GateError("Actor phase space: particle not available
in IAEA format." );

At line 283 the code checks whether the particle is a proton by
comparing its PDG code (Particle Data Group, IIRC)  against the
constant 2122, which supposedly corresponds to protons. If you check
the Geant4 documentation though[1], you will see that 2122 corresponds
to some other baryon, not proton. Proton has a PDG code 2212, so I
suggest that you replace line 283:

283      else if( pdg == 2122) pIAEARecordType->particle = 5; // proton

with this:

283      else if( pdg == 2212) pIAEARecordType->particle = 5; // proton

rebuild Gate and try again. This is why when you are using an e-
source, everything works well. Because the check for electrons is
correct since electrons do have a PDG code 11.

Disclaimer: I haven't read the code thoroughly, so I might be wrong or
there might be other issues as well. The lack of a consistent coding
style makes the code review a tiresome process (an issue I also had
with Geant4 as well).

Good luck.

Best regards,
Stathis Kamperis


____
[1] http://geant4.cern.ch/G4UsersDocuments/UsersGuides/ForApplicationDeveloper/html/Appendix/particleList.src/baryons/index.html


On Mon, Oct 27, 2014 at 10:15 AM, Grevillot Loic
<loic.grevillot at medaustron.at> wrote:
> Hi David,
>
>
>
> For phase spaces, I would suggest to use root format instead of IAEA (just
> change the output to .root).
>
> If you still need IAEA, from what I remember there is an issue with the IAEA
> format (corrupted Phase space or else). Sometimes ago, “Stahis” (look on the
> mailing-list exchanges) made a lot of posts about that and proposed a
> solution. I attached one e-mail if that can help. In future someone should
> implement correctly a patch for IAEA PhS in Gate – if you can do it that
> would be a very good contribution!
>
>
>
> Sincerely,
>
> Loïc
>
>
>
>
>
>
>
>
>
> From: gate-users-bounces at lists.opengatecollaboration.org
> [mailto:gate-users-bounces at lists.opengatecollaboration.org] On Behalf Of
> David Watts
> Sent: Mittwoch, 22. Oktober 2014 11:53
> To: gate-users at lists.opengatecollaboration.org
> Subject: [Gate-users] Can't use IAEA phase space
>
>
>
> Hi Gate community,
>
>
>
> I’m doing some tests recently with Phase Spaces. In particular, I’m trying
> to generate a IAEA Phase Space.
>
>
>
> I’ve just had the error, “src/GatePhaseSpaceActor.cc (l.267): Actor phase
> space: particle not available in IAEA format.”
>
>
>
> This is odd because I am generating a beam of protons using the gps source…
> like this:
>
>                 /gate/source/addSource PBS-source gps
>
>                 /gate/source/PBS-source/gps/particle proton
>
>                 /gate/source/PBS-source/gps/pos/type Beam
>
>                 /gate/source/PBS-source/gps/pos/rot1 0 1 0
>
>                 /gate/source/PBS-source/gps/pos/rot2 1 0 0
>
>                 /gate/source/PBS-source/gps/pos/shape Circle
>
>                 /gate/source/PBS-source/gps/pos/centre 0 0 0 mm
>
>                 /gate/source/PBS-source/gps/pos/sigma_x 0.5 mm
>
>                 /gate/source/PBS-source/gps/pos/sigma_y 0.5 mm
>
>                 /gate/source/PBS-source/gps/ene/mono 70 MeV
>
>                 /gate/source/PBS-source/gps/ene/sigma 0 MeV
>
>                 /gate/source/PBS-source/gps/ene/type Gauss
>
>                 /gate/source/PBS-source/gps/direction 0 0 1
>
>                 /gate/application/setTotalNumberOfPrimaries 10000
>
>
>
> If I change the second line to ‘e-‘ , the simulation runs fine, and the
> output IAEA PS is generated (along with the header file).
>
>
>
> Can someone help please? I’m running the GATE virtual image “vGATE_2.0.vdi”
> on Virtual Box
>
>
>
> In order to avoid starting a new thread on a similar topic, I will include
> another question. What I’m trying to do is develop a method for importing
> particle distributions from beam dynamics codes (such as LINAC… Parmela
> format) as a PS source in GATE. If someone has already done this and is
> willing to share the solution that would be great!
>
>
>
>
>
> Cheers,
>
> Dave.
>
> Disclaimer:
> Please notice our E-Mail Disclaimer
> http://www.medaustron.at/email-disclaimer/
>
>
>
> _______________________________________________
> Gate-users mailing list
> Gate-users at lists.opengatecollaboration.org
> http://lists.opengatecollaboration.org/mailman/listinfo/gate-users


More information about the Gate-users mailing list