#include"TCanvas.h" #include"TF1.h" #include"TROOT.h" #include"TMath.h" #include"TGraph.h" #include"TH2.h" void enroot() { TCanvas* c1 = new TCanvas("c1","Graph"); c1->SetLogy(); float x,y; TGraph *gr = new TGraph("encount.txt"); TF1 *f1 = new TF1("f1","([0]/(2*3.14*pow(103.0,2)))*(tgamma(4.5-[1])/(tgamma([1])*tgamma(4.5-2*[1])))*((x/103.)^([1]-2.0))*((1+(x/103.))^([1]-4.5))",0.05,250.); f1->SetParameters(1.E5,1.203); gr->Fit("f1"); gr->SetMarkerStyle(7); gr->Draw("ap"); }