1 package org.lcsim.recon.tracking.vsegment.geom;
2
3 import hep.physics.vec.Hep3Vector;
4 import hep.physics.vec.VecOp;
5 import hep.physics.matrix.SymmetricMatrix;
6 import org.lcsim.detector.IDetectorElement;
7
8 import org.lcsim.recon.tracking.vsegment.transform.Rotation3D;
9 import org.lcsim.recon.tracking.vsegment.transform.Transformation3D;
10
11
12
13
14
15
16
17
18
19 public class Sensor {
20
21
22
23 public Sensor(IDetectorElement de, int id, SensorType type, Hep3Vector translation, Transformation3D rotation) {
24 _de = de;
25 _id = id;
26 _type = type;
27 _translation = translation;
28 _rotation = rotation;
29 }
30
31
32
33
34
35
36 public IDetectorElement getDetectorElement() {return _de;}
37
38
39
40
41 public SensorType getType() {return _type;}
42
43
44
45
46 public int getID() {return _id;}
47
48
49
50
51 public Hep3Vector getTranslation() {return _translation;}
52
53
54
55
56 public Transformation3D getRotation() {return _rotation;}
57
58
59
60
61 public Hep3Vector localToGlobal(Hep3Vector point) {
62 return VecOp.add(_translation, _rotation.transformFrom(point));
63 }
64
65
66
67
68 public Hep3Vector globalToLocal(Hep3Vector point) {
69 return _rotation.transformTo(VecOp.sub(point, _translation));
70 }
71
72
73
74
75
76
77 public SymmetricMatrix localToGlobal(SymmetricMatrix covMatrix) {
78 return _rotation.transformFrom(covMatrix);
79 }
80
81
82
83
84
85
86 public SymmetricMatrix globalToLocal(SymmetricMatrix covMatrix) {
87 return _rotation.transformTo(covMatrix);
88 }
89
90
91
92
93 public SymmetricMatrix localToGlobal(SymmetricMatrix covMatrix, Hep3Vector position) {
94 return _rotation.transformFrom(covMatrix, position);
95 }
96
97
98
99
100 public SymmetricMatrix globalToLocal(SymmetricMatrix covMatrix, Hep3Vector position) {
101 return _rotation.transformTo(covMatrix, position);
102 }
103
104
105
106 private IDetectorElement _de;
107 private SensorType _type;
108 private int _id;
109 private Hep3Vector _translation;
110 private Transformation3D _rotation;
111
112 }