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 // AliTPCExBTwist class //
19 // The class calculates the space point distortions due to a mismatch //
20 // of the E and B field axis (original code from STAR) //
21 // The class allows "effective Omega Tau" corrections. //
23 // date: 27/04/2010 //
24 // Authors: Jim Thomas, Magnus Mager, Stefan Rossegger //
27 // AliTPCExBTwist twist; //
28 // twist.SetOmegaTauT1T2(0.32,1.,1.); // values ideally from OCDB //
29 // twist.SetXTwist(0.001); // set twist in X direction (in rad) //
30 // // plot dRPhi distortions ... //
31 // twist.CreateHistoDRPhiinZR(1.,100,100)->Draw("surf2"); //
32 ////////////////////////////////////////////////////////////////////////////
34 #include "TGeoGlobalMagField.h"
35 #include "AliTPCcalibDB.h"
36 #include "AliTPCParam.h"
39 #include "AliTPCExBTwist.h"
41 AliTPCExBTwist::AliTPCExBTwist()
42 : AliTPCCorrection("exb_twist","ExB twist"),
44 fXTwist(0.),fYTwist(0.)
47 // default constructor
51 AliTPCExBTwist::~AliTPCExBTwist() {
59 void AliTPCExBTwist::Init() {
61 // Initialization funtion
64 AliMagF* magF= (AliMagF*)TGeoGlobalMagField::Instance()->GetField();
65 if (!magF) AliError("Magneticd field - not initialized");
66 Double_t bzField = magF->SolenoidField()/10.; //field in T
67 AliTPCParam *param= AliTPCcalibDB::Instance()->GetParameters();
68 if (!param) AliError("Parameters - not initialized");
69 Double_t vdrift = param->GetDriftV()/1000000.; // [cm/us] // From dataBase: to be updated: per second (ideally)
70 Double_t ezField = 400; // [V/cm] // to be updated: never (hopefully)
71 Double_t wt = -10.0 * (bzField*10) * vdrift / ezField ;
72 // Correction Terms for effective omegaTau; obtained by a laser calibration run
73 SetOmegaTauT1T2(wt,fT1,fT2);
78 void AliTPCExBTwist::Update(const TTimeStamp &/*timeStamp*/) {
82 AliMagF* magF= (AliMagF*)TGeoGlobalMagField::Instance()->GetField();
83 if (!magF) AliError("Magneticd field - not initialized");
84 Double_t bzField = magF->SolenoidField()/10.; //field in T
85 AliTPCParam *param= AliTPCcalibDB::Instance()->GetParameters();
86 if (!param) AliError("Parameters - not initialized");
87 Double_t vdrift = param->GetDriftV()/1000000.; // [cm/us] // From dataBase: to be updated: per second (ideally)
88 Double_t ezField = 400; // [V/cm] // to be updated: never (hopefully)
89 Double_t wt = -10.0 * (bzField*10) * vdrift / ezField ;
90 // Correction Terms for effective omegaTau; obtained by a laser calibration run
91 SetOmegaTauT1T2(wt,fT1,fT2);
98 void AliTPCExBTwist::GetCorrection(const Float_t x[],const Short_t roc,Float_t dx[]) {
100 // Calculates the correction of a mismatch between the E and B field axis
103 const Float_t zstart=x[2];
104 const Float_t zend =(roc%36<18?fgkTPCZ0:-fgkTPCZ0);
105 const Float_t zdrift=zstart-zend;
107 dx[0]=(fC2*fXTwist-fC1*fYTwist)*zdrift;
108 dx[1]=(fC1*fXTwist+fC2*fYTwist)*zdrift;
112 void AliTPCExBTwist::Print(const Option_t* option) const {
114 // Print function to check the settings (e.g. the twist in the X direction)
115 // option=="a" prints the C0 and C1 coefficents for calibration purposes
118 TString opt = option; opt.ToLower();
119 printf("%s\n",GetTitle());
121 printf(" - Twist settings: X-Twist: %1.5f rad, Y-Twist: %1.5f rad \n",fXTwist,fYTwist);
122 if (opt.Contains("a")) { // Print all details
123 printf(" - T1: %1.4f, T2: %1.4f \n",fT1,fT2);
124 printf(" - C1: %1.4f, C2: %1.4f \n",fC1,fC2);