1 package org.lcsim.recon.tracking.trfzp;
2
3 import java.util.List;
4 import java.util.ArrayList;
5
6 import org.lcsim.recon.tracking.trfutil.Assert;
7
8 import org.lcsim.recon.tracking.trfbase.McCluster;
9 import org.lcsim.recon.tracking.trfbase.ETrack;
10 import org.lcsim.recon.tracking.trfbase.Cluster;
11 import org.lcsim.recon.tracking.trfbase.Surface;
12 import org.lcsim.recon.tracking.trfbase.Hit;
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 public static String typeName()
40 { return "ClusZPlane1"; }
41
42
43
44
45
46
47
48
49
50
51 public static String staticType()
52 { return typeName(); }
53
54
55
56
57 private SurfZPlane _szp;
58
59
60 private double _wx;
61
62
63 private double _wy;
64
65
66 private double _axy;
67
68
69 private double _daxy;
70
71
72
73
74
75
76
77
78
79
80
81 public boolean equal( Cluster clus)
82 {
83 Assert.assertTrue( type().equals(clus.type()) );
84 ClusZPlane1 ccp = (ClusZPlane1) clus;
85 return ( _wx == ccp._wx )
86 && ( _wy == ccp._wy )
87 && ( _axy == ccp._axy )
88 && ( _daxy == ccp._daxy )
89 && ( _szp.equals(ccp._szp) );
90 }
91
92
93
94
95
96
97
98
99
100 public List predict( ETrack tre)
101 {
102 List hits = new ArrayList();
103 double x_track = tre.vector().get(SurfZPlane.IX);
104 double y_track = tre.vector().get(SurfZPlane.IY);
105 double exx_track = tre.error().get(SurfZPlane.IX,SurfZPlane.IX);
106 double exy_track = tre.error().get(SurfZPlane.IX,SurfZPlane.IY);
107 double eyy_track = tre.error().get(SurfZPlane.IY,SurfZPlane.IY);
108
109 double axy = _wx*x_track + _wy*y_track;
110 double eaxy = exx_track*_wx*_wx + 2.*exy_track*_wx*_wy + eyy_track*_wy*_wy;
111
112 hits.add( new HitZPlane1( axy, eaxy ) );
113 return hits;
114 }
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130 public ClusZPlane1(double zpos, double wx, double wy, double axy,double daxy)
131 {
132 _szp = new SurfZPlane(zpos);
133 _wx = wx;
134 _wy = wy;
135 _axy = axy;
136 _daxy = daxy;
137 Assert.assertTrue( _daxy >= 0.0 );
138 }
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153 public ClusZPlane1(double zpos, double wx, double wy, double axy,double daxy, int mcid )
154 {
155 super(mcid);
156 _szp = new SurfZPlane(zpos);
157 _wx = wx;
158 _wy = wy;
159 _axy = axy;
160 _daxy = daxy;
161 Assert.assertTrue( _daxy >= 0.0 );
162 }
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178 public ClusZPlane1(double zpos, double wx, double wy, double axy,double daxy, List mcids )
179 {
180 super(mcids);
181 _szp = new SurfZPlane(zpos);
182 _wx = wx;
183 _wy = wy;
184 _axy = axy;
185 _daxy = daxy;
186 Assert.assertTrue( _daxy >= 0.0 );
187 }
188
189
190
191
192
193
194
195
196 public ClusZPlane1( ClusZPlane1 clus)
197 {
198 super(clus);
199 _szp = new SurfZPlane(clus._szp);
200 _wx = clus._wx;
201 _wy = clus._wy;
202 _axy = clus._axy;
203 _daxy = clus._daxy;
204 }
205
206
207
208
209
210
211
212
213
214 public String type()
215 { return staticType(); }
216
217
218
219
220
221
222
223
224
225 public Surface surface()
226 { return _szp; }
227
228
229
230
231
232
233
234
235 public double wX()
236 { return _wx; }
237
238
239
240
241
242
243
244
245 public double wY()
246 { return _wy; }
247
248
249
250
251
252
253
254
255 public double aXY()
256 { return _axy; }
257
258
259
260
261
262
263
264
265 public double daXY()
266 { return _daxy; }
267
268
269
270
271
272
273
274
275 public Hit newNextPrediction()
276 { return null; }
277
278
279
280
281
282
283
284 public String toString()
285 {
286 return "axy " + _szp + " and x weight " + _wx
287 + " and y weight " + _wy
288 + ": axy = " + _axy + " +/- " + _daxy;
289 }
290
291
292 }