Problem creating branch with vector of user-defined class

Hi all,

Using ROOT 6.04/16, I’m trying to create a branch that contains vectors of objects called FTKHit, which have as a member an FTKCoord object, m_coord. This FTKCoord has its own member float also called m_coord. (I didn’t name them!)

I can get this to work successfully when I make it a vector<FTKHit*>, but for the code I’m trying to input it into, the hits can’t be a pointer. When I attempt to make a vector, I get the following error for the first branch, called “Hits0”:

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

For some context, I’m loading the library that contains all of these objects,
ROOT.gSystem.Load(“libTrigFTKSim.so”)
And another file:
ROOT.gROOT.ProcessLine(".L Loader.C+")
which reads
#include
#ifdef CINT
#pragma link C++ class FTKCoord+;
#pragma link C++ class FTKHit+;
#pragma link C++ class std::vector+;
//#else // I saw this somewhere and tried it but it caused all kinds of errors so I took it out
//template class FTKHit;
//template class std::vector;
#endif

I make the branches as follows:
for t in xrange(64):
branch_name = “Hits%s” % t
branches[branch_name] = ROOT.vector( ROOT.FTKHit.name)()

Any insight into this error would be greatly appreciated!

Best,
Tova

Hi Tova,

can you post the code so that this behaviour can be reproduced?

D