{ const int size=10000; Float_t x[size], y[size], z[size], x_in, y_in, z_in; ifstream input("scanmom.txt"); Int_t count = 0; while (input >> x_in >> y_in >> z_in) { // if (y_in > 5 && y_in < 40) { if (1) { x[count] = x_in; y[count] = y_in; z[count] = z_in; count++; } } cout << count << endl; input.close(); TGraph2D *surf = new TGraph2D(count, x, y, z); surf->GetZaxis()->SetRangeUser(0.0, 0.08); gStyle->SetPalette(1); surf->Draw("surf1"); }