]>
Commit | Line | Data |
---|---|---|
b1f0a2a5 | 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 | ||
17 | //////////////////////////////////////////////////////////////////////////// | |
18 | // // | |
19 | // AliTPCCalibGlobalMisalignment class // | |
20 | // The class calculates the space point distortions due to simple // | |
21 | // misalignments like shifts in caresian coordinates or a rotation // | |
22 | // of the TPC read out planes (A and C side) // | |
23 | // // | |
24 | // date: 06/05/2010 // | |
25 | // Authors: Stefan Rossegger, Jim Thomas, Magnus Mager // | |
26 | //////////////////////////////////////////////////////////////////////////// | |
27 | ||
28 | #include "AliTPCCalibGlobalMisalignment.h" | |
29 | #include "TMath.h" | |
30 | ||
31 | AliTPCCalibGlobalMisalignment::AliTPCCalibGlobalMisalignment() | |
32 | : AliTPCCorrection("mialign","Misalignment"), | |
33 | fXShift(0.),fYShift(0.),fZShift(0.), | |
34 | fRotPhiA(0.),fRotPhiC(0.), | |
35 | fdRPhiOffsetA(0.), fdRPhiOffsetC(0.) | |
36 | { | |
37 | // | |
38 | // default constructor | |
39 | // | |
40 | } | |
41 | ||
42 | AliTPCCalibGlobalMisalignment::~AliTPCCalibGlobalMisalignment() { | |
43 | // | |
44 | // default destructor | |
45 | // | |
46 | } | |
47 | ||
48 | ||
49 | ||
50 | //void AliTPCCalibGlobalMisalignment::Init() { | |
51 | // // | |
52 | // // Initialization funtion | |
53 | // // | |
54 | ||
55 | // // nothing to be initialized, results of this calibration class will go to the global aligment structure | |
56 | ||
57 | //} | |
58 | ||
59 | //void AliTPCCalibGlobalMisalignment::Update(const TTimeStamp &/*timeStamp*/) { | |
60 | // // | |
61 | // // Update function | |
62 | // // | |
63 | // | |
64 | // // nothing to be updated, results of this calibration class will go to the global aligment structure | |
65 | // | |
66 | //} | |
67 | ||
68 | ||
69 | ||
70 | void AliTPCCalibGlobalMisalignment::GetCorrection(const Float_t x[],const Short_t roc,Float_t dx[]) { | |
71 | // | |
72 | // Calculates the simple correction due to a shift (in x,y,z) or an rotation of the TPC (around z) | |
73 | // | |
74 | ||
75 | Double_t r, phi; | |
76 | r = TMath::Sqrt( x[0]*x[0] + x[1]*x[1] ); | |
77 | phi = TMath::ATan2(x[1],x[0]); | |
78 | ||
79 | ||
80 | // rotation of the read-out planes | |
81 | if (roc%36<18) // A side | |
82 | phi += fRotPhiA; | |
83 | else // C side | |
84 | phi += fRotPhiC; | |
85 | ||
86 | // Simply adding a constant dRPHi residual. PURELY FOR CALIBRATION PURPOSES | |
87 | if (roc%36<18) // A side | |
88 | phi += fdRPhiOffsetA/r; | |
89 | else // C side | |
90 | phi += fdRPhiOffsetC/r; | |
91 | ||
92 | dx[0] = r * TMath::Cos(phi) - x[0]; | |
93 | dx[1] = r * TMath::Sin(phi) - x[1]; | |
94 | dx[2] = 0.; | |
95 | ||
96 | // Simple shifts | |
97 | dx[0] -= fXShift; | |
98 | dx[1] -= fYShift; | |
99 | dx[2] -= fZShift; | |
100 | ||
101 | } | |
102 | ||
103 | void AliTPCCalibGlobalMisalignment::Print(Option_t* /*option*/ ) const { | |
104 | // | |
105 | // Print function to check the settings | |
106 | // | |
107 | printf("%s",GetTitle()); | |
108 | printf(" - Trivial Misalignments for calibration purposes: \n"); | |
109 | printf(" - X-Shift: %1.3f cm, Y-Shift: %1.3f cm, Z-Shift: %1.3f cm \n",fXShift,fYShift,fZShift); | |
110 | printf(" - Phi-Rotations: A side: %1.5f rad, C side: %1.5f rad\n",fRotPhiA,fRotPhiC); | |
111 | printf(" - dRPhi offsets: A side: %1.5f cm, C side: %1.5f cm\n",fdRPhiOffsetA,fdRPhiOffsetC); | |
112 | ||
113 | ||
114 | } |