Double_t fff(Double_t *x,Double_t *p) { double E=p[0];double theta=x[0]/180*TMath::Pi(); double Ep=E/(1+E/(511)*(1-cos(theta))); double u=pow(sin(theta),2)/(E/Ep+Ep/E-pow(sin(theta),2)); return u; } Double_t ff(Double_t *x,Double_t *p) { double E=p[0];double theta=x[0]/180*TMath::Pi(); double Ep=E/(1+E/(511)*(1-cos(theta))); // double s=6.652e-29; //double c=3*s/(16*TMath::Pi())*pow(Ep/E,2)*(E/Ep+Ep/E-2*pow(sin(theta),2)); double c=pow(Ep/E,2)*((E/Ep+Ep/E)-pow(sin(theta),2))/2; return c; } void huatu() { TCanvas *c1=new TCanvas("c1","c1",800,600); c1->cd(); gRandom->SetSeed(0); TF1*f1 = new TF1("f1",ff,0,360,1); f1->SetParameter(0,50); const int N=360; double xx[N]={0}; double yy[N]={0}; double rr; for(int i=0;iEval(i); xx[i]=i; yy[i]=rr; } TGraphPolar *gr = new TGraphPolar(N, xx, yy); gr->SetMarkerStyle(21); gr->SetMarkerColor(kBlue); gr->SetFillColor(kBlue); gr->SetMinimum(0); gr->SetMaximum(1); gr->GetYaxis()->SetRange(0,1); gr->Draw("AP"); //f1->Draw(); }