]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/AliTPCFCVoltError3D.cxx
cout removed
[u/mrichter/AliRoot.git] / TPC / AliTPCFCVoltError3D.cxx
index 37c2aaa704a1c308afca63f413ba6ec57b31ba89..033c80dbb9fbd39320835ca5994c337fadbdb19a 100644 (file)
 //   </ul>
 // End_Html
 //
-// Begin_Macro(source) 
+// Begin_Macro(source)
 //   {
 //   gROOT->SetStyle("Plain"); gStyle->SetPalette(1);
-//   TCanvas *c2 = new TCanvas("c2","c2",500,450); 
+//   TCanvas *c2 = new TCanvas("cAliTPCVoltError3D","cAliTPCVoltError3D",500,450); 
 //   AliTPCFCVoltError3D fc;
 //   fc.SetOmegaTauT1T2(0,1,1); 
 //   fc.SetRotatedClipVoltA(0,40);
@@ -75,6 +75,7 @@
 #include "AliTPCParam.h"
 #include "AliLog.h"
 #include "TMatrixD.h"
+#include "TMatrixF.h"
 
 #include "TMath.h"
 #include "AliTPCROC.h"
@@ -115,9 +116,9 @@ AliTPCFCVoltError3D::AliTPCFCVoltError3D()
   // it represents a sum up of the 4 basic look up tables (created individually)
   // see InitFCVoltError3D() function
   for ( Int_t k = 0 ; k < kNPhi ; k++ ) {
-    fLookUpErOverEz[k]   =  new TMatrixD(kNR,kNZ);  
-    fLookUpEphiOverEz[k] =  new TMatrixD(kNR,kNZ);
-    fLookUpDeltaEz[k]    =  new TMatrixD(kNR,kNZ);   
+    fLookUpErOverEz[k]   =  new TMatrixF(kNR,kNZ);  
+    fLookUpEphiOverEz[k] =  new TMatrixF(kNR,kNZ);
+    fLookUpDeltaEz[k]    =  new TMatrixF(kNR,kNZ);   
   }
   
   for ( Int_t k = 0 ; k < kPhiSlices ; k++ ) {
@@ -230,16 +231,26 @@ void AliTPCFCVoltError3D::GetCorrection(const Float_t x[],const Short_t roc,Floa
   //
   // Calculates the correction due e.g. residual voltage errors on the TPC boundaries
   //   
+  const Double_t kEpsilon=Double_t(FLT_MIN);
 
   if (!fInitLookUp) {
     AliInfo("Lookup table was not initialized! Perform the inizialisation now ...");
     InitFCVoltError3D();
   }
 
+  static Bool_t forceInit=kTRUE; //temporary needed for back compatibility with old OCDB entries
+  if (forceInit &&fLookUpErOverEz[0]){
+    if (TMath::Abs(fLookUpErOverEz[0]->Sum())<kEpsilon){//temporary needed for back compatibility with old OCDB entries
+      ForceInitFCVoltError3D();
+    }
+    forceInit=kFALSE;
+  }
+
+
   Int_t   order     = 1 ;               // FIXME: hardcoded? Linear interpolation = 1, Quadratic = 2         
                                         // note that the poisson solution was linearly mirroed on this grid!
-  Double_t intEr, intEphi, intDeltaEz;
-  Double_t r, phi, z ;
+  Float_t intEr, intEphi, intDeltaEz;
+  Float_t r, phi, z ;
   Int_t    sign;
 
   r      =  TMath::Sqrt( x[0]*x[0] + x[1]*x[1] ) ;
@@ -539,9 +550,9 @@ void AliTPCFCVoltError3D::InitFCVoltError3D() {
   for ( Int_t k = 0 ; k < kNPhi ; k++ ) {
     phi = fgkPhiList[k] ;
 
-    TMatrixD &erOverEz   =  *fLookUpErOverEz[k]  ;
-    TMatrixD &ephiOverEz =  *fLookUpEphiOverEz[k];
-    TMatrixD &deltaEz    =  *fLookUpDeltaEz[k]   ;
+    TMatrixF &erOverEz   =  *fLookUpErOverEz[k]  ;
+    TMatrixF &ephiOverEz =  *fLookUpEphiOverEz[k];
+    TMatrixF &deltaEz    =  *fLookUpDeltaEz[k]   ;
 
     for ( Int_t i = 0 ; i < kNZ ; i++ ) {
       z = TMath::Abs(fgkZList[i]) ;  // Symmetric solution in Z that depends only on ABS(Z)