LCOV - code coverage report
Current view: top level - TPC/TPCbase - AliTPCCorrectionDrift.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 1 37 2.7 %
Date: 2016-06-14 17:26:59 Functions: 1 10 10.0 %

          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             : /// \class AliTPCCorrectionDrift
      17             : /// \brief Linear drift corrections
      18             : 
      19             : #include "AliMagF.h"
      20             : #include "TGeoGlobalMagField.h"
      21             : #include "AliTPCcalibDB.h"
      22             : #include "AliTPCParam.h"
      23             : #include "AliLog.h"
      24             : 
      25             : #include "TMath.h"
      26             : #include "AliTPCROC.h"
      27             : #include "AliTPCCorrectionDrift.h"
      28             : /// \cond CLASSIMP
      29          24 : ClassImp(AliTPCCorrectionDrift)
      30             : /// \endcond
      31             : 
      32             : AliTPCCorrectionDrift::AliTPCCorrectionDrift()
      33           0 :   : AliTPCCorrection("CorrectionDrift","CorrectionDrift") ,
      34           0 :     fZ0Aside(0),     // z- t0*vdrift shift A side
      35           0 :     fZ0Cside(0),     // z- t0*vdrift shift C side
      36           0 :     fVScale0(0),     // drift velocity scaling - constant
      37           0 :     fVScaleR(0),     // drift velocity scaling - radial
      38           0 :     fVScaleX(0),     // drift velocity scaling - global x
      39           0 :     fVScaleY(0),     // drift velocity scaling - global y
      40           0 :     fIROCZ0(0),
      41           0 :     fOROCDZ(0)
      42           0 : {
      43             :   //
      44             :   // default constructor
      45             :   //
      46           0 : }
      47             : 
      48           0 : AliTPCCorrectionDrift::~AliTPCCorrectionDrift() {
      49             :   /// default destructor
      50             : 
      51           0 : }
      52             : 
      53             : 
      54             : 
      55             : void AliTPCCorrectionDrift::Init() {
      56             :   /// Initialization funtion
      57             : 
      58             : 
      59             : 
      60           0 : }
      61             : 
      62             : void AliTPCCorrectionDrift::Update(const TTimeStamp &/*timeStamp*/) {
      63             :   /// Update function
      64             : 
      65           0 : }
      66             : 
      67             : 
      68             : 
      69             : void AliTPCCorrectionDrift::GetCorrection(const Float_t x[],const Short_t roc,Float_t dx[]) {
      70             :   /// Calculates the correction due conical shape
      71             : 
      72           0 :   AliTPCROC * calROC = AliTPCROC::Instance();
      73             :   //const Double_t kRTPC0  =calROC->GetPadRowRadii(0,0);
      74           0 :   const Double_t kRTPC1  =calROC->GetPadRowRadii(36,calROC->GetNRows(36)-1);
      75           0 :   const Double_t kRIO    =0.5*(calROC->GetPadRowRadii(0,calROC->GetNRows(0)-1)+calROC->GetPadRowRadii(36,0));
      76             :   //  Float_t rmiddle=(kRTPC0+kRTPC1)/2.;
      77             :   //
      78             :   //Double_t phi      = TMath::ATan2(x[1],x[0]);
      79           0 :   Double_t r        = TMath::Sqrt(x[1]*x[1]+x[0]*x[0]);
      80           0 :   Double_t driftN   = 1.-TMath::Abs(x[2])/calROC->GetZLength(0);  // drift from 0 to 1
      81             :   //
      82           0 :   Double_t dz0   =(roc%36<18) ? fZ0Aside:-fZ0Cside;
      83           0 :   Double_t dscale= (fVScale0+(fVScaleR*r+fVScaleX*x[0]+fVScaleY*x[1])/kRTPC1);
      84           0 :   Double_t ddrift=(roc%36<18) ? driftN*dscale*calROC->GetZLength(0):-driftN*dscale*calROC->GetZLength(0);
      85           0 :   if (r<kRIO) dz0+=(roc%36<18) ? fIROCZ0:-fIROCZ0;
      86           0 :   if (r>kRIO) dz0+=(roc%36<18) ? fOROCDZ*(r-kRIO):-fOROCDZ*(r-kRIO);
      87             :   // Calculate correction in cartesian coordinates
      88           0 :   dx[0] = 0;
      89           0 :   dx[1] = 0;
      90           0 :   dx[2] = dz0+ddrift; // z distortion not implemented (1st order distortions)
      91             : 
      92           0 : }
      93             : 
      94             : 
      95             : 
      96             : 
      97             : 
      98             : void AliTPCCorrectionDrift::Print(const Option_t* option) const {
      99             :   /// Print function to check the settings (e.g. the twist in the X direction)
     100             : 
     101           0 :   TString opt = option; opt.ToLower();
     102           0 :   printf("%s\t%s\n",GetName(),GetTitle());
     103             : 
     104           0 :   if (opt.Contains("a")) { // Print all details
     105           0 :     printf(" - T0A: %1.4f, T0C: %1.4f (cm)\n",fZ0Aside,fZ0Cside);
     106           0 :     printf(" - Scale0: %1.4f, ScaleR: %1.4f \n",fVScale0,fVScaleR);
     107           0 :     printf(" - ScaleX: %1.4f, ScaleY: %1.4f \n",fVScaleX,fVScaleY);
     108             : 
     109             :   }
     110             : 
     111             : 
     112           0 : }

Generated by: LCOV version 1.11