1
2
3
4
5
6
7
8
9
10 package org.lcsim.detector;
11
12 import hep.physics.vec.Hep3Vector;
13 import hep.physics.vec.BasicHep3Vector;
14
15
16
17
18
19
20
21 public class RotationGeant extends Rotation3D
22 {
23
24
25 public RotationGeant(double a, double b, double c)
26 {
27 super(makeRotation(a,b,c));
28 }
29
30
31
32 public static IRotation3D makeRotation(double phi, double theta, double psi)
33 {
34 Hep3Vector x_axis = new BasicHep3Vector(1,0,0);
35 Hep3Vector y_axis = new BasicHep3Vector(0,1,0);
36 Hep3Vector z_axis = new BasicHep3Vector(0,0,1);
37
38
39 IRotation3D rotation = passiveAxisRotation(phi,x_axis);
40
41
42 rotation = Rotation3D.multiply(passiveAxisRotation(theta,rotation.rotated(y_axis)),rotation);
43
44
45 rotation = Rotation3D.multiply(passiveAxisRotation(psi,rotation.rotated(z_axis)),rotation);
46
47 return rotation;
48 }
49
50 }