]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Simple compiled macro for declaration of static distortion function
authormarian <marian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 13 Mar 2010 11:09:32 +0000 (11:09 +0000)
committermarian <marian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 13 Mar 2010 11:09:32 +0000 (11:09 +0000)
  on top of the AliTPCDistortion class.
  Why:
  1. Use static function in the fitting procedure
  2. Usage in TFormual, TF1, Tf2 ... for visualization.
  3. Usage in  tree->Draw() for visualization
  4. Simple visualization of fit residuals in multidemension - using tree Draw functionality

TPC/CalibMacros/AliTPCDistortionFun.C [new file with mode: 0644]

diff --git a/TPC/CalibMacros/AliTPCDistortionFun.C b/TPC/CalibMacros/AliTPCDistortionFun.C
new file mode 100644 (file)
index 0000000..0fdd33e
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+  gSystem->AddIncludePath("-I$ALICE_ROOT/TPC");
+  .L $ALICE_ROOT/TPC/AliTPCDistortions.cxx+
+  .L $ALICE_ROOT/TPC/CalibMacros/AliTPCDistortionFun.C+
+
+  //
+  // integrated distortion
+  //
+  TF2 fdistIFCXvZX("fdistIFCXvZX","GetIFCDistortion(y,0,x,0)",-250,250,80,250);
+  fdistIFCXvZX.GetXaxis()->SetTitle("Z (cm)");
+  fdistIFCXvZX.GetYaxis()->SetTitle("local X (cm)");  
+  fdistIFCXvZX->Draw("colz");
+  //
+  // local distortion angle mrad
+  //
+  TF2 fangleIFCXvZX("fangleIFCXvZX","1000*(GetIFCDistortion(y,0,x,0)-GetIFCDistortion(y,0,x-1,0))*sign(x)",-250,250,85,245);
+  fangleIFCXvZX.GetXaxis()->SetTitle("Z (cm)");
+  fangleIFCXvZX.GetYaxis()->SetTitle("local X (cm)");  
+  fangleIFCXvZX->Draw("colz");
+
+*/
+
+
+#include "AliTPCDistortions.h"
+
+
+Double_t GetIFCDistortion(Double_t lx, Double_t ly, Double_t lz, Int_t icoord, Double_t shift=1.){
+  //
+  static AliTPCDistortions transform;
+  Double_t xyzIn[3]={lx, ly, lz};
+  Double_t xyzOut[3]={lx, ly, lz};
+  transform.SetIFCShift(1);
+  Int_t dummyROC=0;
+  if (lz<0) { dummyROC=36;}
+  transform.UndoIFCShiftDistortion(xyzIn,xyzOut,dummyROC);
+  Double_t result=0;
+  if (icoord<3) result=xyzOut[icoord]-xyzIn[icoord];
+  return result*shift;
+}