using `my classes'

From: Wouter Hulsbergen (s37@nikhef.nl)
Date: Mon Jun 09 1997 - 18:09:00 MEST


Hello there,

I am not that much of a C++ programmer yet, so this might be a silly
question, but:

I am using some CLHEP classes and have tried to store them in a TTree.
Although the following code is compiling (g++) and running 

	  Hep3Vector *p = new Hep3Vector(mtrIt->px,mtrIt->py,mtrIt->pz) ;
	  if (branch) branch->SetAddress(p) ;
	  else branch = tree->Branch("momentum", "Hep3Vector",0,64000,1) ;
	  tree->Fill() ;

(where mtrIt is an iterator over an (Hera-B) Arte table and Hep3Vector
is a CLHEP class name), I don't have a clue if it is legal. In root, I can
open the TFile and TTree.GetEntries() returns the right number of events,
but I haven't managed to read the "Hep3Vector".

According to the TTree class description, storing objects in a tree only
works for objects inherited from TObject. Then, why does my code run
and how should I build the CLHEP classes, such that they are
inherited from TObject, in a proper (OO) way?

Thanks, regards, Wouter



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:26:19 MET