]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Adding the track fit residuals as a consequence of the ExB distortions (Marian)
authormarian <marian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 24 Feb 2008 22:43:17 +0000 (22:43 +0000)
committermarian <marian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 24 Feb 2008 22:43:17 +0000 (22:43 +0000)
TPC/macros/AliTPCExBdraw.C

index f5c2852ef6868e4e5a0afadd9d9aaf1e31df0130..ba667a18c5f1da8f7dc833fd5c15d8379e88649a 100644 (file)
@@ -1,5 +1,18 @@
+/* 
+char *storage = "local://OCDBres"
+  Int_t RunNumber=0;
+  AliCDBManager::Instance()->SetDefaultStorage(storage);
+  AliCDBManager::Instance()->SetRun(RunNumber) 
+  AliTPCExBFirst * exb = AliTPCcalibDB::Instance()->GetExB();
+  //
+  // See example macro $ALICE_ROOT/TPC/macros/AliTPCExBdraw.C 
+  //
+  .L $ALICE_ROOT/TPC/macros/AliTPCExBdraw.C 
+  Draw(0)
+*/
 
-void Draw(Double_t theta){
+
+void Draw(Double_t theta,Float_t magf=5){
   //
   // Draw  "primary track distortion"
   //
@@ -16,16 +29,33 @@ void Draw(Double_t theta){
   fdrfi_rpi1->SetLineColor(3);
   fdrfi_rpi2->SetLineColor(4);
   fdrfi_rpi3->SetLineColor(5);
-  
+  char leg0[1000];
+  char leg1[1000];
+  char leg2[1000];
+  char leg3[1000];
+  Float_t conv= 1/(magf*0.299792458e-3);
+  fdrfi_rpi0->GetHistogram()->Fit("pol2","same","",90,250);
+  sprintf(leg0,"#phi=0*#pi/2      Track res: dy=%.2f mm d#phi=%.2f mrad dC = %.6f 1/GeV",
+         10*pol2->GetParameter(0),1000*pol2->GetParameter(1), conv*pol2->GetParameter(2));
+  fdrfi_rpi1->GetHistogram()->Fit("pol2","same","",90,250);
+  sprintf(leg1,"#phi=1*#pi/2      Track res: dy=%.2f mm d#phi=%.2f mrad dC = %.6f 1/GeV",
+         10*pol2->GetParameter(0),1000*pol2->GetParameter(1),conv*pol2->GetParameter(2));
+  fdrfi_rpi2->GetHistogram()->Fit("pol2","same","",90,250);
+  sprintf(leg2,"#phi=2*#pi/2      Track res: dy=%.2f mm d#phi=%.2f mrad dC = %.6f 1/GeV",
+         10*pol2->GetParameter(0),1000*pol2->GetParameter(1),conv*pol2->GetParameter(2));
+  fdrfi_rpi3->GetHistogram()->Fit("pol2","same","",90,250);
+  sprintf(leg3,"#phi=3*#pi/2      Track res: dy=%.2f mm d#phi=%.2f mrad dC = %.6f 1/GeV",
+         10*pol2->GetParameter(0),1000*pol2->GetParameter(1),conv*pol2->GetParameter(2));
+  fdrfi_rpi0->SetMaximum(fdrfi_rpi0->GetMaximum()*2.0);
   fdrfi_rpi0->Draw();
   fdrfi_rpi1->Draw("same");
   fdrfi_rpi2->Draw("same");
   fdrfi_rpi3->Draw("same");
 
-  TLegend *legend = new TLegend(0.15,0.70,0.6,0.85, Form("ExB distortion alog track (tan(#theta)=%f)",theta));
-  legend->AddEntry(fdrfi_rpi0, "#phi=0", "l");
-  legend->AddEntry(fdrfi_rpi1, "#phi=#pi/2", "l");
-  legend->AddEntry(fdrfi_rpi2, "#phi=pi", "l");
-  legend->AddEntry(fdrfi_rpi3, "#phi=3*#pi/2", "l");
+  TLegend *legend = new TLegend(0.10,0.50,0.8,0.90, Form("ExB distortion alog track (tan(#theta)=%f)",theta));
+  legend->AddEntry(fdrfi_rpi0, leg0, "l");
+  legend->AddEntry(fdrfi_rpi1, leg1, "l");
+  legend->AddEntry(fdrfi_rpi2, leg2, "l");
+  legend->AddEntry(fdrfi_rpi3, leg3, "l");
   legend->Draw();
 }