View Javadoc

1   package org.lcsim.recon.tracking.trfbase;
2   import org.lcsim.recon.tracking.trfutil.Assert;
3   
4   /** Defines a miss with fixed surface and likelihood.
5    *
6    * 
7    *@author Norman A. Graf
8    *@version 1.0
9    *
10   */
11  
12  public class MissFixed extends Miss
13  {
14      
15      // attributes
16      
17      // Type identifier.
18      private String _mytype = "MissTest";
19      
20      // Surface.
21      Surface _srf;
22      
23      // Likelihood.
24      double _like;
25      
26      // methods
27      
28      //
29      
30      /**
31       *Constructor from surface and likelihood.
32       *
33       * @param   srf Surface for this Miss
34       * @param   like likelihood for this Miss
35       */
36      public MissFixed( Surface srf, double like)
37      {
38          _srf = srf;
39          _like = like;
40          Assert.assertTrue( _srf != null );
41          Assert.assertTrue( _like >= 0.0 );
42          Assert.assertTrue( _like <= 1.0 );
43      }
44      
45      //
46      /**
47       *Return the type identifier
48       *
49       * @return String type of this class
50       *Included only for completeness with C++ version
51       */
52      public String type()
53      { return _mytype; }
54      
55      //
56      
57      /**
58       * clone
59       *
60       * @return new copy of this Miss
61       */
62      public Miss newCopy()
63      {
64          return new MissFixed( _srf, _like);
65      }
66      
67      //
68      
69      /**
70       *update the likelihood with a new track
71       *
72       * @param   tre ETrack to update the Miss likelihood
73       */
74      public void update( ETrack tre)
75      {
76      }
77      
78      //
79      
80      /**
81       *return the surface
82       *
83       * @return Surface for this Miss
84       */
85      public Surface surface()
86      {
87          return _srf;
88      }
89      
90      //
91      
92      /**
93       *return the likelihood
94       *
95       * @return likelihood for this Miss
96       */
97      public double likelihood()
98      {
99          return _like;
100     }
101     
102     
103     /**
104      *output stream
105      *
106      * @return String representation for this class
107      */
108     public String toString()
109     {
110         String className = getClass().getName();
111         int lastDot = className.lastIndexOf('.');
112         if(lastDot!=-1)className = className.substring(lastDot+1);
113         
114         return className+" Fixed miss at " +_srf + " with likelihood " + _like;
115     }
116     
117 }