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
42
43 public static String typeName()
44 { return "HitCylPhiZ"; }
45
46
47
48
49
50
51
52
53
54 public static String staticType()
55 { return typeName(); }
56
57
58 private double _phi_pre;
59
60
61 private double _ephi_pre;
62
63
64
65
66
67
68
69
70
71
72 public boolean equal(Hit hit)
73 {
74 Assert.assertTrue( type().equals(hit.type()) );
75 return cluster().equals(hit.cluster());
76 }
77
78
79 HitCylPhiZ(double phi, double ephi)
80 {
81 _phi_pre = phi;
82 _ephi_pre = ephi;
83 }
84
85
86
87
88
89
90
91
92 public HitCylPhiZ(HitCylPhiZ hcpz)
93 {
94 super(hcpz);
95 _phi_pre = hcpz._phi_pre;
96 _ephi_pre = hcpz._ephi_pre;
97 }
98
99
100
101
102
103
104
105
106
107 public String type()
108 { return staticType(); }
109
110
111
112
113
114
115
116
117
118 public int size()
119 { return 1; }
120
121
122
123
124
125
126
127
128 public HitVector measuredVector()
129 {
130 return new HitVector( fullCluster().phiZ() );
131 }
132
133
134
135
136
137
138
139
140 public HitError measuredError()
141 {
142 double dphi = fullCluster().dPhiZ();
143 return new HitError( dphi*dphi );
144 }
145
146
147
148
149
150
151
152
153 public HitVector predictedVector()
154 {
155 return new HitVector( _phi_pre );
156 }
157
158
159
160
161
162
163
164
165 public HitError predictedError()
166 {
167 return new HitError( _ephi_pre );
168 }
169
170
171
172
173
174
175
176
177 public HitDerivative dHitdTrack()
178 {
179 double values[] =
180 { 1.0, 0.0, 0.0, 0.0, 0.0 };
181 values[1] = fullCluster().stereo();
182 HitDerivative deriv = new HitDerivative(1,values);
183 return deriv;
184
185 }
186
187
188
189
190
191
192
193
194 public HitVector differenceVector()
195 {
196 return new HitVector(
197 TRFMath.fmod2(_phi_pre-fullCluster().phiZ(), TRFMath.TWOPI) );
198 }
199
200
201
202
203
204
205
206
207 public void update( ETrack tre)
208 {
209 double stereo = fullCluster().stereo();
210 _phi_pre = tre.vector().get(0) + stereo*tre.vector().get(1);
211 _ephi_pre = tre.error().get(0,0) + 2.0*stereo*tre.error().get(0,1) +
212 stereo*stereo*tre.error().get(1,1);
213
214 }
215
216
217
218
219
220
221
222
223 public ClusCylPhiZ fullCluster()
224 { return (ClusCylPhiZ) _pclus; };
225
226
227
228
229
230
231
232 public String toString()
233 {
234 return "hit from "+_pclus;
235 }
236 }