Hello, when I run mkclss.C on a TChain of a TTree which has a variable length array as a leaf, the .h file which is produced shows a value for the maximum dimension of the array. However, if I actually Scan the TChain to find the value, it is often larger than the value in the .h file. Why? Doesn’t mkclss.C look at all the entries in the TTree?
[quote]Doesn’t mkclss.C look at all the entries in the TTree?[/quote]MakeClass only looks at the content of the first TTree in file, reading the the whole chain could be extremely cost prohibitive (in some case most of the file of the TChain are still in the mass storage system / tape when you issue MakeClass.
Note that using MakeProxy instead of MakeClass would solve this problem (it does not use hard coded length).
Thank you for your prompt reply! A follow-up question: say that the variable length array represents Tracks in an event. If an event in the Chain beyond the first Tree has a Track array with dimension that is larger than what is produced by mkclss.C, then the extra Tracks in that event will not be read? If so, then to include all the data in my analysis I should manually reset the maximum array dimension to a sufficiently large value.
Worse, it will read them but out of the bounds of the array (hence over-writing other data).[quote] If so, then to include all the data in my analysis I should manually reset the maximum array dimension to a sufficiently large value.[/quote]Yes, you should.