Updated macro for ACORDE raw-data visualisation. We use now the ACORDE sym.names...
[u/mrichter/AliRoot.git] / TPC / AliTPCcalibAlign.cxx
CommitLineData
9318a5b4 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15
16
17///////////////////////////////////////////////////////////////////////////////
18// //
19// Class to make a internal alignemnt of TPC chambers //
20//
21// Different linear tranformation investigated
22// 12 parameters - arbitrary transformation
23// 9 parameters - scaling fixed to 1
24// 6 parameters -
25////
26//// Only the 12 parameter version works so far...
27////
28////
29////
30
31#include "TLinearFitter.h"
32#include "AliTPCcalibAlign.h"
33#include "AliExternalTrackParam.h"
e4042305 34#include "AliTPCTracklet.h"
35#include "TH1D.h"
e149f26d 36#include "TTreeStream.h"
9318a5b4 37
38#include <iostream>
e4042305 39#include <sstream>
9318a5b4 40using namespace std;
41
42ClassImp(AliTPCcalibAlign)
43
44AliTPCcalibAlign::AliTPCcalibAlign()
e4042305 45 : fDphiHistArray(72*72),
46 fDthetaHistArray(72*72),
47 fDyHistArray(72*72),
48 fDzHistArray(72*72),
49 fFitterArray12(72*72),
50 fFitterArray9(72*72),
51 fFitterArray6(72*72)
9318a5b4 52{
53 //
54 // Constructor
55 //
56 for (Int_t i=0;i<72*72;++i) {
57 fPoints[i]=0;
58 }
59}
60
e149f26d 61AliTPCcalibAlign::AliTPCcalibAlign(const Text_t *name, const Text_t *title)
62 :AliTPCcalibBase(),
63 fDphiHistArray(72*72),
64 fDthetaHistArray(72*72),
65 fDyHistArray(72*72),
66 fDzHistArray(72*72),
67 fFitterArray12(72*72),
68 fFitterArray9(72*72),
69 fFitterArray6(72*72)
70{
71 //
72 // Constructor
73 //
74 SetName(name);
75 SetTitle(title);
76 for (Int_t i=0;i<72*72;++i) {
77 fPoints[i]=0;
78 }
79}
80
9318a5b4 81AliTPCcalibAlign::~AliTPCcalibAlign() {
82 //
83 // destructor
84 //
85}
86
e4042305 87void AliTPCcalibAlign::Process(AliTPCseed *seed) {
88 TObjArray tracklets=
89 AliTPCTracklet::CreateTracklets(seed,AliTPCTracklet::kKalman,
90 kFALSE,20,2);
cbc19295 91 // TObjArray trackletsL=
92// AliTPCTracklet::CreateTracklets(seed,AliTPCTracklet::kLinear,
93// kFALSE,20,2);
94// TObjArray trackletsQ=
95// AliTPCTracklet::CreateTracklets(seed,AliTPCTracklet::kQuadratic,
96// kFALSE,20,2);
97// TObjArray trackletsR=
98// AliTPCTracklet::CreateTracklets(seed,AliTPCTracklet::kRiemann,
99// kFALSE,20,2);
e4042305 100 tracklets.SetOwner();
cbc19295 101 // trackletsL.SetOwner();
102// trackletsQ.SetOwner();
103// trackletsR.SetOwner();
e4042305 104 if (tracklets.GetEntries()==2) {
105 AliTPCTracklet *t1=static_cast<AliTPCTracklet*>(tracklets[0]);
106 AliTPCTracklet *t2=static_cast<AliTPCTracklet*>(tracklets[1]);
107 if (t1->GetSector()>t2->GetSector()) {
108 AliTPCTracklet* tmp=t1;
109 t1=t2;
110 t2=tmp;
111 }
112 AliExternalTrackParam *common1=0,*common2=0;
113 if (AliTPCTracklet::PropagateToMeanX(*t1,*t2,common1,common2))
114 ProcessTracklets(*common1,*common2,t1->GetSector(),t2->GetSector());
115 delete common1;
116 delete common2;
117 }
cbc19295 118
e4042305 119}
120
121void AliTPCcalibAlign::ProcessTracklets(const AliExternalTrackParam &tp1,
122 const AliExternalTrackParam &tp2,
123 Int_t s1,Int_t s2) {
124
e149f26d 125 if (fStreamLevel>1){
126 TTreeSRedirector *cstream = GetDebugStreamer();
127 if (cstream){
128 AliExternalTrackParam *p1 = &((AliExternalTrackParam&)tp1);
129 AliExternalTrackParam *p2 = &((AliExternalTrackParam&)tp2);
130 (*cstream)<<"Tracklet"<<
131 "tp1.="<<p1<<
132 "tp2.="<<p2<<
133 "s1="<<s1<<
134 "s2="<<s2<<
135 "\n";
136 }
137 }
138
e4042305 139 if (s2-s1==36) {//only inner-outer
140 if (!fDphiHistArray[s1*72+s2]) {
141 stringstream name;
142 stringstream title;
143 name<<"hist_phi_"<<s1<<"_"<<s2;
144 title<<"Phi Missalignment for sectors "<<s1<<" and "<<s2;
145 fDphiHistArray[s1*72+s2]=new TH1D(name.str().c_str(),title.str().c_str(),1024,-0.01,0.01); // +/- 10 mrad
146 ((TH1D*)fDphiHistArray[s1*72+s2])->SetDirectory(0);
147 }
148 if (!fDthetaHistArray[s1*72+s2]) {
149 stringstream name;
150 stringstream title;
151 name<<"hist_theta_"<<s1<<"_"<<s2;
152 title<<"Theta Missalignment for sectors "<<s1<<" and "<<s2;
153 fDthetaHistArray[s1*72+s2]=new TH1D(name.str().c_str(),title.str().c_str(),1024,-0.01,0.01); // +/- 10 mrad
154 ((TH1D*)fDthetaHistArray[s1*72+s2])->SetDirectory(0);
155 }
156 if (!fDyHistArray[s1*72+s2]) {
157 stringstream name;
158 stringstream title;
159 name<<"hist_y_"<<s1<<"_"<<s2;
160 title<<"Y Missalignment for sectors "<<s1<<" and "<<s2;
161 fDyHistArray[s1*72+s2]=new TH1D(name.str().c_str(),title.str().c_str(),1024,-0.3,0.3); // +/- 3 mm
162 ((TH1D*)fDyHistArray[s1*72+s2])->SetDirectory(0);
163 }
164 if (!fDzHistArray[s1*72+s2]) {
165 stringstream name;
166 stringstream title;
167 name<<"hist_z_"<<s1<<"_"<<s2;
168 title<<"Z Missalignment for sectors "<<s1<<" and "<<s2;
169 fDzHistArray[s1*72+s2]=new TH1D(name.str().c_str(),title.str().c_str(),1024,-0.3,0.3); // +/- 3 mm
170 ((TH1D*)fDzHistArray[s1*72+s2])->SetDirectory(0);
171 }
172 static_cast<TH1D*>(fDphiHistArray[s1*72+s2])
173 ->Fill(TMath::ASin(tp1.GetSnp())
174 -TMath::ASin(tp2.GetSnp()));
175 static_cast<TH1D*>(fDthetaHistArray[s1*72+s2])
176 ->Fill(TMath::ATan(tp1.GetTgl())
177 -TMath::ATan(tp2.GetTgl()));
178 static_cast<TH1D*>(fDyHistArray[s1*72+s2])
179 ->Fill(tp1.GetY()
180 -tp2.GetY());
181 static_cast<TH1D*>(fDzHistArray[s1*72+s2])
182 ->Fill(tp1.GetZ()
183 -tp2.GetZ());
184 }
185 return;
186
187
188
9318a5b4 189 //
190 // Process function to fill fitters
191 //
192 Double_t t1[5],t2[5];
193 Double_t &x1=t1[0], &y1=t1[1], &z1=t1[2], &dydx1=t1[3], &dzdx1=t1[4];
cec17745 194 Double_t /*&x2=t2[0],*/ &y2=t2[1], &z2=t2[2], &dydx2=t2[3]/*, &dzdx2=t2[4]*/;
9318a5b4 195 x1 =tp1.GetX();
196 y1 =tp1.GetY();
197 z1 =tp1.GetZ();
198 Double_t snp1=tp1.GetSnp();
199 dydx1=snp1/TMath::Sqrt(1.-snp1*snp1);
200 Double_t tgl1=tp1.GetTgl();
201 // dz/dx = 1/(cos(theta)*cos(phi))
202 dzdx1=1./TMath::Sqrt((1.+tgl1*tgl1)*(1.-snp1*snp1));
203 // x2 =tp1->GetX();
204 y2 =tp2.GetY();
205 z2 =tp2.GetZ();
206 Double_t snp2=tp2.GetSnp();
207 dydx2=snp2/TMath::Sqrt(1.-snp2*snp2);
208 Double_t tgl2=tp2.GetTgl();
209 dzdx1=1./TMath::Sqrt((1.+tgl2*tgl2)*(1.-snp2*snp2));
210
211 Process12(t1,t2,GetOrMakeFitter12(s1,s2));
212 Process9(t1,t2,GetOrMakeFitter12(s1,s2));
213 Process6(t1,t2,GetOrMakeFitter12(s1,s2));
214 ++fPoints[72*s1+s2];
215}
216
217void AliTPCcalibAlign::Process12(Double_t *t1,
218 Double_t *t2,
219 TLinearFitter *fitter) {
220 // x2 = a00*x1 + a01*y1 + a02*z1 + a03
221 // y2 = a10*x1 + a11*y1 + a12*z1 + a13
222 // z2 = a20*x1 + a21*y1 + a22*z1 + a23
223 // dydx2 = (a10 + a11*dydx1 + a12*dzdx1)/(a00 + a01*dydx1 + a02*dzdx1)
224 // dzdx2 = (a20 + a21*dydx1 + a22*dzdx1)/(a00 + a01*dydx1 + a02*dzdx1)
225 //
226 // a00 a01 a02 a03 p[0] p[1] p[2] p[9]
227 // a10 a11 a12 a13 ==> p[3] p[4] p[5] p[10]
228 // a20 a21 a22 a23 p[6] p[7] p[8] p[11]
229 Double_t &x1=t1[0], &y1=t1[1], &z1=t1[2], &dydx1=t1[3], &dzdx1=t1[4];
cec17745 230 Double_t /*&x2=t2[0],*/ &y2=t2[1], &z2=t2[2], &dydx2=t2[3], &dzdx2=t2[4];
9318a5b4 231
232 // TODO:
233 Double_t sy = 1.;
234 Double_t sz = 1.;
235 Double_t sdydx = 1.;
236 Double_t sdzdx = 1.;
237
238 Double_t p[12];
239 Double_t value;
240
241 // x2 = a00*x1 + a01*y1 + a02*z1 + a03
242 // y2 = a10*x1 + a11*y1 + a12*z1 + a13
243 // y2' = a10*x1 + a11*y1 + a12*z1 + a13 + (a01*y1 + a02*z1 + a03)*dydx2
244 for (Int_t i=0; i<12;i++) p[i]=0.;
245 p[3+0] = x1; // a10
246 p[3+1] = y1; // a11
247 p[3+2] = z1; // a12
248 p[9+1] = 1.; // a13
249 p[0+1] = y1*dydx2; // a01
250 p[0+2] = z1*dydx2; // a02
251 p[9+0] = dydx2; // a03
252 value = y2;
253 fitter->AddPoint(p,value,sy);
254
255 // x2 = a00*x1 + a01*y1 + a02*z1 + a03
256 // z2 = a20*x1 + a21*y1 + a22*z1 + a23
257 // z2' = a20*x1 + a21*y1 + a22*z1 + a23 + (a01*y1 + a02*z1 + a03)*dzdx2;
258 for (Int_t i=0; i<12;i++) p[i]=0.;
259 p[6+0] = x1; // a20
260 p[6+1] = y1; // a21
261 p[6+2] = z1; // a22
262 p[9+2] = 1.; // a23
263 p[0+1] = y1*dzdx2; // a01
264 p[0+2] = z1*dzdx2; // a02
265 p[9+0] = dzdx2; // a03
266 value = z2;
267 fitter->AddPoint(p,value,sz);
268
269 // dydx2 = (a10 + a11*dydx1 + a12*dzdx1)/( a00 + a01*dydx1 + a02*dzdx1)
270 // (a10 + a11*dydx1 + a12*dzdx1) - (a00 + a01*dydx1 + a02*dzdx1)*dydx2 = 0
271 for (Int_t i=0; i<12;i++) p[i]=0.;
272 p[3+0] = 1.; // a10
273 p[3+1] = dydx1; // a11
274 p[3+2] = dzdx1; // a12
275 p[0+0] = -dydx2; // a00
276 p[0+1] = -dydx1*dydx2; // a01
277 p[0+2] = -dzdx1*dydx2; // a02
278 value = 0.;
279 fitter->AddPoint(p,value,sdydx);
280
281 // dzdx2 = (a20 + a21*dydx1 + a22*dzdx1)/( a00 + a01*dydx1 + a02*dzdx1)
282 // (a20 + a21*dydx1 + a22*dzdx1) - (a00 + a01*dydx1 + a02*dzdx1)*dzdx2 = 0
283 for (Int_t i=0; i<12;i++) p[i]=0.;
284 p[6+0] = 1; // a20
285 p[6+1] = dydx1; // a21
286 p[6+2] = dzdx1; // a22
287 p[0+0] = -dzdx2; // a00
288 p[0+1] = -dydx1*dzdx2; // a01
289 p[0+2] = -dzdx1*dzdx2; // a02
290 value = 0.;
291 fitter->AddPoint(p,value,sdzdx);
292}
293
294void AliTPCcalibAlign::Process9(Double_t *t1,
295 Double_t *t2,
296 TLinearFitter *fitter) {
297 // x2 = a00*x1 + a01*y1 + a02*z1 + a03
298 // y2 = a10*x1 + a11*y1 + a12*z1 + a13
299 // z2 = a20*x1 + a21*y1 + a22*z1 + a23
300 // dydx2 = (a10 + a11*dydx1 + a12*dzdx1)/(a00 + a01*dydx1 + a02*dzdx1)
301 // dzdx2 = (a20 + a21*dydx1 + a22*dzdx1)/(a00 + a01*dydx1 + a02*dzdx1)
302 //
303 // a00 a01 a02 a03 p[0] p[1] p[2] p[9]
304 // a10 a11 a12 a13 ==> p[3] p[4] p[5] p[10]
305 // a20 a21 a22 a23 p[6] p[7] p[8] p[11]
306 Double_t &x1=t1[0], &y1=t1[1], &z1=t1[2], &dydx1=t1[3], &dzdx1=t1[4];
cec17745 307 Double_t /*&x2=t2[0],*/ &y2=t2[1], &z2=t2[2], &dydx2=t2[3], &dzdx2=t2[4];
9318a5b4 308
309 // TODO:
310 Double_t sy = 1.;
311 Double_t sz = 1.;
312 Double_t sdydx = 1.;
313 Double_t sdzdx = 1.;
314
315 Double_t p[12];
316 Double_t value;
317
318 // x2 = a00*x1 + a01*y1 + a02*z1 + a03
319 // y2 = a10*x1 + a11*y1 + a12*z1 + a13
320 // y2' = a10*x1 + a11*y1 + a12*z1 + a13 + (a01*y1 + a03)*dydx2
321 for (Int_t i=0; i<12;i++) p[i]=0.;
322 p[3+0] = x1;
323 p[3+1] = y1;
324 p[3+2] = z1;
325 p[9+1] = 1.;
326 p[0+1] = y1*dydx2;
327 p[0+2] = z1*dydx2;
328 p[9+0] = dydx2;
329 value = y2;
330 fitter->AddPoint(p,value,sy);
331
332 // x2 = a00*x1 + a01*y1 + a02*z1 + a03
333 // z2 = a20*x1 + a21*y1 + a22*z1 + a23
334 // z2' = a20*x1 + a21*y1 + a22*z1 + a23 + (a01*y1 + a03)*dzdx2;
335 for (Int_t i=0; i<12;i++) p[i]=0.;
336 p[6+0] = x1;
337 p[6+1] = y1;
338 p[6+2] = z1;
339 p[9+2] = 1.;
340 p[0+1] = y1*dzdx2;
341 p[0+2] = z1*dzdx2;
342 p[9+0] = dzdx2;
343 value = z2;
344 fitter->AddPoint(p,value,sz);
345
346 // dydx2 = (a10 + a11*dydx1 + a12*dzdx1)/( a00 + a01*dydx1 + a02*dzdx1)
347 // (a10 + a11*dydx1 + a12*dzdx1) - (a00 + a01*dydx1 + a02*dzdx1)*dydx2 = 0
348 for (Int_t i=0; i<12;i++) p[i]=0.;
349 p[3+0] = 1.;
350 p[3+1] = dydx1;
351 p[3+2] = dzdx1;
352 p[0+0] = -dydx2;
353 p[0+1] = -dydx1*dydx2;
354 p[0+2] = -dzdx1*dydx2;
355 value = 0.;
356 fitter->AddPoint(p,value,sdydx);
357
358 // dzdx2 = (a20 + a21*dydx1 + a22*dzdx1)/( a00 + a01*dydx1 + a02*dzdx1)
359 // (a20 + a21*dydx1 + a22*dzdx1) - (a00 + a01*dydx1 + a02*dzdx1)*dzdx2 = 0
360 for (Int_t i=0; i<12;i++) p[i]=0.;
361 p[6+0] = 1;
362 p[6+1] = dydx1;
363 p[6+2] = dzdx1;
364 p[0+0] = -dzdx2;
365 p[0+1] = -dydx1*dzdx2;
366 p[0+2] = -dzdx1*dzdx2;
367 value = 0.;
368 fitter->AddPoint(p,value,sdzdx);
369}
370
371void AliTPCcalibAlign::Process6(Double_t *t1,
372 Double_t *t2,
373 TLinearFitter *fitter) {
374 // x2 = 1 *x1 +-a01*y1 + 0 +a03
375 // y2 = a01*x1 + 1 *y1 + 0 +a13
376 // z2 = a20*x1 + a21*y1 + 1 *z1 +a23
377 // dydx2 = (a10 + a11*dydx1 + a12*dzdx1)/(a00 + a01*dydx1 + a02*dzdx1)
378 // dzdx2 = (a20 + a21*dydx1 + a22*dzdx1)/(a00 + a01*dydx1 + a02*dzdx1)
379 //
380 // 1 -a01 0 a03 x -p[0] x p[3]
381 // a10 1 0 a13 ==> p[0] x x p[4]
382 // a20 a21 1 a23 p[1] p[2] x p[5]
383 Double_t &x1=t1[0], &y1=t1[1], &z1=t1[2], &dydx1=t1[3], &dzdx1=t1[4];
cec17745 384 Double_t /*&x2=t2[0],*/ &y2=t2[1], &z2=t2[2], &dydx2=t2[3], &dzdx2=t2[4];
9318a5b4 385
386 // TODO:
387 Double_t sy = 1.;
388 Double_t sz = 1.;
389 Double_t sdydx = 1.;
390 Double_t sdzdx = 1.;
391
392 Double_t p[12];
393 Double_t value;
394
395 // x2 = 1 *x1 +-a01*y1 + 0 +a03
396 // y2 = a01*x1 + 1 *y1 + 0 +a13
397 // y2' = a10*x1 + a11*y1 + a12*z1 + a13 + (a01*y1 + a02*z1 + a03)*dydx2
398 for (Int_t i=0; i<12;i++) p[i]=0.;
399 p[3+0] = x1;
400 p[3+1] = y1;
401 p[3+2] = z1;
402 p[9+1] = 1.;
403 p[0+1] = y1*dydx2;
404 p[0+2] = z1*dydx2;
405 p[9+0] = dydx2;
406 value = y2;
407 fitter->AddPoint(p,value,sy);
408
409 // x2 = 1 *x1 +-a01*y1 + 0 + a03
410 // z2 = a20*x1 + a21*y1 + 1 *z1 + a23
411 // z2' = a20*x1 + a21*y1 + a22*z1 + a23 + (a01*y1 + a02*z1 +a03)*dzdx2;
412 for (Int_t i=0; i<12;i++) p[i]=0.;
413 p[6+0] = x1;
414 p[6+1] = y1;
415 p[6+2] = z1;
416 p[9+2] = 1.;
417 p[0+1] = y1*dzdx2;
418 p[0+2] = z1*dzdx2;
419 p[9+0] = dzdx2;
420 value = z2;
421 fitter->AddPoint(p,value,sz);
422
423 // dydx2 = (a10 + a11*dydx1 + a12*dzdx1)/( a00 + a01*dydx1 + a02*dzdx1)
424 // (a10 + a11*dydx1 + a12*dzdx1) - (a00 + a01*dydx1 + a02*dzdx1)*dydx2 = 0
425 for (Int_t i=0; i<12;i++) p[i]=0.;
426 p[3+0] = 1.;
427 p[3+1] = dydx1;
428 p[3+2] = dzdx1;
429 p[0+0] = -dydx2;
430 p[0+1] = -dydx1*dydx2;
431 p[0+2] = -dzdx1*dydx2;
432 value = 0.;
433 fitter->AddPoint(p,value,sdydx);
434
435 // dzdx2 = (a20 + a21*dydx1 + a22*dzdx1)/( a00 + a01*dydx1 + a02*dzdx1)
436 // (a20 + a21*dydx1 + a22*dzdx1) - (a00 + a01*dydx1 + a02*dzdx1)*dzdx2 = 0
437 for (Int_t i=0; i<12;i++) p[i]=0.;
438 p[6+0] = 1;
439 p[6+1] = dydx1;
440 p[6+2] = dzdx1;
441 p[0+0] = -dzdx2;
442 p[0+1] = -dydx1*dzdx2;
443 p[0+2] = -dzdx1*dzdx2;
444 value = 0.;
445 fitter->AddPoint(p,value,sdzdx);
446}
447
448void AliTPCcalibAlign::Eval() {
449 TLinearFitter *f;
450 for (Int_t s1=0;s1<72;++s1)
451 for (Int_t s2=0;s2<72;++s2)
452 if ((f=GetFitter12(s1,s2))&&fPoints[72*s1+s2]>12) {
453 // cerr<<s1<<","<<s2<<": "<<fPoints[72*s1+s2]<<endl;
454 if (!f->Eval()) {
455 cerr<<"Evaluation failed for "<<s1<<","<<s2<<endl;
456 }
457 }
458 /*
459
460 fitter->Eval();
461 fitter->Eval();
462 chi212 = align->GetChisquare()/(4.*entries);
463
464 TMatrixD mat(13,13);
465 TVectorD par(13);
466 align->GetParameters(par);
467 align->GetCovarianceMatrix(mat);
468
469 //
470 //
471 for (Int_t i=0; i<12;i++){
472 palign12(i)= par(i+1);
473 for (Int_t j=0; j<12;j++){
474 pcovar12(i,j) = mat(i+1,j+1);
475 pcovar12(i,j) *= chi212;
476 }
477 }
478 //
479 for (Int_t i=0; i<12;i++){
480 psigma12(i) = TMath::Sqrt(pcovar12(i,i));
481 palignR12(i) = palign12(i)/TMath::Sqrt(pcovar12(i,i));
482 for (Int_t j=0; j<12;j++){
483 pcovarN12(i,j) = pcovar12(i,j)/TMath::Sqrt(pcovar12(i,i)*pcovar12(j,j));
484 }
485 }
486 */
487}
488
489Bool_t AliTPCcalibAlign::GetTransformation12(Int_t s1,Int_t s2,TMatrixD &a) {
490 if (!GetFitter12(s1,s2))
491 return false;
492 else {
493 TVectorD p(12);
494 cerr<<"foo"<<endl;
495 GetFitter12(s1,s2)->GetParameters(p);
496 cerr<<"bar"<<endl;
497 a.ResizeTo(4,4);
498 a[0][0]=p[0];
499 a[0][1]=p[1];
500 a[0][2]=p[2];
501 a[0][3]=p[9];
502 a[1][0]=p[3];
503 a[1][1]=p[4];
504 a[1][2]=p[5];
505 a[1][3]=p[10];
506 a[2][0]=p[6];
507 a[2][1]=p[7];
508 a[2][2]=p[8];
509 a[2][3]=p[11];
510 a[3][0]=0.;
511 a[3][1]=0.;
512 a[3][2]=0.;
513 a[3][3]=1.;
514 return true;
515 }
516}
517
518Bool_t AliTPCcalibAlign::GetTransformation9(Int_t s1,Int_t s2,TMatrixD &a) {
519 if (!GetFitter9(s1,s2))
520 return false;
521 else {
522 TVectorD p(9);
523 GetFitter9(s1,s2)->GetParameters(p);
524 a.ResizeTo(4,4);
525 a[0][0]=p[0];
526 a[0][1]=p[1];
527 a[0][2]=p[2];
528 a[0][3]=p[9];
529 a[1][0]=p[3];
530 a[1][1]=p[4];
531 a[1][2]=p[5];
532 a[1][3]=p[10];
533 a[2][0]=p[6];
534 a[2][1]=p[7];
535 a[2][2]=p[8];
536 a[2][3]=p[11];
537 a[3][0]=0.;
538 a[3][1]=0.;
539 a[3][2]=0.;
540 a[3][3]=1.;
541 return true;
542 }
543}
544
545Bool_t AliTPCcalibAlign::GetTransformation6(Int_t s1,Int_t s2,TMatrixD &a) {
546 if (!GetFitter6(s1,s2))
547 return false;
548 else {
549 TVectorD p(6);
550 cerr<<"foo"<<endl;
551 GetFitter6(s1,s2)->GetParameters(p);
552 cerr<<"bar"<<endl;
553 a.ResizeTo(4,4);
554 a[0][0]=p[0];
555 a[0][1]=p[1];
556 a[0][2]=p[2];
557 a[0][3]=p[9];
558 a[1][0]=p[3];
559 a[1][1]=p[4];
560 a[1][2]=p[5];
561 a[1][3]=p[10];
562 a[2][0]=p[6];
563 a[2][1]=p[7];
564 a[2][2]=p[8];
565 a[2][3]=p[11];
566 a[3][0]=0.;
567 a[3][1]=0.;
568 a[3][2]=0.;
569 a[3][3]=1.;
570 return true;
571 }
572}