1 package org.lcsim.recon.tracking.trfzp;
2
3
4 import org.lcsim.recon.tracking.trfutil.Assert;
5
6 import org.lcsim.recon.tracking.trfbase.HitGenerator;
7 import org.lcsim.recon.tracking.trfbase.VTrack;
8 import org.lcsim.recon.tracking.trfbase.Surface;
9 import org.lcsim.recon.tracking.trfbase.Cluster;
10
11
12
13
14
15
16
17
18 public class HitZPlane1Generator extends HitGenerator
19 {
20
21
22
23
24 private SurfZPlane _szp;
25
26
27 private double _wx;
28
29
30 private double _wy;
31
32
33 private double _daxy;
34
35
36
37
38
39
40
41
42
43
44
45
46 public HitZPlane1Generator(double zpos, double wx, double wy,double daxy)
47 {
48 super();
49 _szp = new SurfZPlane(zpos);
50 _wx = wx;
51 _wy = wy;
52 _daxy = daxy;
53 Assert.assertTrue( _daxy >= 0.0 );
54 }
55
56
57
58
59
60
61
62
63
64
65
66
67
68 public HitZPlane1Generator(double zpos, double wx, double wy,
69 double daxy, long iseed)
70 {
71 super(iseed);
72 _szp = new SurfZPlane(zpos);
73 _wx = wx;
74 _wy = wy;
75 _daxy = daxy;
76 Assert.assertTrue( _daxy >= 0.0 );
77 }
78
79
80
81
82
83
84
85
86 public HitZPlane1Generator( HitZPlane1Generator gen)
87 {
88 super(gen);
89 _szp = new SurfZPlane(gen._szp);
90 _wx = gen._wx;
91 _wy = gen._wy;
92 _daxy = gen._daxy;
93 Assert.assertTrue( _daxy >= 0.0 );
94 }
95
96
97
98
99
100
101
102
103 public Surface surface()
104 { return _szp; }
105
106
107
108
109
110
111
112
113
114
115 public Cluster newCluster( VTrack trv)
116 {
117 return newCluster(trv, 0);
118 }
119
120
121
122
123
124
125
126
127
128 public Cluster newCluster( VTrack trv, int mcid)
129 {
130
131
132 Assert.assertTrue( _szp.pureEqual( trv.surface() ) );
133 if ( ! _szp.pureEqual( trv.surface() ) ) return null;
134
135
136 double x_track = trv.vector().get(SurfZPlane.IX);
137 double y_track = trv.vector().get(SurfZPlane.IY);
138 double axy = _wx*x_track + _wy*y_track
139 + _daxy*gauss();
140
141
142 double zpos = _szp.parameter(SurfZPlane.ZPOS);
143 return new ClusZPlane1(zpos, _wx, _wy, axy, _daxy, mcid );
144 }
145
146
147
148
149
150
151
152 public String toString()
153 {
154 return "Surface: " + _szp
155 + "\n X slope: " + _wx +" Y slope: " + _wy
156 + "\n Measurement error (daxy): " + _daxy ;
157 }
158
159 }
160