LCOV - code coverage report
Current view: top level - TPC/TPCbase - AliTPCChebDist.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 1 30 3.3 %
Date: 2016-06-14 17:26:59 Functions: 1 6 16.7 %

          Line data    Source code
       1             : /**************************************************************************
       2             :  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
       3             :  *                                                                        *
       4             :  * Author: The ALICE Off-line Project.                                    *
       5             :  * Contributors are mentioned in the code where appropriate.              *
       6             :  *                                                                        *
       7             :  * Permission to use, copy, modify and distribute this software and its   *
       8             :  * documentation strictly for non-commercial purposes is hereby granted   *
       9             :  * without fee, provided that the above copyright notice appears in all   *
      10             :  * copies and that both the copyright notice and this permission notice   *
      11             :  * appear in the supporting documentation. The authors make no claims     *
      12             :  * about the suitability of this software for any purpose. It is          *
      13             :  * provided "as is" without express or implied warranty.                  *
      14             :  **************************************************************************/
      15             : 
      16             : #include "AliCheb2DStackF.h"
      17             : #include "AliCheb2DStackS.h"
      18             : #include "AliTPCChebDist.h"
      19             : #include "AliLog.h"
      20             : #include <TMath.h>
      21             : 
      22          24 : ClassImp(AliTPCChebDist)
      23             : 
      24             : Float_t AliTPCChebDist::fgRMinTPC = 83.65; //RS Make sure these are correct radii to use
      25             : Float_t AliTPCChebDist::fgRMaxTPC = 247.7;
      26             : Int_t   AliTPCChebDist::fgNSlices = AliTPCChebCorr::kNRows+10; // check
      27             : 
      28             : //____________________________________________________________________
      29             : AliTPCChebDist::AliTPCChebDist()
      30           0 :   : AliTPCChebCorr()
      31           0 :   ,fXMin(fgRMinTPC)
      32           0 :   ,fXMax(fgRMaxTPC)
      33           0 :   ,fDX(0)
      34           0 :   ,fDXInv(0)
      35           0 : {
      36             : // def. c-tor  
      37           0 : }
      38             : 
      39             : //____________________________________________________________________
      40             : AliTPCChebDist::AliTPCChebDist(const char* name, const char* title, 
      41             :                                int nps, int nzs, float zmaxAbs)
      42           0 :   :AliTPCChebCorr(name,title,nps,nzs,zmaxAbs)
      43           0 :   ,fXMin(fgRMinTPC)
      44           0 :   ,fXMax(fgRMaxTPC)
      45           0 : {
      46             :   // c-tor
      47           0 :   fNRows = fgNSlices;
      48           0 :   if (fNRows<2) AliFatalF("Number of rows=%d cannot be<2",fNRows);
      49           0 :   fDX = (fXMax-fXMin)/(fNRows-1);
      50           0 :   if (fDX<=0)  AliFatalF("X boundaries are not increasing: %f %f",fXMin,fXMax);
      51           0 :   fDXInv = 1./fDX;
      52             :   //
      53           0 : }
      54             : 
      55             : //____________________________________________________________________
      56             : void AliTPCChebDist::Eval(int sector, float x, float y2x, float z, float *distortion) const
      57             : {
      58             :   // Calculate distortion for point with x,y,z sector corrdinates (sector id in 0-71 format)
      59           0 :   int ixLow = X2Slice(x);
      60           0 :   float tz[2] = {y2x,z}; // params use row, Y/X, Z
      61           0 :   const AliCheb2DStack* chpar = GetParam(sector,y2x,z);
      62           0 :   float distUp[3], scl = (x-Slice2X(ixLow))*fDXInv; // lever arm for interpolation
      63           0 :   chpar->Eval(ixLow  , tz, distortion);
      64           0 :   if (ixLow<fNRows-1) {
      65           0 :     chpar->Eval(ixLow+1, tz, distUp);
      66           0 :     for (int i=3;i--;) distortion[i] += scl*(distUp[i]-distortion[i]); // linear interpolation
      67           0 :   }
      68             :   else { // we are at the last slice, extrapolate
      69           0 :     chpar->Eval(ixLow-1, tz, distUp);
      70           0 :     for (int i=3;i--;) distortion[i] += scl*(distortion[i]-distUp[i]); // linear extrapolation   
      71             :   }
      72             :   //
      73           0 : }

Generated by: LCOV version 1.11