When I add a new data member to my class, like this:
Int_t ntcoll ;
Double_t *tcoll ; //[ntcoll]
and I create a tree, I get the following error in root (after I open the tree and do a tree->Scan(tcoll[0])):
Error in <TBufferFile::CheckByteCount>: object of class TWaveform read too many bytes: 257 instead of 256
Warning in <TBufferFile::CheckByteCount>: TWaveform::Streamer() not in sync with data on file /home/mfg/TCT_DB/analysed/2017-12-20_12-29-00_avb_LGAD_W5_I3_1.txt.root, fix Streamer()
If I remove this member everything is fine. Any hint on what could happen here?
Does TWaveForm have a ClassDef? Does it have a dictionary? If so did you use rootcling or genreflex? Either way, can you share the line where you requested the dictionary for TWaveForm? Did you recompile the dictionary after chaging TWaveForm.h?
class TWaveform : public TObject {
public:
Some data members
Int_t ntcoll ;
Double_t *tcoll ; //[ntcoll]
private:
Some data members
ClassDef(TWaveform,3) ; //ROOT RTTI
};
**Does it have a dictionary? If so did you use rootcling or genreflex? **
Yes, I use rootcling and the compilation goes as the attached script SimpleCompile.sh
Pardon, I do not understand the question. .
In the implementation file I use ClassImp(TWaveform) (directly after all the includes).
I have a LinkDef.h which reads: #ifdefCLING #pragma link C++ class TMeas+; //add byte count #endif
I attach as well the created TWaveform dictionary
Finally, I have cleaned/recompiled after every change.
When adding the new data member, did you increase the version number (this is required).
#pragma link C++ class TMeas+; //add byte count
Do you have the same for TWaveform?
Actually the dictionary say you do not or at least it is missing the trailing +.
Missing the trailing + means that there is no automatic schema evolution.
Try increasing the version number and adding the trailing+ to the #pragma link for TWaveForm.