Covariance matrix

Hello Rooters,

I want to calculate the chi^2 to be used in the MINUIT2 mimimization program later as follows. My measurements are correlated and hence I use the covariance matrix Cov_{ij} in the chi^2 definition. This definition will be used in the FCN implementation for MINUIT.

chi^2 = Transpose((N^pred - N^observed)i) (Cov{ij})^(-1) ((N^pred - N^observed)_j)

Is there any built-in class or function in ROOT that let’s me construct a covariance matrix from the data points stored in TH1F or TH2F? Otherwise I can construct it manually.

I apologise if this question is answered in some other post, however, I couldn’t find any.


Maybe your problem has something in common with this thread:

But you need the data points (as ntuples) to work, rather than histos. Perhaps the experts can give a more relevant answer.

Best regards,