1 /**************************************************************************
2 * Copyright(c) 2008-2010, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 //////////////////////////////////////////////////////////////////////////
19 // Class to convert survey tables in alignment objects
21 // origin: Marco Van Leeuwen (m.vanleeuwen1@uu.nl)
22 // Panos.Christakoglou (Panos.Christakoglou@cern.ch)
23 // Martin Poghosyan (Martin.Poghosyan@to.infn.it)
24 //////////////////////////////////////////////////////////////////////////
26 #include "Riostream.h"
27 #include "TClonesArray.h"
28 #include "TGeoManager.h"
29 #include "TGeoPhysicalNode.h"
33 #include "AliITSSurveyToAlign.h"
34 #include "AliSurveyPoint.h"
35 #include "AliAlignObjParams.h"
36 #include "AliGeomManager.h"
40 #include "AliCDBManager.h"
42 #include "AliITSgeomTGeo.h"
44 ClassImp(AliITSSurveyToAlign)
46 const Double_t AliITSSurveyToAlign::fgkLocR[6][3]={{ 3.24,0.21905,-2.4},
51 {-3.24,0.21905,-2.4}};
53 const Double_t AliITSSurveyToAlign::fgkLocL[6][3]={{-3.24,0.21905, 2.4},
58 { 3.24,0.21905, 2.4}};
60 const Double_t kRadToDeg = 180./TMath::Pi();
62 //________________________________________________________________________
63 AliITSSurveyToAlign::AliITSSurveyToAlign(Int_t run, Int_t repSDD, Int_t repVerSDD, Int_t repModSSD, Int_t repModVerSSD, Int_t repLaddSSD, Int_t repLaddVerSSD) :
64 AliSurveyToAlignObjs(),
66 fSDDrepNumber(repSDD),
67 fSDDrepVersion(repVerSDD),
68 fSSDModuleRepNumber(repModSSD),
69 fSSDModuleRepVersion(repModVerSSD),
70 fSSDLadderRepNumber(repLaddSSD),
71 fSSDLadderRepVersion(repLaddVerSSD)
74 // default constructor
75 // Arguments are report numbers for survey data.
76 // The defaults point to reports from detector construction
80 //_________________________________________________________________________
81 AliITSSurveyToAlign::AliITSSurveyToAlign(const AliITSSurveyToAlign &align) :
82 AliSurveyToAlignObjs(align),
84 fSDDrepNumber(align.fSDDrepNumber),
85 fSDDrepVersion(align.fSDDrepVersion),
86 fSSDModuleRepNumber(align.fSSDModuleRepNumber),
87 fSSDModuleRepVersion(align.fSSDModuleRepVersion),
88 fSSDLadderRepNumber(align.fSSDLadderRepNumber),
89 fSSDLadderRepVersion(align.fSSDLadderRepVersion)
96 //__________________________________________________________________________
97 AliITSSurveyToAlign & AliITSSurveyToAlign::operator =(const AliITSSurveyToAlign& /* align */) {
99 // assignment operator - dummy
105 //__________________________________________________________________________
106 AliITSSurveyToAlign::~AliITSSurveyToAlign() {
112 //______________________________________________________________________
113 void AliITSSurveyToAlign::Run() {
115 // Runs the full chain
116 // User should call StoreAlignObjToFile or StoreAlignObjToCDB afterwards to
117 // store output (not included here to leave the choice between the two)
120 // Load ideal geometry from the OCDB
121 AliCDBManager *cdb = AliCDBManager::Instance();
122 cdb->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
124 AliGeomManager::LoadGeometry();
126 if(!CreateAlignObjs()) AliError("Construction of alignment objects from survey failed!");
129 //______________________________________________________________________
130 Bool_t AliITSSurveyToAlign::CreateAlignObjs() {
131 // Fill the array of alignment objects with alignment objects
132 // from survey for all three subdetectors
136 CreateAlignObjDummySPD();
139 if(!LoadSurveyFromAlienFile("ITS", fSDDrepNumber, fSDDrepVersion)){
140 AliError("Loading of alignment objects from survey for SDD failed!");
146 if(!LoadSurveyFromAlienFile("ITS", fSSDLadderRepNumber, fSSDLadderRepVersion)){
147 AliError("Loading of alignment objects from survey for SSD ladders failed!");
150 CreateAlignObjSSDLadders();
153 if(!ApplyAlignObjSSDLadders()) return kFALSE; // needed to build correctly the objects for SSD modules
154 if(!LoadSurveyFromAlienFile("ITS", fSSDModuleRepNumber, fSSDModuleRepVersion)){
155 AliError("Loading of alignment objects from survey for SSD modules failed!");
158 CreateAlignObjSSDModules();
163 //______________________________________________________________________
164 void AliITSSurveyToAlign::CreateAlignObjDummySPD(){
166 // Create alignObjs for SPD
167 // For the moment, uses 0,0,0,0,0,0
169 for(Int_t imod = 0; imod < 240; imod++) {
170 Int_t ilayer = (imod < 80) ? AliGeomManager::kSPD1 : AliGeomManager::kSPD2;
171 Int_t imodule = (imod < 80) ? imod : imod - 80;
173 Int_t uid = AliGeomManager::LayerToVolUID(ilayer,imodule);
174 const Char_t *symname = AliGeomManager::SymName(uid);
176 new((*fAlignObjArray)[imod]) AliAlignObjParams(symname, uid, 0., 0., 0., 0., 0., 0., kTRUE);
181 //______________________________________________________________________
182 void AliITSSurveyToAlign::CreateAlignObjSDD(){
184 // Create alignment objects for SDD
188 const char* symname = 0;
189 AliSurveyPoint* pt = 0;
191 Int_t iModuleIndex=240;
197 if (fSurveyPoints == 0 || fSurveyPoints->GetEntries() == 0) {
198 AliWarning("SDD survey data are not available, using zero values");
199 CreateAlignObjDummySDD();
203 for(Int_t imod = 1; imod < fSurveyPoints->GetEntries(); imod++) {
204 pt = (AliSurveyPoint*) fSurveyPoints->At(imod);
207 Int_t iLayer, iLadder, iModule, iPoint;
208 ReadPointNameSDD(pt->GetName(),iLayer, iLadder, iModule, iPoint);
210 if(iModule==iModule0)
212 fSDDmeP[iPoint][0]=pt->GetX();
213 fSDDmeP[iPoint][1]=pt->GetY();
214 fSDDmeP[iPoint][2]=pt->GetZ();
215 fSDDmeP[iPoint][3]=pt->GetPrecisionX();
216 fSDDmeP[iPoint][4]=pt->GetPrecisionY();
217 fSDDmeP[iPoint][5]=pt->GetPrecisionZ();
218 fSDDisMe[iPoint]=kTRUE;
220 if(iLayer==3) uid = AliGeomManager::LayerToVolUID(iLayer0,iModuleIndex-240);
221 if(iLayer==4) uid = AliGeomManager::LayerToVolUID(iLayer0,iModuleIndex-324);
222 symname = AliGeomManager::SymName(uid);
223 GetIdPosSDD(uid,iLayer0, iModule0, iPoint);
226 // cout << "Points red module " << imod << endl;
227 if((iModule!=iModule0)||(imod==(fSurveyPoints->GetEntries()-1)))
229 ConvertToRSofModulesAndRotSDD(iLayer0, iModule0);
238 if(nModules==2) CalcShiftSDD(x0,y0,z0);
239 if(nModules>2) CalcShiftRotSDD(tet, psi, phi, x0, y0, z0);
244 // printf("%s %d %f %f %f %f %f %f\n",symname, uid, x0/10., y0/10., z0/10., psi, tet, phi);
245 // cout << "Allocate alignobjparams " << imod << endl;
246 new((*fAlignObjArray)[iModuleIndex]) AliAlignObjParams(symname, uid, x0/10., y0/10., z0/10., psi, tet, phi, kFALSE);
252 iModuleIndex = AliITSgeomTGeo::GetModuleIndex(iLayer,iLadder+1,iModule+1);
253 for(Int_t i=0; i<6;i++) fSDDisMe[i]=kFALSE;
254 if(imod!=(fSurveyPoints->GetEntries()-1)) imod--;
259 //______________________________________________________________________
260 void AliITSSurveyToAlign::CreateAlignObjDummySDD(){
262 // Create empty alignment objects
263 // Used when fSurveySDD == 0
265 for(Int_t imod = 0; imod < 260; imod++) {
267 Int_t ilayer = (imod < 84) ? AliGeomManager::kSDD1 : AliGeomManager::kSDD2;
268 Int_t imodule = (imod < 84) ? imod : imod - 84;
270 Int_t uid = AliGeomManager::LayerToVolUID(ilayer,imodule);
271 const Char_t *symname = AliGeomManager::SymName(uid);
273 new((*fAlignObjArray)[imod+240]) AliAlignObjParams(symname, uid, 0., 0., 0., 0., 0., 0., kTRUE);
277 //______________________________________________________________________
278 void AliITSSurveyToAlign::CreateAlignObjSSDModules(){
280 // Create alignment objects for SSD modules
281 // Objects for SSD ladders must be applied to geometry first
284 const Float_t kMu2Cm = 1e-4;
285 const Float_t kSensLength = 7.464;
286 const Int_t kSSDMODULES = 1698;
288 if (fSurveyPoints == 0 || fSurveyPoints->GetEntries() == 0) {
289 AliWarning("SSD module survey data not available; using dummy values");
290 CreateAlignObjDummySSDModules();
294 // First do module-by-module
296 for(Int_t imod = 500; imod < kSSDMODULES + 500; imod++) {
297 Int_t iLayer, iLadder, iLaddMod;
298 AliITSgeomTGeo::GetModuleId(imod,iLayer,iLadder,iLaddMod); // returns 1-based numbers
300 TString pname="ITS/SSD";
306 AliSurveyPoint *pt1 = (AliSurveyPoint*) fSurveyPoints->FindObject(pname+"/Point0");
307 AliSurveyPoint *pt2 = (AliSurveyPoint*) fSurveyPoints->FindObject(pname+"/Point1");
309 AliWarning(Form("No Survey points for iladd %d imod %d",iLadder,iLaddMod));
313 sx = 0.5*(pt1->GetX() + pt2->GetX()) * kMu2Cm;
314 sz = 0.5*(pt1->GetZ() + pt2->GetZ()) * kMu2Cm;
316 // Minus sign to change local coordinate convention
317 Float_t theta = -(pt2->GetZ() - pt1->GetZ())*kMu2Cm/kSensLength;
320 Int_t iLayMod = imod - 500;
323 Int_t uid = AliGeomManager::LayerToVolUID(iLayer,iLayMod);
325 const Char_t *symname = AliGeomManager::SymName(uid);
326 if (pname.CompareTo(symname) != 0)
327 AliWarning(Form("Mapping mismatch survey point %s volume name %s",pname.Data(),symname));
329 if (imod >= 676 && imod <= 697) {
330 cout << "ilayer " << iLayer << " imod " << imod
331 << " uid " << uid << " name " << symname
332 << " survey shift " << sx << " " << 0 << " " << sz << endl
333 << " theta " << theta << endl;
336 new((*fAlignObjArray)[imod]) AliAlignObjParams(symname, uid, sx, 0, sz, 0., theta, 0., kFALSE);
340 //______________________________________________________________________
341 Bool_t AliITSSurveyToAlign::ApplyAlignObjSSDLadders(){
343 // Apply alignment objects for SSD ladders to geometry, needed to correctly
344 // build alignment objects for SSD modules
348 for(Int_t jj=0; jj<fAlignObjArray->GetEntriesFast(); jj++)
350 AliAlignObjParams* ap = dynamic_cast<AliAlignObjParams*> (fAlignObjArray->UncheckedAt(jj));
353 TString sName(ap->GetSymName());
354 if(sName.Contains("SSD") && sName.Contains("Ladder"))
356 if(!ap->ApplyToGeometry()) return kFALSE;
361 AliInfo(Form(" %d alignment objects for SSD ladders applied to geometry.",applied));
366 //______________________________________________________________________
367 void AliITSSurveyToAlign::CreateAlignObjSSDLadders(){
369 // Alignment objects from survey for SSD ladders (Torino data)
371 const Float_t kLaddLen5 = 90.27; // Layer 5: distance between mouting points
372 const Float_t kLaddLen6 = 102.0; // Layer 6: distance between mouting points
373 const Float_t zLag = 2.927; // Distance between V mounting point and Zloc = 0
374 // = half ladder length - nom z-position of ladder from gGeoManager
375 const Float_t kMu2Cm = 1e-4;
377 TString ssdName = "ITS/SSD";
379 TObjArray *ladderPoints = fSurveyPoints;
380 if (ladderPoints == 0 || ladderPoints->GetEntries() == 0) {
381 AliWarning("No SSD Ladder alignment points found. Skipping");
384 if (ladderPoints->GetEntries()!= 2*(34+38)) {
385 AliWarning(Form("Unexpected number of survey points %d, should be 144",ladderPoints->GetEntries()));
388 for (Int_t ilayer = 4; ilayer <= 5; ilayer ++) {
389 Int_t nLadder = 34; // layer 5
391 nLadder = 38; // layer 6
393 for (Int_t iLadder = 0; iLadder < nLadder; iLadder++) {
394 TString ladName = ssdName;
396 ladName += "/Ladder";
399 AliSurveyPoint *vPoint = (AliSurveyPoint*) ladderPoints->FindObject(ladName+"/V");
400 AliSurveyPoint *qPoint = (AliSurveyPoint*) ladderPoints->FindObject(ladName+"/Q");
402 AliWarning(Form("Cannot find V side point for ladder %s",ladName.Data()));
406 AliWarning(Form("Cannot find Q side point for ladder %s",ladName.Data()));
411 tmpStr.Insert(0,vPoint->GetName(),3);
412 Int_t ladder = tmpStr.Atoi();
414 tmpStr.Insert(0,qPoint->GetName(),3);
415 if (tmpStr.Atoi() != ladder)
416 AliError(Form("Survey data file error. Expect pairs of V,Q points. Got ladders %d %d",ladder,tmpStr.Atoi()));
418 // Note: file gives meas-nom in local offline coordinates,
419 // ie. local z = - global z and local x = - global x (for ladder 508, i.e. top ladder)
420 Double_t dxLoc = vPoint->GetX() * kMu2Cm;
421 Double_t dyLoc = vPoint->GetY() * kMu2Cm;
422 Double_t dzLoc = vPoint->GetZ() * kMu2Cm;
425 Double_t phi = 0; // Not measured
430 // Note: local psi = -global psi, psi = atan(-(y(z1) - y(z0)) / (z1-z0))
431 // local theta = global theta = atan(dx/dz)
432 // V side is A side is large global z
433 // Q side is C side is large local z
436 theta = TMath::ATan((qPoint->GetX() - vPoint->GetX())*kMu2Cm/kLaddLen6);
437 psi = TMath::ATan((vPoint->GetY() - qPoint->GetY())*kMu2Cm/kLaddLen6);
440 theta = TMath::ATan((qPoint->GetX() - vPoint->GetX())*kMu2Cm/kLaddLen5);
441 psi = TMath::ATan((vPoint->GetY() - qPoint->GetY())*kMu2Cm/kLaddLen5);
444 // Move along ladder to local Z = 0 point
448 // Convert to degrees
451 AliDebug(1,Form("ladname %f %f %f %f %f %f ",dxLoc,dyLoc,dzLoc,psi,theta,phi));
453 new((*fAlignObjArray)[500+1698+iLadd]) AliAlignObjParams(ladName,0,dxLoc,dyLoc,dzLoc,psi,theta,phi,kFALSE);
460 //______________________________________________________________________
461 void AliITSSurveyToAlign::CreateAlignObjDummySSDModules(){
463 // Create empty alignment objects
464 // Used when fSurveySSD == 0
466 for(Int_t imod = 0; imod < 1698; imod++) {
467 Int_t ilayer = (imod < 748) ? AliGeomManager::kSSD1 : AliGeomManager::kSSD2;
468 Int_t imodule = (imod < 748) ? imod : imod - 748;
470 Int_t uid = AliGeomManager::LayerToVolUID(ilayer,imodule);
471 const Char_t *symname = AliGeomManager::SymName(uid);
473 new((*fAlignObjArray)[500+imod]) AliAlignObjParams(symname, uid, 0., 0., 0., 0., 0., 0., kTRUE);
478 //______________________________________________________________________
479 void AliITSSurveyToAlign::GetIdPosSDD(Int_t uid, Int_t layer, Int_t module, Int_t iPoint)
482 // Utility function used by CreateAlignObjSDD
484 TGeoHMatrix gMod = *AliGeomManager::GetMatrix(uid); //global matrix of sensor
485 TGeoPNEntry* pne = gGeoManager->GetAlignableEntryByUID(uid);
486 // TString ladderPath = AliGeomManager::SymName(uid);
487 TString ladderPath(pne->GetTitle());
488 if(ladderPath.EndsWith("/")) ladderPath.Remove(TString::kTrailing,'/');
489 ladderPath.Remove(ladderPath.Last('/'));
490 ladderPath.Remove(ladderPath.Last('/'));
491 gGeoManager->cd(ladderPath.Data());
492 TGeoHMatrix gLad = *gGeoManager->GetCurrentMatrix(); // global matrix of ladder
493 TGeoHMatrix rel = gMod; // to equal relative matrix ladder to sensor.
494 TGeoHMatrix invgLad = gLad.Inverse();
495 rel.MultiplyLeft(&invgLad);
496 TGeoRotation* rr = new TGeoRotation("rr",90,90,0,0,90,180);
497 TGeoCombiTrans* ct = 0;
498 if(layer==3) ct= new TGeoCombiTrans(25.,0.,0.,rr);
499 if(layer==4) ct= new TGeoCombiTrans(25.+7.5,0.,0.,rr);
501 rel.MultiplyLeft(ct);
503 if((layer==3)&&(module<3)) rel.LocalToMaster(fgkLocR[iPoint],fSDDidP[iPoint]);
504 if((layer==3)&&(module>2)) rel.LocalToMaster(fgkLocL[iPoint],fSDDidP[iPoint]);
505 if((layer==4)&&(module<4)) rel.LocalToMaster(fgkLocR[iPoint],fSDDidP[iPoint]);
506 if((layer==4)&&(module>3)) rel.LocalToMaster(fgkLocL[iPoint],fSDDidP[iPoint]);
508 for(Int_t i=0; i<3; i++) fSDDidP[iPoint][i]*=10;
512 //______________________________________________________________________
513 void AliITSSurveyToAlign::ReadPointNameSDD(const char str[], Int_t &iLayer, Int_t &iLader, Int_t &iModul, Int_t &iPoint) const
516 // Utility function used by CreateAlignObjSDD
523 if(str[7]=='2') iLayer=3;
524 if(str[7]=='3') iLayer=4;
526 if(str[15]=='0') iLader=0;
527 if(str[15]=='1') iLader=1;
528 if(str[15]=='2') iLader=2;
529 if(str[15]=='3') iLader=3;
530 if(str[15]=='4') iLader=4;
531 if(str[15]=='5') iLader=5;
532 if(str[15]=='6') iLader=6;
533 if(str[15]=='7') iLader=7;
534 if(str[15]=='8') iLader=8;
535 if(str[15]=='9') iLader=9;
538 if(str[16]=='0') {iLader=10*iLader+0; ord=1;}
539 if(str[16]=='1') {iLader=10*iLader+1; ord=1;}
540 if(str[16]=='2') {iLader=10*iLader+2; ord=1;}
541 if(str[16]=='3') {iLader=10*iLader+3; ord=1;}
542 if(str[16]=='4') {iLader=10*iLader+4; ord=1;}
543 if(str[16]=='5') {iLader=10*iLader+5; ord=1;}
544 if(str[16]=='6') {iLader=10*iLader+6; ord=1;}
545 if(str[16]=='7') {iLader=10*iLader+7; ord=1;}
546 if(str[16]=='8') {iLader=10*iLader+8; ord=1;}
547 if(str[16]=='9') {iLader=10*iLader+9; ord=1;}
549 if(str[23+ord]=='0') iModul=0;
550 if(str[23+ord]=='1') iModul=1;
551 if(str[23+ord]=='2') iModul=2;
552 if(str[23+ord]=='3') iModul=3;
553 if(str[23+ord]=='4') iModul=4;
554 if(str[23+ord]=='5') iModul=5;
555 if(str[23+ord]=='6') iModul=6;
556 if(str[23+ord]=='7') iModul=7;
557 if(str[23+ord]=='8') iModul=8;
558 if(str[23+ord]=='9') iModul=9;
560 if((str[25+ord]=='R')&&(str[26+ord]=='D')) iPoint=0;
561 if((str[25+ord]=='R')&&(str[26+ord]=='C')) iPoint=1;
562 if((str[25+ord]=='R')&&(str[26+ord]=='U')) iPoint=2;
563 if((str[25+ord]=='L')&&(str[26+ord]=='U')) iPoint=3;
564 if((str[25+ord]=='L')&&(str[26+ord]=='C')) iPoint=4;
565 if((str[25+ord]=='L')&&(str[26+ord]=='D')) iPoint=5;
570 //______________________________________________________________________
571 void AliITSSurveyToAlign::ConvertToRSofModulesAndRotSDD(Int_t Layer, Int_t Module)
574 // Utility function used by CreateAlignObjSDD
585 Double_t x0=fSDDidP[1][0];
586 Double_t z0=fSDDidP[1][2]-0.52;
587 for(Int_t i=0; i<6; i++)
591 if(!fSDDisMe[i]) continue;
601 fSDDidP[i][2]=fSDDidP[i][0];
611 fSDDmeP[i][2]=fSDDmeP[i][0];
614 fSDDmeP[i][5]=fSDDmeP[i][3];
619 if(((Layer==3)&&(Module>2))||((Layer==4)&&(Module>3)))
630 //______________________________________________________________________
631 void AliITSSurveyToAlign::CalcShiftSDD(Double_t &x0,Double_t &y0,Double_t &z0) const
633 // Calculates the 3 shifts for the present SDD module
634 // and sets the three reference arguments
636 Double_t xId, yId, zId;
637 Double_t xMe, yMe, zMe, sX2, sY2, sZ2;
638 Double_t aX=0., bX=0.;
639 Double_t aY=0., bY=0.;
640 Double_t aZ=0., bZ=0.;
641 for(Int_t iP1=0; iP1<6; iP1++)
643 if(!fSDDisMe[iP1]) continue;
650 sX2 =fSDDmeP[iP1][3]*fSDDmeP[iP1][3];
651 sY2 =fSDDmeP[iP1][4]*fSDDmeP[iP1][4];
652 sZ2 =fSDDmeP[iP1][5]*fSDDmeP[iP1][5];
670 //______________________________________________________________________
671 void AliITSSurveyToAlign::CalcShiftRotSDD(Double_t &tet,Double_t &psi,Double_t &phi,Double_t &x0,Double_t &y0,Double_t &z0)
673 // Calculates the 3 shifts and 3 euler angles for the present SDD module
674 // and sets the six reference arguments
679 for(Int_t ii=0; ii<6; ii++){
680 for(Int_t jj=0; jj<6; jj++){
686 for(Int_t ii=0; ii<6; ii++)
689 Double_t xId, yId, zId;
690 Double_t xMe, yMe, zMe, sX2, sY2, sZ2;
692 for(Int_t iP1=0; iP1<=6; iP1++)
694 if(!fSDDisMe[iP1]) continue;
696 //ideal x,y,z for fiducial mark iP1
697 xId= fSDDidP[iP1][0];
698 yId= fSDDidP[iP1][1];
699 zId= fSDDidP[iP1][2];
701 //measured x,y,z for fiducial mark iP1
702 xMe= fSDDmeP[iP1][0];
703 yMe= fSDDmeP[iP1][1];
704 zMe= fSDDmeP[iP1][2];
706 //squared precisions of measured x,y,z for fiducial mark iP1
707 sX2 = fSDDmeP[iP1][3]* fSDDmeP[iP1][3];
708 sY2 = fSDDmeP[iP1][4]* fSDDmeP[iP1][4];
709 sZ2 = fSDDmeP[iP1][5]* fSDDmeP[iP1][5];
711 a[0][0]+=(zId*zId/sX2+xId*xId/sZ2);
712 a[0][1]-=(zId*yId/sX2);
713 a[0][2]-=(xId*yId/sZ2);
717 c[0]+=(xId*(zMe-zId)/sZ2-zId*(xMe-xId)/sX2);
719 a[1][0]-=(yId*zId/sX2);
720 a[1][1]+=(xId*xId/sY2+yId*yId/sX2);
721 a[1][2]-=(xId*zId/sY2);
725 c[1]+=(yId*(xMe-xId)/sX2-xId*(yMe-yId)/sY2);
727 a[2][0]-=(yId*xId/sZ2);
728 a[2][1]-=(xId*zId/sY2);
729 a[2][2]+=(zId*zId/sY2+yId*yId/sZ2);
733 c[2]+=(zId*(yMe-yId)/sY2-yId*(zMe-zId)/sZ2);
741 c[3]+=((xMe-xId)/sX2);
749 c[4]+=((yMe-yId)/sY2);
757 c[5]+=((zMe-zId)/sZ2);
760 ///////////////////////////////////////////////////////////////
762 pC.SetMatrixArray(&(a[0][0]));
770 for(Int_t raw=0; raw<6; raw++)
772 for(Int_t raw=0; raw<6; raw++)
774 for(Int_t raw=0; raw<6; raw++)
776 for(Int_t raw=0; raw<6; raw++)
778 for(Int_t raw=0; raw<6; raw++)
780 for(Int_t raw=0; raw<6; raw++)
783 // cout << "calculating determinants" << endl;
784 Double_t det0=pC.Determinant();
785 Double_t x1 = p1.Determinant()/det0;
786 Double_t x2 = p2.Determinant()/det0;
787 Double_t x3 = p3.Determinant()/det0;
788 Double_t x4 = p4.Determinant()/det0;
789 Double_t x5 = p5.Determinant()/det0;
790 Double_t x6 = p6.Determinant()/det0;
791 //cout << "calculating determinants done" << endl;
793 AliInfo("p1 singular ");
797 AliInfo("p2 singular ");
801 AliInfo("p3 singular ");
805 AliInfo("p4 singular ");
809 AliInfo("p5 singular ");
813 AliInfo("p6 singular ");