Skip to content
Snippets Groups Projects
Commit 375d83a1 authored by Rene Brun's avatar Rene Brun
Browse files

some cleanup

git-svn-id: http://root.cern.ch/svn/root/trunk@36628 27541ba8-7e3a-0410-8455-c3a389f83636
parent 84cb8f5d
Branches
Tags
No related merge requests found
...@@ -80,21 +80,19 @@ void th2polyEurope() ...@@ -80,21 +80,19 @@ void th2polyEurope()
TRandom r; TRandom r;
Double_t longitude, latitude; Double_t longitude, latitude;
Double_t x, y, dr = TMath::Pi()/180, rd = 180/TMath::Pi(); Double_t x, y, pi4 = TMath::Pi()/4, alpha = TMath::Pi()/360;
gBenchmark->Start("Partitioning"); gBenchmark->Start("Partitioning");
p->ChangePartition(100, 100); p->ChangePartition(100, 100);
gBenchmark->Show("Partitioning"); gBenchmark->Show("Partitioning");
latitude = r.Uniform(-dr*90,dr*90);
// Fill TH2Poly according to a Mercator projection. // Fill TH2Poly according to a Mercator projection.
gBenchmark->Start("Filling"); gBenchmark->Start("Filling");
for (i=0; i<500000; i++) { for (i=0; i<500000; i++) {
longitude = r.Uniform(dr*lon1,dr*lon2); longitude = r.Uniform(lon1,lon2);
//latitude = r.Uniform(-dr*90,dr*90); latitude = r.Uniform(lat1,lat2);
latitude = r.Uniform(dr*lat1,dr*lat2); x = longitude;
x = rd*longitude; y = 38*TMath::Log(TMath::Tan(pi4+alpha*latitude));
y = 39*TMath::Log(TMath::Tan((TMath::Pi()/4)+(latitude/2)));
p->Fill(x,y); p->Fill(x,y);
} }
gBenchmark->Show("Filling"); gBenchmark->Show("Filling");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment