AliRoot Core  v5-06-30 (35d6c57)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliTPCTransformation.cxx
Go to the documentation of this file.
1 
30 #include <string.h>
31 #include "TRandom.h"
32 #include "TMath.h"
33 #include "TBits.h"
34 #include "TFormula.h"
35 #include "TF1.h"
36 #include "TLinearFitter.h"
37 #include "TFile.h"
38 #include "TObjString.h"
39 
40 #include "TTreeStream.h"
41 #include "AliTrackPointArray.h"
42 #include "AliLog.h"
43 #include "AliTPCTransformation.h"
44 
48 
49 AliTPCTransformation::GenFuncG AliTPCTransformation::fgFormulas[10000];
50 TObjArray* AliTPCTransformation::fgFormulasName = new TObjArray(10000);
51 
52 
53 void AliTPCTransformation::RegisterFormula(const char * name, GenFuncG formula){
55 
56  Int_t last= fgFormulasName->GetEntries();
57  fgFormulasName->AddLast(new TObjString(name));
58  fgFormulas[last]=formula;
59 }
60 
63 
64  //
65  //build list of basic TPC formulas - corrections
66  //
70  //
73  //
79  //
80  // TPC Local X and Y misalignment + rotation
81  //
88 
89  //
90  // Z offset
91  //
95  return 0;
96 }
97 
100 
101  if (fgFormulasName->FindObject(name)==0) return 0;
102  Int_t entries = fgFormulasName->GetEntries();
103  for (Int_t i=0;i<entries;i++){
104  if (strcmp(fgFormulasName->At(i)->GetName(), name)==0){
105  return fgFormulas[i];
106  }
107  }
108  return 0;
109 }
110 
111 Double_t AliTPCTransformation::Eval(const char * name, const Double_t*x,const Double_t*par){
113 
114  GenFuncG fun = FindFormula(name);
115  if (!fun) return 0;
116  return fun(x,par);
117 }
118 
119 
121  TNamed(),
122  fNameX(0), // x formula name
123  fNameY(0), // y formula name
124  fNameZ(0), // z formula name
125  //
126  fBitMask(0), // bitmaps - transformation only for specified volID
127  fCoordSystem(0), // coord system of output deltas
128  fParam(0), // free parameter of transformation
129  fSigma(0), // uncertainty of the parameter
130  fSigmaMax(0), //maximal sigma (Not allowed to increase in propagate time by bigger factor)
131  fSigma2Time(0), // change of the error in time - (For kalman filter)
132  fFixedParam(0), // fixed parameters of tranformation
133  fIsActive(kTRUE), // swith - On/Off
134  //
135  fInit(kFALSE), // initialization flag - set to kTRUE if corresponding formulas found
136  fFormulaX(0), // x formula - pointer to the function
137  fFormulaY(0), // y formula - pointer to the function
138  fFormulaZ(0) // z formula - pointer to the function
139  //
140 {
142 
143 }
144 
145 
146 
147 AliTPCTransformation::AliTPCTransformation(const char *name, TBits *mask, const char *fx, const char *fy, const char *fz, Int_t coordSystem):
148  TNamed(name,name),
149  fNameX(0), // x formula name
150  fNameY(0), // y formula name
151  fNameZ(0), // z formula name
152  fBitMask(mask), // bitmaps - transformation only for specified volID
153  fCoordSystem(coordSystem), // coordinate system of output deltas
154  fParam(0), // free parameter of transformation
155  fSigma(0),
156  fSigmaMax(0), //maximal sigma (Not allowed to increase in propagate time by bigger factor)
157  fSigma2Time(0), // change of sigma in time
158  fFixedParam(0), // fixed parameters of tranformation
159  fIsActive(kTRUE), // swith - On/Off
160  //
161  fInit(kFALSE), // initialization flag - set to kTRUE if corresponding formulas found
162  fFormulaX(0), // x formula - pointer to the function
163  fFormulaY(0), // y formula - pointer to the function
164  fFormulaZ(0) // z formula - pointer to the function
165 {
167 
168  if (fx) fNameX= new TString(fx);
169  if (fy) fNameY= new TString(fy);
170  if (fz) fNameZ= new TString(fz);
171  Init();
172 }
173 
175  TNamed(trafo),
176  fNameX(0), // x formula name
177  fNameY(0), // y formula name
178  fNameZ(0), // z formula name
179  //
180  fBitMask(0), // bitmaps - transformation only for specified volID
181  fCoordSystem(0), // coord system of output deltas
182  fParam(trafo.fParam), // free parameter of transformation
183  fSigma(trafo.fSigma), // uncertainty of the parameter
184  fSigmaMax(trafo.fSigma), //maximal sigma (Not allowed to increase in propagate time by bigger factor)
185  fSigma2Time(trafo.fSigma2Time), // change of the error in time - (For kalman filter)
186  fFixedParam(0), // fixed parameters of tranformation
187  fIsActive(trafo.fIsActive), // swith - On/Off
188  //
189  fInit(kFALSE), // initialization flag - set to kTRUE if corresponding formulas found
190  fFormulaX(0), // x formula - pointer to the function
191  fFormulaY(0), // y formula - pointer to the function
192  fFormulaZ(0) // z formula - pointer to the function
193 {
195 
196  if (trafo.fNameX) fNameX = new TString(*(trafo.fNameX));
197  if (trafo.fNameY) fNameY = new TString(*(trafo.fNameY));
198  if (trafo.fNameZ) fNameZ = new TString(*(trafo.fNameZ));
199  if (trafo.fBitMask) fBitMask = new TBits(*(trafo.fBitMask));
200 }
201 
204 
205  delete fNameX;
206  delete fNameY;
207  delete fNameZ;
208  delete fBitMask;
209  delete fFixedParam;
210 }
211 void AliTPCTransformation::SetParams(Double_t param, Double_t sigma, Double_t sigma2Time, const TVectorD *const fixedParams){
213 
214  fParam = param;
215  fSigma = sigma;
216  fSigmaMax = sigma;
217  fSigma2Time = sigma2Time;
218  if (fFixedParam) delete fFixedParam;
219  fFixedParam = new TVectorD(*fixedParams);
220  Init();
221 }
222 
223 
226 
227  Bool_t isOK=kTRUE;
228  if (fNameX) {
229  fFormulaX=FindFormula(fNameX->Data());
230  if (fFormulaX==0) isOK=kFALSE;
231  }
232  if (fNameY) {
233  fFormulaY=FindFormula(fNameY->Data());
234  if (fFormulaY==0) isOK=kFALSE;
235  }
236  if (fNameZ) {
237  fFormulaZ=FindFormula(fNameZ->Data());
238  if (!fFormulaZ) isOK=kFALSE;
239  }
240  return isOK;
241 }
242 
243 
244 
245 TBits * AliTPCTransformation::BitsSide(Bool_t aside){
247 
248  TBits * bits = new TBits(72);
249  for (Int_t i=0; i<72;i++){
250  if (i%36<18 && aside) (*bits)[i]=kTRUE;
251  if (i%36<18 && (!aside)) (*bits)[i]=kFALSE;
252  if (i%36>=18 && aside) (*bits)[i]=kFALSE;
253  if (i%36>=18 && (!aside)) (*bits)[i]=kTRUE;
254  }
255  return bits;
256 }
257 
260 
261  TBits * bits = new TBits(72);
262  for (Int_t i=0; i<72;i++){
263  (*bits)[i]=kTRUE;
264  }
265  return bits;
266 }
267 
268 // Double_t AliTPCTransformation::GetDeltaXYZ(Int_t coord, Int_t volID, Double_t param, Double_t x, Double_t y, Double_t z){
269 // //
270 // //
271 // // coord - type of coordinate
272 // // - 0 -X
273 // // 1 -Y
274 // // 2 -Z
275 // // 3 -R
276 // // 4 -RPhi
277 // if (!fIsActive) return 0;
278 // if (fBitMask && (!(*fBitMask)[volID])) return 0;
279 // Double_t xyz[5]={x,y,z, param,volID};
280 // if (fCoordSystem==0){
281 // // cartezian system
282 // if (coord==0 && fFormulaX) return fFormulaX(xyz,fFixedParam->GetMatrixArray());
283 // if (coord==1 && fFormulaY) return fFormulaY(xyz,fFixedParam->GetMatrixArray());
284 // if (coord==2 && fFormulaZ) return fFormulaZ(xyz,fFixedParam->GetMatrixArray());
285 // }
286 // if (fCoordSystem==1){
287 // // cylindrical system
288 // if (coord==2) {
289 // if (fFormulaZ==0) return 0;
290 // return fFormulaZ(xyz,fFixedParam->GetMatrixArray());
291 // }
292 // Double_t rrphiz[3]={0,0,0};
293 // if (fFormulaX) rrphiz[0] = fFormulaX(xyz,fFixedParam->GetMatrixArray());
294 // if (fFormulaY) rrphiz[1] = fFormulaY(xyz,fFixedParam->GetMatrixArray());
295 // Double_t alpha = TMath::ATan2(y,x);
296 // Double_t ca = TMath::Cos(alpha);
297 // Double_t sa = TMath::Sin(alpha);
298 // if (coord==0) return ca*rrphiz[0]-sa*rrphiz[1];
299 // if (coord==1) return sa*rrphiz[0]+ca*rrphiz[1];
300 // }
301 // return 0;
302 // }
303 
304 
305 Double_t AliTPCTransformation::GetDeltaXYZ(Int_t coord, Int_t volID, Double_t param, Double_t x, Double_t y, Double_t z){
313 
314  if (!fIsActive) return 0;
315  if (fBitMask && (!(*fBitMask)[volID])) return 0;
316  Double_t xyz[5]={x,y,z, param,volID};
317  Double_t alpha = TMath::ATan2(y,x);
318  Double_t ca = TMath::Cos(alpha);
319  Double_t sa = TMath::Sin(alpha);
320 
321  if (fCoordSystem==0){
322  // cartezian system
323  Double_t dxdydz[3]={0,0,0};
324  if(fFormulaX) dxdydz[0]=fFormulaX(xyz,fFixedParam->GetMatrixArray());
325  if(fFormulaY) dxdydz[1]=fFormulaY(xyz,fFixedParam->GetMatrixArray());
326  if(fFormulaZ) dxdydz[2]=fFormulaZ(xyz,fFixedParam->GetMatrixArray());
327 
328  if (coord==0) return dxdydz[0];
329  if (coord==1) return dxdydz[1];
330  if (coord==2) return dxdydz[2];
331  if (coord==3) return dxdydz[0]*ca+dxdydz[1]*sa;
332  if (coord==4) return -dxdydz[0]*sa+dxdydz[1]*ca;
333  if (coord==5) return dxdydz[2];
334  }
335  if (fCoordSystem==1){
336  // cylindrical system
337  if (coord==2||coord==5) {
338  if (fFormulaZ==0) return 0;
339  return fFormulaZ(xyz,fFixedParam->GetMatrixArray());
340  }
341  Double_t rrphiz[3]={0,0,0};
342  if (fFormulaX) rrphiz[0] = fFormulaX(xyz,fFixedParam->GetMatrixArray());
343  if (fFormulaY) rrphiz[1] = fFormulaY(xyz,fFixedParam->GetMatrixArray());
344  alpha = TMath::ATan2(y,x);
345  ca = TMath::Cos(alpha);
346  sa = TMath::Sin(alpha);
347  if (coord==0) return ca*rrphiz[0]-sa*rrphiz[1];
348  if (coord==1) return sa*rrphiz[0]+ca*rrphiz[1];
349  if (coord==3) return rrphiz[0];
350  if (coord==4) return rrphiz[1];
351  }
352  return 0;
353 }
354 
355 
356 
357 Double_t AliTPCTransformation::TPCscalingRPol(Double_t *xyz, const Double_t * const param){
365 
366  Double_t rInner=78.8;
367  Double_t rOuter=258.0;
368  Double_t deltaR = rOuter-rInner;
369  Double_t radius = (TMath::Sqrt(xyz[0]*xyz[0]+xyz[1]*xyz[1])-rInner)*2./deltaR;
370  Double_t driftM = (0.5 - TMath::Abs(xyz[2]/250.))*2.0;
371  Double_t delta = TMath::Power(radius,param[0])*TMath::Power(driftM,param[1]);
372  return delta*xyz[3];
373 }
374 
375 
376 Double_t AliTPCTransformation::TPCscalingZDrift(Double_t *xyz, const Double_t * const param){
380 
381  Double_t driftP = TMath::Power(1. - TMath::Abs(xyz[2]/250.), param[0]);
382  Int_t sector = TMath::Nint(xyz[4]);
383  Double_t deltaZ = (sector%36<18) ? -driftP : driftP;
384  return deltaZ*xyz[3];
385 }
386 
387 Double_t AliTPCTransformation::TPCscalingZDriftT0(Double_t *xyz, const Double_t * const /*param*/){
393 
394  Int_t sector = TMath::Nint(xyz[4]);
395  Double_t sign = (sector%36<18) ? -1 : 1;
396  return sign*xyz[3];
397 }
398 
399 
400 Double_t AliTPCTransformation::TPCscalingZDriftGy(Double_t *xyz, const Double_t * const param){
404 
405  Double_t driftP = TMath::Power(1. - TMath::Abs(xyz[2]/250.), param[0]);
406  Double_t gy = xyz[1]/250.;
407  Int_t sector = TMath::Nint(xyz[4]);
408  Double_t deltaZ = (sector%36<18) ? -driftP : driftP;
409  return deltaZ*xyz[3]*gy;
410 }
411 
412 
413 
414 Double_t AliTPCTransformation::TPCscalingPhiLocal(Double_t *xyz, const Double_t * const param){
419 
420  Double_t alpha = TMath::ATan2(xyz[1],xyz[0]);
421  Double_t sector = TMath::Nint(9*alpha/TMath::Pi()-0.5);
422  Double_t localAlpha = (alpha-(sector+0.5)*TMath::Pi()/9.);
423  Double_t radius = TMath::Sqrt(xyz[0]*xyz[0]+xyz[1]*xyz[1])/250.;
424  //
425  Double_t deltaAlpha = radius*TMath::Power(2.*9.*localAlpha/TMath::Pi(),param[0]);
426  return deltaAlpha*xyz[3];
427 }
428 
429 Double_t AliTPCTransformation::TPClocalRPhiEdge(Double_t *xyz, const Double_t *const param){
435 
436  Double_t alpha = TMath::ATan2(xyz[1],xyz[0]);
437  Double_t sector = TMath::Nint(9*alpha/TMath::Pi()-0.5);
438  Double_t localAlpha = (alpha-(sector+0.5)*TMath::Pi()/9.);
439  Double_t radius = TMath::Sqrt(xyz[0]*xyz[0]+xyz[1]*xyz[1]);
440  Double_t deltaAlpha = TMath::Pi()/18.-TMath::Abs(localAlpha);
441  Double_t distEdge = (deltaAlpha*radius);
442  Double_t factor = 1./(1.+(distEdge-param[0])/param[1]);
443  return factor*xyz[3]*((localAlpha>0)? -1.:1.);
444 }
445 
446 
447 Double_t AliTPCTransformation::TPCscalingRIFC(Double_t *xyz, const Double_t * const param){
451 
452  Double_t rInner=78.8;
453  Double_t rFirst=85.2;
454  Double_t deltaR = rFirst-rInner;
455  Double_t ndistR = (TMath::Sqrt(xyz[0]*xyz[0]+xyz[1]*xyz[1])-rInner)/deltaR;
456  Double_t driftM = (0.5 - TMath::Abs(xyz[2]/250.))*2.;
457  Double_t value = TMath::Power(driftM,param[0])/ndistR;
458  return xyz[3]*value;
459 }
460 
461 Double_t AliTPCTransformation::TPCscalingROFC(Double_t *xyz, const Double_t * const param){
465 
466  Double_t rLast=245.8;
467  Double_t rOuter=258.0;
468  Double_t deltaR = rOuter-rLast;
469  Double_t ndistR = (rOuter-TMath::Sqrt(xyz[0]*xyz[0]+xyz[1]*xyz[1]))/deltaR;
470  Double_t driftM = (0.5 - TMath::Abs(xyz[2]/250.))*2.;
471  Double_t value = TMath::Power(driftM,param[0])/ndistR;
472  return xyz[3]*value;
473 }
474 
475 
476 Double_t AliTPCTransformation::TPCdeltaFCROC(Double_t *xyz, const Double_t *const param){
483 
484  Double_t rInner=78.8;
485  Double_t rFirst=85.2;
486  Double_t rLast=245.8;
487  Double_t rOuter=258.0;
488 
489  Double_t radius = TMath::Sqrt(xyz[0]*xyz[0]+xyz[1]*xyz[1]);
490  //calculate distance to the FC - inner or outer
491  Double_t deltaFC = (param[0]<0.5)? TMath::Abs(radius-rFirst) : TMath::Abs(radius-rLast);
492  deltaFC/=(rOuter-rInner);
493  Double_t scalingFC = 1./(1.+deltaFC/(param[1]));
494  //
495  Double_t drift = 1.-TMath::Abs(xyz[2]/250.); // normalized drift length
496  Double_t scalingROC = (1.-1./(1.+drift/param[2]));
497  //
498  return xyz[3]*scalingFC*scalingROC;
499 }
500 
501 
502 Double_t AliTPCTransformation::TPCdeltaFCCE(Double_t *xyz, const Double_t *const param){
509 
510  Double_t rInner=78.8;
511  Double_t rFirst=85.2;
512  Double_t rLast =245.8;
513  Double_t rOuter=258.0;
514 
515  Double_t radius = TMath::Sqrt(xyz[0]*xyz[0]+xyz[1]*xyz[1]);
516  //calculate distance to the FC - inner or outer
517  Double_t deltaFC = (param[0]<0.5)? TMath::Abs(radius-rFirst) : TMath::Abs(radius-rLast);
518  deltaFC/=(rOuter-rInner);
519  Double_t scalingFC = 1./(1.+deltaFC/(param[1]));
520  //
521  Double_t drift = 1.-TMath::Abs(xyz[2]/250.); // normalized drift length
522  Double_t scalingCE = 1/(1.+(1.-drift)/param[2]); //
523  //
524  return xyz[3]*scalingFC*scalingCE;
525 }
526 
527 
528 
529 
530 
531 
532 
533 //
534 // TPC sector local misalignment
535 //
536 //
537 //
538 Double_t AliTPCTransformation:: TPClocaldLxdGX(Double_t *xyz, const Double_t *const param){
546 
547  Int_t sector = TMath::Nint(xyz[4]);
548  Double_t alpha = TMath::Pi()*(sector+0.5)/9;
549  Double_t ca = TMath::Cos(alpha);
550  // Double_t sa = TMath::Sin(alpha);
551  const Double_t xIROCOROC = 133.4;
552  Double_t factor = xyz[3];
553  if (param[0]>0) factor*=TMath::Cos(alpha*param[0]);
554  if (param[1]>0) factor*=TMath::Sin(alpha*param[1]);
555  if (param[2]>0.5 && TMath::Sqrt(xyz[1]*xyz[1]+xyz[0]*xyz[0])>xIROCOROC) factor*=-1;
556  return ca*factor;
557 }
558 
559 Double_t AliTPCTransformation::TPClocaldLxdGY(Double_t *xyz, const Double_t *const param){
567 
568  Int_t sector = TMath::Nint(xyz[4]);
569  Double_t alpha = TMath::Pi()*(sector+0.5)/9;
570  //Double_t ca = TMath::Cos(alpha);
571  Double_t sa = TMath::Sin(alpha);
572  const Double_t xIROCOROC = 133.4;
573  Double_t factor = xyz[3];
574  if (param[0]>0) factor*=TMath::Cos(alpha*param[0]);
575  if (param[1]>0) factor*=TMath::Sin(alpha*param[1]);
576  if (param[2]>0.5 && TMath::Sqrt(xyz[1]*xyz[1]+xyz[0]*xyz[0])>xIROCOROC) factor*=-1;
577  return sa*factor;
578 }
579 
580 Double_t AliTPCTransformation:: TPClocaldLydGX(Double_t *xyz, const Double_t *const param){
588 
589  Int_t sector = TMath::Nint(xyz[4]);
590  Double_t alpha = TMath::Pi()*(sector+0.5)/9;
591  //Double_t ca = TMath::Cos(alpha);
592  Double_t sa = TMath::Sin(alpha);
593  const Double_t xIROCOROC = 133.4;
594  Double_t factor = xyz[3];
595  if (param[0]>0) factor*=TMath::Cos(alpha*param[0]);
596  if (param[1]>0) factor*=TMath::Sin(alpha*param[1]);
597  if (param[2]>0.5 && TMath::Sqrt(xyz[1]*xyz[1]+xyz[0]*xyz[0])>xIROCOROC) factor*=-1;
598  return -sa*factor;
599 }
600 
601 Double_t AliTPCTransformation::TPClocaldLydGY(Double_t *xyz, const Double_t *const param){
609 
610  Int_t sector = TMath::Nint(xyz[4]);
611  Double_t alpha = TMath::Pi()*(sector+0.5)/9;
612  Double_t ca = TMath::Cos(alpha);
613  //Double_t sa = TMath::Sin(alpha);
614  const Double_t xIROCOROC = 133.4;
615  Double_t factor = xyz[3];
616  if (param[0]>0) factor*=TMath::Cos(alpha*param[0]);
617  if (param[1]>0) factor*=TMath::Sin(alpha*param[1]);
618  if (param[2]>0.5 && TMath::Sqrt(xyz[1]*xyz[1]+xyz[0]*xyz[0])>xIROCOROC) factor*=-1;
619  return ca*factor;
620 }
621 
622 
623 Double_t AliTPCTransformation::TPClocaldRzdGX(Double_t *xyz, const Double_t *const param){
631 
632  Int_t sector = TMath::Nint(xyz[4]);
633  Double_t alpha = TMath::Pi()*(sector+0.5)/9;
634  Double_t ca = TMath::Cos(alpha);
635  Double_t sa = TMath::Sin(alpha);
636  Double_t lx = xyz[0]*ca + xyz[1]*sa;
637  Double_t ly = -xyz[0]*sa + xyz[1]*ca;
638  //
639  const Double_t xIROCOROC = 133.4;
640  lx-=xIROCOROC;
641  Double_t rot = xyz[3]*0.001; // rotation in mrad
642  if (param[0]>0) rot*=TMath::Cos(alpha*param[0]);
643  if (param[1]>0) rot*=TMath::Sin(alpha*param[1]);
644  if (param[2]>0.5 && lx>0) rot*=-1;
645  //
646  Double_t dlxR = - ly*rot;
647  Double_t dlyR = lx*rot;
648  Double_t dgxR = dlxR*ca - dlyR*sa;
649  //Double_t dgyR = dlxR*sa + dlyR*ca;
650  return dgxR;
651 }
652 
653 Double_t AliTPCTransformation::TPClocaldRzdGY(Double_t *xyz, const Double_t *const param){
661 
662  Int_t sector = TMath::Nint(xyz[4]);
663  Double_t alpha = TMath::Pi()*(sector+0.5)/9;
664  Double_t ca = TMath::Cos(alpha);
665  Double_t sa = TMath::Sin(alpha);
666  Double_t lx = xyz[0]*ca + xyz[1]*sa;
667  Double_t ly = -xyz[0]*sa + xyz[1]*ca;
668  //
669  const Double_t xIROCOROC = 133.4;
670  lx-=xIROCOROC;
671  Double_t rot = xyz[3]*0.001; // rotation in mrad
672  if (param[0]>0) rot*=TMath::Cos(alpha*param[0]);
673  if (param[1]>0) rot*=TMath::Sin(alpha*param[1]);
674  if (param[2]>0.5 && lx>0) rot*=-1;
675  Double_t dlxR = - ly*rot;
676  Double_t dlyR = lx*rot;
677  //Double_t dgxR = dlxR*ca - dlyR*sa;
678  Double_t dgyR = dlxR*sa + dlyR*ca;
679  return dgyR;
680 }
681 
682 
683 
684 Double_t AliTPCTransformation::TPCDeltaZMediumLong(Double_t *xyz, Double_t * /*param*/){
689 
690  Int_t sector = TMath::Nint(xyz[4]);
691  Double_t signZ = (sector%36<18) ? 1: -1; // drift direction
692  if (sector<36) return 0;
693  //
694  const Double_t radiusLong = 198.1;
695  //
696  Double_t alpha = TMath::Pi()*(sector+0.5)/9;
697  Double_t ca = TMath::Cos(alpha);
698  Double_t sa = TMath::Sin(alpha);
699  Double_t lx = xyz[0]*ca + xyz[1]*sa;
700  Double_t sign = (lx<radiusLong) ? 1:-1;
701  return xyz[3]*sign*signZ;
702 }
703 
704 Double_t AliTPCTransformation::TPCDeltaZ(Double_t *xyz, const Double_t *const param){
709 
710  Int_t sector = TMath::Nint(xyz[4]);
711  Double_t delta = (sector%36<18) ? 1: -1; // drift direction
712  Double_t alpha = TMath::Pi()*(sector+0.5)/9;
713  Double_t ca = TMath::Cos(alpha);
714  Double_t sa = TMath::Sin(alpha);
715  Double_t lx = xyz[0]*ca + xyz[1]*sa;
716  //
717  const Double_t xIROCOROC = 133.4;
718  if (param[0]>0) delta *= TMath::Cos(param[0]*alpha);
719  if (param[1]>0) delta *= TMath::Sin(param[1]*alpha);
720  if (param[2]>0.5 && lx >xIROCOROC) delta *=-1;
721  return delta*xyz[3]; // IROC shift
722 }
723 
724 
725 Double_t AliTPCTransformation::TPCTiltingZ(Double_t *xyz, const Double_t *const param){
733 
734  const Double_t rFirst=85.2;
735  const Double_t rLast =245.8;
736  const Double_t xIROCOROC = 133.4;
737  //
738  Int_t sector = TMath::Nint(xyz[4]);
739  Double_t alpha = TMath::Pi()*(sector+0.5)/9;
740  Double_t ca = TMath::Cos(alpha);
741  Double_t sa = TMath::Sin(alpha);
742  Double_t lx = xyz[0]*ca + xyz[1]*sa;
743  Double_t deltaR = 2.0*(lx-xIROCOROC)/(rLast-rFirst);
744  if (param[0]>0) deltaR *= TMath::Cos(param[0]*alpha);
745  if (param[1]>0) deltaR *= TMath::Sin(param[1]*alpha);
746  if (param[2]>0.5 && lx >xIROCOROC) deltaR *=-1;
747  return deltaR*xyz[3];
748 }
749 
static Double_t TPCscalingRPol(Double_t *xyz, const Double_t *const param)
static AliTPCTransformation::GenFuncG FindFormula(const char *name)
static Double_t TPCdeltaFCCE(Double_t *xyz, const Double_t *const param)
static Double_t TPClocaldLxdGY(Double_t *xyz, const Double_t *const param)
#define TObjArray
static Double_t TPCscalingZDriftGy(Double_t *xyz, const Double_t *const param)
TVectorD * fFixedParam
fixed parameters of tranformation
static Double_t TPClocaldLydGY(Double_t *xyz, const Double_t *const param)
static Double_t TPCscalingZDrift(Double_t *xyz, const Double_t *const param)
static TObjArray * fgFormulasName
! array of formalas name
static Double_t TPCscalingZDriftT0(Double_t *xyz, const Double_t *const param)
TBits * fBitMask
bitmaps - transformation only for specified volID
static void RegisterFormula(const char *name, GenFuncG formula)
Bool_t fIsActive
switch - is transformation active
ClassImp(TPCGenInfo)
Definition: AliTPCCmpNG.C:254
static Double_t TPClocaldRzdGX(Double_t *xyz, const Double_t *const param)
Double_t fSigma
error of the parameter
TString * fNameZ
z formula
static Double_t TPClocalRPhiEdge(Double_t *xyz, const Double_t *const param)
static Double_t TPCTiltingZ(Double_t *xyz, const Double_t *const param)
static Double_t TPCscalingPhiLocal(Double_t *xyz, const Double_t *const param)
static Double_t TPCscalingRIFC(Double_t *xyz, const Double_t *const param)
Int_t fCoordSystem
coord system of output deltas
static Double_t TPCscalingROFC(Double_t *xyz, const Double_t *const param)
void SetParams(Double_t param, Double_t sigma, Double_t sigma2Time, const TVectorD *const fixedParams)
Should represent general non linear transformation.
static Double_t Eval(const char *name, const Double_t *x, const Double_t *par)
static Double_t TPClocaldRzdGY(Double_t *xyz, const Double_t *const param)
static Double_t TPCDeltaZMediumLong(Double_t *xyz, Double_t *param)
TString * fNameX
x formula
static Double_t TPCdeltaFCROC(Double_t *xyz, const Double_t *const param)
GenFuncG fFormulaY
! y formula
static Double_t TPCDeltaZ(Double_t *xyz, const Double_t *const param)
static Int_t BuildBasicFormulas()
virtual Double_t GetDeltaXYZ(Int_t coord, Int_t volID, Double_t param, Double_t x, Double_t y, Double_t z)
GenFuncG fFormulaZ
! z formula
static GenFuncG fgFormulas[10000]
! array of pointers to formula
TString * fNameY
y formula
static TBits * BitsSide(Bool_t aside)
Double_t(* GenFuncG)(const Double_t *, const Double_t *)
Double_t fSigma2Time
change of the error in time (per hour) - (For kalman filter)
Double_t fSigmaMax
maximal sigma (Not allowed to increase in propagate time by bigger factor)
GenFuncG fFormulaX
! x formula
static Double_t TPClocaldLxdGX(Double_t *xyz, const Double_t *const param)
Double_t fParam
free parameter of transformation
static Double_t TPClocaldLydGX(Double_t *xyz, const Double_t *const param)