[Gate-users] Using ROOT -> ASCII; any way to pass command line variables?

Gaens, Michaela m.gaens at fz-juelich.de
Mon Feb 10 10:04:36 CET 2014


Hi Bryan,

I have had a similar problem once and I don't remember where I found it, but this is how I am doing it now:
You can define parameters for the main function in you root macro (rootout_scanner), e.g.:

void rootout_scanner( char*  outname)
{...}

and then you can pass the parameters on the command line like this:

root -l 'rootout_scanner.C( "rootout_scanner.dat" )'

I hope this helps.

Michaela

On 07.02.2014, at 18:58, Bryan McIntosh wrote:

Hi everyone,

I've been using a ROOT script to convert output from ROOT format to ASCII format for some time now, but have reached a point where I will be generating a massive number of simulations. At the moment my file names are hard-coded (my sample script rootout_scanner.C is available for viewing at https://drive.google.com/file/d/0B62SIY5aoKjqMERKZGQ1SXN1ZTQ/edit?usp=sharing), and I'd really like to be able to run the script in the following way from the command line:

root -l -q -b [FILENAME] rootout_scanner.C

I've searched the ROOT documentation, but haven't been able to find a way to pass in command line variables to ROOT. Has anyone else been able to do this? Right now I'm using a clunky Bash script to rename files so that they match the name in the ROOT script, and it's going to cause some issues as I start multi-threading simulation runs.

Any insight you can offer would be a big help!

Cheers,

-Bryan
_______________________________________________
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



------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opengatecollaboration.org/mailman/private/gate-users/attachments/20140210/a7967766/attachment.html>


More information about the Gate-users mailing list