]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/AliTPCCorrection.cxx
Minor updates (and bugfixes) to allow an efficient fitting of the physical
[u/mrichter/AliRoot.git] / TPC / AliTPCCorrection.cxx
index 24e5ae3b72e3ceb9f5b7b34f1de95294e1396f0e..be56ba3df2a1efa90351133d74af939fa819939d 100644 (file)
@@ -1922,12 +1922,13 @@ void AliTPCCorrection::AddVisualCorrection(AliTPCCorrection* corr, Int_t positio
   // NOTE - class is not owner of correction
   //     
   if (!fgVisualCorrection) fgVisualCorrection=new TObjArray;
+  if (position>=fgVisualCorrection->GetEntriesFast()) fgVisualCorrection->Expand(position*2);
   fgVisualCorrection->AddAt(corr, position);
 }
 
 
 
-Double_t AliTPCCorrection::GetCorrSector(Double_t sector, Double_t localX, Double_t kZ, Int_t axisType, Int_t corrType){
+Double_t AliTPCCorrection::GetCorrSector(Double_t sector, Double_t r, Double_t kZ, Int_t axisType, Int_t corrType){
   //
   // calculate the correction at given position - check the geffCorr
   //
@@ -1935,9 +1936,9 @@ Double_t AliTPCCorrection::GetCorrSector(Double_t sector, Double_t localX, Doubl
   AliTPCCorrection *corr = (AliTPCCorrection*)fgVisualCorrection->At(corrType);
   if (!corr) return 0;
   Double_t phi=sector*TMath::Pi()/9.;
-  Double_t gx = localX*TMath::Cos(phi);
-  Double_t gy = localX*TMath::Sin(phi);
-  Double_t gz = localX*kZ;
+  Double_t gx = r*TMath::Cos(phi);
+  Double_t gy = r*TMath::Sin(phi);
+  Double_t gz = r*kZ;
   Int_t nsector=(gz>0) ? 0:18; 
   //
   //