1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
16 ////////////////////////////////////////////////////////////////////////////
18 // AliTPCCorrectionDrift class
19 // linear drift corrections //
21 ////////////////////////////////////////////////////////////////////////////
23 #include "TGeoGlobalMagField.h"
24 #include "AliTPCcalibDB.h"
25 #include "AliTPCParam.h"
29 #include "AliTPCROC.h"
30 #include "AliTPCCorrectionDrift.h"
31 ClassImp(AliTPCCorrectionDrift)
33 AliTPCCorrectionDrift::AliTPCCorrectionDrift()
34 : AliTPCCorrection("CorrectionDrift","CorrectionDrift") ,
35 fZ0Aside(0), // z- t0*vdrift shift A side
36 fZ0Cside(0), // z- t0*vdrift shift C side
37 fVScale0(0), // drift velocity scaling - constant
38 fVScaleR(0), // drift velocity scaling - radial
39 fVScaleX(0), // drift velocity scaling - global x
40 fVScaleY(0), // drift velocity scaling - global y
45 // default constructor
49 AliTPCCorrectionDrift::~AliTPCCorrectionDrift() {
57 void AliTPCCorrectionDrift::Init() {
59 // Initialization funtion
66 void AliTPCCorrectionDrift::Update(const TTimeStamp &/*timeStamp*/) {
75 void AliTPCCorrectionDrift::GetCorrection(const Float_t x[],const Short_t roc,Float_t dx[]) {
77 // Calculates the correction due conical shape
79 AliTPCROC * calROC = AliTPCROC::Instance();
80 //const Double_t kRTPC0 =calROC->GetPadRowRadii(0,0);
81 const Double_t kRTPC1 =calROC->GetPadRowRadii(36,calROC->GetNRows(36)-1);
82 const Double_t kRIO =0.5*(calROC->GetPadRowRadii(0,calROC->GetNRows(0)-1)+calROC->GetPadRowRadii(36,0));
83 // Float_t rmiddle=(kRTPC0+kRTPC1)/2.;
85 //Double_t phi = TMath::ATan2(x[1],x[0]);
86 Double_t r = TMath::Sqrt(x[1]*x[1]+x[0]*x[0]);
87 Double_t driftN = 1.-TMath::Abs(x[2])/calROC->GetZLength(0); // drift from 0 to 1
89 Double_t dz0 =(roc%36<18) ? fZ0Aside:-fZ0Cside;
90 Double_t dscale= (fVScale0+(fVScaleR*r+fVScaleX*x[0]+fVScaleY*x[1])/kRTPC1);
91 Double_t ddrift=(roc%36<18) ? driftN*dscale*calROC->GetZLength(0):-driftN*dscale*calROC->GetZLength(0);
92 if (r<kRIO) dz0+=(roc%36<18) ? fIROCZ0:-fIROCZ0;
93 if (r>kRIO) dz0+=(roc%36<18) ? fOROCDZ*(r-kRIO):-fOROCDZ*(r-kRIO);
94 // Calculate correction in cartesian coordinates
97 dx[2] = dz0+ddrift; // z distortion not implemented (1st order distortions)
105 void AliTPCCorrectionDrift::Print(const Option_t* option) const {
107 // Print function to check the settings (e.g. the twist in the X direction)
111 TString opt = option; opt.ToLower();
112 printf("%s\t%s\n",GetName(),GetTitle());
114 if (opt.Contains("a")) { // Print all details
115 printf(" - T0A: %1.4f, T0C: %1.4f (cm)\n",fZ0Aside,fZ0Cside);
116 printf(" - Scale0: %1.4f, ScaleR: %1.4f \n",fVScale0,fVScaleR);
117 printf(" - ScaleX: %1.4f, ScaleY: %1.4f \n",fVScaleX,fVScaleY);