1 package org.lcsim.recon.tracking.trfbase;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 import org.lcsim.recon.tracking.trfbase.CrossStat;
18 import org.lcsim.recon.tracking.trfbase.PureStat;
19 import org.lcsim.recon.tracking.trfbase.Surface;
20 import org.lcsim.recon.tracking.trfbase.TrackSurfaceDirection;
21 import org.lcsim.recon.tracking.trfbase.TrackVector;
22 import org.lcsim.recon.tracking.trfbase.VTrack;
23 import org.lcsim.recon.tracking.spacegeom.CartesianPath;
24 import org.lcsim.recon.tracking.spacegeom.SpacePath;
25 import org.lcsim.recon.tracking.spacegeom.SpacePoint;
26
27
28
29 public class SurfTest extends Surface
30 {
31
32
33
34
35
36
37 protected double _x;
38
39
40 protected SpacePath _spth;
41
42
43
44 public String toString()
45 {
46 return "Test surface with parameter " + _x + ".";
47
48 }
49
50
51 protected boolean safePureEqual(Surface srf)
52 { return _x == ((SurfTest) srf)._x;
53 }
54
55
56 protected boolean safePureLessThan(Surface srf)
57 { return _x < ((SurfTest) srf)._x;
58 }
59
60
61
62
63 public static String typeName()
64 { return "SurfTest";
65 }
66
67
68 public static String staticType()
69 { return typeName();
70 }
71
72
73
74
75 public SurfTest(double x)
76 {
77 _x = x;
78 _spth = new CartesianPath(_x,0,0,0,0,0);
79 }
80
81
82 public SurfTest(SpacePath spth)
83 {
84 _x = spth.x();
85 _spth = new SpacePath(spth);
86 }
87
88
89 public SurfTest(SurfTest st)
90 {
91 _x = st._x;
92 _spth = new SpacePath(st._spth);
93 }
94
95
96 public String type()
97 { return staticType();
98 }
99
100
101
102
103
104 public TrackSurfaceDirection direction( TrackVector vec)
105 {
106 if ( _x > 0.0 ) return TrackSurfaceDirection.TSD_FORWARD;
107 else return TrackSurfaceDirection.TSD_UNDEFINED;
108 }
109
110
111 public String pureType()
112 { return staticType();
113 }
114
115
116 public Surface newPureSurface( )
117 { return new SurfTest(_spth);
118 };
119
120
121 public double parameter(int ipar)
122 {
123 if( ipar != 0 ) throw new IllegalArgumentException("Wrong Parameter!");
124 return _x;
125 }
126
127
128
129 public SpacePath get_space_vector()
130 { return new CartesianPath(_x, 0.0, 0.0, 1.0, 0.0, 0.0);
131 }
132
133
134 public CrossStat pureStatus( VTrack trv )
135 { return new CrossStat(PureStat.AT);
136 }
137
138
139 public TrackVector vecDiff( TrackVector vec1,
140 TrackVector vec2 )
141 { return vec1.minus(vec2);
142 }
143
144
145 public SpacePoint spacePoint( TrackVector vec )
146 { return new SpacePoint();
147 }
148
149
150 public SpacePath spacePath( TrackVector vec,
151 TrackSurfaceDirection dir)
152 { return _spth;
153 }
154
155 }