1 #ifndef ALIFMDSURVEYTOALIGNOBJS_H
2 #define ALIFMDSURVEYTOALIGNOBJS_H
3 #include <AliSurveyToAlignObjs.h>
4 #include <TGeoMatrix.h>
12 * Class to take survey data and transform that to alignment objects.
15 class AliFMDSurveyToAlignObjs : public AliSurveyToAlignObjs
22 AliFMDSurveyToAlignObjs() : AliSurveyToAlignObjs(),
32 * Method to create the alignment objects
34 * @return @c true on success, @c false otherwise
36 Bool_t CreateAlignObjs();
39 TClonesArray* GetAlignObjArray() const { return fAlignObjArray; }
43 * Do the FMD1 analysis. We have 4 survey targets on V0-A on the
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.
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.
54 * Since these are really sitting on a plane, we can use the method
55 * proposed by the CORE offline.
57 * @return @c true on success, @c false otherwise.
61 * Get the FMD1 plane from the survey points
63 * @param rot Rotation matrix (direction cosines)
64 * @param trans Translation
66 * @return @c true on success, @c false otherwise.
68 Bool_t GetFMD1Plane(Double_t* rot, Double_t* trans) const;
70 * Do the FMD2 calculations. We have 6 survey points of which only
71 * 5 are normally surveyed. These are all sittings
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
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.
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.
89 * @return @c true on success, @c false otherwise.
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.
97 * @param rot Rotation matrix (direction cosines)
98 * @param trans Translation vector.
100 * @return @c true on success, @c false otherwise
102 Bool_t GetFMD2Plane(Double_t* rot, Double_t* trans) const;
104 * Get the factor to translate current coordinates to the canonical
105 * unit (centi-meters).
107 * @return Conversion factor
109 Double_t GetUnitFactor() const;
111 * Get the coordinates of a survey point (if available).
113 * @param name Name of the survey point.
114 * @param p Coordinates.
115 * @param e Error on the measurement.
117 * @return @c true if the survey data is available, @c false otherwise.
119 Bool_t GetPoint(const char* name, TVector3& p, TVector3& e) const;
121 * Calculate the plane translation and rotation from 3 survey points
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)
131 Bool_t CalculatePlane(const TVector3& a,
136 Double_t* rot) const;
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
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
150 * @return @c true on success, @c false otherwise
152 Bool_t FitPlane(const TObjArray& points,
153 const TObjArray& errors,
156 Double_t* rot) const;
158 * Create a delta transform from a global rotation matrix and
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
168 Bool_t MakeDelta(const TGeoMatrix* global,
170 const Double_t* trans,
171 TGeoHMatrix& delta) const;
173 * Create a delta transform from a global rotation matrix and
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
183 Bool_t MakeDelta(const char* path,
185 const Double_t* trans,
186 TGeoHMatrix& delta) const;
188 * Service member function to print a vector
190 * @param text Prefix text
191 * @param v Vector (array of 3 doubles)
193 static void PrintVector(const char* text, const Double_t* v);
195 * Service member function to print a vector
197 * @param text Prefix text
200 static void PrintVector(const char* text, const TVector3& v);
202 * Service member function to print a rotation matrix
204 * @param text Prefix text
205 * @param v Matrix (array of 9 doubles)
207 static void PrintRotation(const char* text, const Double_t* rot);
209 TGeoHMatrix fFMD1Delta; // FMD1 delta transform
210 TGeoHMatrix fFMD2Delta; // FMD2 delta transform
212 ClassDef(AliFMDSurveyToAlignObjs,0) // Convert FMD survey to alignments
217 //____________________________________________________________________