[Gate-users] [Fwd: parametrized macro]

Philipp Matthies philipp.matthies at googlemail.com
Fri Oct 22 10:10:28 CEST 2010


Hi Marta,

I'm using Gate v5 and there you can run a parametrized macro by 

	gate -a NAME_OF_VARIABLE VALUE_OF_VARIABLE 'PATH_TO SCRIPT'

I'm not sure whether your syntax
> Gate -a myfile testfile < mymacro.mac
is correct, because I think "myfile" and "testfile" have to be just names and values instead of files.

> If I try the command:
> Gate -a myfile
> 
> I get the error:
> [G4-cerr] Not enough arguments after the option flag '-a'
> The syntax to use this flag, which allows to create an alias, is:
> 	Gate -a ALIAS_NAME ALIAS_VALUE
> 
> As if the command is now recognized but there are not enough arguments.

Didn't you answer your question by yourself? You checked the syntax
> 	Gate -a ALIAS_NAME ALIAS_VALUE

and entered the command with a wrong one
> Gate -a myfile
and got the warning
> [G4-cerr] Not enough arguments after the option flag '-a'


> As if the command is now recognized but there are not enough arguments.
mmh.... yes, correct.

So just to make it clear again: In your macro you use a line like
	...
	/gate/source/one/gps/centre {source1_x} {source1_y} {source1_z} mm
	...

and then you run GATE using the command
	gate -a source1_x 5 -a source1_y 10 -a source1_z 15 '../gate_scripts/prerunGate.mac'

This will replace {source1_x} by '5' and so on.

Hope this helps you.


Cheers,
Philipp



> ---------------------------- Original Message ----------------------------
> Subject: parametrized macro
> From:    mlai at ca.infn.it
> Date:    Tue, October 19, 2010 12:35 pm
> To:      gate-users at lists.opengatecollaboration.org
> --------------------------------------------------------------------------
> 
> I have installed GATE v 6.0 p04.
> I am trying to use the parametrized macros:
> With the command:
> Gate -a myfile testfile < mymacro.mac
> or the command
> Gate -a myfile testfile
> I get the following error:
> [Core-0] Starting macro -a
> 	[G4-cerr] ***** Can not open a macro file <-a>
> [Gate] Sorry, error in a macro command : abort.
> 
> as if it does not recognize the alias command -a.
> 
> If I try the command:
> Gate -a myfile
> 
> I get the error:
> [G4-cerr] Not enough arguments after the option flag '-a'
> The syntax to use this flag, which allows to create an alias, is:
> 	Gate -a ALIAS_NAME ALIAS_VALUE
> 
> As if the command is now recognized but there are not enough arguments.
> 
> Can anyone help me please?
> Thanks.
> Marta


More information about the Gate-users mailing list