7 void findMinChi2(
const Char_t* inputFileList =
"minChi2_file.list")
9 ifstream fin(inputFileList);
11 Error(
"Error, inputfile",
"can't open %s", inputFileList);
15 Double_t minChi2 = 1.e9;
18 ofstream outData(
"minChi2_rootfile_fullname.dat");
24 TFile* file = TFile::Open(name);
25 if(!file || !file->IsOpen() || !file->GetNkeys())
27 Error(
"check chi2",
"can't open %s", name.Data());
32 TH3* hchi2 = (TH3D*) file->Get(
"hChi2");
34 for(Int_t i=0; i<hchi2->GetNbinsX(); i++)
36 for(Int_t j=0; j<hchi2->GetNbinsY(); j++)
38 for(Int_t k=0; k<hchi2->GetNbinsZ(); k++)
40 Double_t chi2 = hchi2->GetBinContent(i+1, j+1, k+1);
60 outData<<
"The minimum Chi2 are found: "<<minChi2<<endl;
61 outData<<
"the corresponding root fileName: "<<endl;
62 outData<<minName<<endl;
66 cout<<
"The minimum Chi2: "<<minChi2<<
" fileName: "<<minName<<endl;