[Gate-users] More than One Alias error and simple arithmetic in GATE

Gergely Patay gergely.patay at mediso.com
Thu Dec 8 13:33:32 CET 2016


Hi,

basic arithmetic expressions ("add", "subtract", "multiply", "divide", 
"remainder") are available in Geant macros, under the command directory /control 
. They are easy to use if you get used to the quite assembly-ish syntax.

E.g. this is a valid macro excerpt:

/control/alias radius 40.0
/control/alias crystallength 10.0
/control/divide temp {crystallength} 2.0
/control/add effectiveradius {radius} {temp}
# the {effectiveradius} will now hold the value 45.0

The full documentation is avaliable here:
http://geant4.web.cern.ch/geant4/UserDocumentation/UsersGuides/ForApplicationDeveloper/html/AllResources/Control/UIcommands/_control_.html

best regards,

  Gergely



On 2016-12-08 11:29, Thomas DESCHLER wrote:
> Hi Lukas,
>
> Yes the problem with aliases is a known issue
> <https://github.com/OpenGATE/Gate/issues/69>.
>
> To solve it just declare all aliases without spaces, like this:
> Gate -a [AliasOne,$varone][AliasTwo,$vartwo] main.mac
>
> For your second question, I don't think it is possible to do arithmetic
> operation in macros, but I could be wrong.
>
> Sincerely,
>
> Thomas
>
> *Thomas DESCHLER*
> Doctorant en Physique des Rayonnements
> Institut Pluridisciplinaire Hubert Curien <http://www.iphc.cnrs.fr/>
> Département Recherches Subatomiques
> <http://www.iphc.cnrs.fr/spip.php?page=rubrique&id_rubrique=143> - Groupe Ramses
> <http://www.iphc.cnrs.fr/-Ramses-.html>
> Bâtiment 35, Bureau 208
>
> Thomas.Deschler at iphc.cnrs.fr
> <https://mail.google.com/mail/u/0/?view=cm&fs=1&tf=1&to=Thomas.Deschler@iphc.cnrs.fr>
> (+33) 03 88 10 63 95 <tel:+33388106395>
> (+33) 06 20 96 07 49 <tel:+33620960749>
>
> 2016-12-08 10:41 GMT+01:00 Lukas Gromann <lukas.gromann at tum.de
> <mailto:lukas.gromann at tum.de>>:
>
>     Hi all,
>
>     Im trying to use aliases to batch process more than one simulation, however
>     only the first alias after the „-a“ gets read… I’m using Version 7.1, is
>     this a known bug? The wiki says I should be able to read in more than one…
>
>     The other question would be to dismiss the second alias and calculate the
>     desired value directly in the macro. (In my case the position, depending on
>     a sample size). I can not find any documentation about simple arithmetic
>     operations in the wiki. Is there a possibility to do something like „value =
>     a+b" in a gate macro?
>
>     Thanks,
>
>     Lukas
>
>     ----------------------------------------------------
>     Lukas Gromann
>
>     Lehrstuhl für Biomedizinische Physik (E17)
>     Technische Universität München
>     Boltzmannstrasse 11
>     85748 Garching
>
>     Lukas.Gromann at TUM.de <mailto:Lukas.Gromann at TUM.de>
>
>     Tel.: 089-289/10905
>     Mobil: 017629718306
>
>
>     _______________________________________________
>     Gate-users mailing list
>     Gate-users at lists.opengatecollaboration.org
>     <mailto:Gate-users at lists.opengatecollaboration.org>
>     http://lists.opengatecollaboration.org/mailman/listinfo/gate-users
>     <http://lists.opengatecollaboration.org/mailman/listinfo/gate-users>
>
>
>
>
> _______________________________________________
> 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