User class in TBranch

Hello,

I am facing the following issue while trying to save an user class-based object in TTree. The object is defined as:

#ifndef MYCLASS_H
#define MYCLASS_H

#include “TObject.h”
#include “TLorentzVector.h”

class MyClass : public TLorentzVector
{
public:
MyClass();
virtual ~MyClass();

protected:

ClassDef(MyClass,1)
};

#endif

which is saved to TTree in the following way:

m_tree->Branch(“MyClass”,“std::vector”,(NtClass),32000,1);

This results in:

Fatal in TBranchElement::InitializeOffsets: Could not find the real data member ‘MyClass’ when constructing the branch ‘MyClass’ [Likely an internal error, please report to the developers].
aborting

at the execution.

If I remove the dependence on TLorentzVector, i.e. replace class MyClass : public TLorentzVector by class MyClass, everything works fine. I was wondering if something has changed in ROOTv6, because in ROOTv5 such structures were saved to TTree without any problems. Please let me know. I can provide a simple standalone example, if it is of any use.

Thanks in advance,

Kirill

Hi Kirill,

Which revision of v6 shows this problem? Did you generate a dictionary for both MyClass and vector?
If you did generate a dictionary, it should have work and we would need a runnable reproducer to debug this issue.

Thanks,
Philippe.