]> git.uio.no Git - u/mrichter/AliRoot.git/blob - FMD/scripts/polar.C
Handle deletion of AliFMDAltroMapping object. If we make the object
[u/mrichter/AliRoot.git] / FMD / scripts / polar.C
1 void
2 polar()
3 {
4    TCanvas *c1 = new TCanvas("c1","c1",500,500);
5    TGraphPolar * grP1 = new TGraphPolar();
6    grP1->SetTitle("TGraphPolar example");
7
8    for (Int_t i = 0; i < 2; i++) {
9      grP1->SetPoint(i, (i+1) * TMath::Pi() / 4, (i+1) * 0.05);
10      grP1->SetPointError(i, 9*TMath::Pi()/180, 0.0);
11      Double_t rr = grP1->GetY()[i];
12      Double_t tt = grP1->GetX()[i];
13      Double_t x  = rr * TMath::Cos(tt);
14      Double_t y  = rr * TMath::Sin(tt);
15      Printf("(x,y)=(%f,%f)", x, y);
16    }
17    Double_t r = 1;
18    TH2* frame = new TH2F("frame", "Frame", 100, -r,r, 100, -r, r);
19    frame->Draw();
20
21    grP1->SetMarkerStyle(1);
22    grP1->SetMarkerSize(1.);
23    grP1->SetMarkerColor(4);
24    grP1->SetLineColor(4);
25    grP1->SetLineWidth(3);
26    grP1->SetFillColor(kRed+1);
27    grP1->SetFillStyle(3001);
28    grP1->Draw("PNEF same");
29    // grP1->Draw("APNEF");
30
31    // Update, otherwise GetPolargram returns 0
32    c1->Update();
33    TGraphPolargram* gram = grP1->GetPolargram();
34    gram->SetLineWidth(0);
35    // gram->SetLineColor(kWhite);
36    gram->SetNdivPolar(20);
37    gram->SetNdivRadial(10);   
38    gram->SetTextSize(0);
39    gram->SetRadialLabelSize(0);
40    gram->SetPolarLabelSize(0);
41    gram->SetAxisAngle(9*TMath::Pi()/180);
42    gram->SetTwoPi();
43    gram->SetToRadian();
44    c1->SetGridx();
45    c1->SetGridy();
46    c1->Update();
47 }