#include"TFile.h" #include"TH1.h" #include"TMatrixD.h" #include void FSA2() { TFile *f1 = new TFile("fileketqua.root", "recreate"); const int nlines=2048; // so dong trong file TKA Double_t phomau[nlines],phochuan[4][nlines]; Double_t anpha[4][4],beta[4],a[4],xichma[4]; Int_t i; //pho betong TFile file("hopdami20betong_truphong.root"); TH1F *hpho = (TH1F*)file.Get("h3"); for (i=0;iGetBinContent(i + 1); phomau[i]=value; } // file.Close(); // write phochuan //cat TFile file1("hopcat20_truphong.root"); TH1F *hpho1 = (TH1F*)file1.Get("h3"); for (i=0;iGetBinContent(i + 1); phochuan[0][i]=value1; } // file1.Close(); //da TFile file2("hopdami20_truphong.root"); TH1F *hpho2 = (TH1F*)file2.Get("h3"); for (i=0;iGetBinContent(i + 1); phochuan[1][i]=value2; } // file2.Close(); //nuoc TFile file3("hopnuoc20_truphong.root"); TH1F *hpho3 = (TH1F*)file3.Get("h3"); for (i=0;iGetBinContent(i + 1); phochuan[2][i]=value3; } // file3.Close(); //xi mang TFile file4("hopximang20_truphong.root"); TH1F *hpho4 = (TH1F*)file4.Get("h3"); for (i = 0; i < nlines; i++) { Float_t value4 = 0.0; if (hpho4) value4 = hpho4->GetBinContent(i + 1); phochuan[3][i]=value4; } // file4.Close(); //Tinh ma tran Int_t j,x; for (j = 0; j < 4; j++) { beta[j]=0; a[j]=0; for (x=0;x<4;x++) anpha[j][x]=0; } /*for (j=0;j<4;j++){ beta[j]=0; a[j]=0; for (x=0;x<4,x++) { anpha[j][x]=0; } }*/ Int_t c; for (c=0;cWrite(); delete f1; std::cout<<"a =\t"<