View Javadoc

1   package org.lcsim.recon.tracking.trfbase;
2   
3   // Dummy concrete cluster and hit classes.
4   // These are only used for testing.
5   import org.lcsim.recon.tracking.trfbase.ETrack;
6   import org.lcsim.recon.tracking.trfbase.Hit;
7   import org.lcsim.recon.tracking.trfbase.HitDerivative;
8   import org.lcsim.recon.tracking.trfbase.HitError;
9   import org.lcsim.recon.tracking.trfbase.HitVector;
10  import org.lcsim.recon.tracking.trfutil.Assert;
11  
12  // Hit.
13  public class HitTest extends Hit
14  {
15      
16      private static double _pdata[]= { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0,
17              10.0, 11.0, 12.0, 13.0, 14.0, 15.0 };
18              private static final int SIZE=2;
19              private int _ival;
20              
21              public String toString()
22              {
23                  return "Dummy hit prediction " + _ival + "\n"
24                          + "Cluster address: " + _pclus + "\n"
25                          + "Cluster: " + _pclus + "\n";
26              }
27              
28              protected boolean equal(Hit hp)
29              {
30                  Assert.assertTrue( hp.type().equals(type()) );
31                  return _ival == (( HitTest) hp)._ival;
32              }
33              
34              // static methods
35              // Return the type name.
36              public static String typeName()
37              { return "HitTest";
38              }
39              // Return the type.
40              public static String staticType()
41              { return typeName();
42              }
43              
44              public HitTest(int ival)
45              {
46                  _ival = ival;
47              }
48              
49              HitTest( HitTest ht)
50              {
51                  _ival = ht._ival;
52              }
53              public String type()
54              { return staticType();
55              }
56              
57              public int get_ival()
58              { return _ival;
59              }
60              public int size()
61              { return SIZE;
62              };
63              double[] tmp = new double[2];
64              double[] tmp3 = new double[3];
65              double[] tmp10 = new double[10];
66              public HitVector measuredVector()
67              {
68                  System.arraycopy(_pdata, 0, tmp, 0, 2);
69                  return new HitVector(2,tmp);
70              }
71              public HitError measuredError()
72              {
73                  System.arraycopy(_pdata, 1, tmp3, 0, 3);
74                  return new HitError(2,tmp3);
75              }
76              public HitVector predictedVector()
77              {
78                  System.arraycopy(_pdata, 2, tmp, 0, 2);
79                  return new HitVector(2,tmp);
80              }
81              public HitError predictedError()
82              {
83                  System.arraycopy(_pdata, 3, tmp3, 0, 3);
84                  return new HitError(2,tmp3);
85              }
86              public HitDerivative dHitdTrack()
87              {
88                  System.arraycopy(_pdata, 4, tmp10, 0, 10);
89                  return new HitDerivative(2,tmp10);
90              }
91              public HitVector differenceVector()
92              { return predictedVector().minus(measuredVector());
93              }
94              public void update(ETrack tre)
95              { _ival = 0;
96              }
97  }
98  
99  
100