Hi Jonathan,
The idea of storing things that are constants in treename->GetUserInfo()
is good. However, you can only add objects deriving from TObject in this
list. To store your array (or multiple arrays), you can use objects
like TVectorF or TH1F. Adding it as a TH1F (or TGraph) has the advantage
that you can still visualize quickly the contents of the array.
For roottalk readers, note that I introduced this facility in version
4.00/08.
Rene Brun
On
Thu, 16 Sep 2004, Jonathan Eisch wrote:
> Hi,
>
> I'm rather new to ROOT, so please bear with me.
>
> I'm using ROOT 4.00/08 and I'm trying to build a tree with waveforms.
> I have one branch that is an array of type Float_t for the time and
> another for the voltage. The time array is constant for each branch,
> so I'd like to be able to be able to tell root that it's always
> constant and to only store it once (it takes up much more space than
> the mostly zero filled voltage array. I've tried:
>
> Float_t time[10000]; // holds the point times
> treename->GetUserInfo()->Add(time);
> waves1.Branch("chx_time",&time,"chx_time[numpoints]/F");
>
> but I know that my use of GetUserInfo() is incorrect, and I can't find
> much for documentation/examples of it's use.
>
> -Jonathan
>
This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:09 MET