#ifndef __CINT__ main() #endif { #include TFile* file = new TFile("bar.root","RECREATE"); if (!file) { cerr << "bad" << endl; return; } TNtuple *ntuple = new TNtuple("n","A Ntuple", "x1:x2:x3:x4:x5:x6:x7:x8:x9:x10:x11:x12:x13:x14:x15"); ifstream in("foo.dat",ios::in); if(!in) { cerr << "bad" << endl; return; } Float_t* x = new Float_t[15]; Int_t i; while(kTRUE) { for (i = 0; i < 15; i++) in >> x[i]; if (in.eof()) break; if (in.fail()) { cerr << "Bad" << endl; return; } ntuple.Fill(x); } delete x; in.close(); file->Write(); file->Close(); }