Problems writing custom class to file

Dear ROOT experts,

I’m attempting to write a class inheriting from TObjArray to file, but while I manage to create the dictionary and library just fine, and my test script runs without errors, my custom objects aren’t being written. No doubt I’m missing something, but I’d appreciate any advice as to what that could be… A tarball containing my code is attached.

Thanks,
Frank
container.tgz (1.81 KB)

Hi Frank,

Writing a TObjArray has a special meaning, see root.cern.ch/root/html/TCollecti … tion:Write

What you want is to write the collection object itself; attached version does that. I also improved a few other, irrelevant bits of code, with documentation of why it’s better.

Cheers, Axel.
testContainer.C (2.07 KB)