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()
parser.open(filename)
parser.read()
#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 = matrix.name
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(matrix.data[row][column])
theTree.Fill()
theFile.Write()
# write and close
theFile.Close()
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?
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. Of course the splitting does not make much sense here. In the former version I wondered why so many subobjects are within one branch
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”…
The libMatrix library is no longer hard linked to the root executable and should be loaded by the autoloader.
Philippe[/quote]
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.