1 package org.lcsim.recon.tracking.trfcyl;
2
3 import org.lcsim.recon.tracking.trfutil.Assert;
4 import org.lcsim.recon.tracking.trfutil.TRFMath;
5 import org.lcsim.recon.tracking.trfbase.ETrack;
6 import org.lcsim.recon.tracking.trfbase.Hit;
7 import org.lcsim.recon.tracking.trfbase.HitVector;
8 import org.lcsim.recon.tracking.trfbase.HitError;
9 import org.lcsim.recon.tracking.trfbase.HitDerivative;
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 /
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41 public static String typeName()
42 {
43 return "HitCylPhi";
44 }
45
46
47
48
49
50
51
52
53
54 public static String staticType()
55 {
56 return typeName();
57 }
58
59
60
61
62 private double _phi_pre;
63
64
65 private double _ephi_pre;
66
67
68
69
70
71
72
73
74
75
76
77
78
79 public boolean equal( Hit hit)
80 {
81 Assert.assertTrue( type().equals(hit.type()) );
82 return cluster().equals(hit.cluster());
83 }
84
85
86 HitCylPhi(double phi, double ephi)
87 {
88 _phi_pre = phi;
89 _ephi_pre = ephi;
90 }
91
92
93
94
95
96
97
98
99
100
101 public HitCylPhi( HitCylPhi hcp)
102 {
103 super(hcp);
104 _phi_pre = hcp._phi_pre;
105 _ephi_pre = hcp._ephi_pre;
106 }
107
108
109
110
111
112
113
114
115 public String type()
116 {
117 return staticType();
118 }
119
120
121
122
123
124
125
126
127
128 public int size()
129 {
130 return 1;
131 }
132
133
134
135
136
137
138
139
140 public HitVector measuredVector()
141 {
142 return new HitVector(fullCluster().phi());
143 }
144
145
146
147
148
149
150
151
152 public HitError measuredError()
153 {
154 double dphi = fullCluster().dPhi();
155 return new HitError(dphi*dphi);
156 }
157
158
159
160
161
162
163
164
165 public HitVector predictedVector()
166 {
167 return new HitVector(_phi_pre);
168 }
169
170
171
172
173
174
175
176
177 public HitError predictedError()
178 {
179 return new HitError(_ephi_pre);
180 }
181
182
183
184
185
186
187
188
189 public HitDerivative dHitdTrack()
190 {
191 double values[] =
192 { 1.0, 0.0, 0.0, 0.0, 0.0 };
193 return new HitDerivative(1, values);
194 }
195
196
197
198
199
200
201
202
203 public HitVector differenceVector()
204 {
205 return new HitVector(TRFMath.fmod2(_phi_pre - fullCluster().phi(),TRFMath.TWOPI));
206 }
207
208
209
210
211
212
213
214
215 public void update( ETrack tre)
216 {
217 _phi_pre = tre.vector().get(0);
218 _ephi_pre = tre.error().get(0,0);
219 }
220
221
222
223
224
225
226
227
228 public ClusCylPhi fullCluster()
229 {
230 return (ClusCylPhi) _pclus;
231 }
232
233
234
235
236
237
238
239
240 public String toString()
241 {
242 if ( _pclus != null )
243 {
244 return "HitCylPhi prediction for " +_pclus;
245 }
246 else return "No parent cluster.";
247 }
248 }