Problems while creating branches in new 5.16/00 with python


Iam using python to store some TMatrixD as branches in a tree. With ROOT 5.12 it worked but when using the new version 5.16 it says:

“Warning in TTree::Bronch: TMatrixT cannot be split, resetting splitlevel to 0”

and there is no data in the branches. The error message appears at the point where the branch is created. Here is the code which does the filling:

for filename in filenames:

        # start parsing
        parser = Parser()

        #make tree name ROOT save
        treename = filename.replace("-","_").split(".")[0]
        theTree = TTree(treename, "DataTree")

        # create all needed branches and buffers
        branchBuffers = []

        for timestep, matrix in zip(xrange(10000), parser.MyMatrices):

            branchBuffers.append(TMatrixD(matrix.nrows, matrix.ncolumns))
            branchname =
            tmp = theTree.Branch(branchname, "TMatrixD", branchBuffers[timestep])

        # fill the matrices
        for index, matrix in zip(xrange(10000), parser.MyMatrices):
            for row in range(0, matrix.nrows):
                for column in range(0, matrix.ncolumns):
                   branchBuffers[index][row][column] = float([row][column])

    # write and close

Hi again!

I must correct my statement. It seems that the data has been filled. I was irritated because of this warning and the fact that looking at the data with “StartViewer()” the objects filled looked very different from the case where I used 5.12. When reading the file in root it in addition says:

“Warning in TClass::TClass: no dictionary for class TMatrixT is available
Warning in TClass::TClass: no dictionary for class TMatrixTBase is available

which did not appear in the 5.12 case. So can anybody explain the difference in the two versions and what to do to get rid of the warnings?



The libMatrix library is no longer hard linked to the root executable and should be loaded by the autoloader.



After loading the the warning while loading the root file disappeared. Also the warning

“Warning in TTree::Bronch: TMatrixT cannot be split, resetting splitlevel to 0”

disappeared after setting the splitlevel to zero by hand:

tmp = theTree.Branch(branchname, “TMatrixD”, branchBuffers[timestep],32000,0)

Also the data is filled, the only difference I noticed is, that now the stored objects are looking quite different in the Viewer. Before each branch had many subobjects (such as “fElements”, “fNcols”, …) which now are no more present. Is this just a new way of treating such objects (like TMatrixD) in the new version?

Thanks a lot,

In version 5.16 objects like TMatrix and TVector are declared non splittable as splitting theses objects does not make much sense.


Hi Rene!

Thanks a lot. Of course the splitting does not make much sense here. In the former version I wondered why so many subobjects are within one branch :slight_smile:
I just wanted to be sure to do the right thing…
One additional question: In 5.12 (because of the splitting) one was able to “Scan” for example the “fElements” and got the values as a screen output. Now “Scan” does not work in the same way anymore. Is there another way of getting a screen output of e.g. a matrix content by using the Viewer? Of course one can use the “print” statement on the shell but it was a nice feature to see the content by just “clicking” on the “Scan button”…


A priori, you should be able to scan (and also browse) inside unsplitted object.
Let me know if this is not the case with your example with root 5.16?



The libMatrix library is no longer hard linked to the root executable and should be loaded by the autoloader.


Can you please explain this in more detail or point me to a reference that descibes the “autoloader”. I also store TMatrixT<> objects to a root file and at least for interactive scripts I am also having this error now as well.




I attached two pictures that show what happens when scanning an object. in the version 5.16 where only the matrix object is present, the scan just gives one line (no info about the content). When using 5.12 and scanning the “fElements” the data filled can bee seen.

Hi lindenle!

I tried

and it worked.