This is kind of simple question for you.
I have 120(6X6 matrix) TMatrixD(from generated) and 120 TvectorD(from data) made from two different runs.
I can print them in the terminal /copy and paste into a txt file.
I need to multiply these two(Aj= Mij* Ai), what is the easy way to do that?
No idea how to multiply matrix and vector in two different files.
is there a way to store Matrices/vectors in .root file ?
Any idea/code would be greatly appreciated.
I might be wrong , but since TMatrix inherits from TObject, you can write it to a TFile and retrieve it back.
Have you tried to write the object to a TFile and check you can get it back when reading the file?
import ROOT as r
fOut = r.TFile("test_save.root","RECREATE")
rows = 5
cols = 6
matrix = r.TMatrixD(5, 6)
matrix = 1
fIn = r.TFile("test_save.root")
matrixRead = fIn.Get("mymatrix")
Tried on a notebook and there is no problem to write a matrix to a file and read it back
Thank You RENATO_QUAGLIANI.
I will try this way.