1 package org.lcsim.recon.tracking.trfbase;
2
3
4
5
6 public class TestProp extends Propagator
7 {
8
9
10 public static String typeName()
11 { return "TestProp"; }
12
13 public String get_static_type()
14 { return typeName(); }
15
16 public String toString()
17 {
18 return "Test propagator";
19 }
20
21 public PropStat
22 myprop(VTrack trv, Surface asrf, PropDir dir)
23 {
24 Surface srf = asrf.newPureSurface();
25 trv.setSurface(srf);
26 PropStat pst = new PropStat();
27 TrackVector vec = trv.vector();
28 if ( dir.equals(PropDir.BACKWARD) )
29 {
30 vec.set(1,vec.get(1)-1.0);
31 }
32 else
33 {
34 vec.set(1, vec.get(1)+1.0);
35 }
36 trv.setVector(vec);
37 return pst;
38 }
39
40 public String get_type()
41 { return get_static_type(); }
42
43 public Propagator newPropagator()
44 {
45 return new TestProp();
46 }
47
48 public PropStat vecProp(VTrack trv, Surface srf,
49 TrackDerivative pder )
50 {
51 return myprop(trv,srf,PropDir.NEAREST);
52 }
53
54 public PropStat vecProp(VTrack trv, Surface srf)
55 {
56 TrackDerivative pder = null;
57 return vecProp(trv, srf, pder);
58 }
59
60 public PropStat vecDirProp(VTrack trv, Surface srf,
61 PropDir dir, TrackDerivative pder)
62 {
63 return myprop(trv,srf,dir);
64 }
65
66 public PropStat vecDirProp(VTrack trv, Surface srf,
67 PropDir dir)
68 {
69 TrackDerivative pder = null;
70 return vecDirProp(trv,srf,dir,pder);
71 }
72
73 public PropStat errProp(ETrack trv, Surface srf,
74 TrackDerivative pder)
75 {
76 return myprop(trv,srf,PropDir.NEAREST);
77 }
78
79 public PropStat errProp(ETrack trv, Surface srf)
80 {
81 TrackDerivative pder = null;
82 return errProp(trv,srf,pder);
83 }
84
85 public PropStat errDirProp(ETrack trv, Surface srf,
86 PropDir dir, TrackDerivative pder)
87 {
88 return myprop(trv,srf,dir);
89 }
90
91 public PropStat errDirProp(ETrack trv, Surface srf,
92 PropDir dir)
93 {
94 TrackDerivative pder = null;
95 return errDirProp(trv,srf,dir, pder);
96 }
97 }