31 #include "TGeoMatrix.h"
37 #include "TGraph2DErrors.h"
41 #include "AliSurveyPoint.h"
46 void SurveyFcn(
int &npar,
double *g,
double &
f,
double *par,
int iflag);
60 , fOwnerLocalTrf(kFALSE)
61 , fOwnerAlignTrf(
kTRUE)
62 , fOwnerBaseTrf(kFALSE)
76 fSTargets->SetOwner(kFALSE);
78 fGBTargets->SetOwner(kFALSE);
80 fLBTargets->SetOwner(kFALSE);
82 fAlignTrf =
new TGeoCombiTrans();
84 fFitter =
new TFitter(100);
158 AliError(Form(
"Survey points array is empty %p!",pArray));
161 if (stBaseName.IsNull()) {
162 AliError(Form(
"Need base name for sticker targets %s!",stBaseName.Data()));
167 AliSurveyPoint *pointSST = 0x0;
171 for (
int iPoint=0; iPoint<lTargetMax; iPoint++) {
172 TString stFullName(stBaseName);
173 stNumber = Form(
"%d",iPoint+1);
174 if(lTargetMax>9&&iPoint+1<10) {
177 stFullName+=stNumber;
179 pointSST = (AliSurveyPoint *)pArray->FindObject(stFullName.Data());
183 AliInfo(Form(
"Added survey sticker target %s at index %d",pointSST->GetName(),stIndex));
188 AliInfo(Form(
"Found %d sticker targets with base name %s",
fSTargets->GetEntries(),stBaseName.Data()));
194 printf(
"%s \n",btBaseName.Data());
196 AliError(Form(
"Survey points array is empty %p!",pArray));
199 if (btBaseName.IsNull()) {
200 AliError(Form(
"Need base name for button targets %s!",btBaseName.Data()));
205 AliSurveyPoint *pointSBT = 0x0;
209 for (
int iPoint=0; iPoint<lTargetMax; iPoint++) {
210 TString btFullName(btBaseName);
211 btNumber = Form(
"%d",iPoint+1);
212 if(lTargetMax>9&&iPoint+1<10) {
215 btFullName+=btNumber;
216 printf(
"%s \n",btFullName.Data());
217 pointSBT = (AliSurveyPoint *)pArray->FindObject(btFullName.Data());
221 AliInfo(Form(
"Added survey button target %s at index %d",pointSBT->GetName(),btIndex));
226 AliInfo(Form(
"Found %d button targets with base name %s",
fGBTargets->GetEntries(),btBaseName.Data()));
232 printf(
"%s \n",btBaseName.Data());
234 AliError(Form(
"Local points array is empty %p!",pArray));
237 if (btBaseName.IsNull()) {
238 AliError(Form(
"Need base name for button targets %s!",btBaseName.Data()));
243 AliSurveyPoint *pointSBT = 0x0;
247 for (
int iPoint=0; iPoint<lTargetMax; iPoint++) {
248 TString btFullName(btBaseName);
249 btNumber = Form(
"%d",iPoint+1);
250 if(lTargetMax>9&&iPoint+1<10) {
253 btFullName+=btNumber;
254 printf(
"%s \n",btFullName.Data());
255 pointSBT = (AliSurveyPoint *)pArray->FindObject(btFullName.Data());
259 AliInfo(Form(
"Added local button target %s at index %d",pointSBT->GetName(),btIndex));
264 AliInfo(Form(
"Found %d local button targets with base name %s",
fLBTargets->GetEntries(),btBaseName.Data()));
275 if (stIndex<0||stIndex>=
fSTargets->GetEntriesFast()) {
276 AliError(Form(
"No sticker target at index %d",stIndex));
280 return (AliSurveyPoint*)
fSTargets->At(stIndex);
291 if (btIndex<0||btIndex>=
fGBTargets->GetEntriesFast()) {
292 AliError(Form(
"No surveyed button target at index %d",btIndex));
296 return (AliSurveyPoint*)
fGBTargets->At(btIndex);
307 if (btIndex<0||btIndex>=
fLBTargets->GetEntriesFast()) {
308 AliError(Form(
"No surveyed button target at index %d",btIndex));
312 if(
fLBTargets->At(btIndex)->IsA()==TVector3::Class()){
313 TVector3 *lBT = (TVector3*)
fLBTargets->At(btIndex);
315 return (
new AliSurveyPoint(TString(
"local"),(
float)lBT->X(),(float)lBT->Y(),(float)lBT->Z(),(float)0.,(
float)0.,(float)0.,
'B',
kTRUE));
316 }
else if(
fLBTargets->At(btIndex)->IsA()==AliSurveyPoint::Class()) {
317 AliSurveyPoint *lBT = (AliSurveyPoint*)
fLBTargets->At(btIndex);
320 AliError(Form(
"Unexpected class %s ! Valid classes are TVector3 or AliSurveyPoint",
fLBTargets->At(btIndex)->ClassName()));
338 AliError(
"Must use SetPlane before SetPlaneParameters!!!");
341 fPlane->SetParameter(0,p0);
342 fPlane->SetParameter(1,p1);
343 fPlane->SetParameter(2,p2);
349 TGraph2DErrors *gST =
new TGraph2DErrors(3);
350 AliSurveyPoint *pST = 0x0;
354 gST->SetPoint(iPoint,pST->GetX(),pST->GetY(),pST->GetZ());
355 gST->SetPointError(iPoint,pST->GetPrecisionX(),pST->GetPrecisionY(),pST->GetPrecisionZ());
357 gST->DrawClone(
"P0");
365 AliError(
"Must use SetPlane before FitPlane!!!");
369 AliError(
"Not enough sticker targets (%d) for plane fitting!!!");
373 Double_t pl[3] = {0};
374 Double_t pg[3] = {0};
376 TGraph2DErrors *gST =
new TGraph2DErrors(3);
377 AliSurveyPoint *pST = 0x0;
385 gST->SetPoint(iPoint,pl[0],pl[1],pl[2]);
386 printf(
"%d %f %f %f\n",iPoint,pl[0],pl[1],pl[2]);
387 gST->SetPointError(iPoint,pST->GetPrecisionX(),pST->GetPrecisionY(),pST->GetPrecisionZ());
393 return fPlane->GetChisquare();
398 TGeoTranslation transTemp;
399 TGeoRotation rotTemp;
400 TGeoCombiTrans trfTemp;
404 trfTemp.SetTranslation(transTemp);
405 trfTemp.SetRotation(rotTemp);
407 trfTemp.RotateZ(TMath::RadToDeg()*par[5]);
408 trfTemp.RotateY(TMath::RadToDeg()*par[4]);
409 trfTemp.RotateX(TMath::RadToDeg()*par[3]);
410 trfTemp.SetTranslation(par[0],par[1],par[2]);
412 TGeoHMatrix matGlo = (*fBaseTrf)*trfTemp;
413 TGeoCombiTrans trfGlo(matGlo);
415 Double_t pl[3] = {0};
416 Double_t pg[3] = {0};
418 for(Int_t iPoint=0; iPoint<
fGBTargets->GetEntries(); iPoint++){
419 AliSurveyPoint *gBT = (AliSurveyPoint*)
fGBTargets->At(iPoint);
420 if(
fLBTargets->At(iPoint)->IsA()==TVector3::Class()){
421 TVector3 *lBT = (TVector3*)
fLBTargets->At(iPoint);
425 }
else if(
fLBTargets->At(iPoint)->IsA()==AliSurveyPoint::Class()) {
426 AliSurveyPoint *lBT = (AliSurveyPoint*)
fLBTargets->At(iPoint);
431 AliError(Form(
"Unexpected class %s ! Valid classes are TVector3 or AliSurveyPoint",
fLBTargets->At(iPoint)->ClassName()));
435 trfGlo.LocalToMaster(pl, pg);
437 if(
fLBTargets->At(iPoint)->IsA()==TVector3::Class()){
438 lChi2 += (pg[0]-gBT->GetX())*(pg[0]-gBT->GetX())/(gBT->GetPrecisionX()*gBT->GetPrecisionX());
439 lChi2 += (pg[1]-gBT->GetY())*(pg[1]-gBT->GetY())/(gBT->GetPrecisionY()*gBT->GetPrecisionY());
440 lChi2 += (pg[2]-gBT->GetZ())*(pg[2]-gBT->GetZ())/(gBT->GetPrecisionZ()*gBT->GetPrecisionZ());
441 }
else if(
fLBTargets->At(iPoint)->IsA()==AliSurveyPoint::Class()) {
442 AliSurveyPoint *lBT = (AliSurveyPoint*)
fLBTargets->At(iPoint);
443 lChi2 += (pg[0]-gBT->GetX())*(pg[0]-gBT->GetX())/(gBT->GetPrecisionX()*gBT->GetPrecisionX()+lBT->GetPrecisionX()*lBT->GetPrecisionX());
444 lChi2 += (pg[1]-gBT->GetY())*(pg[1]-gBT->GetY())/(gBT->GetPrecisionY()*gBT->GetPrecisionY()+lBT->GetPrecisionY()*lBT->GetPrecisionY());
445 lChi2 += (pg[2]-gBT->GetZ())*(pg[2]-gBT->GetZ())/(gBT->GetPrecisionZ()*gBT->GetPrecisionZ()+lBT->GetPrecisionZ()*lBT->GetPrecisionZ());
447 AliError(Form(
"Unexpected class %s ! Valid classes are TVector3 or AliSurveyPoint",
fLBTargets->At(iPoint)->ClassName()));
456 void SurveyFcn(
int &npar,
double *g,
double &
f,
double *par,
int iflag) {
476 AliError(Form(
"Different number of button targets: %d survey points and %d local coord!",
482 gMinuit->SetObjectFit(
this);
484 fitter.SetParameter(0,
"dx",0,0.1,-20,20);
485 fitter.SetParameter(1,
"dy",0,0.1,-20,20);
486 fitter.SetParameter(2,
"dz",0,0.1,0,0);
487 fitter.SetParameter(3,
"rx",psi,0.0001,-0.05,0.05);
488 fitter.SetParameter(4,
"ry",tht,0.0001,-0.05,0.05);
491 fitter.SetParameter(5,
"rz",0,0.0001,0,0);
493 if(psi) fitter.FixParameter(3);
494 if(tht) fitter.FixParameter(4);
498 fitter.ExecuteCommand(
"SET PRINT", arglist, 1);
499 fitter.ExecuteCommand(
"SET ERR", arglist, 1);
503 fitter.ExecuteCommand(
"MIGRAD", arglist, 1);
504 fitter.ExecuteCommand(
"IMPROVE", arglist, 1);
508 for (
int j=0; j<3; j++)
printf(
"%10.3f ",fitter.GetParameter(j));
509 for (
int j=3; j<6; j++)
printf(
"%10.3f ",1000*fitter.GetParameter(j));
511 for (
int j=0; j<3; j++)
printf(
"%10.3f ",fitter.GetParError(j));
512 for (
int j=3; j<6; j++)
printf(
"%10.3f ",1000*fitter.GetParError(j));
516 quadTransf.RotateZ(TMath::RadToDeg()*fitter.GetParameter(5));
517 quadTransf.RotateY(TMath::RadToDeg()*fitter.GetParameter(4));
518 quadTransf.RotateX(TMath::RadToDeg()*fitter.GetParameter(3));
519 quadTransf.SetTranslation(fitter.GetParameter(0),fitter.GetParameter(1),fitter.GetParameter(2));
521 for(Int_t iPar=0; iPar<6; iPar++){
522 parErr[iPar] = fitter.GetParError(iPar);
524 if(epsi) parErr[3] = epsi;
525 if(etht) parErr[4] = etht;
535 AliError(Form(
"Different number of button targets: %d survey points and %d local coord!",
541 gMinuit->SetObjectFit(
this);
543 fFitter->SetParameter(0,
"dx",0,0.1,-20,20);
544 fFitter->SetParameter(1,
"dy",0,0.1,-20,20);
545 fFitter->SetParameter(2,
"dz",0,0.1,0,0);
547 fFitter->SetParameter(3,
"rx",psi,epsi,psi-5*epsi,psi+5*epsi);
549 fFitter->SetParameter(3,
"rx",psi,0.0001,-0.05,0.05);
551 fFitter->SetParameter(4,
"ry",tht,etht,tht-5*etht,tht+5*etht);
553 fFitter->SetParameter(4,
"ry",tht,0.0001,-0.05,0.05);
556 fFitter->SetParameter(5,
"rz",0,0.0001,0,0);
558 if(psi)
fFitter->FixParameter(3);
559 if(tht)
fFitter->FixParameter(4);
563 fFitter->ExecuteCommand(
"SET PRINT", arglist, 1);
564 fFitter->ExecuteCommand(
"SET ERR", arglist, 1);
568 fFitter->ExecuteCommand(
"MIGRAD", arglist, 1);
569 fFitter->ExecuteCommand(
"IMPROVE", arglist, 1);
573 for (
int j=0; j<3; j++)
printf(
"%10.3f ",
fFitter->GetParameter(j));
574 for (
int j=3; j<6; j++)
printf(
"%10.3f ",1000*
fFitter->GetParameter(j));
576 for (
int j=0; j<3; j++)
printf(
"%10.3f ",
fFitter->GetParError(j));
577 for (
int j=3; j<6; j++)
printf(
"%10.3f ",1000*
fFitter->GetParError(j));
586 if(epsi)
fFitter->ReleaseParameter(3);
587 if(etht)
fFitter->ReleaseParameter(4);
590 AliSurveyPoint *pointGBT;
591 AliSurveyPoint *pointLBT;
592 Double_t pl[3] = {0};
593 Double_t pg[3] = {0};
597 pl[0] = pointLBT->GetX();
598 pl[1] = pointLBT->GetY();
599 pl[2] = pointLBT->GetZ();
600 lGlobalTrf.LocalToMaster(pl,pg);
601 printf(
"Point %d local: %.3f %.3f %.3f\n",iPoint,pl[0],pl[1],pl[2]);
602 printf(
"Point %d global: %.3f %.3f %.3f\n",iPoint,pg[0],pg[1],pg[2]);
603 printf(
"Point %d survey: %.3f %.3f %.3f\n",iPoint,pointGBT->GetX(),pointGBT->GetY(),pointGBT->GetZ());
613 AliError(
"No function given!!!");
620 AliError(
"Missing global button target!!!");
625 Double_t pl1[3] = {0};
626 Double_t pl2[3] = {0};
627 Double_t pg1[3] = {0};
628 Double_t pg2[3] = {0};
630 pg1[0] = gP1->GetX();
631 pg1[1] = gP1->GetY();
632 pg1[2] = gP1->GetZ();
633 pg2[0] = gP2->GetX();
634 pg2[1] = gP2->GetY();
635 pg2[2] = gP2->GetZ();
644 lVal = lFunction->Eval(pl1[0],pl2[0]);
651 lVal = lFunction->Eval(pl1[1],pl2[1]);
658 lVal = lFunction->Eval(pl1[2],pl2[2]);
665 AliError(Form(
"Coordinate %s is not valid, options are X Y Z",lCoord));
685 for(Int_t iVal=0; iVal<nPoints*(3+1)+1; iVal++){
689 Double_t pl[3] = {0};
690 Double_t pg[3] = {0};
691 Double_t pml[3] = {0};
692 Double_t pmg[3] = {0};
693 AliSurveyPoint *gBT = 0x0;
694 for(Int_t iPoint=0; iPoint<nPoints; iPoint++){
697 AliError(Form(
"The local or global target %d is missing!",iPoint));
698 lDiff[nPoints*(3+1)] = 1.e7;
699 return lDiff[nPoints*(3+1)];
701 if(
fLBTargets->At(iPoint)->IsA()==TVector3::Class()){
702 TVector3 *lBT = (TVector3*)
fLBTargets->At(iPoint);
706 }
else if(
fLBTargets->At(iPoint)->IsA()==AliSurveyPoint::Class()) {
707 AliSurveyPoint *lBT = (AliSurveyPoint*)
fLBTargets->At(iPoint);
712 AliError(Form(
"Unexpected class %s ! Valid classes are TVector3 or AliSurveyPoint",
fLBTargets->At(iPoint)->ClassName()));
716 lTransf.LocalToMaster(pl,pg);
717 pmg[0] = gBT->GetX();
718 pmg[1] = gBT->GetY();
719 pmg[2] = gBT->GetZ();
725 lDiff[iPoint*(3+1)+0] = (pml[0]-pg[0]);
726 lDiff[iPoint*(3+1)+1] = (pml[1]-pg[1]);
727 lDiff[iPoint*(3+1)+2] = (pml[2]-pg[2]);
729 lDiff[iPoint*(3+1)+3] = TMath::Sqrt(lDiff[iPoint*(3+1)+0]*lDiff[iPoint*(3+1)+0]+
730 lDiff[iPoint*(3+1)+1]*lDiff[iPoint*(3+1)+1]+
731 lDiff[iPoint*(3+1)+2]*lDiff[iPoint*(3+1)+2]);
733 lDiff[nPoints*(3+1)] += lDiff[iPoint*(3+1)+3]*lDiff[iPoint*(3+1)+3];
736 lDiff[nPoints*(3+1)] = TMath::Sqrt(lDiff[nPoints*(3+1)]);
737 return lDiff[nPoints*(3+1)];
742 Double_t lPsi = lPTP[0];
743 Double_t lTht = lPTP[1];
745 Double_t pl1[3] = {0};
746 Double_t pl2[3] = {0};
749 AliError(Form(
"Local target %d or %d is missing!",iP1,iP2));
753 if(
fLBTargets->At(iP1)->IsA()==TVector3::Class()){
754 TVector3 *lBT1 = (TVector3*)
fLBTargets->At(iP1);
758 }
else if(
fLBTargets->At(iP1)->IsA()==AliSurveyPoint::Class()) {
759 AliSurveyPoint *lBT1 = (AliSurveyPoint*)
fLBTargets->At(iP1);
764 AliError(Form(
"Unexpected class %s ! Valid classes are TVector3 or AliSurveyPoint",
fLBTargets->At(iP1)->ClassName()));
767 if(
fLBTargets->At(iP2)->IsA()==TVector3::Class()){
768 TVector3 *lBT2 = (TVector3*)
fLBTargets->At(iP2);
772 }
else if(
fLBTargets->At(iP2)->IsA()==AliSurveyPoint::Class()) {
773 AliSurveyPoint *lBT2 = (AliSurveyPoint*)
fLBTargets->At(iP2);
778 AliError(Form(
"Unexpected class %s ! Valid classes are TVector3 or AliSurveyPoint",
fLBTargets->At(iP2)->ClassName()));
786 const char *fxcName =
"fXcn00";
787 TF2 **fXc =
new TF2*[2];
794 const char *fycName =
"fYcn00";
795 TF2 **fYc =
new TF2*[2];
802 const char *fzcName =
"fZcn00";
803 TF2 **fZc =
new TF2*[2];
810 const char *fphixName =
"fPhiXnn00";
811 TF2 ***fPhiX =
new TF2**[2];
812 for (Int_t iX =0; iX<2; iX++) {
813 fPhiX[iX] =
new TF2*[2];
815 fphixName =
"fPhiXnn";
817 fphixName =
"fPhiXnp";
819 fphixName =
"fPhiXpn";
821 fphixName =
"fPhiXpp";
825 const char *fphiyName =
"fPhiYnn00";
826 TF2 ***fPhiY =
new TF2**[2];
827 for (Int_t iY =0; iY<2; iY++) {
828 fPhiY[iY] =
new TF2*[2];
830 fphiyName =
"fPhiYnn";
832 fphiyName =
"fPhiYnp";
834 fphiyName =
"fPhiYpn";
836 fphiyName =
"fPhiYpp";
841 for(Int_t iS=0; iS<2; iS++){
842 fXc[iS]->SetParameters(pl1[0],pl1[1],pl1[2],pl2[0],pl2[1],pl2[2],lTht);
843 fYc[iS]->SetParameters(pl1[0],pl1[1],pl1[2],pl2[0],pl2[1],pl2[2],lPsi,lTht);
844 fZc[iS]->SetParameters(pl1[0],pl1[1],pl1[2],pl2[0],pl2[1],pl2[2],lPsi,lTht);
848 for(Int_t jS=0; jS<2; jS++){
849 fPhiX[iS][jS]->SetParameters(pl1[0],pl1[1],pl1[2],pl2[0],pl2[1],pl2[2],lTht);
850 fPhiY[iS][jS]->SetParameters(pl1[0],pl1[1],pl1[2],pl2[0],pl2[1],pl2[2],lPsi,lTht);
856 Double_t lCenTemp[3];
857 Double_t lRotTemp[3];
859 TGeoCombiTrans trfTemp;
863 TArrayD lDiffTemp(nPoints*(3+1)+1);
864 TArrayD lDiffMin(nPoints*(3+1)+1);
866 for(Int_t i=0; i<nPoints*(3+1)+1; i++){
867 lDiffMin[i]=1000000.;
876 for(Int_t iX=0; iX<2; iX++){
877 for(Int_t iY=0; iY<2; iY++){
878 for(Int_t iZ=0; iZ<2; iZ++){
883 for(Int_t iP=0; iP<2; iP++){
887 trfTemp.RotateZ(TMath::RadToDeg()*lRotTemp[2]);
888 trfTemp.RotateY(TMath::RadToDeg()*lRotTemp[1]);
889 trfTemp.RotateX(TMath::RadToDeg()*lRotTemp[0]);
890 trfTemp.SetTranslation(lCenTemp);
894 for(Int_t i=0; i<nPoints*(3+1)+1; i++){
895 printf(
" %f",lDiffTemp[i]);
898 printf(
" : mycenX%dY%dZ%d(%f,%f,%f); rotx%d(%f,%f,%f)\n",iX,iY,iZ,lCenTemp[0],lCenTemp[1],lCenTemp[2],iP,lRotTemp[0],lRotTemp[1],lRotTemp[2]);
899 printf(
"Transformation improved ...\n");
900 for (
int i=0; i<3; i++) {
901 lXYZ[i] = lCenTemp[i];
903 lPTP[2] = lRotTemp[2];
904 for(Int_t i=0; i<nPoints*(3+1)+1; i++){
905 lDiffMin[i]=lDiffTemp[i];
909 for(Int_t iP=0; iP<2; iP++){
913 trfTemp.RotateZ(TMath::RadToDeg()*lRotTemp[2]);
914 trfTemp.RotateY(TMath::RadToDeg()*lRotTemp[1]);
915 trfTemp.RotateX(TMath::RadToDeg()*lRotTemp[0]);
916 trfTemp.SetTranslation(lCenTemp);
920 for(Int_t i=0; i<nPoints*(3+1)+1; i++){
921 printf(
" %f",lDiffTemp[i]);
924 printf(
" : mycenX%dY%dZ%d(%f,%f,%f); roty%d(%f,%f,%f)\n",iX,iY,iZ,lCenTemp[0],lCenTemp[1],lCenTemp[2],iP,lRotTemp[0],lRotTemp[1],lRotTemp[2]);
925 printf(
"Transformation improved ...\n");
926 for (
int i=0; i<3; i++) {
927 lXYZ[i] = lCenTemp[i];
929 lPTP[2] = lRotTemp[2];
930 for(Int_t i=0; i<nPoints*(3+1)+1; i++){
931 lDiffMin[i]=lDiffTemp[i];
939 for (Int_t i=0; i<2; i++) {
943 for (Int_t j=0; j<2; j++) {
956 if (lDiffMin[nPoints*(3+1)]>20)
return 0;
971 for(Int_t iP1=0; iP1<nPoints; iP1++){
972 for(Int_t iP2=iP1+1; iP2<nPoints; iP2++){
973 printf(
"%d and %d\n",iP1,iP2);
996 Double_t lRotTemp[3];
998 printf(
"(%.3f %.3f %.3f), (%.6f %.6f %.6f)\n",
fLocalTrf->GetTranslation()[0],
fLocalTrf->GetTranslation()[1],
fLocalTrf->GetTranslation()[2],lRotTemp[0],lRotTemp[1],lRotTemp[2]);
1003 Double_t lRotTemp[3];
1005 printf(
"(%.3f %.3f %.3f), (%.6f %.6f %.6f)\n",
fAlignTrf->GetTranslation()[0],
fAlignTrf->GetTranslation()[1],
fAlignTrf->GetTranslation()[2],lRotTemp[0],lRotTemp[1],lRotTemp[2]);
1010 if(baseNameC.IsNull()||!hSTc){
1011 AliError(
"Need base name for points on side C and/or a histogram for them!");
1014 AliSurveyPoint *pointST = 0x0;
1017 if (!pointST)
continue;
1018 if (pointST->GetPointName().Contains(baseNameC)){
1019 hSTc->Fill(pointST->GetX(),pointST->GetY(),-pointST->GetZ());
1020 }
else if ((!baseNameA.IsNull()) &&
1021 (pointST->GetPointName().Contains(baseNameA))) {
1023 AliError(
"Base name for points on side A provided but no histogram for them!");
1026 hSTa->Fill(pointST->GetX(),pointST->GetY(),-pointST->GetZ());
1034 AliError(
"There is no fitter for this object! X resolution will be 0.");
1037 return fFitter->GetParError(0);
1043 AliError(
"There is no fitter for this object! Y resolution will be 0.");
1046 return fFitter->GetParError(1);
1051 return new AliSurveyPoint(stPoint->GetPointName(),
1052 lFactor*stPoint->GetX(),lFactor*stPoint->GetY(),lFactor*stPoint->GetZ(),
1053 lFactor*stPoint->GetPrecisionX(),lFactor*stPoint->GetPrecisionY(),lFactor*stPoint->GetPrecisionZ(),
1054 stPoint->GetType(), stPoint->GetTarget());
printf("Chi2/npoints = %f\n", TMath::Sqrt(chi2/npoints))
Double_t fYMin
yMin for functions fitting
virtual void PrintAlignTrf()
virtual Int_t AddGButtonTargets(TObjArray *pArray, TString btBaseName, Int_t lTargetMax=9)
Double_t PhiXnp(const Double_t *x, const Double_t *par) const
Double_t SurveyChi2(Double_t *par)
void AddLButtonTarget(AliSurveyPoint *btPoint)
Double_t PhiYnn(const Double_t *x, const Double_t *par) const
Bool_t fUseCM
Use centimeters, survey units are mm but aliroot uses cm.
Double_t fZMax
zMax for functions fitting
void FillSTHistograms(TString baseNameC, TH2 *hSTc, TString baseNameA="", TH2 *hSTa=0)
TGeoCombiTrans * fAlignTrf
Local alignment transformation.
Double_t PhiYnp(const Double_t *x, const Double_t *par) const
Double_t CalculateGlobalDiff(TGeoCombiTrans &lTransf, Int_t nPoints, TArrayD &lDiff)
Int_t GetNLButtonTargets()
Double_t fXMax
xMax for functions fitting
TFile f("CalibObjects.root")
Double_t PhiYpn(const Double_t *x, const Double_t *par) const
Double_t ZnCenter(const Double_t *x, const Double_t *par) const
Double_t EqPlane(const Double_t *x, const Double_t *par) const
void CalculateTranslation(TF2 *xFunc, TF2 *yFunc, TF2 *zFunc, Int_t iP1, Int_t iP2, Double_t *lCenTemp)
virtual Int_t AddLButtonTargets(TObjArray *pArray, TString btBaseName, Int_t lTargetMax=9)
void AddStickerTarget(AliSurveyPoint *stPoint)
TObjArray * fLBTargets
Array of TVector3 or AliSurveyPoint of local position of Button Targets.
Double_t PhiXpn(const Double_t *x, const Double_t *par) const
Int_t CalculateBestTransf(Int_t iP1, Int_t iP2, Double_t *lXYZ, Double_t *lPTP)
TF2 * fPlane
TF2 for plane fitting.
Double_t PhiXpp(const Double_t *x, const Double_t *par) const
AliSurveyPoint * GetGButtonTarget(Int_t btIndex)
Bool_t fOwnerBaseTrf
Flag for owner of fBaseTrf.
void CalculateMeanTransf(Double_t *lXYZ, Double_t *lPTP)
Bool_t fOwnerLocalTrf
Flag for owner of fLocalTrf.
TGeoCombiTrans * fBaseTrf
Base Transformation.
TObjArray * fSTargets
Array of AliSurveyPoint of Sticker Targets.
Int_t GetNGButtonTargets()
Double_t fYMax
yMax for functions fitting
void SetPlane(TString pName, Double_t xMin=-2000., Double_t xMax=+2000., Double_t yMin=-2000., Double_t yMax=2000.)
virtual Int_t AddStickerTargets(TObjArray *pArray, TString stBaseName, Int_t lTargetMax=9)
TFitter * fFitter
Fitter for best local to global transformation.
void SetPlaneParameters(Double_t p0, Double_t p1, Double_t p2)
AliSurveyPoint * GetLButtonTarget(Int_t btIndex)
Double_t XnCenter(const Double_t *x, const Double_t *par) const
Utility class for survey of muon spectrometer.
Int_t GetNStickerTargets()
Double_t YnCenter(const Double_t *x, const Double_t *par) const
void SurveyFcn(int &npar, double *g, double &f, double *par, int iflag)
Double_t YpCenter(const Double_t *x, const Double_t *par) const
Double_t PhiXnn(const Double_t *x, const Double_t *par) const
Double_t EvalFunction(const TF2 *lFunction, Int_t iP1, Int_t iP2, const Char_t *lCoord)
Double_t PhiYpp(const Double_t *x, const Double_t *par) const
Double_t fZMin
zMin for functions fitting
virtual ~AliMUONSurveyObj()
Double_t ZpCenter(const Double_t *x, const Double_t *par) const
Int_t SurveyToAlign(TGeoCombiTrans &quadTransf, Double_t *parErr, Double_t psi=0., Double_t tht=0., Double_t epsi=0., Double_t etht=0.)
TObjArray * fGBTargets
Array of AliSurveyPoint of Button Targets.
void AddGButtonTarget(AliSurveyPoint *btPoint)
virtual void PrintLocalTrf()
static Bool_t MatrixToAngles(const Double_t *rot, Double_t *angles)
static AliMUONSurveyUtil * Instance()
Bool_t fOwnerAlignTrf
Flag for owner of fAlignTrf.
Double_t XpCenter(const Double_t *x, const Double_t *par) const
Double_t fXMin
xMin for functions fitting
AliSurveyPoint * ConvertPointUnits(AliSurveyPoint *stPoint, Float_t lFactor=0.1)
AliSurveyPoint * GetStickerTarget(Int_t stIndex)
Base class for survey of muon spectrometer.
TGeoCombiTrans * fLocalTrf
Local transformation.