Again TTree::MakeClass

Dear ROOTers,
I have in my tree a variable-lenght array, such as TDCt[nTDC].
When i use MakeClass, i notice that in the class

Int_t TDCt[31]; //[nTDC]

is declared, and i don’t know why this “31” is chosen as array lenght.

Is it correct? Should I adjust manually the size?

Are you using a very old version (more than 4 years old)?

If your Tree was produced with a declaration like
Int_t *TDCt; //[nTDC]

the code generated by MakeClass will contain one line like
Int_t TDCt[kMaxnTDC]; //[nTDC]

where kMaxnTDC will be declared early in the file with teh maximum value
seen in nTDC when filling the Tree, eg
const Int_t kMaxnTDC = 56;

If this is not the case, please post a copy of a small root file showing this problem

Rene

[quote=“brun”]Are you using a very old version (more than 4 years old)?

If your Tree was produced with a declaration like
Int_t *TDCt; //[nTDC]

the code generated by MakeClass will contain one line like
Int_t TDCt[kMaxnTDC]; //[nTDC]

where kMaxnTDC will be declared early in the file with teh maximum value
seen in nTDC when filling the Tree, eg
const Int_t kMaxnTDC = 56;

If this is not the case, please post a copy of a small root file showing this problem

Rene[/quote]

the versions are the following:
ROOT v4.03.04, compiled by me on a Scientific Linux (maybe SLAC version) pc with gcc vesion 3.2.3

I attached the root file containing the tree and the routine i used to fill the tree. In the meanwhile i have increased manually the length of the array, but in this case i lose the advantage of re-using Makeclass to update the tree structure.
readdata.C (2.09 KB)
run0.root (381 KB)