Writing an array with only 1 element to a TTree

Dear rooters,

I have a little event class which (besides other things) contains an array of double with only one element, i.e., double[1] .
I am storing this class in a tree. Everything seems to work OK so far.
However, if I try to copy a subset of the tree to another file, the message

appears on the console window for each event. This does not happen if I let the array have at least two elements.
I admit that an array with only one element makes little sense at first impression, but it makes the later development easier in my case and I think it should be supported.
Another subtlety: The double[1] business does work if I generate the file to be reread in the same root session which rereads – I do not understand this behaviour. Please try the attached example (with a stripped-down TEvent_Det class) by typing

root -l eventproblem.C(true)

to generate an example file & tree, get it closed, reopened and read / copied (works) and

root -l eventproblem.C(false)

to skip generating the first file and read it as it was generated last time (=> problem).

Can anyone explain this effect to me?

Thanks,

Moritz

root 5.21/04 under Windows Vista / VC++ 2008[/code]
TEvent_Det.h (514 Bytes)
eventproblem.C (1.6 KB)

Hi,

Thanks for reporting this problem. It has been fixed in the SVN trunk.
You can also work around the problem with your version of ROOT, by executing the following codeTClass::GetClass("TEvent_Det")->GetStreamerInfo();after loading the library containing the dictionary for TEvent_Det and before opening the ROOT file.

Cheers,
Philippe

This one line of code did the trick.

Thank you!

Moritz