Re: read file from ASCII file with vector

From: Rene Brun <Rene.Brun_at_cern.ch>
Date: Wed, 3 May 2006 12:23:22 +0200 (MEST)


Note that you do not need to write a script to read data from a file to be inserted into a TGraph or TGraphErrors. These classes have dedicated constructors creating automatically a TGraph/TGraphErrors from a file

   TGraph(const char* filename, const char* format = "%lg %lg",

          Option_t* option = "")
   TGraphErrors(const char* filename, const char* format = "%lg %lg %lg

               %lg", Option_t* option = "")

Rene Brun

On
Wed, 3 May 2006, Marco Calviani wrote:

> Hi rooters,
> i've tried to build a small C++ macro to read data from an ASCII
> file to be later used to build a TGraphErrors. I've decided to use
> vector object insted of the traditional array because vector objects
> can grow dynamically un size at runtime while traditional array have a
> fixed size.
> The data are correctly read by the macro but TGraphErrors is not able
> to accept a vector as a input. I've seen that it could accept
> TVectorT: how is it possible (and if) to transform a vector into a
> TVectorT?
>
> Regards,
> Marco
>
Received on Wed May 03 2006 - 12:23:26 MEST

This archive was generated by hypermail 2.2.0 : Mon Jan 01 2007 - 16:31:58 MET