Re: cint :: Limitation: Function can not be defined in a command line or a tempfile

From: suvayu ali <fatkasuvayu_at_gmail.com>
Date: Fri, 29 Jul 2011 11:39:58 +0200


Hi Adrian,

On Fri, Jul 29, 2011 at 10:41 AM, Adrian Sevcenco <Adrian.Sevcenco_at_cern.ch> wrote:

>> You can always have named macros.

> not in interpretor shell as it seems.. and also that would defeat the
> purpose of what i do; instead of doing :

Sorry I wasn't clear enough. Although ROOT does not allow you to define functions within rootcint, you can always define such functions in a root macro.

> root script.C 'complicated_form_to_pass_arguments'
> i have :
> script arg1 arg2
> and i kind of want to keep this ..

To retain your workflow all you need is to change the shebang line from root to bash/<whatever shell you use>.

An example:

#!/bin/bash

root -l -b <<EOF
.L someROOTmacro.C+
someROOTmacro(..)
.q
EOF The added advantage of this method is you can do all kinds of string manipulation with the arguments you pass to the script with usual shell scripting tricks. For the lack of a better name, your script becomes a "bi-lingual" script (bash and ROOT).

> Thank you,
> Adrian

Hope this helps.

-- 
Suvayu

Open source is the future. It sets us free.
Received on Fri Jul 29 2011 - 11:40:23 CEST

This archive was generated by hypermail 2.2.0 : Fri Jul 29 2011 - 23:50:01 CEST