View Javadoc

1   package org.lcsim.recon.tracking.trfbase;
2   // Concrete Miss class for testing Miss and providing an example.
3   
4   import org.lcsim.recon.tracking.trfbase.ETrack;
5   import org.lcsim.recon.tracking.trfbase.Miss;
6   import org.lcsim.recon.tracking.trfbase.Surface;
7   
8   // Dummy miss class.
9   
10  public class MissTest extends Miss
11  {
12      
13      // attributes
14      
15      // static pointer specifying the type
16      static String _mytype = "MissTest";
17      
18      // surface
19      private SurfTest _srf;
20      
21      // fixed likelihood -- in a real miss this would be calculated
22      // from the track and surface
23      private double _like;
24      
25      // constructor from surface and likelihood
26      public MissTest(double par,double like)
27      {
28          _srf = new SurfTest(par);
29          _like = like;
30      }
31      
32      // return the type identifier
33      public String type()
34      { return _mytype; }
35      
36      //
37      /** clone
38       * @return new copy of this Miss
39       */
40      public Miss newCopy()
41      {
42          return new MissTest(_srf.parameter(0),_like);
43      }
44      
45      // update the likelihood -- again should use track and surface;
46      // here we simply decrease the old value by 10%
47      /** update the likelihood
48       * @param tre ETrack to update the likelihood
49       */
50      public void update( ETrack tre)
51      { _like *= 0.9; }
52      
53      // return the surface
54      public  Surface surface()
55      {
56          return new SurfTest(_srf);
57      }
58      
59      // return the likelihood
60      public double likelihood()
61      { return _like; }
62      
63      public String toString()
64      {
65          return  "Miss Test layer with surface " + _srf
66                  + "\n and fixed likelihood = " + _like;
67          
68      }
69      
70      public boolean equals( MissTest miss)
71      {
72          if( ! _srf.equals(miss._srf) ) return false;
73          if( _like != miss._like ) return false;
74          return true;
75      }
76      
77  }