View Javadoc

1   package org.lcsim.recon.tracking.trfbase;
2   
3   import org.lcsim.recon.tracking.trfbase.ETrack;
4   import org.lcsim.recon.tracking.trfbase.Interactor;
5   import org.lcsim.recon.tracking.trfbase.TrackError;
6   
7   // A file to test the abstract Interactor class.
8   
9   public class InteractorTest extends Interactor
10  {
11      
12      // static methods
13      
14      // Return the type name.
15      public static String get_type_name()
16      {
17          return "InteractorTest";
18      }
19      
20      // Return the type.
21      public static String get_static_type()
22      {
23          return get_type_name();
24      }
25      
26      // attributes
27      
28      private double _errfac;
29      
30      // methods
31      
32      // constructor
33      public InteractorTest(double errfac)
34      {
35          _errfac = errfac;
36      }
37      
38      // copy Constructor
39      public InteractorTest(InteractorTest it)
40      {
41          _errfac = it._errfac;
42      }
43      
44      // Return the type.
45      public String get_type()
46      {
47          return get_static_type();
48      }
49      
50      // method for adding the interaction:
51      public void interact(ETrack tre)
52      {
53          TrackError err = tre.error();
54          err.set(0,0, err.get(0,0)*_errfac);
55          tre.setError(err);
56      }
57      
58      // return the error factor
59      public double get_errfac()
60      {
61          return _errfac;
62      }
63      
64      // make a clone
65      public Interactor newCopy()
66      {
67          return new InteractorTest(this);
68      }
69      
70      public String toString()
71      {
72          return "Test Interactor";
73      }
74      
75  }
76  
77