[ROOT] Error in <TBuffer::ReadClass>: got wrong class: TObject

From: Colin Bernet (bernet@hep.saclay.cea.fr)
Date: Mon Jul 22 2002 - 16:43:00 MEST


Hello, dear rooters.

First of all, sorry for this long mail...
I created a tree containing (as usual) vectors of tracks and
vertices. This tree has one single branch for an MEvent object : 

class MEvent : public TObject {
 
 public:
  int number;   
  vector<MVertex> vertex;
  vector<MTrack>  track;
  
  MEvent();
// ...

  ClassDef(MEvent,1)
};

As you can see, I would like to use STL vectors to store vertices and
tracks. Everything seems to work fine, except I get the following error
message at the first TTree::GetEntry(int)

Error in <TBuffer::ReadClass>: got wrong class: TObject

Does anybody know what could be the cause of this message ? 
In case you need it, my code can be found in 
/afs/cern.ch/user/c/cbernet/public/MDST

Tree is created and filled or chained and read in MDST class.
Linux/testMDST produced the tree
Linux/Debug reads the tree and produces the error message.

executables are in 
/afs/cern.ch/user/c/cbernet/public/MDST/Linux

I also have a question : At the beginning, my LinkDef was :

#ifdef __CINT__

#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;

#pragma link C++ class MTrack;
#pragma link C++ class MVertex;
#pragma link C++ class MEvent;
#pragma link C++ class MDST;

#endif

Then the tree was filled but the vectors of tracks and vertices were empty
at reading stage. Wandering on the root web site, I found out that
appending "+" at the end of the class names in the LinkDef solves this
problem.

Is this the normal behaviour ? is it related to the "wrong class" error
message ?

I tried with root 3.00/06 and 3.03/07.

thanks a lot if you can help me.
Colin



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:51:00 MET