1 package org.lcsim.recon.tracking.trfcyl;
2
3 import java.util.*;
4 import org.lcsim.recon.tracking.trfutil.Assert;
5 import org.lcsim.recon.tracking.trfbase.McCluster;
6 import org.lcsim.recon.tracking.trfbase.Cluster;
7 import org.lcsim.recon.tracking.trfbase.Hit;
8 import org.lcsim.recon.tracking.trfbase.ETrack;
9 import org.lcsim.recon.tracking.trfbase.Surface;
10
11
12
13
14
15
16
17 public class ClusCylPhiZ2D extends McCluster
18 {
19
20
21
22
23
24
25
26
27
28
29
30 public static String typeName()
31 { return "ClusCylPhiZ2D";
32 }
33
34
35
36
37
38
39
40
41
42 public static String staticType()
43 { return typeName();
44 }
45
46
47
48
49 private SurfCylinder _scy;
50
51
52 private double _phi;
53
54
55 private double _dphi;
56
57
58 private double _z;
59
60
61 private double _dz;
62
63
64 private double _dphidz;
65
66
67
68
69
70
71
72
73
74
75
76 public boolean equal(Cluster clus)
77 {
78 Assert.assertTrue( type().equals(clus.type()) );
79 ClusCylPhiZ2D ccpz = ( ClusCylPhiZ2D ) clus;
80 return ( _phi == ccpz._phi ) && ( _dphi == ccpz._dphi ) &&
81 ( _z == ccpz._z ) && ( _dz == ccpz._dz ) &&
82 ( _scy.equals(ccpz._scy) );
83 }
84
85
86
87
88
89
90
91
92
93 public List predict(ETrack tre)
94 {
95 List hits = new ArrayList();
96 double phi = tre.vector().get(SurfCylinder.IPHI);
97 double dphi = tre.error().get(SurfCylinder.IPHI, SurfCylinder.IPHI);
98 double z = tre.vector().get(SurfCylinder.IZ);
99 double dz = tre.error().get(SurfCylinder.IZ,SurfCylinder.IZ);
100 double dphidz = 0.;
101 hits.add( new HitCylPhiZ2D( phi, dphi, z, dz, dphidz ) );
102 return hits;
103 }
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121 public ClusCylPhiZ2D(double radius, double phi, double dphi, double z, double dz, double dphidz)
122 {
123 _scy = new SurfCylinder(radius);
124 _phi = phi;
125 _dphi = dphi;
126 _z = z;
127 _dz = dz;
128 _dphidz = dphidz;
129 Assert.assertTrue( _dphi >= 0.0 );
130 Assert.assertTrue( _dz >= 0.0 );
131 }
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148 public ClusCylPhiZ2D(double radius, double phi, double dphi, double z, double dz, double dphidz,
149 int mcid)
150 {
151 super(mcid);
152 _scy = new SurfCylinder(radius);
153 _phi = phi;
154 _dphi = dphi;
155 _z = z;
156 _dz = dz;
157 _dphidz = dphidz;
158 Assert.assertTrue( _dphi >= 0.0 );
159 Assert.assertTrue( _dz >= 0.0 );
160 }
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177 public ClusCylPhiZ2D(double radius, double phi, double dphi, double z, double dz, double dphidz,
178 List mcids)
179 {
180 super(mcids);
181 _scy = new SurfCylinder(radius);
182 _phi = phi;
183 _dphi = dphi;
184 _z = z;
185 _dz = dz;
186 _dphidz = dphidz;
187 Assert.assertTrue( _dphi >= 0.0 );
188 Assert.assertTrue( _dz >= 0.0 );
189 }
190
191
192
193
194
195
196
197
198 public ClusCylPhiZ2D(ClusCylPhiZ2D ccpz)
199 {
200 super(ccpz);
201 _scy = new SurfCylinder(ccpz._scy);
202 _phi = ccpz._phi;
203 _dphi = ccpz._dphi;
204 _z = ccpz._z;
205 _dz = ccpz._dz;
206 _dphidz = ccpz._dphidz;
207 }
208
209
210
211
212
213
214
215
216
217 public String type()
218 {
219 return staticType();
220 }
221
222
223
224
225
226
227
228
229 public Surface surface()
230 {
231 return _scy;
232 }
233
234
235
236
237
238
239
240
241 public double phi()
242 {
243 return _phi;
244 }
245
246
247
248
249
250
251
252
253 public double dPhi()
254 {
255 return _dphi;
256 }
257
258
259
260
261
262
263
264
265 public double z()
266 {
267 return _z;
268 }
269
270
271
272
273
274
275
276
277 public double dZ()
278 {
279 return _dz;
280 }
281
282
283
284
285
286
287
288
289 public double dPhidZ()
290 {
291 return _dphidz;
292 }
293
294
295
296
297
298
299
300
301 public double radius()
302 {
303 return _scy.radius();
304 }
305
306
307
308
309
310
311
312
313 public Hit newNextPrediction()
314 { return null;
315 }
316
317
318
319
320
321
322
323 public String toString()
324 {
325 StringBuffer sb = new StringBuffer("ClusCylPhiZ2D at " + _scy
326 + "\n phi = " + _phi + " +/- " + _dphi
327 + "\n z = " + _z + " +/- " + _dz);
328 List mcids = mcIds();
329 if ( mcids.size() > 0)
330 {
331 sb.append( "\n MC ID's:");
332 for ( Iterator it=mcids.iterator(); it.hasNext(); )
333 {
334 sb.append( " " + it.next());
335 }
336 sb.append("\n");
337 }
338 return sb.toString();
339
340 }
341 }
342
343