{ char strDir[] = "/Users/kresan/neuland/"; char strFileName[1000]; TFile *file; TH1F *h1; Float_t eff_old[4][4]; Float_t eff[4][4]; Float_t err_old[4][4]; Float_t err[4][4]; for(Int_t i = 0; i < 4; i++) { sprintf(strFileName, "%sr3breco.%1dAMeV.%1dn.%1dkeV.%1dm.old.root", strDir, 600, i+1, 500, 14); file = new TFile(strFileName); h1 = (TH1F*) file->Get("h_ntracks"); for(Int_t j = 0; j < 4; j++) { eff_old[j][i] = 100. * (Float_t)h1->GetBinContent(j+2) / 10000.; err_old[j][i] = 100. * TMath::Sqrt((Float_t)h1->GetBinContent(j+2)) / 10000.; } file->Close(); sprintf(strFileName, "%sr3breco.%1dAMeV.%1dn.%1dkeV.%1dm.root", strDir, 600, i+1, 500, 14); file = new TFile(strFileName); h1 = (TH1F*) file->Get("h_ntracks"); for(Int_t j = 0; j < 4; j++) { eff[j][i] = 100. * (Float_t)h1->GetBinContent(j+2) / 10000.; err[j][i] = 100. * TMath::Sqrt((Float_t)h1->GetBinContent(j+2)) / 10000.; } file->Close(); } char str[100]; cout << endl << endl; cout << " 1n 2n 3n 4n" << endl; for(Int_t i = 0; i < 4; i++) { cout << (i+1) << "n "; for(Int_t j = 0; j < 4; j++) { sprintf(str, "%5.2f +- %3.2f", eff_old[i][j], err_old[i][j]); cout << str << " "; } cout << endl; } cout << endl << endl; cout << " 1n 2n 3n 4n" << endl; for(Int_t i = 0; i < 4; i++) { cout << (i+1) << "n "; for(Int_t j = 0; j < 4; j++) { sprintf(str, "%5.2f +- %3.2f", eff[i][j], err[i][j]); cout << str << " "; } cout << endl; } cout << endl << endl; }