Re: can root read free format card file?

From: Rene Brun (Rene.Brun@cern.ch)
Date: Mon Nov 30 1998 - 08:23:49 MET


Canguo Li wrote:
> 
>  Can ROOT read card files (like FFREAD)?
>  I guess the answer should be yes. Can anybody refer me to the relevant
> section of the ROOT manuals?
>  My plan is to read in things like detector parameters from
> free-formatted files into arrays in my ROOT application, and then in my
> program assign these parameters to some objects(e.g., material class
> predefined by ROOT). I think this should work. However, I wonder if there's
> a better or more efficient way to achieve this purpose.
> 
> --Canguo

You can read ascii files from your classes. See an example
in tutorials basic.C and staff.C.
It is however much better to replace the style "FFREAD" data cards
by a Root C++ macro calling setter functions of your classes.
This has many advantages:
 - you can call this (these) macros(s) at any time from the command line
 - macros can easily call other macros
 - the user sees one single API (interactive & batch)
 - you can document (hyperize) your input with the class THtml
Examples are given in the ATLFast package
    http://root.cern.ch/root/Atlfast.html

Rene Brun



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:34:40 MET