]> git.uio.no Git - u/mrichter/AliRoot.git/blame - FMD/AliFMDSurveyToAlignObjs.h
New FMD correction objects. Again.
[u/mrichter/AliRoot.git] / FMD / AliFMDSurveyToAlignObjs.h
CommitLineData
b2e6f0b0 1#ifndef ALIFMDSURVEYTOALIGNOBJS_H
2#define ALIFMDSURVEYTOALIGNOBJS_H
3#include <AliSurveyToAlignObjs.h>
f567c3ce 4#include <TGeoMatrix.h>
b2e6f0b0 5
6// Forward decl
7class TVector3;
f567c3ce 8class TGeoMatrix;
b2e6f0b0 9
10
f567c3ce 11/**
12 * Class to take survey data and transform that to alignment objects.
13 *
14 */
b2e6f0b0 15class AliFMDSurveyToAlignObjs : public AliSurveyToAlignObjs
16{
17public:
f567c3ce 18 /**
19 * Constructor
20 *
21 */
638bc5af 22 AliFMDSurveyToAlignObjs() : AliSurveyToAlignObjs(),
23 fFMD1Delta(0),
24 fFMD2Delta(0) {}
f567c3ce 25 /**
26 * Run the task.
27 *
28 */
b2e6f0b0 29 void Run();
f567c3ce 30 /**
31 *
32 * Method to create the alignment objects
33 *
34 * @return @c true on success, @c false otherwise
35 */
36 Bool_t CreateAlignObjs();
37
38
39 TClonesArray* GetAlignObjArray() const { return fAlignObjArray; }
40
b2e6f0b0 41protected:
f567c3ce 42 /**
43 * Do the FMD1 analysis. We have 4 survey targets on V0-A on the
44 * C-side. These are
45 *
46 * - V0A_ICT In-side, C-side, top.
47 * - V0A_ICB In-side, C-side, bottom.
48 * - V0A_OCT Out-side, C-side, top.
49 * - V0A_OCB Out-side, C-side, bottom.
50 *
51 * These 4 survey targets sit 3.3mm over the V0-A C-side surface, or
52 * 3.3mm over the back surface of FMD1.
53 *
54 * Since these are really sitting on a plane, we can use the method
55 * proposed by the CORE offline.
56 *
57 * @return @c true on success, @c false otherwise.
58 */
faf80567 59 Bool_t DoFMD1();
f567c3ce 60 /**
61 * Get the FMD1 plane from the survey points
62 *
63 * @param rot Rotation matrix (direction cosines)
64 * @param trans Translation
65 *
66 * @return @c true on success, @c false otherwise.
67 */
faf80567 68 Bool_t GetFMD1Plane(Double_t* rot, Double_t* trans) const;
f567c3ce 69 /**
70 * Do the FMD2 calculations. We have 6 survey points of which only
71 * 5 are normally surveyed. These are all sittings
72 *
73 * - FMD2_ITOP - In-side, top
74 * - FMD2_IBOTM - In-side, middle bottom
75 * - FMD2_IBOT - In-side, bottom
76 * - FMD2_OTOP - Out-side, top
77 * - FMD2_OBOTM - Out-side, middle bottom
78 * - FMD2_OBOT - Out-side, bottom
79 *
80 * The nominal coordinates of these retro-fitted survey stickers
81 * isn't known. Also, these stickers are put on a thin (0.3mm
82 * thick) carbon cover which flexes quite easily. This means, that
83 * to rotations and xy-translation obtained from the survey data
84 * cannot be used, and left is only the z-translation.
85 *
86 * Further more, since FMD2 to is attached to the ITS SPD thermal
87 * screen, it is questionable if the FMD2 survey will ever be used.
88 *
89 * @return @c true on success, @c false otherwise.
90 */
b2e6f0b0 91 Bool_t DoFMD2();
f567c3ce 92 /**
93 * Get the surveyed plane corresponding to the backside of FMD2.
94 * The plane is done as a best fit of the plane equation to at least
95 * 4 of the available survey points.
96 *
97 * @param rot Rotation matrix (direction cosines)
98 * @param trans Translation vector.
99 *
100 * @return @c true on success, @c false otherwise
101 */
faf80567 102 Bool_t GetFMD2Plane(Double_t* rot, Double_t* trans) const;
f567c3ce 103 /**
104 * Get the factor to translate current coordinates to the canonical
105 * unit (centi-meters).
106 *
107 * @return Conversion factor
108 */
faf80567 109 Double_t GetUnitFactor() const;
f567c3ce 110 /**
111 * Get the coordinates of a survey point (if available).
112 *
113 * @param name Name of the survey point.
114 * @param p Coordinates.
115 * @param e Error on the measurement.
116 *
117 * @return @c true if the survey data is available, @c false otherwise.
118 */
faf80567 119 Bool_t GetPoint(const char* name, TVector3& p, TVector3& e) const;
f567c3ce 120 /**
121 * Calculate the plane translation and rotation from 3 survey points
122 *
123 * @param a 1st Survey point
124 * @param b 2nd Survey point
125 * @param c 3rd Survey point
126 * @param trans Translation vector
127 * @param rot Rotation matrix (direction cosines)
128 *
129 * @return
130 */
faf80567 131 Bool_t CalculatePlane(const TVector3& a,
132 const TVector3& b,
f567c3ce 133 const TVector3& c,
134 Double_t depth,
faf80567 135 Double_t* trans,
136 Double_t* rot) const;
f567c3ce 137 /**
138 * Calculate the plane rotation and translation by doing a fit of
139 * the plane equation to the surveyed points. At least 4 points
140 * must be passed in the @a points array with corresponding errors
141 * in the array @a errors. The arrays are assumed to contain
142 * TVector3 objects.
143 *
144 * @param points Array surveyed positions
145 * @param errors Array of errors corresponding to @a points
146 * @param depth Survey targets depth (perpendicular to the plane)
147 * @param trans On return, translation of the plane
148 * @param rot On return, rotation (direction cosines) of the plane
149 *
150 * @return @c true on success, @c false otherwise
151 */
152 Bool_t FitPlane(const TObjArray& points,
153 const TObjArray& errors,
154 Double_t depth,
155 Double_t* trans,
156 Double_t* rot) const;
157 /**
158 * Create a delta transform from a global rotation matrix and
159 * translation.
160 *
161 * @param global Global matrix of element to transform.
162 * @param rot Rotation matrix (direction cosines)
163 * @param trans Translation
164 * @param delta On return, the delta transform
165 *
166 * @return Newly
167 */
168 Bool_t MakeDelta(TGeoMatrix* global,
169 Double_t* rot,
170 Double_t* trans,
171 TGeoHMatrix& delta) const;
172 /**
173 * Create a delta transform from a global rotation matrix and
174 * translation.
175 *
176 * @param path Path of element to transform.
177 * @param rot Rotation matrix (direction cosines)
178 * @param trans Translation
179 * @param delta On return, the delta transform
180 *
181 * @return Newly
182 */
183 Bool_t MakeDelta(const char* path,
184 Double_t* rot,
185 Double_t* trans,
186 TGeoHMatrix& delta) const;
187 /**
188 * Service member function to print a vector
189 *
190 * @param text Prefix text
191 * @param v Vector (array of 3 doubles)
192 */
b2e6f0b0 193 static void PrintVector(const char* text, const Double_t* v);
f567c3ce 194 /**
195 * Service member function to print a vector
196 *
197 * @param text Prefix text
198 * @param v Vector
199 */
b2e6f0b0 200 static void PrintVector(const char* text, const TVector3& v);
f567c3ce 201 /**
202 * Service member function to print a rotation matrix
203 *
204 * @param text Prefix text
205 * @param v Matrix (array of 9 doubles)
206 */
b2e6f0b0 207 static void PrintRotation(const char* text, const Double_t* rot);
208
f567c3ce 209 TGeoHMatrix fFMD1Delta; // FMD1 delta transform
210 TGeoHMatrix fFMD2Delta; // FMD2 delta transform
b2e6f0b0 211
212 ClassDef(AliFMDSurveyToAlignObjs,0) // Convert FMD survey to alignments
213};
214
215
216#endif
217//____________________________________________________________________
218//
219// Local Variables:
220// mode: C++
221// End:
222//
223