BufferFile::CheckByteCount and Streamer

Hi

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?

I am using 6.12/04 in a CentOS 7.4.1708

echo $LD_LIBRARY_PATH 
/home/mfg/apps/root/lib:/afs/cern.ch/sw/lcg/contrib/gcc/4.8/x86_64-slc6/lib64:/home/mfg/TRICS_old
echo $ROOT_INCLUDE_PATH 
/home/mfg/apps/root/include:/home/mfg/TRICS_old
echo $ROOTSYS 
/home/mfg/apps/root
[

Thank you

Hi,

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?

Cheers,
Philippe.

Hello Philippe

thank you so much for your kind help.

Anwers:
Does TWaveForm have a ClassDef?
Yes

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:
#ifdef CLING
#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.

SimpleCompile_sh.txt (1.3 KB)
TWaveDict.C (8.0 KB)

Please, let me know if you need the code. I can strip it off or send it in zipped format. It is made of 3 small classes and a main.

Does TWaveForm have a ClassDef?
Yes

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.

Cheers,

Yes ! These 2 advices fixed it!

Big relief !!
Thank you very much !

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.