]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TPC/CalibMacros/AliTPCDistortionFun.C
Simple compiled macro for declaration of static distortion function
[u/mrichter/AliRoot.git] / TPC / CalibMacros / AliTPCDistortionFun.C
1 /*
2   gSystem->AddIncludePath("-I$ALICE_ROOT/TPC");
3   .L $ALICE_ROOT/TPC/AliTPCDistortions.cxx+
4   .L $ALICE_ROOT/TPC/CalibMacros/AliTPCDistortionFun.C+
5
6   //
7   // integrated distortion
8   //
9   TF2 fdistIFCXvZX("fdistIFCXvZX","GetIFCDistortion(y,0,x,0)",-250,250,80,250);
10   fdistIFCXvZX.GetXaxis()->SetTitle("Z (cm)");
11   fdistIFCXvZX.GetYaxis()->SetTitle("local X (cm)");  
12   fdistIFCXvZX->Draw("colz");
13   //
14   // local distortion angle mrad
15   //
16   TF2 fangleIFCXvZX("fangleIFCXvZX","1000*(GetIFCDistortion(y,0,x,0)-GetIFCDistortion(y,0,x-1,0))*sign(x)",-250,250,85,245);
17   fangleIFCXvZX.GetXaxis()->SetTitle("Z (cm)");
18   fangleIFCXvZX.GetYaxis()->SetTitle("local X (cm)");  
19   fangleIFCXvZX->Draw("colz");
20
21 */
22
23
24 #include "AliTPCDistortions.h"
25
26
27 Double_t GetIFCDistortion(Double_t lx, Double_t ly, Double_t lz, Int_t icoord, Double_t shift=1.){
28   //
29   static AliTPCDistortions transform;
30   Double_t xyzIn[3]={lx, ly, lz};
31   Double_t xyzOut[3]={lx, ly, lz};
32   transform.SetIFCShift(1);
33   Int_t dummyROC=0;
34   if (lz<0) { dummyROC=36;}
35   transform.UndoIFCShiftDistortion(xyzIn,xyzOut,dummyROC);
36   Double_t result=0;
37   if (icoord<3) result=xyzOut[icoord]-xyzIn[icoord];
38   return result*shift;
39 }