--- /dev/null
+/**************************************************************************
+ * 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. *
+ **************************************************************************/
+
+
+////////////////////////////////////////////////////////////////////////////
+// //
+// AliTPCCalibGlobalMisalignment class //
+// The class calculates the space point distortions due to simple //
+// misalignments like shifts in caresian coordinates or a rotation //
+// of the TPC read out planes (A and C side) //
+// //
+// date: 06/05/2010 //
+// Authors: Stefan Rossegger, Jim Thomas, Magnus Mager //
+////////////////////////////////////////////////////////////////////////////
+
+#include "AliTPCCalibGlobalMisalignment.h"
+#include "TMath.h"
+
+AliTPCCalibGlobalMisalignment::AliTPCCalibGlobalMisalignment()
+ : AliTPCCorrection("mialign","Misalignment"),
+ fXShift(0.),fYShift(0.),fZShift(0.),
+ fRotPhiA(0.),fRotPhiC(0.),
+ fdRPhiOffsetA(0.), fdRPhiOffsetC(0.)
+{
+ //
+ // default constructor
+ //
+}
+
+AliTPCCalibGlobalMisalignment::~AliTPCCalibGlobalMisalignment() {
+ //
+ // default destructor
+ //
+}
+
+
+
+//void AliTPCCalibGlobalMisalignment::Init() {
+// //
+// // Initialization funtion
+// //
+
+// // nothing to be initialized, results of this calibration class will go to the global aligment structure
+
+//}
+
+//void AliTPCCalibGlobalMisalignment::Update(const TTimeStamp &/*timeStamp*/) {
+// //
+// // Update function
+// //
+//
+// // nothing to be updated, results of this calibration class will go to the global aligment structure
+//
+//}
+
+
+
+void AliTPCCalibGlobalMisalignment::GetCorrection(const Float_t x[],const Short_t roc,Float_t dx[]) {
+ //
+ // Calculates the simple correction due to a shift (in x,y,z) or an rotation of the TPC (around z)
+ //
+
+ Double_t r, phi;
+ r = TMath::Sqrt( x[0]*x[0] + x[1]*x[1] );
+ phi = TMath::ATan2(x[1],x[0]);
+
+
+ // rotation of the read-out planes
+ if (roc%36<18) // A side
+ phi += fRotPhiA;
+ else // C side
+ phi += fRotPhiC;
+
+ // Simply adding a constant dRPHi residual. PURELY FOR CALIBRATION PURPOSES
+ if (roc%36<18) // A side
+ phi += fdRPhiOffsetA/r;
+ else // C side
+ phi += fdRPhiOffsetC/r;
+
+ dx[0] = r * TMath::Cos(phi) - x[0];
+ dx[1] = r * TMath::Sin(phi) - x[1];
+ dx[2] = 0.;
+
+ // Simple shifts
+ dx[0] -= fXShift;
+ dx[1] -= fYShift;
+ dx[2] -= fZShift;
+
+}
+
+void AliTPCCalibGlobalMisalignment::Print(Option_t* /*option*/ ) const {
+ //
+ // Print function to check the settings
+ //
+ printf("%s",GetTitle());
+ printf(" - Trivial Misalignments for calibration purposes: \n");
+ printf(" - X-Shift: %1.3f cm, Y-Shift: %1.3f cm, Z-Shift: %1.3f cm \n",fXShift,fYShift,fZShift);
+ printf(" - Phi-Rotations: A side: %1.5f rad, C side: %1.5f rad\n",fRotPhiA,fRotPhiC);
+ printf(" - dRPhi offsets: A side: %1.5f cm, C side: %1.5f cm\n",fdRPhiOffsetA,fdRPhiOffsetC);
+
+
+}
--- /dev/null
+#ifndef ALI_TPC_CALIB_GLOBAL_MISALIGNMENT_H
+#define ALI_TPC_CALIB_GLOBAL_MISALIGNMENT_H
+
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+////////////////////////////////////////////////////////////////////////////
+// //
+// AliTPCCalibGlobalMisalignment class //
+// The class calculates the space point distortions due to simple //
+// misalignments like shifts in caresian coordinates or a rotation //
+// of the TPC read out planes (A and C side) //
+// //
+// date: 06/05/2010 //
+// Authors: Stefan Rossegger, Jim Thomas, Magnus Mager //
+////////////////////////////////////////////////////////////////////////////
+
+#include "AliTPCCorrection.h"
+
+class AliTPCCalibGlobalMisalignment : public AliTPCCorrection {
+public:
+ AliTPCCalibGlobalMisalignment();
+ virtual ~AliTPCCalibGlobalMisalignment();
+
+ // initialization and update functions
+ // virtual void Init();
+ // virtual void Update(const TTimeStamp &timeStamp);
+
+ // setters and getters for misalignments
+ void SetXShift(Float_t xShift) {fXShift=xShift;}
+ void SetYShift(Float_t yShift) {fYShift=yShift;}
+ void SetZShift(Float_t zShift) {fZShift=zShift;}
+ void SetRotPhiA(Float_t rotPhiA) {fRotPhiA=rotPhiA;}
+ void SetRotPhiC(Float_t rotPhiC) {fRotPhiC=rotPhiC;}
+ void SetdRPhiOffsetA(Float_t dRPhiOffsetA) {fdRPhiOffsetA=dRPhiOffsetA;}
+ void SetdRPhiOffsetC(Float_t dRPhiOffsetC) {fdRPhiOffsetC=dRPhiOffsetC;}
+
+ Float_t GetXShift() const {return fXShift;}
+ Float_t GetYShift() const {return fYShift;}
+ Float_t GetZShift() const {return fZShift;}
+ Float_t GetRotPhiA() const {return fRotPhiA;}
+ Float_t GetRotPhiC() const {return fRotPhiC;}
+ Float_t GetdRPhiOffsetA() const {return fdRPhiOffsetA;}
+ Float_t GetdRPhiOffsetC() const {return fdRPhiOffsetC;}
+
+ virtual void Print(Option_t* option="") const;
+
+protected:
+ virtual void GetCorrection(const Float_t x[],const Short_t roc,Float_t dx[]);
+
+private:
+ Float_t fXShift; // Shift in global X [cm]
+ Float_t fYShift; // Shift in global Y [cm]
+ Float_t fZShift; // Shift in global Z [cm]
+
+ Float_t fRotPhiA; // simple rotation of A side read-out plane around the Z axis [rad]
+ Float_t fRotPhiC; // simple rotation of C side read-out plane around the Z axis [rad]
+ Float_t fdRPhiOffsetA; // add a constant offset of dRPhi (or local Y) in [cm]: purely for calibration purposes!
+ Float_t fdRPhiOffsetC; // add a constant offset of dRPhi (or local Y) in [cm]: purely for calibration purposes!
+
+ ClassDef(AliTPCCalibGlobalMisalignment,1);
+};
+
+#endif
#include <TCollection.h>
-#include <TIterator.h>
#include <TTimeStamp.h>
+#include <TIterator.h>
+
#include "AliTPCComposedCorrection.h"
#include "AliTPCCorrection.h"
class TCollection;
+class TTimeStamp;
class AliTPCComposedCorrection : public AliTPCCorrection {
public:
void SetOmegaTauT1T2(Float_t omegaTau,Float_t t1,Float_t t2);
TCollection* GetCorrections() const {return fCorrections;}
- void SetCorrections(TCollection *corrections) {fCorrections=corrections;}
+ void SetCorrections(const TCollection *corrections) {fCorrections=(TCollection*)corrections;}
CompositionType GetMode() const {return fMode;}
void SetMode(CompositionType mode) {fMode=mode;}
ClassImp(AliTPCCorrection)
// FIXME: the following values should come from the database
-const Double_t AliTPCCorrection::fgkTPC_Z0 =249.7; // nominal gating grid position
+const Double_t AliTPCCorrection::fgkTPCZ0 =249.7; // nominal gating grid position
const Double_t AliTPCCorrection::fgkIFCRadius= 83.06; // Mean Radius of the Inner Field Cage ( 82.43 min, 83.70 max) (cm)
const Double_t AliTPCCorrection::fgkOFCRadius=254.5; // Mean Radius of the Outer Field Cage (252.55 min, 256.45 max) (cm)
const Double_t AliTPCCorrection::fgkZOffSet = 0.2; // Offset from CE: calculate all distortions closer to CE as if at this point
// Simple Interpolation functions: e.g. with bi(tri)cubic interpolations (not yet in TH2 and TH3)
void AliTPCCorrection::Interpolate2DEdistortion( const Int_t order, const Double_t r, const Double_t z,
- const Double_t er[kNZ][kNR], Double_t &er_value )
-{
+ const Double_t er[kNZ][kNR], Double_t &erValue ) {
//
// Interpolate table - 2D interpolation
//
- Double_t save_er[10] ;
+ Double_t saveEr[10] ;
Search( kNZ, fgkZList, z, fJLow ) ;
Search( kNR, fgkRList, r, fKLow ) ;
if ( fKLow + order >= kNR - 1 ) fKLow = kNR - 1 - order ;
for ( Int_t j = fJLow ; j < fJLow + order + 1 ; j++ ) {
- save_er[j-fJLow] = Interpolate( &fgkRList[fKLow], &er[j][fKLow], order, r ) ;
+ saveEr[j-fJLow] = Interpolate( &fgkRList[fKLow], &er[j][fKLow], order, r ) ;
}
- er_value = Interpolate( &fgkZList[fJLow], save_er, order, z ) ;
+ erValue = Interpolate( &fgkZList[fJLow], saveEr, order, z ) ;
}
Double_t AliTPCCorrection::Interpolate( const Double_t xArray[], const Double_t yArray[],
- const Int_t order, const Double_t x )
-{
+ const Int_t order, const Double_t x ) {
//
// Interpolate function Y(x) using linear (order=1) or quadratic (order=2) interpolation.
//
}
-void AliTPCCorrection::Search( const Int_t n, const Double_t xArray[], const Double_t x, Int_t &low )
-{
+void AliTPCCorrection::Search( const Int_t n, const Double_t xArray[], const Double_t x, Int_t &low ) {
//
// Search an ordered table by starting at the most recently used point
//
}
-AliExternalTrackParam * AliTPCCorrection::FitDistortedTrack(AliExternalTrackParam & trackIn, Double_t refX, Int_t dir,TTreeSRedirector *pcstream){
+AliExternalTrackParam * AliTPCCorrection::FitDistortedTrack(AliExternalTrackParam & trackIn, Double_t refX, Int_t dir, TTreeSRedirector * const pcstream){
//
// Fit the track parameters - without and with distortion
// 1. Space points in the TPC are simulated along the trajectory
-void AliTPCCorrection::MakeTrackDistortionTree(TTree *tinput, Int_t dtype, Int_t ptype, TObjArray * corrArray, Int_t step, Bool_t debug ){
+void AliTPCCorrection::MakeTrackDistortionTree(TTree *tinput, Int_t dtype, Int_t ptype, const TObjArray * corrArray, Int_t step, Bool_t debug ){
//
// Make a fit tree:
// For each partial correction (specified in array) and given track topology (phi, theta, snp, refX)
AliTPCCorrection *corr = (AliTPCCorrection*)corrArray->At(icorr);
corrections[icorr]=0;
if (entries>kMinEntries){
- if (dtype==0) {
- refX=85; dir=-1;
- }
- if (dtype==1) {
- refX=275; dir=1;
- }
- if (dtype==2) {
- refX=0; dir=-1;
- }
- //
AliExternalTrackParam trackIn(refX,phi,tPar,cov);
AliExternalTrackParam *trackOut = 0;
if (debug) trackOut=corr->FitDistortedTrack(trackIn, refX, dir,pcstream);
if (!debug) trackOut=corr->FitDistortedTrack(trackIn, refX, dir,0);
- AliTrackerBase::PropagateTrackToBxByBz(&trackIn,refX,kMass,3,kFALSE,kMaxSnp);
- AliTrackerBase::PropagateTrackToBxByBz(trackOut,refX,kMass,3,kFALSE,kMaxSnp);
+ if (dtype==0) {refX=85; dir=-1;}
+ if (dtype==1) {refX=275; dir=1;}
+ if (dtype==2) {refX=0; dir=-1;}
+ //
+ AliTrackerBase::PropagateTrackToBxByBz(&trackIn,refX,kMass,3,kTRUE,kMaxSnp);
+ AliTrackerBase::PropagateTrackToBxByBz(trackOut,refX,kMass,3,kTRUE,kMaxSnp);
//
corrections[icorr]= trackOut->GetParameter()[ptype]-trackIn.GetParameter()[ptype];
delete trackOut;
-void AliTPCCorrection::MakeDistortionMap(THnSparse * his0, TTreeSRedirector *pcstream, const char* hname, Int_t run){
+void AliTPCCorrection::MakeDistortionMap(THnSparse * his0, TTreeSRedirector * const pcstream, const char* hname, Int_t run){
//
// make a distortion map out ou fthe residual histogram
// Results are written to the debug streamer - pcstream
virtual void SetOmegaTauT1T2(Float_t omegaTau,Float_t t1,Float_t t2);
AliExternalTrackParam * FitDistortedTrack(AliExternalTrackParam & trackIn, Double_t refX, Int_t dir,TTreeSRedirector *pcstream);
void StoreInOCDB(Int_t startRun, Int_t endRun, const char *comment=0);
- static void MakeTrackDistortionTree(TTree *tinput, Int_t dtype, Int_t ptype, TObjArray * corrArray, Int_t step=1, Bool_t debug=0);
+ static void MakeTrackDistortionTree(TTree *tinput, Int_t dtype, Int_t ptype, const TObjArray * corrArray, Int_t step=1, Bool_t debug=0);
protected:
TH2F* CreateTH2F(const char *name,const char *title,
const char *xlabel,const char *ylabel,const char *zlabel,
Int_t nbinsx,Double_t xlow,Double_t xup,
Int_t nbinsy,Double_t ylow,Double_t yup);
- static const Double_t fgkTPC_Z0; // nominal gating grid position
+ static const Double_t fgkTPCZ0; // nominal gating grid position
static const Double_t fgkIFCRadius; // Mean Radius of the Inner Field Cage ( 82.43 min, 83.70 max) (cm)
static const Double_t fgkOFCRadius; // Mean Radius of the Outer Field Cage (252.55 min, 256.45 max) (cm)
static const Double_t fgkZOffSet; // Offset from CE: calculate all distortions closer to CE as if at this point
enum {kNR= 92}; // Number of R points in the table for interpolating distortion data
enum {kNZ= 270}; // Number of Z points in the table for interpolating distortion data
- static const Double_t fgkRList[kNR];
- static const Double_t fgkZList[kNZ];
+ static const Double_t fgkRList[kNR]; // points in the radial direction (for the lookup table)
+ static const Double_t fgkZList[kNZ]; // points in the z direction (for the lookup table)
// Simple Interpolation functions: e.g. with tricubic interpolation (not yet in TH3)
- Int_t fJLow;
- Int_t fKLow;
+ Int_t fJLow; // variable to help in the interpolation
+ Int_t fKLow; // variable to help in the interpolation
void Interpolate2DEdistortion( const Int_t order, const Double_t r, const Double_t z,
- const Double_t er[kNZ][kNR], Double_t &er_value );
+ const Double_t er[kNZ][kNR], Double_t &erValue );
Double_t Interpolate( const Double_t xArray[], const Double_t yArray[],
const Int_t order, const Double_t x );
void Search( const Int_t n, const Double_t xArray[], const Double_t x, Int_t &low );
--- /dev/null
+/**************************************************************************
+ * 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. *
+ **************************************************************************/
+
+/*
+ Calculation of the Electric field:
+ Sollution of laplace equation in cartezian system, with boundary condition.
+ Se details:
+ http://web.mit.edu/6.013_book/www/chapter5/5.10.html
+
+
+*/
+
+/* $Id: AliTPCEfield.cxx 41275 2010-05-16 22:23:06Z marian $ */
+
+#include "TTreeStream.h"
+#include "TMath.h"
+#include "TLinearFitter.h"
+#include "TRandom.h"
+#include "AliTPCEfield.h"
+
+ClassImp(AliTPCEfield)
+
+
+AliTPCEfield* AliTPCEfield::fgInstance=0;
+
+AliTPCEfield::AliTPCEfield():
+ TNamed(),
+ fScale(0),
+ fMaxFreq(0),
+ fIs2D(kTRUE),
+ fWorkspace(0) // file with trees, pictures ...
+{
+ //
+ for (Int_t i=0; i<3; i++){
+ fMin[i]=0; fMax[i]=0;
+ }
+ fgInstance =this;
+}
+
+AliTPCEfield::AliTPCEfield(const char* name, Int_t maxFreq, Bool_t is2D, Bool_t useLinear):
+ TNamed(name,name),
+ fScale(0),
+ fMaxFreq(maxFreq),
+ fIs2D(is2D),
+ fUseLinear(useLinear),
+ fWorkspace(0) // file with trees, pictures ...
+{
+ //
+ for (Int_t i=0; i<3; i++){
+ fMin[i]=0; fMax[i]=0;
+ }
+ fWorkspace=new TTreeSRedirector(Form("%s.root",name));
+ MakeFitFunctions(maxFreq);
+ fgInstance =this;
+}
+
+void AliTPCEfield::MakeFitFunctions(Int_t maxFreq){
+ //
+ // fit functions = f(x,y,z) = fx(x)*fy(y)*fz(z)
+ // function can be of following types:
+ // 0 - constant
+ // 1 - linear
+ // 2 - hypx
+ // 3 - hypy
+ // 4 - hypz
+ //
+ Int_t nfunctions=0;
+ if (fIs2D) nfunctions = 1+(maxFreq)*8;
+ if (!fIs2D) nfunctions = 1+(maxFreq)*8;
+ if (fUseLinear) nfunctions+=2;
+ fFitFunctions = new TMatrixD(nfunctions,4);
+ fFitParam = new TVectorD(nfunctions);
+ fFitCovar = new TMatrixD(nfunctions,nfunctions);
+ TMatrixD &fitF = *fFitFunctions;
+ // constant function
+ Int_t counter=1;
+ fitF(0,0)=0;
+ //
+ // linear functions in one cordinate - constan in others
+ if (fUseLinear)
+ for (Int_t ifx=0; ifx<=1; ifx++)
+ for (Int_t ify=0; ify<=1; ify++)
+ for (Int_t ifz=0; ifz<=1; ifz++){
+ if (fIs2D && ifz>0) continue;
+ if ((ifx+ify+ifz)==0) continue;
+ if ((ifx+ify+ifz)>1) continue;
+ fitF(counter,0)= 1; // function type
+ fitF(counter,1)= ifx; // type of x function
+ fitF(counter,2)= ify; // type of y function
+ fitF(counter,3)= ifz; // type of z function
+ counter++;
+ }
+ //
+ if (fIs2D){
+ for (Int_t ihyp=0; ihyp<2; ihyp++)
+ for (Int_t ifx=-maxFreq; ifx<=maxFreq; ifx++)
+ for (Int_t ify=-maxFreq; ify<=maxFreq; ify++){
+ if (TMath::Abs(ify)!=TMath::Abs(ifx)) continue;
+ if (ifx==0) continue;
+ if (ify==0) continue;
+ fitF(counter,0)= 2+ihyp; // function type
+ fitF(counter,1)= ifx; // type of x function - + sinus - cosin
+ fitF(counter,2)= ify; // type of y function
+ fitF(counter,3)= 0; // type of y function
+ counter++;
+ }
+ }
+
+}
+
+
+
+AliTPCEfield::~AliTPCEfield() {
+ //
+ // Destructor
+ //
+ if (fWorkspace) delete fWorkspace;
+}
+
+void AliTPCEfield::SetRange(Double_t x0, Double_t x1, Double_t y0, Double_t y1, Double_t z0,Double_t z1){
+ //
+ // Set the ranges - coordinates are rescaled in order to use proper
+ // cos,sin expansion in scaled space
+ //
+ fMin[0]=x0; fMax[0]=x1;
+ fMin[1]=y0; fMax[1]=y1;
+ fMin[2]=z0; fMax[2]=z1;
+ if (fIs2D) fScale=0.5*(TMath::Abs(x1-x0)+TMath::Abs(y1-y0));
+ if (!fIs2D) fScale=0.5*(TMath::Abs(x1-x0)+TMath::Abs(y1-y0)+TMath::Abs(z1-z0));
+}
+
+
+void AliTPCEfield::AddBoundaryLine(Double_t x0,Double_t y0,Double_t z0, Double_t v0, Double_t x1, Double_t y1, Double_t z1,Double_t v1, Int_t id, Int_t npoints){
+ //
+ // Add a e field boundary line
+ // From point (x0,y0) to point (x1,y1)
+ // Linear decrease of potential is assumed
+ // Boundary can be identified using boundary ID
+ // The line is written into tree Boundary
+ //
+ Double_t deltaX = (x1-x0);
+ Double_t deltaY = (y1-y0);
+ Double_t deltaZ = (z1-z0);
+ Double_t deltaV = (v1-v0);
+ for (Int_t ipoint=0; ipoint<npoints; ipoint++){
+ Double_t bpoint=gRandom->Rndm();
+ Double_t x = x0+deltaX*bpoint;
+ Double_t y = y0+deltaY*bpoint;
+ Double_t z = z0+deltaZ*bpoint;
+ Double_t v = v0+deltaV*bpoint;
+ (*fWorkspace)<<"Boundary"<<
+ "x="<<x<< // x coordinate
+ "y="<<y<< // y coordinate
+ "z="<<z<< // z coordinate
+ "v="<<v<< // potential
+ "id="<<id<< // boundary ID
+ "\n";
+ }
+}
+
+TTree * AliTPCEfield::GetTree(const char * tname){
+ //
+ //
+ //
+ return ((*fWorkspace)<<tname).GetTree();
+}
+
+Double_t AliTPCEfield::Field(Int_t ftype, Double_t ifx, Double_t ify, Double_t ifz, Double_t x, Double_t y, Double_t z){
+ //
+ // Field component in
+ // f frequency
+ Double_t fx=1,fy=1,fz=1;
+ const Double_t kEps=0.01;
+ //
+ if (ftype==0) return 1;
+ if (ftype==1) {
+ if (TMath::Nint(ifx)==1) return x;
+ if (TMath::Nint(ify)==1) return y;
+ if (TMath::Nint(ifz)==1) return z;
+ }
+ Double_t pi = TMath::Pi();
+ if (ifx>kEps) fx = (ftype==2) ? SinHNorm(ifx*pi*x,TMath::Abs(ifx*pi)): TMath::Sin(ifx*pi*x);
+ if (ifx<-kEps) fx = (ftype==2) ? CosHNorm(ifx*pi*x,TMath::Abs(ifx*pi)): TMath::Cos(ifx*pi*x);
+ //
+ if (ify>kEps) fy = (ftype==3) ? SinHNorm(ify*pi*y,TMath::Abs(ify*pi)): TMath::Sin(ify*pi*y);
+ if (ify<-kEps) fy = (ftype==3) ? CosHNorm(ify*pi*y,TMath::Abs(ify*pi)): TMath::Cos(ify*pi*y);
+ //
+ if (ifz>kEps) fz = (ftype==4) ? SinHNorm(ifz*pi*z,TMath::Abs(ifz*pi)): TMath::Sin(ifz*pi*z);
+ if (ifz<-kEps) fz = (ftype==4) ? CosHNorm(ifz*pi*z,TMath::Abs(ifz*pi)): TMath::Cos(ifz*pi*z);
+ (*fWorkspace)<<"eval"<<
+ "x="<<x<<
+ "y="<<y<<
+ "z="<<z<<
+ "ifx="<<ifx<<
+ "ify="<<ify<<
+ "ifz="<<ifz<<
+ "fx="<<fx<<
+ "fy="<<fy<<
+ "fz="<<fz<<
+ "ftype="<<ftype<<
+ "\n";
+ return fx*fy*fz;
+}
+
+
+Double_t AliTPCEfield::FieldDn(Int_t ftype, Double_t ifx, Double_t ify, Double_t ifz, Int_t dn, Double_t x, Double_t y, Double_t z){
+ //
+ //
+ //
+ //
+ // Field component in
+ // f frequency
+ Double_t fx=1,fy=1,fz=1;
+ const Double_t kEps=0.01;
+ //
+ if (ftype==0) return 0.;
+ if (ftype==1) {
+ Double_t value=0;
+ if (TMath::Nint(ifx)==1 &&dn==0) value=1.;
+ if (TMath::Nint(ify)==1 &&dn==1) value=1.;
+ if (TMath::Nint(ifz)==1 &&dn==2) value=1.;
+ return value;
+ }
+ Double_t pi = TMath::Pi();
+ if (ifx>kEps) fx = (ftype==2) ? SinHNorm(ifx*pi*x,TMath::Abs(ifx*pi)): TMath::Sin(ifx*pi*x);
+ if (ifx<-kEps) fx = (ftype==2) ? CosHNorm(ifx*pi*x,TMath::Abs(ifx*pi)): TMath::Cos(ifx*pi*x);
+ //
+ if (ify>kEps) fy = (ftype==3) ? SinHNorm(ify*pi*y,TMath::Abs(ify*pi)): TMath::Sin(ify*pi*y);
+ if (ify<-kEps) fy = (ftype==3) ? CosHNorm(ify*pi*y,TMath::Abs(ify*pi)): TMath::Cos(ify*pi*y);
+ //
+ if (ifz>kEps) fz = (ftype==4) ? SinHNorm(ifz*pi*z,TMath::Abs(ifz*pi)): TMath::Sin(ifz*pi*z);
+ if (ifz<-kEps) fz = (ftype==4) ? CosHNorm(ifz*pi*z,-TMath::Abs(ifz*pi)): TMath::Cos(ifz*pi*z);
+
+ if (dn==0){
+ if (ifx>kEps) fx = (ftype==2) ? CosHNorm(ifx*pi*x,TMath::Abs(ifx*pi)): TMath::Cos(ifx*pi*x);
+ if (ifx<-kEps) fx = (ftype==2) ? SinHNorm(ifx*pi*x,TMath::Abs(ifx*pi)): -TMath::Sin(ifx*pi*x);
+ fx*=ifx*pi;
+ }
+ if (dn==1){
+ if (ify>kEps) fy = (ftype==3) ? CosHNorm(ify*pi*y,TMath::Abs(ify*pi)): TMath::Cos(ify*pi*y);
+ if (ify<-kEps) fy = (ftype==3) ? SinHNorm(ify*pi*y,TMath::Abs(ify*pi)): -TMath::Sin(ify*pi*y);
+ fy*=ify*pi;
+ }
+ if (dn==2){
+ if (ifz>kEps) fz = (ftype==4) ? CosHNorm(ifz*pi*z,TMath::Abs(ifz*pi)): TMath::Cos(ifz*pi*z);
+ if (ifz<-kEps) fz = (ftype==4) ? SinHNorm(ifz*pi*z,TMath::Abs(ifz*pi)): -TMath::Sin(ifz*pi*z);
+ fz*=ifz*pi;
+ }
+
+ return fx*fy*fz;
+}
+
+
+
+
+Double_t AliTPCEfield::EvalField(Int_t ifun, Double_t x, Double_t y, Double_t z, Int_t type){
+ //
+ // Evaluate function ifun at position gx amd gy
+ // type == 0 - field
+ // == 1 - Ex
+ // == 2 - Ey
+ // == 3 - Ez
+ TMatrixD &mat = *fFitFunctions;
+ Int_t fid = TMath::Nint(mat(ifun,0));
+ Double_t ifx = (mat(ifun,1));
+ Double_t ify = (mat(ifun,2));
+ Double_t ifz = (mat(ifun,3));
+ //
+ if (type==0) return Field(fid,ifx,ify,ifz, x, y,z);
+ if (type>0) return FieldDn(fid,ifx,ify,ifz,type-1, x, y,z);
+ return 0;
+}
+
+Double_t AliTPCEfield::Eval(Double_t x, Double_t y, Double_t z, Int_t type){
+ //
+ // Evaluate function ifun at position gx amd gy
+ // type == 0 - field
+ // == 1 - Ex
+ // == 2 - Ey
+ // == 3 - Ez
+ Double_t value=0;
+ Double_t lx= 2.*(x-(fMin[0]+fMax[0])*0.5)/fScale;
+ Double_t ly= 2.*(y-(fMin[1]+fMax[1])*0.5)/fScale;
+ Double_t lz= 2.*(z-(fMin[2]+fMax[2])*0.5)/fScale;
+ //
+ Int_t nfun=fFitFunctions->GetNrows();
+ for (Int_t ifun=0; ifun<nfun; ifun++){
+ if (type==0) value+=(*fFitParam)[ifun]*EvalField(ifun,lx,ly,lz,type);
+ if (type>0) value+=2*(*fFitParam)[ifun]*EvalField(ifun,lx,ly,lz,type)/fScale;
+ }
+ return value;
+}
+
+Double_t AliTPCEfield::EvalS(Double_t x, Double_t y, Double_t z, Int_t type){
+ //
+ // static evaluation - possible to use it in the TF1
+ //
+ return fgInstance->Eval(x,y,z,type);
+}
+
+void AliTPCEfield::FitField(){
+ //
+ // Fit the e field
+ // Minimize chi2 residuals at the boundary points
+ // ?Tempoary sollution - integrals can be calculated analytically -
+ //
+ Int_t nfun=fFitFunctions->GetNrows();
+ Double_t *fun =new Double_t[nfun];
+ fFitter= new TLinearFitter(nfun, Form("hyp%d", nfun-1));
+ //
+ TTree * tree = GetTree("Boundary");
+ Int_t npoints = tree->GetEntries();
+ Int_t *indexes = new Int_t[npoints];
+ Double_t *rindex = new Double_t[npoints];
+ //
+
+ Double_t x=0, y=0, z=0, v=0;
+ tree->SetBranchAddress("x",&x);
+ tree->SetBranchAddress("y",&y);
+ tree->SetBranchAddress("z",&z);
+ tree->SetBranchAddress("v",&v);
+ TMatrixD valMatrix(npoints,4);
+ for (Int_t ipoint=0; ipoint<npoints; ipoint++){
+ tree->GetEntry(ipoint);
+ valMatrix(ipoint,0)=2.*(x-(fMin[0]+fMax[0])*0.5)/fScale;
+ valMatrix(ipoint,1)=2.*(y-(fMin[1]+fMax[1])*0.5)/fScale;
+ valMatrix(ipoint,2)=2.*(z-(fMin[2]+fMax[2])*0.5)/fScale;
+ valMatrix(ipoint,3)=v;
+ rindex[ipoint]=gRandom->Rndm();
+ }
+ TMath::Sort(npoints,rindex,indexes);
+ for (Int_t jpoint=0; jpoint<npoints; jpoint++){
+ Int_t ipoint=indexes[jpoint];
+ //
+ Double_t lx= valMatrix(ipoint,0);
+ Double_t ly= valMatrix(ipoint,1);
+ Double_t lz= valMatrix(ipoint,2);
+ Double_t value = valMatrix(ipoint,3);
+ for (Int_t ifun=1; ifun<nfun; ifun++){
+ Double_t ffun=EvalField(ifun,lx,ly,lz,0);
+ fun[ifun-1]=ffun;
+ }
+ fFitter->AddPoint(fun,value,1);
+ }
+ fFitter->Eval();
+ fFitter->GetCovarianceMatrix(*fFitCovar);
+ fFitter->GetParameters(*fFitParam);
+
+ (*fWorkspace)<<"fitGlobal"<<
+ "covar.="<<fFitCovar<< // covariance matrix
+ "param.="<<fFitParam<< // fit parameters
+ "fun.="<<fFitFunctions<< // type of fit functions
+ "\n";
+
+ for (Int_t ifun=1; ifun<nfun; ifun++){
+
+ }
+
+
+}
+
+
+TMatrixD* AliTPCEfield::MakeCorrelation(TMatrixD &matrix){
+ //
+ //
+ //
+ Int_t nrows = matrix.GetNrows();
+ TMatrixD * mat = new TMatrixD(nrows,nrows);
+ for (Int_t irow=0; irow<nrows; irow++)
+ for (Int_t icol=0; icol<nrows; icol++){
+ (*mat)(irow,icol)= matrix(irow,icol)/TMath::Sqrt(matrix(irow,irow)*matrix(icol,icol));
+ }
+ return mat;
+}
+
+
+
+
+void AliTPCEfield::DumpField(Double_t gridSize, Double_t step){
+ //
+ //
+ //
+ Double_t stepSize=0.001*fScale/fMaxFreq;
+ //
+ for (Double_t x = fMin[0]+stepSize; x<=fMax[0]-stepSize; x+=gridSize){
+ for (Double_t y = fMin[1]+stepSize; y<=fMax[1]-stepSize; y+=gridSize)
+ for (Double_t z = fMin[2]; z<=fMax[2]; z+=gridSize){
+ //
+ //
+ Double_t v = Eval(x,y,z,0);
+ Double_t ex = Eval(x,y,z,1);
+ Double_t ey = Eval(x,y,z,2);
+ Double_t ez = Eval(x,y,z,3);
+ Double_t dexdx = (Eval(x,y,z,1)-Eval(x-stepSize,y,z,1))/stepSize; // numerical derivative
+ Double_t deydy = (Eval(x,y,z,2)-Eval(x,y-stepSize,z,2))/stepSize;
+ Double_t dezdz = (Eval(x,y,z,3)-Eval(x,y,z-stepSize,3))/stepSize;
+ (*fWorkspace)<<"dumpField"<<
+ "x="<<x<< // position
+ "y="<<y<<
+ "z="<<z<<
+ "v="<<v<< // potential
+ "ex="<<ex<< // Efield
+ "ey="<<ey<<
+ "ez="<<ez<<
+ "dexdx="<<dexdx<< //gradient of e field
+ "deydy="<<deydy<<
+ "dezdz="<<dezdz<<
+ "\n";
+ }
+ }
+ //
+ //
+ for (Double_t x = fMin[0]+stepSize; x<=fMax[0]-stepSize; x+=gridSize){
+ Double_t sumEx=0;
+ Double_t sumEy=0;
+ Double_t sumExEy=0;
+ for (Double_t y = fMin[1]+0.2; y<=fMax[1]-stepSize; y+=step)
+ for (Double_t z = fMin[2]; z<=fMax[2]; z+=gridSize){
+ //
+ //
+ Double_t v = Eval(x,y+step*0.5,z,0);
+ Double_t ex = Eval(x,y+step*0.5,z,1);
+ Double_t ey = Eval(x,y+step*0.5,z,2);
+ Double_t ez = Eval(x,y+step*0.5,z,3);
+ sumEx+=ex*step;
+ sumEy+=ey*step;
+ sumExEy+=(ex/ey)*step;
+ (*fWorkspace)<<"dumpDistortion"<<
+ "x="<<x<< // position
+ "y="<<y<<
+ "z="<<z<<
+ "v="<<v<< // potential
+ "ex="<<ex<< // Efield
+ "ey="<<ey<<
+ "ez="<<ez<<
+ //
+ "sEx="<<sumEx<< // field x integral
+ "sEy="<<sumEy<< // field y integral
+ "sExEy="<<sumExEy<< // tan integral
+ "\n";
+ }
+ }
+}
+
+
+void MakeTPC2DExample(AliTPCEfield *field){
+ //
+ /*
+ .L $ALICE_ROOT/TPC/AliTPCEfield.cxx++
+ AliTPCEfield *field = new AliTPCEfield("field",20, kTRUE,kTRUE);
+ MakeTPC2DExample(field)
+ field->FitField()
+ sqrt(field->fFitter.GetChisquare()/field->fFitter.GetNpoints())
+
+ TF2 f2("f2","AliTPCEfield::EvalS(x,y,0,0)",90,245,0,250);
+ f2->SetNpx(100); f2->SetNpy(100); f2->Draw("colz");
+
+ TF2 f2x("f2x","AliTPCEfield::EvalS(x,y,0,1)",90,240,0,240);
+ f2x->SetNpx(100); f2x->SetNpy(100); f2x->Draw("surf2");
+
+ TF2 f2y("f2y","AliTPCEfield::EvalS(x,y,0,2)",90,240,0,240);
+ f2y->SetNpx(100); f2y->SetNpy(100); f2y->Draw("surf2");
+
+ field->MakeCorrelation(*(field->fFitCovar)).Print()
+ Double_t index[100000];
+ for (Int_t i=0; i<field->fFitCovar->GetNrows(); i++) index[i]=i;
+ TGraph gr(field->fFitCovar->GetNrows(), index, field->fFitParam->GetMatrixArray());
+ gr->Draw("alp");
+
+ field->GetTree()->Draw("AliTPCEfield::EvalS(x,y,0,0):v");
+
+
+ TF2 f2xdy("f2xdy","AliTPCEfield::EvalS(x,y,0,1)/AliTPCEfield::EvalS(x,y,0,2)",90,240,0,240);
+ f2xdy->SetNpx(100); f2xdy->SetNpy(100); f2xdy->Draw("colz");
+
+ */
+
+ Double_t p0[4];
+ Double_t p1[4];
+ Double_t xmin=85, xmax=245;
+ Double_t ymin=0, ymax=250, deltaY=0.1*ymax;
+ Double_t vup=1;
+ Int_t npoints=1000;
+ field->SetRange(xmin, xmax,ymin,ymax,0,0);
+ // upper part
+ p0[0]=xmin; p0[1]=ymax+deltaY; p0[2]=0; p0[3]=vup;
+ p1[0]=xmax; p1[1]=ymax-deltaY; p1[2]=0; p1[3]=vup;
+ field->AddBoundaryLine(p0[0],p0[1], p0[2],p0[3],p1[0],p1[1], p1[2],p1[3],1,npoints);
+ //left
+ p0[0]=xmin; p0[1]=ymin+deltaY; p0[2]=0; p0[3]=0;
+ p1[0]=xmin; p1[1]=ymax+deltaY; p1[2]=0; p1[3]=vup;
+ field->AddBoundaryLine(p0[0],p0[1], p0[2],p0[3],p1[0],p1[1], p1[2],p1[3],2,npoints);
+ //right
+ p0[0]=xmax; p0[1]=ymin-deltaY; p0[2]=0; p0[3]=0;
+ p1[0]=xmax; p1[1]=ymax-deltaY; p1[2]=0; p1[3]=vup;
+ field->AddBoundaryLine(p0[0],p0[1], p0[2],p0[3],p1[0],p1[1], p1[2],p1[3],3,npoints);
+ //
+ //ROC
+ p0[0]=xmin; p0[1]=deltaY; p0[2]=0; p0[3]=-0;
+ p1[0]=xmax; p1[1]=-deltaY; p1[2]=0; p1[3]=0;
+ field->AddBoundaryLine(p0[0],p0[1], p0[2],p0[3],p1[0],p1[1], p1[2],p1[3],4,npoints);
+}
+
+
+
--- /dev/null
+#ifndef ALITPCEFIELD_H
+#define ALITPCEFIELD_H
+
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+/* $Id: AliTPCEfield.h 35613 2009-10-16 03:24:40Z marian $ */
+
+
+#include "TNamed.h"
+#include "TMatrixD.h"
+#include "TVectorD.h"
+#include "TNamed.h"
+class TTreeSRedirector;
+
+class AliTPCEfield:public TNamed {
+public:
+ AliTPCEfield();
+ AliTPCEfield(const char * name, Int_t maxFreq, Bool_t is2D, Bool_t useLinear=kTRUE);
+ virtual ~AliTPCEfield();
+ void SetRange(Double_t x0, Double_t x1, Double_t y0, Double_t y1, Double_t z00,Double_t z1=0);
+ void AddBoundaryLine(Double_t x0,Double_t y0, Double_t z0, Double_t v0, Double_t x1, Double_t y1, Double_t z1, Double_t v1, Int_t id=0, Int_t npoints=100);
+ TTree * GetTree(const char * tname="Boundary");
+ //
+ void MakeFitFunctions(Int_t maxFreq);
+ void FitField();
+ void DumpField(Double_t gridSize=5, Double_t step=0.5);
+ //
+ Double_t EvalField(Int_t ifun, Double_t x, Double_t y, Double_t z, Int_t type=0);
+ Double_t Eval(Double_t x, Double_t y, Double_t z, Int_t type=0);
+ //
+ static Double_t EvalS(Double_t x, Double_t y, Double_t z, Int_t type=0);
+ //
+
+ Double_t Field(Int_t ftype, Double_t ifx, Double_t ify, Double_t ifz, Double_t x, Double_t y, Double_t z);
+ Double_t FieldDn(Int_t ftype, Double_t ifx, Double_t ify, Double_t ifz, Int_t dn, Double_t x, Double_t y, Double_t z);
+ TMatrixD* MakeCorrelation(TMatrixD &matrix);
+
+ // get rid of numerical instabilities
+ Double_t SinHNorm(Double_t x, Double_t norm){ return 0.5*(TMath::Exp(x-norm)-TMath::Exp(-x-norm));}
+ Double_t CosHNorm(Double_t x, Double_t norm){ return 0.5*(TMath::Exp(x-norm)+TMath::Exp(-x-norm));}
+ public:
+ Double_t fMin[3]; // range of coordinates from Min to Max
+ Double_t fMax[3]; //
+ Double_t fScale; // scaling factor
+ Int_t fMaxFreq; // maximal frequency of expansion
+ Bool_t fIs2D; // flag for 2D field
+ Bool_t fUseLinear; // flag to use also linear term of the field
+ //
+ TTreeSRedirector * fWorkspace; //! workspace
+ TMatrixD *fFitFunctions; // fit function description
+ TVectorD *fFitParam; // fit parameters - coeficients
+ TMatrixD *fFitCovar; // fit covariance
+ TLinearFitter *fFitter; // linear fitter - temporary solution - integrals to be calculated
+ static AliTPCEfield* fgInstance; // instance of fied - for visualization
+ ClassDef(AliTPCEfield,1)
+};
+
+#endif
}
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];
-#ifndef ALI_TPC_EXB_B_SHAPE_H
-#define ALI_TPC_EXB_B_SHAPE_H
+#ifndef ALI_TPC_EX_BB_SHAPE_H
+#define ALI_TPC_EX_BB_SHAPE_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
// common setters and getters for ExB
virtual void SetOmegaTauT1T2(Float_t omegaTau,Float_t t1,Float_t t2) {
fT1=t1; fT2=t2;
- const Float_t wt1=t1*omegaTau;
- fC1=wt1/(1.+wt1*wt1);
- const Float_t wt2=t2*omegaTau;
- fC2=wt2*wt2/(1.+wt2*wt2);
+ const Float_t wt1=t1*omegaTau; fC1=wt1/(1.+wt1*wt1);
+ const Float_t wt2=t2*omegaTau; fC2=wt2*wt2/(1.+wt2*wt2);
};
void SetC1C2(Float_t c1,Float_t c2) {fC1=c1;fC2=c2;} // CAUTION: USE WITH CARE
Float_t GetC1() const {return fC1;}
Float_t GetC2() const {return fC2;}
// setters and getters for the magentic field map
- void SetBField(AliMagF *bField) {fBField=bField;}
+ void SetBField(const AliMagF *bField) {fBField=(AliMagF*)bField;}
AliMagF* GetBField() const {return fBField;}
virtual void GetCorrection(const Float_t x[],const Short_t roc,Float_t dx[]);
Float_t fC1; // coefficient C1 (compare Jim Thomas's notes for definitions)
Float_t fC2; // coefficient C2 (compare Jim Thomas's notes for definitions)
- AliMagF *fBField;
+ AliMagF *fBField; // pointer to magnetic field
AliTPCExBBShape & operator =(const AliTPCExBBShape);
AliTPCExBBShape(const AliTPCExBBShape&); //dummy copy contructor
}
-void AliTPCExBConical::Print(Option_t* option) const {
+void AliTPCExBConical::Print(const Option_t* option) const {
//
// Print function to check the settings (e.g. the conical in the X direction)
// option=="a" prints the C0 and C1 coefficents for calibration purposes
// common setters and getters for ExB
virtual void SetOmegaTauT1T2(Float_t omegaTau,Float_t t1,Float_t t2) {
fT1=t1; fT2=t2;
- const Float_t wt1=t1*omegaTau;
- fC1=wt1/(1.+wt1*wt1);
- const Float_t wt2=t2*omegaTau;
- fC2=wt2*wt2/(1.+wt2*wt2);
+ const Float_t wt1=t1*omegaTau; fC1=wt1/(1.+wt1*wt1);
+ const Float_t wt2=t2*omegaTau; fC2=wt2*wt2/(1.+wt2*wt2);
};
void SetC1C2(Float_t c1,Float_t c2) {fC1=c1;fC2=c2;} // CAUTION: USE WITH CARE
Float_t GetC1() const {return fC1;}
Float_t GetConicalC(Int_t i) const {return fConicalC[i];}
Float_t GetConicalFactor() const {return fConicalFactor;}
- virtual void Print(Option_t* option="") const;
+ virtual void Print(const Option_t* option="") const;
protected:
virtual void GetCorrection(const Float_t x[],const Short_t roc,Float_t dx[]);
//
const Float_t zstart=x[2];
- const Float_t zend =(roc%36<18?fgkTPC_Z0:-fgkTPC_Z0);
+ const Float_t zend =(roc%36<18?fgkTPCZ0:-fgkTPCZ0);
const Float_t zdrift=zstart-zend;
dx[0]=(fC2*fXTwist-fC1*fYTwist)*zdrift;
dx[2]=0.;
}
-void AliTPCExBTwist::Print(Option_t* option) const {
+void AliTPCExBTwist::Print(const Option_t* option) const {
//
// Print function to check the settings (e.g. the twist in the X direction)
// option=="a" prints the C0 and C1 coefficents for calibration purposes
-#ifndef ALI_TPC_EXB_TWIST_H
-#define ALI_TPC_EXB_TWIST_H
+#ifndef ALI_TPC_EX_B_TWIST_H
+#define ALI_TPC_EX_B_TWIST_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
// common setters and getters for ExB
virtual void SetOmegaTauT1T2(Float_t omegaTau,Float_t t1,Float_t t2) {
- fT1=t1; fT2=t2;
- const Float_t wt1=t1*omegaTau;
- fC1=wt1/(1.+wt1*wt1);
- const Float_t wt2=t2*omegaTau;
- fC2=wt2*wt2/(1.+wt2*wt2);
+ fT1=t1; fT2=t2;
+ const Float_t wt1=t1*omegaTau; fC1=wt1/(1.+wt1*wt1);
+ const Float_t wt2=t2*omegaTau; fC2=wt2*wt2/(1.+wt2*wt2);
};
void SetC1C2(Float_t c1,Float_t c2) {fC1=c1;fC2=c2;} // CAUTION: USE WITH CARE
Float_t GetC1() const {return fC1;}
Float_t GetXTwist() const {return fXTwist;}
Float_t GetYTwist() const {return fYTwist;}
- virtual void Print(Option_t* option="") const;
+ virtual void Print(const Option_t* option="") const;
protected:
virtual void GetCorrection(const Float_t x[],const Short_t roc,Float_t dx[]);
void AliTPCGGVoltError::Init() {
//
- //
+ // Init function
//
AliMagF* magF= (AliMagF*)TGeoGlobalMagField::Instance()->GetField();
if (!magF) AliError("Magneticd field - not initialized");
fGGVoltErrorER[i][j] = 0.0 ;
Double_t intz = 0.0 ;
for ( Int_t n = 1 ; n < nterms ; ++n ) {
- Double_t k = n * TMath::Pi() / fgkTPC_Z0 ;
+ Double_t k = n * TMath::Pi() / fgkTPCZ0 ;
Double_t ein = 0 ; // Error potential on the IFC
Double_t eout = 0 ; // Error potential on the OFC
if ( z < 0 ) {
Double_t denominator =
TMath::BesselK0( k*fgkOFCRadius ) * TMath::BesselI0( k*fgkIFCRadius ) -
TMath::BesselK0( k*fgkIFCRadius ) * TMath::BesselI0( k*fgkOFCRadius ) ;
- Double_t zterm = TMath::Cos( k*(fgkTPC_Z0-TMath::Abs(z)) ) - 1 ;
+ Double_t zterm = TMath::Cos( k*(fgkTPCZ0-TMath::Abs(z)) ) - 1 ;
intz += zterm * numerator / denominator ;
// Assume series converges, break if small terms
if ( n>10 && TMath::Abs(intz)*1.e-10 > TMath::Abs(numerator/denominator) ) break;
-void AliTPCGGVoltError::Print(Option_t* option) const {
+void AliTPCGGVoltError::Print(const Option_t* option) const {
//
// Print function to check the settings (e.g. voltage offsets)
// option=="a" prints the C0 and C1 coefficents for calibration purposes
-#ifndef ALI_TPC_GG_VOLT_ERROR_H
-#define ALI_TPC_GG_VOLT_ERROR_H
+#ifndef ALI_TPCGG_VOLT_ERROR_H
+#define ALI_TPCGG_VOLT_ERROR_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
// common setters and getters for ExB
virtual void SetOmegaTauT1T2(Float_t omegaTau,Float_t t1,Float_t t2) {
fT1=t1; fT2=t2;
- const Double_t wt0=t2*omegaTau;
- fC0=1./(1.+wt0*wt0);
- const Double_t wt1=t1*omegaTau;
- fC1=wt1/(1.+wt1*wt1);
+ const Double_t wt0=t2*omegaTau; fC0=1./(1.+wt0*wt0);
+ const Double_t wt1=t1*omegaTau; fC1=wt1/(1.+wt1*wt1);
};
void SetC0C1(Double_t c0,Double_t c1) {fC0=c0;fC1=c1;} // CAUTION: USE WITH CARE
Float_t GetIntErOverEz(const Float_t x[],const Short_t roc);
- virtual void Print(Option_t* option="") const;
+ virtual void Print(const Option_t* option="") const;
protected:
virtual void GetCorrection(const Float_t x[],const Short_t roc, Float_t dx[]);
AliTPCInverseCorrection(AliTPCCorrection *correction);
virtual ~AliTPCInverseCorrection();
- void SetCorrection(AliTPCCorrection *correction) {fCorrection=correction;}
- AliTPCCorrection* GetCorrection() const {return fCorrection;}
+ void SetCorrection(const AliTPCCorrection *correction) {fCorrection=(AliTPCCorrection*) correction;}
+ const AliTPCCorrection* GetCorrection() const {return fCorrection;}
virtual void GetCorrection(const Float_t x[],const Short_t roc,Float_t dx[]);
virtual void GetDistortion(const Float_t x[],const Short_t roc,Float_t dx[]);
#pragma link C++ class AliTPCExBTwist+;
#pragma link C++ class AliTPCExBConical+;
#pragma link C++ class AliTPCGGVoltError+;
+#pragma link C++ class AliTPCCalibGlobalMisalignment+;
#endif
AliTPCkalmanTime.cxx AliESDcosmic.cxx AliTPCPointCorrection.cxx AliTPCTransformation.cxx \
AliTPCkalmanFit.cxx AliTPCLaserTrack.cxx AliTPCcalibBase.cxx \
AliTPCCorrection.cxx AliTPCInverseCorrection.cxx AliTPCComposedCorrection.cxx \
- AliTPCExBBShape.cxx AliTPCExBTwist.cxx AliTPCGGVoltError.cxx AliTPCExBConical.cxx AliXRDPROOFtoolkit.cxx
+ AliTPCExBBShape.cxx AliTPCExBTwist.cxx AliTPCGGVoltError.cxx AliTPCExBConical.cxx AliXRDPROOFtoolkit.cxx AliTPCCalibGlobalMisalignment.cxx
HDRS:= $(SRCS:.cxx=.h)