]> git.uio.no Git - u/mrichter/AliRoot.git/blame - FMD/AliFMDSurveyToAlignObjs.h
Extacting the OCDB in a separate module. The detectors have write permission in the...
[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 */
b2e6f0b0 22 AliFMDSurveyToAlignObjs() : AliSurveyToAlignObjs() {}
f567c3ce 23 /**
24 * Run the task.
25 *
26 */
b2e6f0b0 27 void Run();
f567c3ce 28 /**
29 *
30 * Method to create the alignment objects
31 *
32 * @return @c true on success, @c false otherwise
33 */
34 Bool_t CreateAlignObjs();
35
36
37 TClonesArray* GetAlignObjArray() const { return fAlignObjArray; }
38
b2e6f0b0 39protected:
f567c3ce 40 /**
41 * Do the FMD1 analysis. We have 4 survey targets on V0-A on the
42 * C-side. These are
43 *
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.
48 *
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.
51 *
52 * Since these are really sitting on a plane, we can use the method
53 * proposed by the CORE offline.
54 *
55 * @return @c true on success, @c false otherwise.
56 */
faf80567 57 Bool_t DoFMD1();
f567c3ce 58 /**
59 * Get the FMD1 plane from the survey points
60 *
61 * @param rot Rotation matrix (direction cosines)
62 * @param trans Translation
63 *
64 * @return @c true on success, @c false otherwise.
65 */
faf80567 66 Bool_t GetFMD1Plane(Double_t* rot, Double_t* trans) const;
f567c3ce 67 /**
68 * Do the FMD2 calculations. We have 6 survey points of which only
69 * 5 are normally surveyed. These are all sittings
70 *
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
77 *
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.
83 *
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.
86 *
87 * @return @c true on success, @c false otherwise.
88 */
b2e6f0b0 89 Bool_t DoFMD2();
f567c3ce 90 /**
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.
94 *
95 * @param rot Rotation matrix (direction cosines)
96 * @param trans Translation vector.
97 *
98 * @return @c true on success, @c false otherwise
99 */
faf80567 100 Bool_t GetFMD2Plane(Double_t* rot, Double_t* trans) const;
f567c3ce 101 /**
102 * Get the factor to translate current coordinates to the canonical
103 * unit (centi-meters).
104 *
105 * @return Conversion factor
106 */
faf80567 107 Double_t GetUnitFactor() const;
f567c3ce 108 /**
109 * Get the coordinates of a survey point (if available).
110 *
111 * @param name Name of the survey point.
112 * @param p Coordinates.
113 * @param e Error on the measurement.
114 *
115 * @return @c true if the survey data is available, @c false otherwise.
116 */
faf80567 117 Bool_t GetPoint(const char* name, TVector3& p, TVector3& e) const;
f567c3ce 118 /**
119 * Calculate the plane translation and rotation from 3 survey points
120 *
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)
126 *
127 * @return
128 */
faf80567 129 Bool_t CalculatePlane(const TVector3& a,
130 const TVector3& b,
f567c3ce 131 const TVector3& c,
132 Double_t depth,
faf80567 133 Double_t* trans,
134 Double_t* rot) const;
f567c3ce 135 /**
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
140 * TVector3 objects.
141 *
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
147 *
148 * @return @c true on success, @c false otherwise
149 */
150 Bool_t FitPlane(const TObjArray& points,
151 const TObjArray& errors,
152 Double_t depth,
153 Double_t* trans,
154 Double_t* rot) const;
155 /**
156 * Create a delta transform from a global rotation matrix and
157 * translation.
158 *
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
163 *
164 * @return Newly
165 */
166 Bool_t MakeDelta(TGeoMatrix* global,
167 Double_t* rot,
168 Double_t* trans,
169 TGeoHMatrix& delta) const;
170 /**
171 * Create a delta transform from a global rotation matrix and
172 * translation.
173 *
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
178 *
179 * @return Newly
180 */
181 Bool_t MakeDelta(const char* path,
182 Double_t* rot,
183 Double_t* trans,
184 TGeoHMatrix& delta) const;
185 /**
186 * Service member function to print a vector
187 *
188 * @param text Prefix text
189 * @param v Vector (array of 3 doubles)
190 */
b2e6f0b0 191 static void PrintVector(const char* text, const Double_t* v);
f567c3ce 192 /**
193 * Service member function to print a vector
194 *
195 * @param text Prefix text
196 * @param v Vector
197 */
b2e6f0b0 198 static void PrintVector(const char* text, const TVector3& v);
f567c3ce 199 /**
200 * Service member function to print a rotation matrix
201 *
202 * @param text Prefix text
203 * @param v Matrix (array of 9 doubles)
204 */
b2e6f0b0 205 static void PrintRotation(const char* text, const Double_t* rot);
206
f567c3ce 207 TGeoHMatrix fFMD1Delta; // FMD1 delta transform
208 TGeoHMatrix fFMD2Delta; // FMD2 delta transform
b2e6f0b0 209
210 ClassDef(AliFMDSurveyToAlignObjs,0) // Convert FMD survey to alignments
211};
212
213
214#endif
215//____________________________________________________________________
216//
217// Local Variables:
218// mode: C++
219// End:
220//
221