void plot_tracks(){ float x[50],xtrack[50],y[50],ytrack[50],z[50]; ifstream track_file; track_file.open("junk3"); for (int i=0;i<50;i++){ track_file >> x[i]; track_file >> y[i]; track_file >> z[i]; } TH2F *hr13 = new TH2F("hr13","Track segments", 20,200,410,20,-25.,25); gStyle->SetOptStat(0); hr13->SetXTitle("z (cm)"); hr13->SetYTitle("x (cm)"); hr13->Draw(); float pos[3]={-8.040955,-7.481406,213.000000}; float dir[3]={-0.056444,-0.031782,0.000000}; TGraph *g0=new TGraph(50,z,x); g0->SetMarkerStyle(kOpenCircle); g0->SetMarkerColor(2); g0->SetLineColor(2); g0->Draw("P"); double par[5]={-8.040955,-7.481406,213.000000,-0.056444,-0.03178}; TF1 *f1= new TF1("f1","[0]+[3]*(x-[2])/sqrt(1-[3]*[3]-[4]*[4])",par[2]-2, par[2]+12); f1->SetParameters(par); f1->Draw("same"); par[0]=5.191975; par[3]=0.083540; par[4]=0.079144; TF1 *f2= new TF1("f2","[0]+[3]*(x-[2])/sqrt(1-[3]*[3]-[4]*[4])",par[2]-2, par[2]+12); f2->SetParameters(par); f2->Draw("same"); par[0]=-10.861805; par[2]=273.000000; par[3]=-0.077154; par[4]=-0.064426; TF1 *f3= new TF1("f3","[0]+[3]*(x-[2])/sqrt(1-[3]*[3]-[4]*[4])",par[2]-2, par[2]+12); f3->SetParameters(par); f3->Draw("same"); par[0]=8.232714; par[3]=0.056718; par[4]=0.011401; TF1 *f4= new TF1("f4","[0]+[3]*(x-[2])/sqrt(1-[3]*[3]-[4]*[4])",par[2]-2, par[2]+12); f4->SetParameters(par); f4->Draw("same"); par[0]=11.444582; par[2]=332.000000; par[3]=0.057622; par[4]=0.014649; TF1 *f5= new TF1("f5","[0]+[3]*(x-[2])/sqrt(1-[3]*[3]-[4]*[4])",par[2]-2, par[2]+12); f5->SetParameters(par); f5->Draw("same"); par[0]=-13.651492; par[3]=-0.044052; par[4]=-0.038575; TF1 *f6= new TF1("f6","[0]+[3]*(x-[2])/sqrt(1-[3]*[3]-[4]*[4])",par[2]-2, par[2]+12); f6->SetParameters(par); f6->Draw("same"); par[0]=14.853036; par[2]=392.000000; par[3]=0.031415; par[4]=0.004696; TF1 *f7= new TF1("f7","[0]+[3]*(x-[2])/sqrt(1-[3]*[3]-[4]*[4])",par[2]-2, par[2]+12); f7->SetParameters(par); f7->Draw("same"); par[0]=-16.345502; par[3]=-0.039857; par[4]=-0.037325; TF1 *f8= new TF1("f8","[0]+[3]*(x-[2])/sqrt(1-[3]*[3]-[4]*[4])",par[2]-2, par[2]+12); f8->SetParameters(par); f8->Draw("same"); }