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() {}
30 * Method to create the alignment objects
32 * @return @c true on success, @c false otherwise
34 Bool_t CreateAlignObjs();
37 TClonesArray* GetAlignObjArray() const { return fAlignObjArray; }
41 * Do the FMD1 analysis. We have 4 survey targets on V0-A on the
44 * - V0A_ICT In-side, C-side, top.
45 * - V0A_ICB In-side, C-side, bottom.
46 * - V0A_OCT Out-side, C-side, top.
47 * - V0A_OCB Out-side, C-side, bottom.
49 * These 4 survey targets sit 3.3mm over the V0-A C-side surface, or
50 * 3.3mm over the back surface of FMD1.
52 * Since these are really sitting on a plane, we can use the method
53 * proposed by the CORE offline.
55 * @return @c true on success, @c false otherwise.
59 * Get the FMD1 plane from the survey points
61 * @param rot Rotation matrix (direction cosines)
62 * @param trans Translation
64 * @return @c true on success, @c false otherwise.
66 Bool_t GetFMD1Plane(Double_t* rot, Double_t* trans) const;
68 * Do the FMD2 calculations. We have 6 survey points of which only
69 * 5 are normally surveyed. These are all sittings
71 * - FMD2_ITOP - In-side, top
72 * - FMD2_IBOTM - In-side, middle bottom
73 * - FMD2_IBOT - In-side, bottom
74 * - FMD2_OTOP - Out-side, top
75 * - FMD2_OBOTM - Out-side, middle bottom
76 * - FMD2_OBOT - Out-side, bottom
78 * The nominal coordinates of these retro-fitted survey stickers
79 * isn't known. Also, these stickers are put on a thin (0.3mm
80 * thick) carbon cover which flexes quite easily. This means, that
81 * to rotations and xy-translation obtained from the survey data
82 * cannot be used, and left is only the z-translation.
84 * Further more, since FMD2 to is attached to the ITS SPD thermal
85 * screen, it is questionable if the FMD2 survey will ever be used.
87 * @return @c true on success, @c false otherwise.
91 * Get the surveyed plane corresponding to the backside of FMD2.
92 * The plane is done as a best fit of the plane equation to at least
93 * 4 of the available survey points.
95 * @param rot Rotation matrix (direction cosines)
96 * @param trans Translation vector.
98 * @return @c true on success, @c false otherwise
100 Bool_t GetFMD2Plane(Double_t* rot, Double_t* trans) const;
102 * Get the factor to translate current coordinates to the canonical
103 * unit (centi-meters).
105 * @return Conversion factor
107 Double_t GetUnitFactor() const;
109 * Get the coordinates of a survey point (if available).
111 * @param name Name of the survey point.
112 * @param p Coordinates.
113 * @param e Error on the measurement.
115 * @return @c true if the survey data is available, @c false otherwise.
117 Bool_t GetPoint(const char* name, TVector3& p, TVector3& e) const;
119 * Calculate the plane translation and rotation from 3 survey points
121 * @param a 1st Survey point
122 * @param b 2nd Survey point
123 * @param c 3rd Survey point
124 * @param trans Translation vector
125 * @param rot Rotation matrix (direction cosines)
129 Bool_t CalculatePlane(const TVector3& a,
134 Double_t* rot) const;
136 * Calculate the plane rotation and translation by doing a fit of
137 * the plane equation to the surveyed points. At least 4 points
138 * must be passed in the @a points array with corresponding errors
139 * in the array @a errors. The arrays are assumed to contain
142 * @param points Array surveyed positions
143 * @param errors Array of errors corresponding to @a points
144 * @param depth Survey targets depth (perpendicular to the plane)
145 * @param trans On return, translation of the plane
146 * @param rot On return, rotation (direction cosines) of the plane
148 * @return @c true on success, @c false otherwise
150 Bool_t FitPlane(const TObjArray& points,
151 const TObjArray& errors,
154 Double_t* rot) const;
156 * Create a delta transform from a global rotation matrix and
159 * @param global Global matrix of element to transform.
160 * @param rot Rotation matrix (direction cosines)
161 * @param trans Translation
162 * @param delta On return, the delta transform
166 Bool_t MakeDelta(TGeoMatrix* global,
169 TGeoHMatrix& delta) const;
171 * Create a delta transform from a global rotation matrix and
174 * @param path Path of element to transform.
175 * @param rot Rotation matrix (direction cosines)
176 * @param trans Translation
177 * @param delta On return, the delta transform
181 Bool_t MakeDelta(const char* path,
184 TGeoHMatrix& delta) const;
186 * Service member function to print a vector
188 * @param text Prefix text
189 * @param v Vector (array of 3 doubles)
191 static void PrintVector(const char* text, const Double_t* v);
193 * Service member function to print a vector
195 * @param text Prefix text
198 static void PrintVector(const char* text, const TVector3& v);
200 * Service member function to print a rotation matrix
202 * @param text Prefix text
203 * @param v Matrix (array of 9 doubles)
205 static void PrintRotation(const char* text, const Double_t* rot);
207 TGeoHMatrix fFMD1Delta; // FMD1 delta transform
208 TGeoHMatrix fFMD2Delta; // FMD2 delta transform
210 ClassDef(AliFMDSurveyToAlignObjs,0) // Convert FMD survey to alignments
215 //____________________________________________________________________