// code for plotting input neutron spectra // Jennie Davies - December 2003 { gROOT->Reset(); // reset global variables gStyle->SetCanvasColor(10); gStyle->SetTitleColor(10); gStyle->SetFrameFillColor(10); gStyle->SetOptStat(0); ifstream data; // declare a file to input from data.open("led1.data"); // open file containing values const Int_t n = 100; // number of points to be plotted Int_t in = 0; Float_t x[n], y1[n], y2[n]; Float_t x1; char line[1024]; while (data >> x1) { x[in] = x1; data >> y1[in]; data >> y2[in]; in++; } for (Int_t i=0; iSetTitle("Intensity of LED 1"); inputSpec->GetHistogram()->SetXTitle("Cos Theta"); inputSpec->GetHistogram()->SetYTitle("pJ/pulse/sr"); TCanvas *c1 = new TCanvas("c1", "Intensity of LED 1",0, 0, 800, 600); c1->SetLogy(); //this line not working now c1->SetMinimum(1e-6); inputSpec->Draw("AC"); gPad->Update(); inputSpec2->Draw("CP"); //draw an axis on the right hand side TGaxis *axis = new TGaxis(gPad->GetUxmax(), gPad->GetUymin(), gPad->GetUxmax(), gPad->GetUymax(), 0,10,510,"+L"); axis->Draw(); }