TH2F* Latticedisplay(Latticepoint* lparray, int numoflps) { printf("\n** In Latticedisplay() **\n"); for (int tempor=6630; tempor<6670; tempor++) { printf("\nLP %d has bfield %d", tempor+1, lparray[tempor+1].Getbfield()); } latticecanvas = new TCanvas; latticecanvas->cd(); char histoname[40] = "Lattice Point Graph"; char currentime[40] = time(NULL); strcat(histoname, currentime); lphisto = new TH2F(histoname, "Lattice Points Histo", 80,-800,800,125,0,2500); lphisto->GetXaxis()->SetTitle(" z position in mm "); // beautify graph lphisto->GetYaxis()->SetTitle(" r position in mm "); lphisto->GetXaxis()->SetLabelSize(0.03); lphisto->GetYaxis()->SetLabelSize(0.03); lphisto->GetXaxis()->CenterTitle(1); lphisto->GetYaxis()->CenterTitle(1); gStyle->SetOptStat(000000); fwrite= new TFile("lattice.root","RECREATE"); lpntuple= new TNtuple("lpntuple", "latticepoint ntuple", "z:r:bfield"); for (int i=0; iFill(temppz,temppr,tempbfield); } fwrite->Write(); fwrite->Close(); printf("\nWrote the ntuple containing file lattice.root\n"); fread= new TFile("lattice.root"); fread->cd(); lpntuple.Draw("z:r>>lphisto","(bfield)",""); lphisto->Draw("lego"); return lphisto; }