Problem with vectors of objects in trees


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:

But I dont know how to fix it.

I have put my current test code on the web for you to try out:

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?


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

To build the example job:
cd TestJob

The to get a data file to run on:

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.



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.