1 #ifndef ALIFMDSURVEYTOALIGNOBJS_H
2 #define ALIFMDSURVEYTOALIGNOBJS_H
3 #include <AliSurveyToAlignObjs.h>
4 #include <TGeoMatrix.h>
9 class AliAlignObjParams;
12 * Class to take survey data and transform that to alignment objects.
15 class AliFMDSurveyToAlignObjs : public AliSurveyToAlignObjs
22 AliFMDSurveyToAlignObjs() : AliSurveyToAlignObjs(),
30 void Run(const char** files);
33 * Method to create the alignment objects
35 * @return @c true on success, @c false otherwise
37 Bool_t CreateAlignObjs();
40 TClonesArray* GetAlignObjArray() const { return fAlignObjArray; }
44 * Do the FMD1 analysis. We have 4 survey targets on V0-A on the
47 * - V0A_ICT In-side, C-side, top.
48 * - V0A_ICB In-side, C-side, bottom.
49 * - V0A_OCT Out-side, C-side, top.
50 * - V0A_OCB Out-side, C-side, bottom.
52 * These 4 survey targets sit 3.3mm over the V0-A C-side surface, or
53 * 3.3mm over the back surface of FMD1.
55 * Since these are really sitting on a plane, we can use the method
56 * proposed by the CORE offline.
58 * @return @c true on success, @c false otherwise.
62 * Get the FMD1 plane from the survey points
64 * @param rot Rotation matrix (direction cosines)
65 * @param trans Translation
67 * @return @c true on success, @c false otherwise.
69 Bool_t GetFMD1Plane(Double_t* rot, Double_t* trans) const;
71 * Do the FMD2 calculations. We have 6 survey points of which only
72 * 5 are normally surveyed. These are all sittings
74 * - FMD2_ITOP - In-side, top
75 * - FMD2_IBOTM - In-side, middle bottom
76 * - FMD2_IBOT - In-side, bottom
77 * - FMD2_OTOP - Out-side, top
78 * - FMD2_OBOTM - Out-side, middle bottom
79 * - FMD2_OBOT - Out-side, bottom
81 * The nominal coordinates of these retro-fitted survey stickers
82 * isn't known. Also, these stickers are put on a thin (0.3mm
83 * thick) carbon cover which flexes quite easily. This means, that
84 * to rotations and xy-translation obtained from the survey data
85 * cannot be used, and left is only the z-translation.
87 * Further more, since FMD2 to is attached to the ITS SPD thermal
88 * screen, it is questionable if the FMD2 survey will ever be used.
90 * @return @c true on success, @c false otherwise.
94 * Get the surveyed plane corresponding to the backside of FMD2.
95 * The plane is done as a best fit of the plane equation to at least
96 * 4 of the available survey points.
98 * @param rot Rotation matrix (direction cosines)
99 * @param trans Translation vector.
101 * @return @c true on success, @c false otherwise
103 Bool_t GetFMD2Plane(Double_t* rot, Double_t* trans) const;
105 * Get the factor to translate current coordinates to the canonical
106 * unit (centi-meters).
108 * @return Conversion factor
110 Double_t GetUnitFactor() const;
112 * Get the coordinates of a survey point (if available).
114 * @param name Name of the survey point.
115 * @param p Coordinates.
116 * @param e Error on the measurement.
118 * @return @c true if the survey data is available, @c false otherwise.
120 Bool_t GetPoint(const char* name, TVector3& p, TVector3& e) const;
122 * Calculate the plane translation and rotation from 3 survey points
124 * @param a 1st Survey point
125 * @param b 2nd Survey point
126 * @param c 3rd Survey point
127 * @param trans Translation vector
128 * @param rot Rotation matrix (direction cosines)
132 Bool_t CalculatePlane(const TVector3& a,
137 Double_t* rot) const;
139 * Calculate the plane rotation and translation by doing a fit of
140 * the plane equation to the surveyed points. At least 4 points
141 * must be passed in the @a points array with corresponding errors
142 * in the array @a errors. The arrays are assumed to contain
145 * @param points Array surveyed positions
146 * @param errors Array of errors corresponding to @a points
147 * @param depth Survey targets depth (perpendicular to the plane)
148 * @param trans On return, translation of the plane
149 * @param rot On return, rotation (direction cosines) of the plane
151 * @return @c true on success, @c false otherwise
153 Bool_t FitPlane(const TObjArray& points,
154 const TObjArray& errors,
157 Double_t* rot) const;
159 * Create a delta transform from a global rotation matrix and
162 * @param global Global matrix of element to transform.
163 * @param rot Rotation matrix (direction cosines)
164 * @param trans Translation
165 * @param delta On return, the delta transform
169 Bool_t MakeDelta(const TGeoMatrix* global,
171 const Double_t* trans,
172 TGeoHMatrix& delta) const;
174 * Create a delta transform from a global rotation matrix and
177 * @param path Path of element to transform.
178 * @param rot Rotation matrix (direction cosines)
179 * @param trans Translation
180 * @param delta On return, the delta transform
184 Bool_t MakeDelta(const char* path,
186 const Double_t* trans,
187 TGeoHMatrix& delta) const;
189 * Create a default (i.e., no rotation or translation) alignment object.
191 * @param path Path to volume
192 * @param id Id of volume
194 * @return Created object
196 AliAlignObjParams* CreateDefaultAlignObj(const TString& path, Int_t id=0);
198 * Check if we have an alignment object for the given path alread
200 * @param path PAth to check
202 * @return Pointer to object if found, otherwise 0
204 AliAlignObjParams* FindAlignObj(const TString& path) const;
206 * Fill In default alignmen objects
208 * @return true on sucess
210 Bool_t FillDefaultAlignObjs();
213 * Service member function to print a vector
215 * @param text Prefix text
216 * @param v Vector (array of 3 doubles)
218 static void PrintVector(const char* text, const Double_t* v);
220 * Service member function to print a vector
222 * @param text Prefix text
225 static void PrintVector(const char* text, const TVector3& v);
227 * Service member function to print a rotation matrix
229 * @param text Prefix text
230 * @param v Matrix (array of 9 doubles)
232 static void PrintRotation(const char* text, const Double_t* rot);
234 TGeoHMatrix fFMD1Delta; // FMD1 delta transform
235 TGeoHMatrix fFMD2Delta; // FMD2 delta transform
237 ClassDef(AliFMDSurveyToAlignObjs,0) // Convert FMD survey to alignments
242 //____________________________________________________________________