int test_output(string fname){ TFile *f1 = new TFile(fname.c_str()); TTree *E = (TTree*)f1->Get("E"); if (E->GetEntries()==1000) { cout << "file is OK" << endl; return 0; } else { cerr << "file is not OK" << endl; return 1; } }