+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+////
+// This implementation AliTPCExB is using an "exact" calculation of the ExB
+// effect. That is, it uses the drift ODE to calculate the distortion
+// without any further assumption.
+// Due to the numerical integration of the ODE, there are some numerical
+// uncertencies involed.
+////
+
#include "TMath.h"
#include "TTreeStream.h"
+#include "AliFieldMap.h"
+#include "AliMagF.h"
#include "AliTPCExBExact.h"
ClassImp(AliTPCExBExact)
void AliTPCExBExact::TestThisBeautifulObject(const AliFieldMap *bFieldMap,
const char* fileName) {
+ //
+ // Have a look at the common part "TestThisBeautifulObjectGeneric".
+ //
fkMap=bFieldMap;
fkField=0;
TestThisBeautifulObjectGeneric(fileName);
void AliTPCExBExact::TestThisBeautifulObject(const AliMagF *bField,
const char* fileName) {
+ //
+ // Have a look at the common part "TestThisBeautifulObjectGeneric".
+ //
fkField=bField;
fkMap=0;
TestThisBeautifulObjectGeneric(fileName);
void AliTPCExBExact::TestThisBeautifulObjectGeneric(const char* fileName) {
//
- // well, as the name sais...
+ // Well, as the name sais... it tests the object.
//
TTreeSRedirector ts(fileName);
Double_t x[3];
}
}
-void AliTPCExBExact::GetE(Double_t *E,const Double_t *x) const {
+void AliTPCExBExact::GetE(Double_t *e,const Double_t *x) const {
//
// Helper function returning the E field in SI units (V/m).
//
- E[0]=0.;
- E[1]=0.;
- E[2]=(x[2]<0.?-1.:1.)*fgkDriftField; // in V/m
+ e[0]=0.;
+ e[1]=0.;
+ e[2]=(x[2]<0.?-1.:1.)*fgkDriftField; // in V/m
}
-void AliTPCExBExact::GetB(Double_t *B,const Double_t *x) const {
+void AliTPCExBExact::GetB(Double_t *b,const Double_t *x) const {
//
// Helper function returning the B field in SI units (T).
//
// the beautiful m to cm (and the ugly "const_cast") and Double_t
// to Float_t read the NRs introduction!:
for (int i=0;i<3;++i) xm[i]=x[i]*100.;
- Float_t Bf[3];
+ Float_t bf[3];
if (fkMap!=0)
- fkMap->Field(xm,Bf);
+ fkMap->Field(xm,bf);
else
- fkField->Field(xm,Bf);
- for (int i=0;i<3;++i) B[i]=Bf[i]/10.;
+ fkField->Field(xm,bf);
+ for (int i=0;i<3;++i) b[i]=bf[i]/10.;
}
void AliTPCExBExact::Motion(const Double_t *x,Double_t,
//
// The differential equation of motion of the electrons.
//
- const Double_t tau=fDriftVelocity/fgkDriftField/fgkEM;
- const Double_t tau2=tau*tau;
- Double_t E[3];
- Double_t B[3];
- GetE(E,x);
- GetB(B,x);
- Double_t wx=fgkEM*B[0];
- Double_t wy=fgkEM*B[1];
- Double_t wz=fgkEM*B[2];
- Double_t ex=fgkEM*E[0];
- Double_t ey=fgkEM*E[1];
- Double_t ez=fgkEM*E[2];
+ Double_t tau=fDriftVelocity/fgkDriftField/fgkEM;
+ Double_t tau2=tau*tau;
+ Double_t e[3];
+ Double_t b[3];
+ GetE(e,x);
+ GetB(b,x);
+ Double_t wx=fgkEM*b[0];
+ Double_t wy=fgkEM*b[1];
+ Double_t wz=fgkEM*b[2];
+ Double_t ex=fgkEM*e[0];
+ Double_t ey=fgkEM*e[1];
+ Double_t ez=fgkEM*e[2];
Double_t w2=(wx*wx+wy*wy+wz*wz);
dxdt[0]=(1.+wx*wx*tau2)*ex+(wz*tau+wx*wy*tau2)*ey+(-wy*tau+wx*wz*tau2)*ez;
dxdt[1]=(-wz*tau+wx*wy*tau2)*ex+(1.+wy*wy*tau2)*ey+(wx*tau+wy*wz*tau2)*ez;
// Helper function that calculates one distortion by integration
// (only used to fill the lookup table).
//
- const Double_t h=0.01*250./fDriftVelocity/fkN;
+ Double_t h=0.01*250./fDriftVelocity/fkN;
Double_t t=0.;
Double_t xt[3];
Double_t xo[3];
-#ifndef ALITPC_EXB_EXACT
-#define ALITPC_EXB_EXACT
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+////
+// An exact implementation of the ExB effect.
+////
+
+#ifndef ALITPCEXBEXACT_H
+#define ALITPCEXBEXACT_H
#include "AliTPCExB.h"
-#include "AliFieldMap.h"
-#include "AliMagF.h"
+
+class AliFieldMap;
+class AliMagF;
class AliTPCExBExact:public AliTPCExB {
public:
AliTPCExBExact(const AliTPCExBExact&); // don't copy me
void TestThisBeautifulObjectGeneric(const char* fileName);
void CreateLookupTable();
- void GetE(Double_t *E,const Double_t *x) const;
- void GetB(Double_t *B,const Double_t *x) const;
+ void GetE(Double_t *e,const Double_t *x) const;
+ void GetB(Double_t *b,const Double_t *x) const;
void Motion(const Double_t *x,Double_t t,Double_t *dxdt) const;
void CalculateDistortion(const Double_t *x,Double_t *dist) const;
void DGLStep(Double_t *x,Double_t t,Double_t h) const;
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+////
+// This implementation AliTPCExB is using an aproximate calculation of the ExB
+// effect. Therefore the drift ODE is Taylor expanded and only the first
+// order part is taken.
+////
+
#include "TMath.h"
+#include "AliFieldMap.h"
+#include "AliMagF.h"
#include "TTreeStream.h"
#include "AliTPCExBFirst.h"
//
// correct for the distortion
//
- Double_t Bx,By;
- GetMeanFields(position[0],position[1],position[2],&Bx,&By);
+ Double_t bx,by;
+ GetMeanFields(position[0],position[1],position[2],&bx,&by);
if (position[2]>0.) {
- Double_t Bxe,Bye;
- GetMeanFields(position[0],position[1],250.,&Bxe,&Bye);
+ Double_t bxe,bye;
+ GetMeanFields(position[0],position[1],250.,&bxe,&bye);
if (position[2]!=250.) {
- Bx=(500.*Bxe-(position[2]+250.)*Bx)/(250.-position[2]);
- By=(500.*Bye-(position[2]+250.)*By)/(250.-position[2]);
+ bx=(500.*bxe-(position[2]+250.)*bx)/(250.-position[2]);
+ by=(500.*bye-(position[2]+250.)*by)/(250.-position[2]);
}
else {
- Bx=Bxe;
- By=Bye;
+ bx=bxe;
+ by=bye;
}
}
Double_t mu=fDriftVelocity/fgkDriftField;
Double_t wt=mu*fkMeanBz;
- corrected[0]=mu*(wt*Bx-By)/(1.+wt*wt);
- corrected[1]=mu*(wt*By+Bx)/(1.+wt*wt);
+ corrected[0]=mu*(wt*bx-by)/(1.+wt*wt);
+ corrected[1]=mu*(wt*by+bx)/(1.+wt*wt);
if (position[2]>0.) {
corrected[0]*=(250.-position[2]);
// THIS IS PRIVATE! (a helper for the constructor)
//
fkNMean=fkNX*fkNY*fkNZ;
- fkMeanBx=new Float_t[fkNMean];
- fkMeanBy=new Float_t[fkNMean];
+ fkMeanBx=new Double_t[fkNMean];
+ fkMeanBy=new Double_t[fkNMean];
Double_t x[3];
Double_t nBz=0;
x[0]=fkXMin+i*(fkXMax-fkXMin)/(fkNX-1);
for (int j=0;j<fkNY;++j) {
x[1]=fkYMin+j*(fkYMax-fkYMin)/(fkNY-1);
- Double_t R=TMath::Sqrt(x[0]*x[0]+x[1]*x[1]);
- Double_t Bx=0.,By=0.;
+ Double_t r=TMath::Sqrt(x[0]*x[0]+x[1]*x[1]);
+ Double_t bx=0.,by=0.;
for (int k=0;k<fkNZ;++k) {
x[2]=fkZMin+k*(fkZMax-fkZMin)/(fkNZ-1);
- Float_t B[3];
+ Float_t b[3];
// the x is not const in the Field function...
Float_t xt[3];
for (int l=0;l<3;++l) xt[l]=x[l];
// that happens due to the lack of a sophisticated class design:
if (bFieldMap!=0)
- bFieldMap->Field(xt,B);
+ bFieldMap->Field(xt,b);
else
- bField->Field(xt,B);
- Bx+=B[0]/10.;
- By+=B[1]/10.;
- /*old
- fkMeanBx[(k*fkNY+j)*fkNX+i]=Bx/(k+1);
- fkMeanBy[(k*fkNY+j)*fkNX+i]=By/(k+1);
- */
- fkMeanBx[(k*fkNY+j)*fkNX+i]=Bx;
- fkMeanBy[(k*fkNY+j)*fkNX+i]=By;
- if (90.<=R&&R<=250.) {
- fkMeanBz+=B[2]/10.;
+ bField->Field(xt,b);
+ bx+=b[0]/10.;
+ by+=b[1]/10.;
+ fkMeanBx[(k*fkNY+j)*fkNX+i]=bx;
+ fkMeanBy[(k*fkNY+j)*fkNX+i]=by;
+ if (90.<=r&&r<=250.) {
+ fkMeanBz+=b[2]/10.;
++nBz;
}
}
-#ifndef ALITPC_EXB_FIRST_H
-#define ALITPC_EXB_FIRST_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+////
+// An approximate (first order) implementation of the ExB effect.
+////
+
+#ifndef ALITPCEXBFIRST_H
+#define ALITPCEXBFIRST_H
#include "AliTPCExB.h"
-#include "AliFieldMap.h"
-#include "AliMagF.h"
+class AliFieldMap;
+class AliMagF;
class AliTPCExBFirst:public AliTPCExB {
public:
Double_t fkZMin; // the first grid point in z direction
Double_t fkZMax; // the last grid point in z direction
Int_t fkNMean; // size of the tablE the mean fields
- Float_t *fkMeanBx; //[fkNMean] the mean field in x direction upto a certain z value
- Float_t *fkMeanBy; //[fkNMean] the mean field in y direction upto a certain z value
+ Double_t *fkMeanBx; //[fkNMean] the mean field in x direction upto a certain z value
+ Double_t *fkMeanBy; //[fkNMean] the mean field in y direction upto a certain z value
Double_t fkMeanBz; // the mean field in z direction inside the TPC volume
static const Double_t fgkEM; //! elementary charge over electron mass (C/kg)
static const Double_t fgkDriftField; //! the TPC drift field (V/m) (modulus)
- ClassDef(AliTPCExBFirst,2)
+ ClassDef(AliTPCExBFirst,1)
};
#endif