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 // AliTPCExBConical class //
19 // The class calculates the space point distortions due to the conical shape
22 // Becasue of mechanical deformation ALICE TPC, chambers are misaligned in z direction
23 // TPC has roughly conical shape
25 // For the moment ONLY efective correction used - NOT EDGE EFFECT calcualted //
28 // The class allows "effective Omega Tau" corrections. //
31 // date: 02/05/2010 //
32 // Authors: Marian Ivanov, Jim Thomas, Magnus Mager, Stefan Rossegger //
35 // AliTPCExBConical conical; //
36 // conical.SetOmegaTauT1T2(0.32,1.,1.); // values ideally from OCDB //
37 // conical.SetXConical(0.001); // set conical in X direction (in rad) //
38 // // plot dRPhi distortions ... //
39 // conical.CreateHistoDRPhiinZR(1.,100,100)->Draw("surf2"); //
40 ////////////////////////////////////////////////////////////////////////////
42 #include "TGeoGlobalMagField.h"
43 #include "AliTPCcalibDB.h"
44 #include "AliTPCParam.h"
48 #include "AliTPCROC.h"
49 #include "AliTPCExBConical.h"
50 ClassImp(AliTPCExBConical)
52 AliTPCExBConical::AliTPCExBConical()
53 : AliTPCCorrection("exb_conical","ExB conical"),
54 fC1(0.),fC2(0.),fConicalFactor(0)
57 // default constructor
59 for (Int_t i=0; i<3; i++){
65 AliTPCExBConical::~AliTPCExBConical() {
73 void AliTPCExBConical::Init() {
75 // Initialization funtion
78 AliMagF* magF= (AliMagF*)TGeoGlobalMagField::Instance()->GetField();
79 if (!magF) AliError("Magneticd field - not initialized");
80 Double_t bzField = magF->SolenoidField()/10.; //field in T
81 AliTPCParam *param= AliTPCcalibDB::Instance()->GetParameters();
82 if (!param) AliError("Parameters - not initialized");
83 Double_t vdrift = param->GetDriftV()/1000000.; // [cm/us] // From dataBase: to be updated: per second (ideally)
84 Double_t ezField = 400; // [V/cm] // to be updated: never (hopefully)
85 Double_t wt = -10.0 * (bzField*10) * vdrift / ezField ;
86 // Correction Terms for effective omegaTau; obtained by a laser calibration run
87 SetOmegaTauT1T2(wt,fT1,fT2);
92 void AliTPCExBConical::Update(const TTimeStamp &/*timeStamp*/) {
96 AliMagF* magF= (AliMagF*)TGeoGlobalMagField::Instance()->GetField();
97 if (!magF) AliError("Magneticd field - not initialized");
98 Double_t bzField = magF->SolenoidField()/10.; //field in T
99 AliTPCParam *param= AliTPCcalibDB::Instance()->GetParameters();
100 if (!param) AliError("Parameters - not initialized");
101 Double_t vdrift = param->GetDriftV()/1000000.; // [cm/us] // From dataBase: to be updated: per second (ideally)
102 Double_t ezField = 400; // [V/cm] // to be updated: never (hopefully)
103 Double_t wt = -10.0 * (bzField*10) * vdrift / ezField ;
104 // Correction Terms for effective omegaTau; obtained by a laser calibration run
105 SetOmegaTauT1T2(wt,fT1,fT2);
112 void AliTPCExBConical::GetCorrection(const Float_t x[],const Short_t roc,Float_t dx[]) {
114 // Calculates the correction due conical shape
116 AliTPCROC * calROC = AliTPCROC::Instance();
117 const Double_t kRTPC0 =calROC->GetPadRowRadii(0,0);
118 const Double_t kRTPC1 =calROC->GetPadRowRadii(36,calROC->GetNRows(36)-1);
119 Float_t rmiddle=(kRTPC0+kRTPC1)/2.;
121 Double_t phi =TMath::ATan2(x[1],x[0]);
122 Double_t r =TMath::Sqrt(x[1]*x[1]+x[0]*x[0]);
124 if (roc%36<18) dTheta = fConicalA[0]+TMath::Cos(phi)*fConicalA[1]+TMath::Sin(phi)*fConicalA[2];
126 dTheta = fConicalC[0]+TMath::Cos(phi)*fConicalC[1]+TMath::Sin(phi)*fConicalC[2];
128 Double_t corr=dTheta*fConicalFactor;
129 if (roc%36>=18) corr*=-1.;
130 Double_t drphi=fC1*corr;
131 Double_t dr =fC2*corr;
132 dx[0]= TMath::Cos(phi)*dr-TMath::Sin(phi)*drphi;
133 dx[1]= TMath::Sin(phi)*dr+TMath::Cos(phi)*drphi;
134 dx[2]= -0.001*dTheta*(r-rmiddle); // dtheta in mrad
138 void AliTPCExBConical::Print(const Option_t* option) const {
140 // Print function to check the settings (e.g. the conical in the X direction)
141 // option=="a" prints the C0 and C1 coefficents for calibration purposes
144 TString opt = option; opt.ToLower();
145 printf("%s:%s\n",GetTitle(), GetName());
146 printf(" - T1: %1.4f, T2: %1.4f \n",fT1,fT2);
147 printf("Conical settings: Empirical: %1.5f mm/mrad\n",fConicalFactor);
148 printf("Conical settings: A-Conical: %1.5f mrad:%1.5f mrad:%1.5f mrad \n",fConicalA[0],fConicalA[1],fConicalA[2]);
149 printf("Conical settings: C-Conical: %1.5f mrad:%1.5f mrad:%1.5f mrad \n",fConicalC[0],fConicalC[1],fConicalC[2]);
154 void AliTPCExBConical::SetConicalA(Float_t conicalA[3]){
156 // set paramters of conical shape - A side - obtained from alignment
158 fConicalA[0]= conicalA[0]; // constant
159 fConicalA[1]= conicalA[1]; // cos
160 fConicalA[2]= conicalA[2]; // sin
162 void AliTPCExBConical::SetConicalC(Float_t conicalC[3]){
164 // set paramters of conical shape -C side obtained form the alignemnt
166 fConicalC[0]= conicalC[0]; // constant
167 fConicalC[1]= conicalC[1]; // cos
168 fConicalC[2]= conicalC[2]; // sin