void track(){ double x,y,z; int i=0,n; double r[3][2650]; //Infile ifstream in; in.open("TRACK.dat"); //Canvas TCanvas *c1 = new TCanvas("c1", "Track", 1); while(1){ i++; in >> x >> y >> z ; r[0][i]=x; r[1][i]=y; r[2][i]=z; cout << i << " " << x << " " << y <<" " << z << endl ; if(!in.good()) break; } n=i; cout << x <<" "<< y <<" " << z << endl ; //Graph TGraph2D *g = new TGraph2D(n,r[0],r[1],r[2]); g->SetFillColor(19); g->SetLineColor(2); g->SetLineWidth(4); g->SetMarkerColor(4); g->SetMarkerStyle(21); g->SetTitle("electron track"); g->Draw("P"); cout << "number of lines read: "<< i << endl; //Close inputfile in.close(); }