Hi Ben,
There are no (intended) restriction on multiple inheritance. However there
was a few bugs that have been fixed recently.
Could you please try with ROOT v3.05/07? If it does work, please send me a
small tar file to reproduce the problem.
Thanks,
Philippe
-----Original Message-----
From: owner-roottalk@pcroot.cern.ch
[mailto:owner-roottalk@pcroot.cern.ch]On Behalf Of Ben Morgan
Sent: Monday, July 28, 2003 11:17 AM
To: roottalk@pcroot.cern.ch
Subject: [ROOT] Storing Inherited Classes in TTree
Hi ROOTers,
I've been writing a data storage class which inherits from
TObject and two header classes:
class TRDMwpcEvent : public TObject, public TRDTimeHeader, public
TRDSlowHeader
Neither of the 'Header' classes inherits from TObject, but they both have
ClassDef and ClassImp defined. They also only have simple data members,
Int_ts or Float_ts. The code for these classes compiles and builds into a
shared library without complaint, and I can create/delete objects without
any problem (I'm using ROOT v3.05/03 built with gcc3.2 on a RH7.3 PC).
I can also write TRDMwpcEvent objects to a TTree without any fault, but
the real problem is that I can't read the data back in if the TTree branch
for the object is split. i.e. using
TBranch *branch =
tree->Branch("RDMwpcDataBranch","TRDMwpcEvent",&tdd,32000,0);
produces a data file I can read, but
TBranch *branch =
tree->Branch("RDMwpcDataBranch","TRDMwpcEvent",&tdd,32000,2);
leads to a seg. fault when trying to extract data from
the TTree to a TRDMwpcObject with GetEntry. Is there a restriction on
inherited classes being written to TTrees, or am I missing something
obvious? Thanks for any advice you can offer,
Ben Morgan.
--
----------------------------------------------------------------------------
---
Mr. Ben Morgan Tel: 44 (0)114 22 23553 (Work)
Postgraduate Student
University of Sheffield
Department of Physics & Astronomy
Hicks Building
Hounsfield Road
Sheffield S3 7RH
----------------------------------------------------------------------------
---
This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:14 MET