Re: [ROOT] TMatrix .. TObject

From: Rene Brun (Rene.Brun@cern.ch)
Date: Thu Mar 02 2000 - 10:42:03 MET


Hi Matevz,
Why do you want to complicate your life ?
Instead of:
class ZNode : public TNamed, public ZTrans {}

simply have:
class ZNode : public ZTrans {}
private:
TString  fName:
public:
  virtual const char* GetName() const
  virtual void SetName(const char* name)

see for example Root class TPave.

Rene Brun

Matevz Tadel wrote:
> 
> Hi,
> 
> tried the following:
> class ZTrans : public TMatrix {}
> class ZNode : public TNamed, public ZTrans {}
> and finished (of course ... what have i been thinking) with ambiguous
> TObject base.
> 
> Is something wrong with the following scheme:
> class RMatrix {} which implements all "raw" matrix operations
> class TMatrix : public TObject, public RMatrix {}
> 
> In this case ... the above scheme would be feasable by substituting
> class ZTrans : public RMatrix.
> Then, I could have the same interface to ZNode (which is the base for
> elements in forest of 4d objects) and ZTrans (which can appear in
> containers of classes derived from ZNode).
> 
> Now i'm using
> class ZTrans { friend class ZNode; protected: TMatrix mM; ... }
> and that makes numeric algorithms full of .mM-s.
> 
> Streaming & dictionaries work ok for non-TObject derived classes (or am i
> missing sth) ... the only problem is i can not use ROOT containers. But in
> any case ... i was spolit by stl b4 and prefer to use simple stl
> containers now that cint/rootcint supports them. (Must hide hash_maps
> ... but these are run-time information in my case ... and it's easy to
> provide simple interface to it.)
> 
> Are TTree-s the issue i'm not considering properly?
> 
> Would appreciate any comment ... still learning, trying to get the pig
> picture, to use the american lingo.
> 
> Cheers,
> matevz
> 
> ---------------------------------------------------
>  Matevz Tadel,         E-mail: Matevz.Tadel@ijs.si
>  Department of Experimental High Energy Physics F9
>  Jozef Stefan Institute,  Jamova 39,  P.o.Box 3000
>  SI-1001 Ljubljana, Slovenia
>  Tel.: +386-61-177-3674      Fax: +386-61-125-7074
> ---------------------------------------------------



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