Problem with vectors of objects in trees

Hi

I’m writing a data format for the NOvA experiment and i would like to put std::vectors of objects in the class that I write out. All the data format classes are inside the namespace “SoCal” (dont ask!).

I seem to be having problems with the dictionarys. After reading the user manual and experimenting with different things in the LinkDef.h file I’m having some trouble getting stable IO. The current implementation writes out fine, however, when I open the resulting ROOT file in root and try to draw something, it complains:

UNKNOW type, sopen=NeuKin

UNKNOW type, sopen=StdHEP
UNKNOW type, sopen=ScintHit
UNKNOW type, sopen=PESignal
UNKNOW type, sopen=Digit

…then it segv’s and root goes into zombie mode.

I’m betting that there is some problem with having concrete objects inside vectors, that seems to be the suggestion from other posts:
root.cern.ch/root/roottalk/roottalk01/1358.html

But I dont know how to fix it.

I have put my current test code on the web for you to try out:
hep.caltech.edu/~howcroft/socal.tar.gz

Once you have untardet the above file, the Event directory holds the data format. The top level object (the one I put in TTree::Branch()) is Record.h. The TestJob directory shows an example of usage.

Can anyone point out where I’m going wrong here?

Caius

To build the software, just untar the file and you get a socal directory.
setup ROOTSYS, (and PATH and LD_LIBRARY_PATH)
cd socal
setenv SOCAL_DIR $PWD
(add $SOCAL_DIR/lib to your LD_LIBRARY_PATH)
gmake

To build the example job:
cd TestJob
gmake

The to get a data file to run on:
hep.caltech.edu/~howcroft/nova_test.root

Then in the TestJob, run the exmaple job:
./socal nova_test.root

This will produce a small file called nue_test.root: try to open this in a root session:

One thing I forgot to say: my objects that I am trying to dump to a tree DO NOT inherit from TObject. I was under the impression this was no longer a requirment for IO.

–Caius

Hi,

I could not reproduce this problem with ROOT 5.11/07 (and hence the upcoming 5.12 production release). I suggest you upgrade your version of ROOT.

Cheers,
Philippe.