**************************************************************************/
////////////////////////////////////////////////////////////////////////////
-// //
-// AliExBBShape class //
-// The class calculates the space point distortions due to the B field //
-// shape imperfections using a second order technique based on integrals //
-// over Bz (e.g. int By/Bz) obtained via the AliMagF class //
-// The class allows "effective Omega Tau" corrections. //
-// //
-// date: 27/04/2010 //
-// Authors: Magnus Mager, Jim Thomas, Stefan Rossegger //
-// //
-// Example usage: //
-// AliMagF mag("mag","mag"); //
-// AliTPCExBBShape exb; //
-// exb.SetBField(&mag); // use Bfield from AliMagF //
-// exb.SetOmegaTauT1T2(0.32,1.,1.); // values ideally from OCDB //
-// // plot dRPhi distortions ... //
-// exb.CreateHistoDRPhiinZR(0,100,100)->Draw("surf2"); //
+// AliTPCExBBShape class //
////////////////////////////////////////////////////////////////////////////
#include <AliMagF.h>
}
const Double_t xStart[3]={ x[0], x[1], x[2] };
- const Double_t xEnd[3]={ x[0], x[1], roc%36<18?fgkTPC_Z0:-fgkTPC_Z0 };
+ const Double_t xEnd[3]={ x[0], x[1], roc%36<18?fgkTPCZ0:-fgkTPCZ0 };
Double_t intBStart[3];
Double_t intBEnd[3];
}
const Double_t xStart[3]={ x[0], x[1], x[2] };
- const Double_t xEnd[3]={ x[0], x[1], roc%36<18?fgkTPC_Z0:-fgkTPC_Z0 };
+ const Double_t xEnd[3]={ x[0], x[1], roc%36<18?fgkTPCZ0:-fgkTPCZ0 };
Double_t intBStart[3];
Double_t intBEnd[3];
printf(" - C1: %1.4f, C2: %1.4f \n",fC1,fC2);
}
}
+
+Double_t AliTPCExBBShape::GetBFieldXYZ(Double_t gx, Double_t gy, Double_t gz, Int_t axisType){
+ //
+ // return B field at given x,y,z
+ //
+ AliMagF* field = (AliMagF*)TGeoGlobalMagField::Instance()->GetField();
+ if (!field) return 0;
+ Double_t xyz[3]={gx,gy,gz};
+ Double_t bxyz[3]={0};
+ field->Field(xyz,bxyz);
+ //
+ Double_t r=TMath::Sqrt(gx*gx+gy*gy);
+ // Double_t b=TMath::Sqrt(bxyz[0]*bxyz[0]+bxyz[1]*bxyz[1]);
+ if (axisType==0) {
+ return (xyz[0]*bxyz[1]-xyz[1]*bxyz[0])/(bxyz[2]*r);
+ }
+ if (axisType==1){
+ return (xyz[0]*bxyz[0]+xyz[1]*bxyz[1])/(bxyz[2]*r);
+ }
+ if (axisType==2) return bxyz[2];
+ if (axisType==3) return bxyz[0];
+ if (axisType==4) return bxyz[1];
+ if (axisType==5) return bxyz[2];
+ return bxyz[2];
+}