TVector3 v[28]; Int_t nCh; TGeoHMatrix GetResSurvAlign(Int_t survNch); void SurveyToAlignHmpid(){ AliSurveyObj *so = new AliSurveyObj(); Int_t size = so->GetEntries(); printf("-> %d\n", size); so->FillFromLocalFile("Survey_781282_HMPID.txt"); size = so->GetEntries(); printf("--> %d\n", size); TObjArray *points = so->GetData(); // TVector3 v[28]; for (Int_t i = 0; i < points->GetEntries(); ++i) { AliSurveyPoint *p=(AliSurveyPoint *) points->At(i); v[i].SetXYZ(p->GetX()*100.,p->GetY()*100.,p->GetZ()*100.); } // // To produce the alignment object for the given volume you would // // then do something like this: // // Calculate the global delta transformation as ng * g3-1 // TGeoHMatrix gdelta = g3->Inverse(); //now equal to the inverse of g3 // gdelta.MultiplyLeft(&ng); // Int_t index = 0; // // if the volume is in the look-up table use something like this instead: // // AliGeomManager::LayerToVolUID(AliGeomManager::kTOF,i); // AliAlignObjMatrix* mobj = new AliAlignObjMatrix("symname",index,gdelta,kTRUE); TGeoHMatrix mtx = GetResSurvAlign(5); TGeoManager::Import("/home/mserio/tstesdtrk/geometry.root"); gGeoManager->cd(Form("ALIC_1/Hmp_%1i",nCh)); TGeoHMatrix g0 = *gGeoManager->GetCurrentMatrix(); cout<<"\n\n*********Ideal Matrix (chamber "<Print(); cout<<""<4) { // first vector on the plane of the fiducial marks for(Int_t i=0;i<3;i++){ ab[i] = ngB[i] - ngA[i]; } // second vector on the plane of the fiducial marks for(Int_t i=0;i<3;i++){ bc[i] = ngC[i] - ngB[i]; } } else{ // first vector on the plane of the fiducial marks for(Int_t i=0;i<3;i++){ ab[i] = ngB[i] - ngA[i]; } // second vector on the plane of the fiducial marks for(Int_t i=0;i<3;i++){ bc[i] = ngD[i] - ngB[i]; } } // vector normal to the plane of the fiducial marks obtained // as cross product of the two vectors on the plane d0^d1 n[0] = ab[1] * bc[2] - ab[2] * bc[1]; n[1] = ab[2] * bc[0] - ab[0] * bc[2]; n[2] = ab[0] * bc[1] - ab[1] * bc[0]; Double_t sizen = TMath::Sqrt( n[0]*n[0] + n[1]*n[1] + n[2]*n[2] ); if(sizen>1.e-8){ s = Double_t(1.)/sizen ; //normalization factor }else{ return 0; } // plane expressed in the hessian normal form, see: // http://mathworld.wolfram.com/HessianNormalForm.html // the first three are the coordinates of the orthonormal vector // the fourth coordinate is equal to the distance from the origin for(i=0;i<3;i++){ plane[i] = n[i] * s; } plane[3] = -( plane[0] * ngA[0] + plane[1] * ngA[1] + plane[2] * ngA[2] ); cout<<"normal to plane and distance from IP: "<4){ for(i=0;i<3;i++){ md[i] = (ngA[i] + ngC[i]) * 0.5;//modified!!!!!!!!! } } else { for(i=0;i<3;i++){ md[i] = (ngA[i] + ngD[i]) * 0.5;//modified!!!!!!!!! } } cout<1.e-8){ for(i=0;i<3;i++){ ab[i] /= sx; } cout<1.e-8){ for(i=0;i<3;i++){ bc[i] /= sy; } cout<