The ROOT class TTree has 3 member functions to create branches:
a, Branch(const Text_t *name, TClonesArray *list, Int_t bufsize=32000, Int_t splitlevel=1);
b, Branch(const Text_t *name, const Text_t *classname, void *addobj, Int_t bufsize=32000, Int_t splitlevel=1);
c, Branch(const Text_t *name, void *address, const Text_t *leaflist, Int_t bufsize=32000);
type a can be used to create a branch corresponding to one or few variables.
type b can be used to create a branch corresponding to an object derived from TObject
type c can be used to create a branch corresponding to a special list type TClonesArray.
In your case, you call a type b function. This is not legal because your object
is not derived from TObject. You should proceed as follows:
- Create a class with a data member being a pointer to the Hep3Vector object
- Run rootcint on the corresponding header file
- Edit the generated function Streamer to include the relevant code
to serialize the Hep3Vector object. This code can use the TBuffer::WriteFastArray
functions. see for example TGraph::Streamer.
It is clear that progressively we should instrument the few widely utility classes
of CLHEP in the ROOT framework to provide an automatic I/O and an interactive
interface as well.
Rene Brun