]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TPC/macros/AliTPCExBdraw.C
ba667a18c5f1da8f7dc833fd5c15d8379e88649a
[u/mrichter/AliRoot.git] / TPC / macros / AliTPCExBdraw.C
1 /* 
2 char *storage = "local://OCDBres"
3   Int_t RunNumber=0;
4   AliCDBManager::Instance()->SetDefaultStorage(storage);
5   AliCDBManager::Instance()->SetRun(RunNumber) 
6   AliTPCExBFirst * exb = AliTPCcalibDB::Instance()->GetExB();
7   //
8   // See example macro $ALICE_ROOT/TPC/macros/AliTPCExBdraw.C 
9   //
10   .L $ALICE_ROOT/TPC/macros/AliTPCExBdraw.C 
11   Draw(0)
12 */
13
14
15 void Draw(Double_t theta,Float_t magf=5){
16   //
17   // Draw  "primary track distortion"
18   //
19   //Double_t theta=0.5;
20   TF1 *fdrfi_rpi0=new TF1("fdrfi_rpi0",Form("AliTPCExB::GetDrphi(x,0*pi/2,%f*x)",theta),20,250);
21   TF1 *fdrfi_rpi1=new TF1("fdrfi_rpi1",Form("AliTPCExB::GetDrphi(x,1*pi/2,%f*x)",theta),20,250);
22   TF1 *fdrfi_rpi2=new TF1("fdrfi_rpi2",Form("AliTPCExB::GetDrphi(x,2*pi/2,%f*x)",theta),20,250);
23   TF1 *fdrfi_rpi3=new TF1("fdrfi_rpi3",Form("AliTPCExB::GetDrphi(x,3*pi/2,%f*x)",theta),20,250);
24
25   fdrfi_rpi0->GetXaxis()->SetTitle("r (cm)");
26   fdrfi_rpi0->GetYaxis()->SetTitle("drd#phi (cm)");
27   
28   fdrfi_rpi0->SetLineColor(2);
29   fdrfi_rpi1->SetLineColor(3);
30   fdrfi_rpi2->SetLineColor(4);
31   fdrfi_rpi3->SetLineColor(5);
32   char leg0[1000];
33   char leg1[1000];
34   char leg2[1000];
35   char leg3[1000];
36   Float_t conv= 1/(magf*0.299792458e-3);
37   fdrfi_rpi0->GetHistogram()->Fit("pol2","same","",90,250);
38   sprintf(leg0,"#phi=0*#pi/2      Track res: dy=%.2f mm d#phi=%.2f mrad dC = %.6f 1/GeV",
39           10*pol2->GetParameter(0),1000*pol2->GetParameter(1), conv*pol2->GetParameter(2));
40   fdrfi_rpi1->GetHistogram()->Fit("pol2","same","",90,250);
41   sprintf(leg1,"#phi=1*#pi/2      Track res: dy=%.2f mm d#phi=%.2f mrad dC = %.6f 1/GeV",
42           10*pol2->GetParameter(0),1000*pol2->GetParameter(1),conv*pol2->GetParameter(2));
43   fdrfi_rpi2->GetHistogram()->Fit("pol2","same","",90,250);
44   sprintf(leg2,"#phi=2*#pi/2      Track res: dy=%.2f mm d#phi=%.2f mrad dC = %.6f 1/GeV",
45           10*pol2->GetParameter(0),1000*pol2->GetParameter(1),conv*pol2->GetParameter(2));
46   fdrfi_rpi3->GetHistogram()->Fit("pol2","same","",90,250);
47   sprintf(leg3,"#phi=3*#pi/2      Track res: dy=%.2f mm d#phi=%.2f mrad dC = %.6f 1/GeV",
48           10*pol2->GetParameter(0),1000*pol2->GetParameter(1),conv*pol2->GetParameter(2));
49   fdrfi_rpi0->SetMaximum(fdrfi_rpi0->GetMaximum()*2.0);
50   fdrfi_rpi0->Draw();
51   fdrfi_rpi1->Draw("same");
52   fdrfi_rpi2->Draw("same");
53   fdrfi_rpi3->Draw("same");
54
55   TLegend *legend = new TLegend(0.10,0.50,0.8,0.90, Form("ExB distortion alog track (tan(#theta)=%f)",theta));
56   legend->AddEntry(fdrfi_rpi0, leg0, "l");
57   legend->AddEntry(fdrfi_rpi1, leg1, "l");
58   legend->AddEntry(fdrfi_rpi2, leg2, "l");
59   legend->AddEntry(fdrfi_rpi3, leg3, "l");
60   legend->Draw();
61 }