Re: [ROOT] TGraph and vector

From: Michael Wiesmann (wiesmann@e18.physik.tu-muenchen.de)
Date: Tue Jan 08 2002 - 10:59:27 MET


Hi Colin!


 > As root was not compiled with STL (why not, Rene ?), 
 > root classes don't know about it. I also think it would be pretty
 > useful to have TTree/Branch classes know about the vector container. 
 > 
 > Anyway, even if you don't know how many points you have in your file, or
 > how many points you want, you can reallocate memory for your arrays
 > manually : 
 > 
 > float *x = malloc(100);

.... I just remember that "malloc" is one of the things not to be used
in c++ ...


My current idea is to read in an stl container and than copy this to an
array. The obvious way would be to use knowledge about how vector is
implemented in stl, but this I do not like.
I was looking for something like vector::MakeArray(), which
doesnt seem to exist. Pity ...

Anyway, thanks for the confirmation of the missing stl ...

BTW, the latest version 3.02 offers a TGraph::TGraph(TVector, ....),
which could help a bit. But unfortunately I need a TGrahpErrors, which
seems not yet to be updated ...


Michael



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:37 MET