48 #include "TGeoGlobalMagField.h" 65 fROCdisplacement(kTRUE),
71 for (Int_t i=0; i<8; i++){
73 if (i<6) fBoundariesC[i]= 0;
92 AliError(
"Zerro pointer - correction");
97 AliError(TString::Format(
"Inconsistent class types: %s\%s",IsA()->GetName(),corr->IsA()->GetName()).Data());
101 AliError(TString::Format(
"Inconsistent fROCdisplacement : %s\%s",IsA()->GetName(),corr->IsA()->GetName()).Data());
104 for (Int_t i=0;i <8; i++){
118 AliMagF* magF= (
AliMagF*)TGeoGlobalMagField::Instance()->GetField();
119 if (!magF)
AliError(
"Magneticd field - not initialized");
122 if (!param)
AliError(
"Parameters - not initialized");
124 Double_t ezField = 400;
125 Double_t wt = -10.0 * (bzField*10) * vdrift / ezField ;
135 AliMagF* magF= (
AliMagF*)TGeoGlobalMagField::Instance()->GetField();
136 if (!magF)
AliError(
"Magneticd field - not initialized");
139 if (!param)
AliError(
"Parameters - not initialized");
141 Double_t ezField = 400;
142 Double_t wt = -10.0 * (bzField*10) * vdrift / ezField ;
154 AliInfo(
"Lookup table was not initialized! Perform the inizialisation now ...");
160 Double_t intEr, intEphi, intdEz ;
164 r = TMath::Sqrt( x[0]*x[0] + x[1]*x[1] ) ;
165 phi = TMath::ATan2(x[1],x[0]) ;
166 if ( phi < 0 ) phi += TMath::TwoPi() ;
169 if ( (roc%36) < 18 ) {
181 if ( (sign==1 && z<0) || (sign==-1 && z>0) )
182 AliError(
"ROC number does not correspond to z coordinate! Calculation of distortions is most likely wrong!");
191 phi = phi + (
fC0*intEphi -
fC1*intEr ) / r;
192 r = r + (
fC0*intEr +
fC1*intEphi );
196 dx[0] = r * TMath::Cos(phi) - x[0];
197 dx[1] = r * TMath::Sin(phi) - x[1];
219 for ( Int_t j = 0 ; j <
kColumns ; j++ ) {
220 Double_t zed = j*gridSizeZ ;
222 for ( Int_t i = 0 ; i <
kRows ; i++ ) {
227 chargeDensity(i,j) = 0;
238 for (Int_t i=0; i<8; i++) {
245 if (sVec[0]==1 && sVec[1]==1 && sVec[2]==1 && sVec[3]==1 && sVec[4]==1 && sVec[5]==1 && sVec[6]==1 && sVec[7]==1 )
247 else if (sVec[0]==-1 && sVec[1]==-1 && sVec[2]==-1 && sVec[3]==-1 && sVec[4]==-1 && sVec[5]==-1 && sVec[6]==-1 && sVec[7]==-1 )
259 for ( Int_t j = 0 ; j <
kColumns ; j++ ) {
260 Double_t zed = j*gridSizeZ ;
261 for ( Int_t i = 0 ; i <
kRows ; i++ ) {
289 voltArrayA(0,0) *= 0.5 ;
290 voltArrayA(
kRows-1,0) *= 0.5 ;
291 voltArrayA(0,kColumns-1) *= 0.5 ;
292 voltArrayA(
kRows-1,kColumns-1)*= 0.5 ;
295 voltArrayC(0,0) *= 0.5 ;
296 voltArrayC(
kRows-1,0) *= 0.5 ;
297 voltArrayC(0,kColumns-1) *= 0.5 ;
298 voltArrayC(
kRows-1,kColumns-1)*= 0.5 ;
307 for ( Int_t j = 0 ; j <
kColumns ; j++ ) {
308 for ( Int_t i = 0 ; i <
kRows ; i++ ) {
309 arrayErOverEzC(i,j) = symmetry*arrayErOverEzA(i,j);
310 arrayDeltaEzC(i,j) = -symmetry*arrayDeltaEzA(i,j);
313 }
else if (symmetry==0) {
316 for ( Int_t j = 0 ; j <
kColumns ; j++ ) {
317 for ( Int_t i = 0 ; i <
kRows ; i++ ) {
318 arrayDeltaEzC(i,j) = -arrayDeltaEzC(i,j);
324 Int_t ilow=0, jlow=0 ;
328 for ( Int_t i = 0 ; i <
kNZ ; ++i ) {
330 for ( Int_t j = 0 ; j <
kNR ; ++j ) {
334 Search( kColumns, zedList, z, jlow ) ;
335 if ( ilow < 0 ) ilow = 0 ;
336 if ( jlow < 0 ) jlow = 0 ;
337 if ( ilow + 1 >=
kRows - 1 ) ilow =
kRows - 2 ;
338 if ( jlow + 1 >= kColumns - 1 ) jlow = kColumns - 2 ;
341 saveEr[0] = arrayErOverEzA(ilow,jlow) +
342 (arrayErOverEzA(ilow,jlow+1)-arrayErOverEzA(ilow,jlow))*(z-zedList[jlow])/gridSizeZ ;
343 saveEr[1] = arrayErOverEzA(ilow+1,jlow) +
344 (arrayErOverEzA(ilow+1,jlow+1)-arrayErOverEzA(ilow+1,jlow))*(z-zedList[jlow])/gridSizeZ ;
345 saveEz[0] = arrayDeltaEzA(ilow,jlow) +
346 (arrayDeltaEzA(ilow,jlow+1)-arrayDeltaEzA(ilow,jlow))*(z-zedList[jlow])/gridSizeZ ;
347 saveEz[1] = arrayDeltaEzA(ilow+1,jlow) +
348 (arrayDeltaEzA(ilow+1,jlow+1)-arrayDeltaEzA(ilow+1,jlow))*(z-zedList[jlow])/gridSizeZ ;
351 saveEr[0] = arrayErOverEzC(ilow,jlow) +
352 (arrayErOverEzC(ilow,jlow+1)-arrayErOverEzC(ilow,jlow))*(z-zedList[jlow])/gridSizeZ ;
353 saveEr[1] = arrayErOverEzC(ilow+1,jlow) +
354 (arrayErOverEzC(ilow+1,jlow+1)-arrayErOverEzC(ilow+1,jlow))*(z-zedList[jlow])/gridSizeZ ;
355 saveEz[0] = arrayDeltaEzC(ilow,jlow) +
356 (arrayDeltaEzC(ilow,jlow+1)-arrayDeltaEzC(ilow,jlow))*(z-zedList[jlow])/gridSizeZ ;
357 saveEz[1] = arrayDeltaEzC(ilow+1,jlow) +
358 (arrayDeltaEzC(ilow+1,jlow+1)-arrayDeltaEzC(ilow+1,jlow))*(z-zedList[jlow])/gridSizeZ ;
361 AliWarning(
"Field calculation at z=0 (CE) is not allowed!");
362 saveEr[0]=0; saveEr[1]=0;
363 saveEz[0]=0; saveEz[1]=0;
365 fLookUpErOverEz[i][j] = saveEr[0] + (saveEr[1]-saveEr[0])*(r-rList[ilow])/gridSizeR ;
366 fLookUpDeltaEz[i][j] = saveEz[0] + (saveEz[1]-saveEz[0])*(r-rList[ilow])/gridSizeR ;
372 chargeDensity.Clear();
373 arrayErOverEzA.Clear();
374 arrayErOverEzC.Clear();
375 arrayDeltaEzA.Clear();
376 arrayDeltaEzC.Clear();
386 TString opt = option; opt.ToLower();
387 printf(
"%s\n",GetTitle());
388 printf(
" - Voltage settings (on the TPC boundaries) - linearly interpolated\n");
389 printf(
" : A-side (anti-clockwise)\n");
394 printf(
" : C-side (clockwise)\n");
403 AliWarning(
"Boundary parameters for the Central Electrode (CE) are not anti-symmetric! HOW DID YOU MANAGE THAT?");
404 AliWarning(
"Congratulations, you just splitted the Central Electrode of the TPC!");
405 AliWarning(
"Non-physical settings of the boundary parameter at the Central Electrode");
408 if (opt.Contains(
"a")) {
414 AliError(
"Lookup table was not initialized! You should do InitBoundaryVoltErrorDistortion() ...");
431 for (Int_t i=0; i<8; i++) {
449 for (Int_t i=0; i<6; i++) {
static AliTPCcalibDB * Instance()
printf("Chi2/npoints = %f\n", TMath::Sqrt(chi2/npoints))
Double_t fgkZList[kNZ]
points in the z direction (for the lookup table)
Bool_t fInitLookUp
flag to check it the Look Up table was created
virtual ~AliTPCBoundaryVoltError()
Float_t fC1
coefficient C1 (compare Jim Thomas's notes for definitions)
Manager and of geomety classes for set: TPC.
Float_t GetDriftV() const
static const Double_t fgkOFCRadius
Mean Radius of the Outer Field Cage (252.55 min, 256.45 max) (cm)
AliTPCParam * GetParameters() const
Double_t SolenoidField() const
#define AliWarning(message)
Double_t fT1
tensor term of wt - T1
void InitBoundaryVoltErrorDistortion()
static const Double_t fgkZOffSet
Offset from CE: calculate all distortions closer to CE as if at this point.
void PoissonRelaxation2D(TMatrixD &arrayV, TMatrixD &chargeDensity, TMatrixD &arrayErOverEz, TMatrixD &arrayDeltaEz, Int_t rows, Int_t columns, Int_t iterations, Bool_t rocDisplacement=kTRUE)
Float_t fC0
coefficient C0 (compare Jim Thomas's notes for definitions)
void SetBoundariesA(Float_t boundariesA[8])
Bool_t fROCdisplacement
flag for ROC displacement (important for z distortions)
static const Double_t fgkTPCZ0
nominal gating grid position
Float_t fBoundariesC[8]
Boundary values on the C side (see Setter function)
virtual void SetOmegaTauT1T2(Float_t omegaTau, Float_t t1, Float_t t2)
virtual Bool_t AddCorrectionCompact(AliTPCCorrection *corr, Double_t weight)
virtual void GetCorrection(const Float_t x[], const Short_t roc, Float_t dx[])
void Search(Int_t n, const Double_t xArray[], Double_t x, Int_t &low)
virtual void Update(const TTimeStamp &timeStamp)
void SetBoundariesC(Float_t boundariesC[6])
virtual void Print(const Option_t *option="") const
Double_t fLookUpErOverEz[kNZ][kNR]
Array to store electric field integral (int Er/Ez)
void Interpolate2DEdistortion(Int_t order, Double_t r, Double_t z, const Double_t er[kNZ][kNR], Double_t &erValue)
Double_t fLookUpDeltaEz[kNZ][kNR]
Array to store electric field integral (int Delta Ez)
Double_t fT2
tensor term of wt - T2
Double_t fgkRList[kNR]
points in the radial direction (for the lookup table)
#define AliError(message)
static const Double_t fgkIFCRadius
Mean Radius of the Inner Field Cage ( 82.43 min, 83.70 max) (cm)/hera/alice/wiechula/calib/guiTrees.
Float_t fBoundariesA[8]
Boundary values on the A side (see Setter function)