#include #include #include int atmo(){ Double_t X0= 1013.; Double_t XM = 0.01; Double_t n0= 0.00029; Double_t dx=0.01; Double_t n; Double_t H0 = 8.4e3; TH1D *h1= new TH1D("h1","",200,0.,200.); TH1D *h2= new TH1D("h2","",200,1.,log(200.)); Double_t z; Double_t sc2; Double_t sc; Double_t y; Double_t phot=0.; for (Double_t x = XM; x <=X0; x+=dx){ n = 1.+n0*x/X0; z = -H0*log(x/X0)-2400.; sc2 = 1.-1./n**2; sc = sqrt(sc2); y = sqrt(n**2-1.)*z; if(z>0){ phot = 2.*acos(-1.)/137.*sc2*(1./400.e-9-1./700.e-9)/2./acos(-1.)/y; h1->Fill(y,phot); h2->Fill(log(y),phot); } } TCanvas *c1 = new TCanvas("c1"); c1->SetLogy(); h1->Draw(); TCanvas *c2 = new TCanvas("c2"); c2->SetLogy(); h2->Draw(); }