Re: [ROOT] How to fill a TVector object

From: Rene Brun (Rene.Brun@cern.ch)
Date: Mon Oct 09 2000 - 17:33:16 MEST


Hi Hucheng,

We would prefer to avoid introducing a dependency of the histogram package
from classes such as TVector or TMatrix (I agree that it would be more user
friendly to do vector.Draw() or matrix.Draw().

one could add functions such as:
  TH1F::TH1F(const char *name, const char *title, TVector &vector)
  TH2F::TH2F(const char *name, const char *title, TMatrix &matrix)
  TH1D::TH1D(const char *name, const char *title, TVectorD &vector)
  TH2D::TH2D(const char *name, const char *title, TMatrixD &matrix)

One could also add something like:
  TObject *TVector::DrawCopy()
  TObject *TMatrix::DrawCopy();
  TObject *TVectorD::DrawCopy()
  TObject *TMatrixD::DrawCopy();

The DrawCopy function invoking the histogram package via the interpreter
and returning a pointer to the created histogram.

Implementing TVector::Draw,Paint, etc could also be considered, but this
would imply moving the TVector,TMatrix classes with the TH1 classes.

Input is welcome

Rene Brun

Hucheng CHEN wrote:
> 
> Hi, Rooter:
> 
> I have one newbie question about TVector, I want to read one data file
> which includes one row of data to a object of TVector, then draw it
> rather than plot histogram. In PAW, I can easily do it:
> 
> vec/read vecname data.file
> vec/draw vecname
> 
> But in ROOT, I can not find a way to do it after reading those
> tutorials. So please give me some advice. Thank you a lot.
> 
> Hucheng CHEN



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:35 MET