19 Double_t* PD, Double_t* RD, Int_t& IERR)
44 Double_t A[5][5], S[15], COSL, SINL;
48 memset(RD,0,
sizeof(*RD));
52 if(TMath::Abs(COSL) < 1.
e-7) {
64 for(Int_t
I=0;
I<5;
I++) {
65 for(Int_t K=0; K<5; K++) {
71 for(Int_t
I=0;
I<15;
I++) { S[
I]=RC[
I]; }
79 A[0][1] = -PC[0]*SINL;
86 for(Int_t
I=0;
I<15;
I++) { RD[
I]=S[
I]; }
90 Double_t SPU, Double_t DJ[2], Double_t DK[2],
92 Int_t& IERR, Double_t* PC, Double_t* RC)
130 Double_t A[5][5], S[15], TN[3], COSL, SINL, COSL1;
132 Double_t PM, HM, UN[3], VN[3], DI[3], TVW[3];
133 Double_t UJ, UK, VJ, VK, HA, HAM, Q, SINZ, COSZ;
135 Double_t CFACT8 = 2.997925e-04;
143 TVW[0]=1./TMath::Sqrt(1.+PD[1]*PD[1]+PD[2]*PD[2]);
144 if(SPU < 0.) { TVW[0]=-TVW[0]; }
148 DI[0]=DJ[1]*DK[2]-DJ[2]*DK[1];
149 DI[1]=DJ[2]*DK[0]-DJ[0]*DK[2];
150 DI[2]=DJ[0]*DK[1]-DJ[1]*DK[0];
152 for(Int_t
I=0;
I<3;
I++) {
153 TN[
I]=TVW[0]*DI[
I]+TVW[1]*DJ[
I]+TVW[2]*DK[
I];
156 COSL=TMath::Sqrt(TMath::Abs(1.-TN[2]*TN[2]));
157 if(COSL < 1.
e-30) { COSL = 1.e-30; }
166 if(TMath::Abs (TN[0]) < 1.E-30) { TN[0] = 1.e-30; }
176 UJ=UN[0]*DJ[0]+UN[1]*DJ[1]+UN[2]*DJ[2];
177 UK=UN[0]*DK[0]+UN[1]*DK[1]+UN[2]*DK[2];
178 VJ=VN[0]*DJ[0]+VN[1]*DJ[1]+VN[2]*DJ[2];
179 VK=VN[0]*DK[0]+VN[1]*DK[1]+VN[2]*DK[2];
182 for(Int_t
I=0;
I<5;
I++) {
183 for(Int_t K=0; K<5; K++) {
189 for(Int_t
I=0;
I<15;
I++) { S[
I]=RD[
I]; }
192 HA=TMath::Sqrt(H[0]*H[0]+H[1]*H[1]+H[2]*H[2]);
199 SINZ=-(H[0]*UN[0]+H[1]*UN[1]+H[2]*UN[2])*HM;
200 COSZ= (H[0]*VN[0]+H[1]*VN[1]+H[2]*VN[2])*HM;
201 A[0][3] = Q*TVW[1]*SINZ*(SINL*PD[0]);
202 A[0][4] = Q*TVW[2]*SINZ*(SINL*PD[0]);
212 A[0][1] = -TVW[0]*VJ*(SINL*PD[0]);
213 A[0][2] = -TVW[0]*VK*(SINL*PD[0]);
221 for(Int_t
I=0;
I<15;
I++) { RC[
I]=S[
I]; }
227 Double_t* PD, Double_t* RD, Int_t& IERR)
252 Double_t A[5][5], S[15], COSL, COSL1;
257 memset(RD,0,
sizeof(*RD));
260 if(TMath::Abs(COSL) < 1.
e-7) {
271 for(Int_t
I=0;
I<5;
I++) {
272 for(Int_t K=0; K<5; K++) {
278 for(Int_t
I=0;
I<15;
I++) { S[
I]=RC[
I]; }
286 A[0][1] = PD[0]*TANL;
293 for(Int_t
I=0;
I<15;
I++) { RD[
I]=S[
I]; }
298 Double_t DJ[3], Double_t DK[3],
300 Int_t& IERR, Double_t& SPU,
301 Double_t* PD, Double_t* RD)
335 Double_t A[5][5], S[15], TN[3], COSL, COSP;
336 Double_t UN[3], VN[3], DI[3], TVW[3];
339 Double_t CFACT8= 2.997925e-04;
340 Double_t T1R, T2R, T3R, SINP, SINZ, COSZ, HA, HM, HAM;
341 Double_t Q, UI, VI, UJ, UK, VJ, VK;
344 memset(RD,0,
sizeof(*RD));
345 memset(PD,0,
sizeof(*PD));
347 COSL=TMath::Cos(PC[1]);
348 SINP=TMath::Sin(PC[2]);
349 COSP=TMath::Cos(PC[2]);
353 TN[2]=TMath::Sin(PC[1]);
356 DI[0]=DJ[1]*DK[2]-DJ[2]*DK[1];
357 DI[1]=DJ[2]*DK[0]-DJ[0]*DK[2];
358 DI[2]=DJ[0]*DK[1]-DJ[1]*DK[0];
360 TVW[0]=TN[0]*DI[0]+TN[1]*DI[1]+TN[2]*DI[2];
362 if(TVW[0] < 0.) { SPU=-1.; }
363 TVW[1]=TN[0]*DJ[0]+TN[1]*DJ[1]+TN[2]*DJ[2];
364 TVW[2]=TN[0]*DK[0]+TN[1]*DK[1]+TN[2]*DK[2];
367 if(TMath::Abs(TVW[0]) < 1.
e-7) {
385 UJ=UN[0]*DJ[0]+UN[1]*DJ[1]+UN[2]*DJ[2];
386 UK=UN[0]*DK[0]+UN[1]*DK[1]+UN[2]*DK[2];
387 VJ=VN[0]*DJ[0]+VN[1]*DJ[1]+VN[2]*DJ[2];
388 VK=VN[0]*DK[0]+VN[1]*DK[1]+VN[2]*DK[2];
390 for(Int_t
I=0;
I<5;
I++) {
391 for(Int_t K=0; K<5; K++) {
397 for(Int_t
I=0;
I<15;
I++) { S[
I]=RC[
I]; }
401 HA=TMath::Sqrt(H[0]*H[0]+H[1]*H[1]+H[2]*H[2]);
407 SINZ=-(H[0]*UN[0]+H[1]*UN[1]+H[2]*UN[2])*HM;
408 COSZ= (H[0]*VN[0]+H[1]*VN[1]+H[2]*VN[2])*HM;
410 UI=UN[0]*DI[0]+UN[1]*DI[1]+UN[2]*DI[2];
411 VI=VN[0]*DI[0]+VN[1]*DI[1]+VN[2]*DI[2];
412 A[1][3] = -UI*(VK*COSZ-UK*SINZ)*T3R;
413 A[1][4] = -VI*(VK*COSZ-UK*SINZ)*T3R;
414 A[2][3] = UI*(VJ*COSZ-UJ*SINZ)*T3R;
415 A[2][4] = VI*(VJ*COSZ-UJ*SINZ)*T3R;
425 A[1][2] = VK*COSL*T2R;
427 A[2][2] = -VJ*COSL*T2R;
438 for(Int_t
I=0;
I<15;
I++) { RD[
I]=S[
I]; }
444 Int_t CH, Double_t SP1,
445 Double_t DJ1[2], Double_t DK1[2],
446 Double_t DJ2[2], Double_t DK2[2],
448 Int_t& IERR, Double_t& SP2,
449 Double_t* PD2, Double_t* RD2)
490 Double_t A[5][5], S[15], TN[3], COSL, COSL1;
491 Double_t SINZ, COSZ, UN[3], VN[3];
494 Double_t PM, TR, TS, TT, HA, HM, HAM, Q;
495 Double_t UJ1, UK1, UJ2, UK2, VJ1, VJ2, VK1, VK2;
496 Double_t SJ1I2, SK1I2, SK2U, SK2V, SJ2U, SJ2V;
497 Double_t DI1[3], DI2[3], TVW1[3], TVW2[3];
498 Double_t CFACT8= 2.997925e-04;
501 memset(PD2,0,
sizeof(*PD2));
502 memset(RD2,0,
sizeof(*RD2));
505 TVW1[0]=1./sqrt(1.+PD1[1]*PD1[1]+PD1[2]*PD1[2]);
506 if(SP1 < 0.) { TVW1[0]=-TVW1[0]; }
507 TVW1[1]=PD1[1]*TVW1[0];
508 TVW1[2]=PD1[2]*TVW1[0];
510 DI1[0]=DJ1[1]*DK1[2]-DJ1[2]*DK1[1];
511 DI1[1]=DJ1[2]*DK1[0]-DJ1[0]*DK1[2];
512 DI1[2]=DJ1[0]*DK1[1]-DJ1[1]*DK1[0];
514 for(Int_t
I=0;
I<3;
I++) {
515 TN[
I]=TVW1[0]*DI1[
I]+TVW1[1]*DJ1[
I]+TVW1[2]*DK1[
I];
518 DI2[0]=DJ2[1]*DK2[2]-DJ2[2]*DK2[1];
519 DI2[1]=DJ2[2]*DK2[0]-DJ2[0]*DK2[2];
520 DI2[2]=DJ2[0]*DK2[1]-DJ2[1]*DK2[0];
522 TVW2[0]=TN[0]*DI2[0]+TN[1]*DI2[1]+TN[2]*DI2[2];
523 TVW2[1]=TN[0]*DJ2[0]+TN[1]*DJ2[1]+TN[2]*DJ2[2];
524 TVW2[2]=TN[0]*DK2[0]+TN[1]*DK2[1]+TN[2]*DK2[2];
526 if(TMath::Abs(TVW2[0]) < 1.
e-7) {
533 if(TVW2[0] < 0.) { SP2=-1; }
538 COSL=sqrt(TMath::Abs(1.-TN[2]*TN[2]));
539 if(TMath::Abs(COSL) < 1.
e-7) {
553 UJ1=UN[0]*DJ1[0]+UN[1]*DJ1[1]+UN[2]*DJ1[2];
554 UK1=UN[0]*DK1[0]+UN[1]*DK1[1]+UN[2]*DK1[2];
555 VJ1=VN[0]*DJ1[0]+VN[1]*DJ1[1]+VN[2]*DJ1[2];
556 VK1=VN[0]*DK1[0]+VN[1]*DK1[1]+VN[2]*DK1[2];
558 UJ2=UN[0]*DJ2[0]+UN[1]*DJ2[1]+UN[2]*DJ2[2];
559 UK2=UN[0]*DK2[0]+UN[1]*DK2[1]+UN[2]*DK2[2];
560 VJ2=VN[0]*DJ2[0]+VN[1]*DJ2[1]+VN[2]*DJ2[2];
561 VK2=VN[0]*DK2[0]+VN[1]*DK2[1]+VN[2]*DK2[2];
564 for(Int_t
I=0;
I<5;
I++) {
565 for(Int_t K=0; K<5; K++) {
569 for(Int_t J=0; J<15; J++) { S[J]=RD1[J]; }
573 HA=sqrt(H[0]*H[0]+H[1]*H[1]+H[2]*H[2]);
580 SJ1I2=DJ1[0]*DI2[0]+DJ1[1]*DI2[1]+DJ1[2]*DI2[2];
581 SK1I2=DK1[0]*DI2[0]+DK1[1]*DI2[1]+DK1[2]*DI2[2];
582 SK2U=DK2[0]*UN[0]+DK2[1]*UN[1]+DK2[2]*UN[2];
583 SK2V=DK2[0]*VN[0]+DK2[1]*VN[1]+DK2[2]*VN[2];
584 SJ2U=DJ2[0]*UN[0]+DJ2[1]*UN[1]+DJ2[2]*UN[2];
585 SJ2V=DJ2[0]*VN[0]+DJ2[1]*VN[1]+DJ2[2]*VN[2];
587 SINZ=-(H[0]*UN[0]+H[1]*UN[1]+H[2]*UN[2])*HM;
588 COSZ= (H[0]*VN[0]+H[1]*VN[1]+H[2]*VN[2])*HM;
589 A[1][3] = -TT*SJ1I2*(SK2U*SINZ-SK2V*COSZ);
590 A[1][4] = -TT*SK1I2*(SK2U*SINZ-SK2V*COSZ);
591 A[2][3] = TT*SJ1I2*(SJ2U*SINZ-SJ2V*COSZ);
592 A[2][4] = TT*SK1I2*(SJ2U*SINZ-SJ2V*COSZ);
597 A[3][3] = TR*(UJ1*VK2-VJ1*UK2);
598 A[3][4] = TR*(UK1*VK2-VK1*UK2);
599 A[4][3] = TR*(VJ1*UJ2-UJ1*VJ2);
600 A[4][4] = TR*(VK1*UJ2-UK1*VJ2);
603 A[1][1] = A[3][3]*TS;
604 A[1][2] = A[3][4]*TS;
605 A[2][1] = A[4][3]*TS;
606 A[2][2] = A[4][4]*TS;
616 for(Int_t J=0; J<15; J++) {
624 Int_t CH, Double_t SPU, Double_t DJ[3], Double_t DK[3],
626 Int_t& IERR, Double_t* PC, Double_t* RC)
665 Double_t A[5][5], S[15], TN[3], TANL, COSL, COSL1;
667 Double_t PM, HM, UN[3], VN[3], DI[3], TVW[3];
669 Double_t CFACT8 = 2.997925e-04;
671 Double_t UJ, UK, VJ, VK, HA, HAM, Q, SINZ, COSZ;
679 TVW[0]=1./TMath::Sqrt(1.+PD[1]*PD[1]+PD[2]*PD[2]);
680 if(SPU<0.) { TVW[0]=-TVW[0]; }
684 DI[0]=DJ[1]*DK[2]-DJ[2]*DK[1];
685 DI[1]=DJ[2]*DK[0]-DJ[0]*DK[2];
686 DI[2]=DJ[0]*DK[1]-DJ[1]*DK[0];
688 for(Int_t
I=0;
I<3;
I++) {
689 TN[
I]=TVW[0]*DI[
I]+TVW[1]*DJ[
I]+TVW[2]*DK[
I];
692 COSL=TMath::Sqrt(TMath::Abs(1.-TN[2]*TN[2]));
693 if(COSL < 1.
e-30) { COSL = 1.e-30; }
701 if(TMath::Abs (TN[0])< 1.
e-30) { TN[0] = 1.e-30; }
711 UJ=UN[0]*DJ[0]+UN[1]*DJ[1]+UN[2]*DJ[2];
712 UK=UN[0]*DK[0]+UN[1]*DK[1]+UN[2]*DK[2];
713 VJ=VN[0]*DJ[0]+VN[1]*DJ[1]+VN[2]*DJ[2];
714 VK=VN[0]*DK[0]+VN[1]*DK[1]+VN[2]*DK[2];
716 for(Int_t
I=0;
I<5;
I++) {
717 for(Int_t K=0; K<5; K++) {
723 for(Int_t
I=0;
I<15;
I++) { S[
I]=RD[
I]; }
727 HA=TMath::Sqrt(H[0]*H[0]+H[1]*H[1]+H[2]*H[2]);
734 SINZ=-(H[0]*UN[0]+H[1]*UN[1]+H[2]*UN[2])*HM;
735 COSZ= (H[0]*VN[0]+H[1]*VN[1]+H[2]*VN[2])*HM;
736 A[0][3] = -Q*TVW[1]*SINZ*(TANL*PC[0]);
737 A[0][4] = -Q*TVW[2]*SINZ*(TANL*PC[0]);
747 A[0][1] = TVW[0]*VJ*(TANL*PC[0]);
748 A[0][2] = TVW[0]*VK*(TANL*PC[0]);
755 for(Int_t
I=0;
I<15;
I++) { RC[
I]=S[
I]; }
761 Double_t SPU, Double_t DJ[3], Double_t DK[3],
763 Int_t& IERR, Double_t* PC, Double_t* RC)
800 Double_t A[5][5], S[15], TN[3];
801 Double_t SINZ, COSZ, COSL, COSL1;
802 Double_t UN[3], VN[3], DI[3], TVW[3];
805 Double_t CFACT8= 2.997925e-04;
806 Double_t HA, HM, HAM, Q, UJ, UK, VJ, VK;
811 memset(RC,0,
sizeof(*RC));
812 memset(PC,0,
sizeof(*PC));
815 TVW[0]=1./TMath::Sqrt(1.+PD[1]*PD[1]+PD[2]*PD[2]);
817 if(SPU < 0.) { TVW[0]=-TVW[0]; }
821 DI[0]=DJ[1]*DK[2]-DJ[2]*DK[1];
822 DI[1]=DJ[2]*DK[0]-DJ[0]*DK[2];
823 DI[2]=DJ[0]*DK[1]-DJ[1]*DK[0];
825 for(Int_t
I=0;
I<3;
I++) {
826 TN[
I]=TVW[0]*DI[
I]+TVW[1]*DJ[
I]+TVW[2]*DK[
I];
830 PC[1] = TMath::ASin(TN[2]);
831 if(TMath::Abs(TN[0]) < 1.
e-30) { TN[0] = 1.e-30; }
833 PC[2] = TMath::ATan2(TN[1],TN[0]);
835 COSL=TMath::Sqrt(TMath::Abs(1.-TN[2]*TN[2]));
836 if(COSL < 1.
e-30) { COSL = 1.e-30; }
838 UN[0] = -TN[1]*COSL1;
842 VN[0] = -TN[2]*UN[1];
846 UJ = UN[0]*DJ[0]+UN[1]*DJ[1]+UN[2]*DJ[2];
847 UK = UN[0]*DK[0]+UN[1]*DK[1]+UN[2]*DK[2];
848 VJ = VN[0]*DJ[0]+VN[1]*DJ[1]+VN[2]*DJ[2];
849 VK = VN[0]*DK[0]+VN[1]*DK[1]+VN[2]*DK[2];
853 for(Int_t
I=0;
I<5;
I++) {
854 for(Int_t K=0; K<5; K++) {
858 for(Int_t J=0; J<15; J++) { S[J]=RD[J]; }
862 HA=TMath::Sqrt(H[0]*H[0]+H[1]*H[1]+H[2]*H[2]);
868 SINZ=-(H[0]*UN[0]+H[1]*UN[1]+H[2]*UN[2])*HM;
869 COSZ= (H[0]*VN[0]+H[1]*VN[1]+H[2]*VN[2])*HM;
870 A[1][3] = -Q*TVW[1]*SINZ;
871 A[1][4] = -Q*TVW[2]*SINZ;
872 A[2][3] = -Q*TVW[1]*COSZ*COSL1;
873 A[2][4] = -Q*TVW[2]*COSZ*COSL1;
879 A[2][1] = TVW[0]*UJ*COSL1;
880 A[2][2] = TVW[0]*UK*COSL1;
891 for(Int_t
I=0;
I<15;
I++) { RC[
I]=S[
I]; }
926 for(Int_t
I=0;
I<5;
I++) {
927 for(Int_t
k=
I;
k<5;
k++) {
977 Double_t* PC, Double_t* RC)
1012 Double_t SPU, DJ[3], DK[3], PM, PM3, PT;
1014 Double_t clam, slam, cphi, sphi, PC1[3], RC1[15];
1020 memset(RC,0,
sizeof(*RC));
1021 memset(PC,0,
sizeof(*PC));
1023 PM = TMath::Sqrt(PD[0]*PD[0]+PD[1]*PD[1]+PD[2]*PD[2]);
1024 PM3 = TMath::Power(PM,3);
1025 PT = TMath::Sqrt(PD[0]*PD[0]+PD[1]*PD[1]);
1031 clam = TMath::Sqrt(1.-slam*slam);
1034 if(TMath::Abs(clam)<1.
e-10) {
1040 cphi = PD[0]/(clam*PM);
1041 sphi = PD[1]/(clam*PM);
1053 IERR, SPU, PC1, RC1) ;
1058 FromSDToSC(PC1, RC1, H, CH, SPU, DJ, DK, IERR, PC, RC);
1066 Double_t* PD, sixMat& RD)
1099 Double_t DJ[3], DK[3];
1100 Double_t PDD[3], RDD[15];
1105 Double_t clam, slam, cphi, sphi;
1109 memset(PD,0,
sizeof(*PD));
1112 for(Int_t
I=0;
I<6;
I++) {
1113 for(Int_t K=0; K<6; K++) {
1122 clam = TMath::Cos(PC[1]);
1123 slam = TMath::Sin(PC[1]);
1124 cphi = TMath::Cos(PC[2]);
1125 sphi = TMath::Sin(PC[2]);
1129 if(TMath::Abs(clam)<1.
e-15) {
1146 FromSCToSD(PC, RC, H, CH, DJ, DK, IERR, SPU, PDD, RDD);
1157 Double_t H[3], Int_t CH,
1158 Double_t DJ1[3], Double_t DK1[3],
1160 Int_t& IERR, Double_t& SP1,
1161 Double_t* PC, Double_t* RC)
1206 Double_t M56[5][6], M56T[6][5], AJ[5][5], AJT[6][5];
1207 Double_t R6[6][6], RLC[6][6];
1209 Double_t PM, PM3, PT;
1210 Double_t Rot[3][3], Rmat[6][6], Rtra[6][6];
1216 memset(RC,0,
sizeof(*RC));
1217 memset(PC,0,
sizeof(*PC));
1219 for(Int_t
I=0;
I<5;
I++) {
1220 for(Int_t K=0; K<6; K++) {
1224 if(K != 5) { AJ[
I][K]=0.; }
1228 for(Int_t i=0; i<6; i++) {
1229 for(Int_t
k=0;
k<6;
k++) {
1239 TVector3 MI(1.,0.,0.);
1240 TVector3 MJ(0.,1.,0.);
1241 TVector3 MK(0.,0.,1.);
1243 TVector3 DI(DJ1[0],DJ1[1],DJ1[2]);
1244 TVector3 DJ(DK1[0],DK1[1],DK1[2]);
1245 TVector3 DK= DI.Cross(DJ);
1250 Rot[0][0] = DI.Dot(MI);
1251 Rot[0][1] = DI.Dot(MJ);
1252 Rot[0][2] = DI.Dot(MK);
1253 Rot[1][0] = DJ.Dot(MI);
1254 Rot[1][1] = DJ.Dot(MJ);
1255 Rot[1][2] = DJ.Dot(MK);
1256 Rot[2][0] = DK.Dot(MI);
1257 Rot[2][1] = DK.Dot(MJ);
1258 Rot[2][2] = DK.Dot(MK);
1260 TMatrixT<double> PD1(3,1);
1265 TMatrixT<double> Rot1(3,3);
1266 for(
int i = 0; i < 3; i++)
for(
int j = 0; j < 3; j++) {
1267 Rot1[i][j] = Rot[i][j];
1273 TMatrixT<double> Rot1xPD1(Rot1,TMatrixT<double>::kMult,PD1);
1274 PDD[0] = Rot1xPD1[0][0];
1275 PDD[1] = Rot1xPD1[1][0];
1276 PDD[2] = Rot1xPD1[2][0];
1280 Rmat[0][0] = Rot[0][0];
1281 Rmat[0][1] = Rot[0][1];
1282 Rmat[0][2] = Rot[0][2];
1283 Rmat[1][0] = Rot[1][0];
1284 Rmat[1][1] = Rot[1][1];
1285 Rmat[1][2] = Rot[1][2];
1286 Rmat[2][0] = Rot[2][0];
1287 Rmat[2][1] = Rot[2][1];
1288 Rmat[2][2] = Rot[2][2];
1290 Rmat[3][3] = Rot[0][0];
1291 Rmat[3][4] = Rot[0][1];
1292 Rmat[3][5] = Rot[0][2];
1293 Rmat[4][3] = Rot[1][0];
1294 Rmat[4][4] = Rot[1][1];
1295 Rmat[4][5] = Rot[1][2];
1296 Rmat[5][3] = Rot[2][0];
1297 Rmat[5][4] = Rot[2][1];
1298 Rmat[5][5] = Rot[2][2];
1302 for(Int_t
I=0;
I<6;
I++) {
1303 for(Int_t K=0; K<6; K++) {
1304 Rtra[K][
I]=Rmat[
I][K];
1310 for(Int_t i=0; i<6; i++) {
1311 for(Int_t
k=0;
k<6;
k++) {
1312 for(Int_t l=0; l<6; l++) {
1313 R6[i][
k] += RD[i][l]*Rtra[l][
k];
1318 for(Int_t i=0; i<6; i++) {
1319 for(Int_t
k=0;
k<6;
k++) {
1320 for(Int_t l=0; l<6; l++) {
1321 RLC[i][
k] += Rmat[i][l]*R6[l][
k];
1330 PM = TMath::Sqrt(PDD[0]*PDD[0]+PDD[1]*PDD[1]+PDD[2]*PDD[2]);
1331 PM3 = TMath::Power(PM,3);
1332 PT = TMath::Sqrt(PDD[0]*PDD[0]+PDD[1]*PDD[1]);
1339 if(TMath::Abs(PDD[2]) < 1.
e-08) {
1348 PC[1] = PDD[0]/PDD[2];
1349 PC[2] = PDD[1]/PDD[2];;
1354 M56[0][0] = - CH*PDD[0]/PM3;
1355 M56[0][1] = - CH*PDD[1]/PM3;
1356 M56[0][2] = - CH*PDD[2]/PM3;
1358 M56[1][0] = 1./PDD[2];
1360 M56[1][2] = - PDD[0]/(PDD[2]*PDD[2]);
1363 M56[2][1] = 1./PDD[2];
1364 M56[2][2] = - PDD[1]/(PDD[2]*PDD[2]);
1372 for(Int_t
k=0;
k<5;
k++) {
1373 for(Int_t l=0; l<6; l++) {
1374 M56T[l][
k]= M56[
k][l];
1378 for(Int_t i=0; i<6; i++) {
1379 for(Int_t
k=0;
k<5;
k++) {
1380 for(Int_t l=0; l<6; l++) {
1381 AJT[i][
k] += RLC[i][l]*M56T[l][
k];
1386 for(Int_t i=0; i<5; i++) {
1387 for(Int_t
k=0;
k<5;
k++) {
1388 for(Int_t l=0; l<6; l++) {
1389 AJ[i][
k] += M56[i][l]*AJT[l][
k];
1397 SP1 =
TMath::Sign(1., PD[0]*(DJ1[1]*DK1[2]-DJ1[2]*DK1[1])+
1398 PD[1]*(DJ1[2]*DK1[0]-DJ1[0]*DK1[2])+
1399 PD[2]*(DJ1[0]*DK1[1]-DJ1[1]*DK1[0]) );
1406 Double_t H[3], Int_t CH,
1407 Double_t SP1, Double_t DJ1[3], Double_t DK1[3],
1409 Double_t* PD, sixMat& RD)
1445 Double_t M65[6][5], M65T[5][6], AJ[5][6];
1453 Double_t RD1[6][6], Rmat[6][6], AJJ[6][6], Rtra[6][6];
1455 Double_t SPU, PM, PM2, PVW, PVW3;
1459 memset(PD,0,
sizeof(*PD));
1462 for(Int_t
I=0;
I<5;
I++) {
1463 for(Int_t K=0; K<6; K++) {
1474 for(Int_t
I=0;
I<6;
I++) {
1487 if(PC[0] != 0.) { PM =CH/PC[0]; }
1489 PVW = TMath::Sqrt(1.+PC[1]*PC[1]+PC[2]*PC[2]);
1490 PVW3 = TMath::Power(PVW,3);
1494 PDD[0] = SPU*PM*PC[1]/PVW;
1495 PDD[1] = SPU*PM*PC[2]/PVW;
1496 PDD[2] = SPU*PM/PVW ;
1501 M65[0][0] = - SPU*PM2*PC[1]/(CH*PVW);
1502 M65[1][0] = - SPU*PM2*PC[2]/(CH*PVW);
1503 M65[2][0] = - SPU*PM2/(CH*PVW);
1505 M65[0][1] = SPU*PM*(1.+PC[2]*PC[2])/PVW3;
1506 M65[1][1] = - SPU*PM*PC[1]*PC[2]/PVW3;
1507 M65[2][1] = - SPU*PM*PC[1]/PVW3;
1509 M65[0][2] = - SPU*PM*PC[1]*PC[2]/PVW3;
1510 M65[1][2] = SPU*PM*(1.+PC[1]*PC[1])/PVW3;
1511 M65[2][2] = - SPU*PM*PC[2]/PVW3;
1521 for(Int_t
I=0;
I<6;
I++) {
1522 for(Int_t K=0; K<5; K++) {
1523 M65T[K][
I]=M65[
I][K];
1529 for(Int_t i=0; i<5; i++) {
1530 for(Int_t
k=0;
k<6;
k++) {
1531 for(Int_t l=0; l<5; l++) {
1532 AJ[i][
k] += RCM[i][l]*M65T[l][
k];
1537 for(Int_t i=0; i<6; i++) {
1538 for(Int_t
k=0;
k<6;
k++) {
1539 for(Int_t l=0; l<5; l++) {
1540 RD1[i][
k] += M65[i][l]*AJ[l][
k];
1549 TVector3 MI(1.,0.,0.);
1550 TVector3 MJ(0.,1.,0.);
1551 TVector3 MK(0.,0.,1.);
1553 TVector3 DI(DJ1[0],DJ1[1],DJ1[2]);
1554 TVector3 DJ(DK1[0],DK1[1],DK1[2]);
1555 TVector3 DK= DI.Cross(DJ);
1560 Rot[0][0] = MI.Dot(DI);
1561 Rot[0][1] = MI.Dot(DJ);
1562 Rot[0][2] = MI.Dot(DK);
1563 Rot[1][0] = MJ.Dot(DI);
1564 Rot[1][1] = MJ.Dot(DJ);
1565 Rot[1][2] = MJ.Dot(DK);
1566 Rot[2][0] = MK.Dot(DI);
1567 Rot[2][1] = MK.Dot(DJ);
1568 Rot[2][2] = MK.Dot(DK);
1570 TMatrixT<double> PD1(3,1);
1575 TMatrixT<double> Rot1(3,3);
1576 for(
int i = 0; i < 3; i++)
for(
int j = 0; j < 3; j++) {
1577 Rot1[i][j] = Rot[i][j];
1580 TMatrixT<double> Rot1xPD1(Rot1,TMatrixT<double>::kMult,PD1);
1581 PD[0] = Rot1xPD1[0][0];
1582 PD[1] = Rot1xPD1[1][0];
1583 PD[2] = Rot1xPD1[2][0];
1587 Rmat[0][0] = Rot[0][0];
1588 Rmat[0][1] = Rot[0][1];
1589 Rmat[0][2] = Rot[0][2];
1590 Rmat[1][0] = Rot[1][0];
1591 Rmat[1][1] = Rot[1][1];
1592 Rmat[1][2] = Rot[1][2];
1593 Rmat[2][0] = Rot[2][0];
1594 Rmat[2][1] = Rot[2][1];
1595 Rmat[2][2] = Rot[2][2];
1597 Rmat[3][3] = Rot[0][0];
1598 Rmat[3][4] = Rot[0][1];
1599 Rmat[3][5] = Rot[0][2];
1600 Rmat[4][3] = Rot[1][0];
1601 Rmat[4][4] = Rot[1][1];
1602 Rmat[4][5] = Rot[1][2];
1603 Rmat[5][3] = Rot[2][0];
1604 Rmat[5][4] = Rot[2][1];
1605 Rmat[5][5] = Rot[2][2];
1609 for(Int_t
I=0;
I<6;
I++) {
1610 for(Int_t K=0; K<6; K++) {
1611 Rtra[K][
I]=Rmat[
I][K];
1615 for(Int_t i=0; i<6; i++) {
1616 for(Int_t
k=0;
k<6;
k++) {
1617 for(Int_t l=0; l<6; l++) {
1618 AJJ[i][
k] += RD1[i][l]*Rtra[l][
k];
1623 for(Int_t i=0; i<6; i++) {
1624 for(Int_t
k=0;
k<6;
k++) {
1625 for(Int_t l=0; l<6; l++) {
1626 RD[i][
k] += Rmat[i][l]*AJJ[l][
k];
1740 for(Int_t i=0; i<15; i++) { Q[i]=S[i]; }
1743 for(Int_t J=0; J<5; J++) {
1749 for(Int_t
I=J;
I<5;
I++) {
1750 R[K]=A[
I ]*(Q[0]*T1+Q[1]*T2+Q[ 2]*T3+Q[ 3]*T4+Q[ 4]*
T5)
1751 +A[
I+ 5]*(Q[1]*T1+Q[5]*T2+Q[ 6]*T3+Q[ 7]*T4+Q[ 8]*T5)
1752 +A[
I+10]*(Q[2]*T1+Q[6]*T2+Q[ 9]*T3+Q[10]*T4+Q[11]*
T5)
1753 +A[
I+15]*(Q[3]*T1+Q[7]*T2+Q[10]*T3+Q[12]*T4+Q[13]*T5)
1754 +A[
I+20]*(Q[4]*T1+Q[8]*T2+Q[11]*T3+Q[13]*T4+Q[14]*
T5);
1765 TMatrixT<double>
matrix(3,3);
1767 matrix[0][0] = di[0];
1768 matrix[0][1] = di[1];
1769 matrix[0][2] = di[2];
1770 matrix[1][0] = dj[0];
1771 matrix[1][1] = dj[1];
1772 matrix[1][2] = dj[2];
1773 matrix[2][0] = dk[0];
1774 matrix[2][1] = dk[1];
1775 matrix[2][2] = dk[2];
1779 TMatrixT<double> xyzvec(3,1);
1780 xyzvec[0][0] = xyz.X();
1781 xyzvec[1][0] = xyz.Y();
1782 xyzvec[2][0] = xyz.Z();
1785 TMatrixT<double>
origin(3,1);
1786 origin[0][0] = o.X();
1787 origin[1][0] = o.Y();
1788 origin[2][0] = o.Z();
1792 TMatrixT<double> uvwvec(matrix, TMatrixT<double>::kMult, xyzvec);
1794 TVector3 uvw = TVector3(uvwvec[0][0], uvwvec[1][0], uvwvec[2][0]);
1800 TMatrixT<double>
matrix(3,3);
1801 matrix[0][0] = di[0];
1802 matrix[0][1] = di[1];
1803 matrix[0][2] = di[2];
1804 matrix[1][0] = dj[0];
1805 matrix[1][1] = dj[1];
1806 matrix[1][2] = dj[2];
1807 matrix[2][0] = dk[0];
1808 matrix[2][1] = dk[1];
1809 matrix[2][2] = dk[2];
1812 TMatrixT<double> uvwvec(3,1);
1813 uvwvec[0][0] = uvw.X();
1814 uvwvec[1][0] = uvw.Y();
1815 uvwvec[2][0] = uvw.Z();
1817 TMatrixT<double> uvwrot(matrix, TMatrixT<double>::kTransposeMult, uvwvec);
1819 TMatrixT<double>
origin(3,1);
1820 origin[0][0] = o.X();
1821 origin[1][0] = o.Y();
1822 origin[2][0] = o.Z();
1824 TMatrixT<double> xyzvec(3,1);
1825 xyzvec = uvwrot +
origin;
1828 TVector3 xyz = TVector3(xyzvec[0][0], xyzvec[1][0], xyzvec[2][0]);