{
//________________________________________________________________________________
/*
makeCovMatrix.C
A simple example ROOT script which turns a hard-coded matrix in the script (tDat)
into a small ROOT file with just the matrix. The covariance matrix ROOT file
is used as an input to grwghtnp, the covariance reweighting routine.
The error matrix provided is for reweighting the four z-expansion parameters
for the axial form factor. These values are UNPHYSICAL and are only for demonstration.
Typical numerical values are included in Phys.Rev.D 93, 113015
e-Print arXiv: 1603.03048 [hep-ph], which is calculated from combining
Eqs. (32) and (33) to form an error matrix.
*/
#include
int nP = 4; // matrix size
TFile *fMat = new TFile("tmat.out.root","recreate");
// UNPHYSICAL covariance matrix
double tDat[nP][nP] =
{{0.0154, 0.0, 0.0, 0.0},
{0.0, 1.08, 0.0, 0.0},
{0.0, 0.0, 6.54, 0.0},
{0.0, 0.0, 0.0, 7.40} };
// flatten matrix into 1-D array
double tFlt[nP* nP] = {0.};
for (int i=0;i j)
{
std::cout<< "Matrix needs to be symmetric!" << std::endl;
std::cout<< i<<","<Write("tMat",TObject::kOverwrite);
fMat->Close();
exit(0);
}