From b1f0a2a55d72ef9a5834950f7793efb30a41cc1e Mon Sep 17 00:00:00 2001 From: marian Date: Wed, 26 May 2010 11:44:32 +0000 Subject: [PATCH] Fixing coding violation + New class to calcualte electric field in the cartezian coordinate system Marian --- TPC/AliTPCCalibGlobalMisalignment.cxx | 114 ++++++ TPC/AliTPCCalibGlobalMisalignment.h | 64 ++++ TPC/AliTPCComposedCorrection.cxx | 3 +- TPC/AliTPCComposedCorrection.h | 3 +- TPC/AliTPCCorrection.cxx | 41 +- TPC/AliTPCCorrection.h | 14 +- TPC/AliTPCEfield.cxx | 517 ++++++++++++++++++++++++++ TPC/AliTPCEfield.h | 59 +++ TPC/AliTPCExBBShape.cxx | 4 +- TPC/AliTPCExBBShape.h | 14 +- TPC/AliTPCExBConical.cxx | 2 +- TPC/AliTPCExBConical.h | 8 +- TPC/AliTPCExBTwist.cxx | 4 +- TPC/AliTPCExBTwist.h | 14 +- TPC/AliTPCGGVoltError.cxx | 8 +- TPC/AliTPCGGVoltError.h | 12 +- TPC/AliTPCInverseCorrection.h | 4 +- TPC/TPCbaseLinkDef.h | 1 + TPC/libTPCbase.pkg | 2 +- 19 files changed, 814 insertions(+), 74 deletions(-) create mode 100644 TPC/AliTPCCalibGlobalMisalignment.cxx create mode 100644 TPC/AliTPCCalibGlobalMisalignment.h create mode 100644 TPC/AliTPCEfield.cxx create mode 100644 TPC/AliTPCEfield.h diff --git a/TPC/AliTPCCalibGlobalMisalignment.cxx b/TPC/AliTPCCalibGlobalMisalignment.cxx new file mode 100644 index 00000000000..f7b2049e011 --- /dev/null +++ b/TPC/AliTPCCalibGlobalMisalignment.cxx @@ -0,0 +1,114 @@ +/************************************************************************** + * 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); + + +} diff --git a/TPC/AliTPCCalibGlobalMisalignment.h b/TPC/AliTPCCalibGlobalMisalignment.h new file mode 100644 index 00000000000..12f3056114d --- /dev/null +++ b/TPC/AliTPCCalibGlobalMisalignment.h @@ -0,0 +1,64 @@ +#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 diff --git a/TPC/AliTPCComposedCorrection.cxx b/TPC/AliTPCComposedCorrection.cxx index 1268b382323..c85d82d3c66 100644 --- a/TPC/AliTPCComposedCorrection.cxx +++ b/TPC/AliTPCComposedCorrection.cxx @@ -55,8 +55,9 @@ #include -#include #include +#include + #include "AliTPCComposedCorrection.h" diff --git a/TPC/AliTPCComposedCorrection.h b/TPC/AliTPCComposedCorrection.h index c4e6fe9eebb..a8d0c5461ac 100644 --- a/TPC/AliTPCComposedCorrection.h +++ b/TPC/AliTPCComposedCorrection.h @@ -29,6 +29,7 @@ #include "AliTPCCorrection.h" class TCollection; +class TTimeStamp; class AliTPCComposedCorrection : public AliTPCCorrection { public: @@ -41,7 +42,7 @@ 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;} diff --git a/TPC/AliTPCCorrection.cxx b/TPC/AliTPCCorrection.cxx index 3fcc1b5d7c2..a1262bfed16 100644 --- a/TPC/AliTPCCorrection.cxx +++ b/TPC/AliTPCCorrection.cxx @@ -65,7 +65,7 @@ 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 @@ -391,12 +391,11 @@ TH2F* AliTPCCorrection::CreateTH2F(const char *name,const char *title, // 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 ) ; @@ -406,16 +405,15 @@ void AliTPCCorrection::Interpolate2DEdistortion( const Int_t order, const Double 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. // @@ -434,8 +432,7 @@ Double_t AliTPCCorrection::Interpolate( const Double_t xArray[], const Double_t } -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 // @@ -483,7 +480,7 @@ void AliTPCCorrection::Search( const Int_t n, const Double_t xArray[], const Dou } -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 @@ -688,7 +685,7 @@ TTree* AliTPCCorrection::CreateDistortionTree(Double_t step){ -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) @@ -755,22 +752,16 @@ void AliTPCCorrection::MakeTrackDistortionTree(TTree *tinput, Int_t dtype, Int_t 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; @@ -786,7 +777,7 @@ void AliTPCCorrection::MakeTrackDistortionTree(TTree *tinput, Int_t dtype, Int_t -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 diff --git a/TPC/AliTPCCorrection.h b/TPC/AliTPCCorrection.h index eab8bafb08d..0db7bef7c19 100644 --- a/TPC/AliTPCCorrection.h +++ b/TPC/AliTPCCorrection.h @@ -76,14 +76,14 @@ public: 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 @@ -92,14 +92,14 @@ protected: 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 ); diff --git a/TPC/AliTPCEfield.cxx b/TPC/AliTPCEfield.cxx new file mode 100644 index 00000000000..759dfe9d3ec --- /dev/null +++ b/TPC/AliTPCEfield.cxx @@ -0,0 +1,517 @@ +/************************************************************************** + * 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; ipointRndm(); + 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="<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="<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; ifun0) 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; ipointGetEntry(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; jpointAddPoint(fun,value,1); + } + fFitter->Eval(); + fFitter->GetCovarianceMatrix(*fFitCovar); + fFitter->GetParameters(*fFitParam); + + (*fWorkspace)<<"fitGlobal"<< + "covar.="<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; ifFitCovar->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); +} + + + diff --git a/TPC/AliTPCEfield.h b/TPC/AliTPCEfield.h new file mode 100644 index 00000000000..46408e60f70 --- /dev/null +++ b/TPC/AliTPCEfield.h @@ -0,0 +1,59 @@ +#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 diff --git a/TPC/AliTPCExBBShape.cxx b/TPC/AliTPCExBBShape.cxx index 1df9c203c2b..2e3c6fe8114 100644 --- a/TPC/AliTPCExBBShape.cxx +++ b/TPC/AliTPCExBBShape.cxx @@ -109,7 +109,7 @@ void AliTPCExBBShape::GetCorrection(const Float_t x[],const Short_t roc,Float_t } 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]; @@ -139,7 +139,7 @@ void AliTPCExBBShape::GetBxAndByOverBz(const Float_t x[],const Short_t roc,Float } 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]; diff --git a/TPC/AliTPCExBBShape.h b/TPC/AliTPCExBBShape.h index 980284cef97..9c7b569b281 100644 --- a/TPC/AliTPCExBBShape.h +++ b/TPC/AliTPCExBBShape.h @@ -1,5 +1,5 @@ -#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 */ @@ -32,17 +32,15 @@ public: // 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[]); @@ -54,7 +52,7 @@ private: 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 diff --git a/TPC/AliTPCExBConical.cxx b/TPC/AliTPCExBConical.cxx index f23e0c98d7d..5f93a2a9ffc 100644 --- a/TPC/AliTPCExBConical.cxx +++ b/TPC/AliTPCExBConical.cxx @@ -135,7 +135,7 @@ void AliTPCExBConical::GetCorrection(const Float_t x[],const Short_t roc,Float_t } -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 diff --git a/TPC/AliTPCExBConical.h b/TPC/AliTPCExBConical.h index 38d68a79d9e..547967ceddd 100644 --- a/TPC/AliTPCExBConical.h +++ b/TPC/AliTPCExBConical.h @@ -26,10 +26,8 @@ public: // 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;} @@ -44,7 +42,7 @@ public: 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[]); diff --git a/TPC/AliTPCExBTwist.cxx b/TPC/AliTPCExBTwist.cxx index f9e2dd2b310..ba8104b6319 100644 --- a/TPC/AliTPCExBTwist.cxx +++ b/TPC/AliTPCExBTwist.cxx @@ -101,7 +101,7 @@ void AliTPCExBTwist::GetCorrection(const Float_t x[],const Short_t roc,Float_t d // 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; @@ -109,7 +109,7 @@ void AliTPCExBTwist::GetCorrection(const Float_t x[],const Short_t roc,Float_t d 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 diff --git a/TPC/AliTPCExBTwist.h b/TPC/AliTPCExBTwist.h index 33acd880bd3..afceedceba0 100644 --- a/TPC/AliTPCExBTwist.h +++ b/TPC/AliTPCExBTwist.h @@ -1,5 +1,5 @@ -#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 */ @@ -29,11 +29,9 @@ public: // 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;} @@ -45,7 +43,7 @@ public: 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[]); diff --git a/TPC/AliTPCGGVoltError.cxx b/TPC/AliTPCGGVoltError.cxx index edf22649bc1..04d1a691c14 100644 --- a/TPC/AliTPCGGVoltError.cxx +++ b/TPC/AliTPCGGVoltError.cxx @@ -62,7 +62,7 @@ AliTPCGGVoltError::~AliTPCGGVoltError() { void AliTPCGGVoltError::Init() { // - // + // Init function // AliMagF* magF= (AliMagF*)TGeoGlobalMagField::Instance()->GetField(); if (!magF) AliError("Magneticd field - not initialized"); @@ -199,7 +199,7 @@ void AliTPCGGVoltError::InitGGVoltErrorDistortion() { 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 ) { @@ -218,7 +218,7 @@ void AliTPCGGVoltError::InitGGVoltErrorDistortion() { 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; @@ -231,7 +231,7 @@ void AliTPCGGVoltError::InitGGVoltErrorDistortion() { -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 diff --git a/TPC/AliTPCGGVoltError.h b/TPC/AliTPCGGVoltError.h index 46f00abf8ff..f5c747d3903 100644 --- a/TPC/AliTPCGGVoltError.h +++ b/TPC/AliTPCGGVoltError.h @@ -1,5 +1,5 @@ -#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 */ @@ -30,10 +30,8 @@ public: // 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 @@ -50,7 +48,7 @@ public: 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[]); diff --git a/TPC/AliTPCInverseCorrection.h b/TPC/AliTPCInverseCorrection.h index 21d10890886..ac4767d3c1e 100644 --- a/TPC/AliTPCInverseCorrection.h +++ b/TPC/AliTPCInverseCorrection.h @@ -28,8 +28,8 @@ public: 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[]); diff --git a/TPC/TPCbaseLinkDef.h b/TPC/TPCbaseLinkDef.h index 10f11570497..79dab1d9036 100644 --- a/TPC/TPCbaseLinkDef.h +++ b/TPC/TPCbaseLinkDef.h @@ -98,6 +98,7 @@ #pragma link C++ class AliTPCExBTwist+; #pragma link C++ class AliTPCExBConical+; #pragma link C++ class AliTPCGGVoltError+; +#pragma link C++ class AliTPCCalibGlobalMisalignment+; #endif diff --git a/TPC/libTPCbase.pkg b/TPC/libTPCbase.pkg index 6ebf1fee3ec..ad109d7eaed 100644 --- a/TPC/libTPCbase.pkg +++ b/TPC/libTPCbase.pkg @@ -25,7 +25,7 @@ SRCS:= AliSegmentID.cxx AliSegmentArray.cxx AliDigits.cxx AliH2F.cxx \ 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) -- 2.43.0