Re: Create a bash-script that runs C-files in ROOT

From: Philip Rodrigues <p.rodrigues1_at_physics.ox.ac.uk>
Date: Tue, 6 Apr 2010 10:11:25 +0100


Hi Ida,
root will execute any scripts you pass to it on the commandline, eg:

root -q myscript.C myscript2.C

will execute myscript.C followed by myscript2.C. The "-q" tells root to quit when done. If you're running from a bash script you might want to also add "-b" to make root run in batch mode (no graphics will be displayed on screen).

Regards,
Phil

Ida Häggström wrote:
> Hi!
>
> I'm quite new to ROOT so I've run into a problem with automating
> ROOT-runs. I run a couple of C-scripts in ROOT that calls for some
> ROOT-data files and creates new files (not .root). So, for one file I do
> this:
>
> ------------------------------------------------------------
> >> root
> root [0] .x myCScript.C (this C-script calls for
> "rootFile_0.root" and creates a new file)
> root [1] .x mySecondCScript.C (this script calls for the output of
> the first C-script and creates a new file)
> root [2] .q
> ------------------------------------------------------------
>
> I want to do this on a whole bunch of files (rootFile_0.root -
> rootFile_40.root) but this is really cumbersome to do manually. I want
> to create a bash-script to run from my Linux teminal that calls for ROOT
> and executes the C-scripts and so on... Any ideas how to get started
> with this would be greatly appreciated! Thanks,
> /Ida
>
>
>
>
Received on Tue Apr 06 2010 - 11:11:31 CEST

This archive was generated by hypermail 2.2.0 : Tue Apr 06 2010 - 17:50:01 CEST