61 {
62
63 outlier = false;
64 lr = 0;
65 std::vector<AbsMeasurement*> retVal;
67
68 TVector3 point, dir;
70
71
72 TVector3 planeNorm(dir);
75 static const TVector3
z(0,0,1);
76 static const TVector3
x(1,0,0);
77
78
80 TVector3 wirePerp;
81
84
85
90 }
92 }
93 currentWireDir.SetMag(1.);
94
95
96 lr = 1;
97 wirePerp = dir.Cross(currentWireDir);
98 if (gRandom->Uniform(-1,1) >= 0) {
99 wirePerp *= -1.;
100 lr = -1;
101 }
103 }
104
106 outlier = true;
107 if(
debug_) std::cerr <<
"create outlier" << std::endl;
108 }
109
110
111 switch(type){
113 if (
debug_) std::cerr <<
"create PixHit" << std::endl;
114
116
117 TVectorD hitCoords(2);
118 if (outlier) {
121 }
122 else {
125 }
126
127 TMatrixDSym hitCov(2);
130
133 retVal.push_back(measurement);
134 }
135 break;
136
138 if (
debug_) std::cerr <<
"create SpacepointHit" << std::endl;
139
140 TVectorD hitCoords(3);
141 if (outlier) {
145 }
146 else {
147 hitCoords(0) = gRandom->Gaus(point.X(),
resolution_);
148 hitCoords(1) = gRandom->Gaus(point.Y(),
resolution_);
149 hitCoords(2) = gRandom->Gaus(point.Z(),
resolution_);
150 }
151
152 TMatrixDSym hitCov(3);
156
158 retVal.push_back(measurement);
159 }
160 break;
161
163 if (
debug_) std::cerr <<
"create ProlateSpacepointHit" << std::endl;
164
165 TVectorD hitCoords(3);
166 if (outlier) {
170 }
171 else {
172 hitCoords(0) = point.X();
173 hitCoords(1) = point.Y();
174 hitCoords(2) = point.Z();
175 }
176
177 TMatrixDSym hitCov(3);
181
182
183 TVector3 xp = currentWireDir.Orthogonal();
184 xp.SetMag(1);
185 TVector3 yp = currentWireDir.Cross(xp);
186 yp.SetMag(1);
187
188 TMatrixD rot(3,3);
189
190 rot(0,0) = xp.X(); rot(0,1) = yp.X(); rot(0,2) = currentWireDir.X();
191 rot(1,0) = xp.Y(); rot(1,1) = yp.Y(); rot(1,2) = currentWireDir.Y();
192 rot(2,0) = xp.Z(); rot(2,1) = yp.Z(); rot(2,2) = currentWireDir.Z();
193
194
195 TVectorD smearVec(3);
199 smearVec *= rot;
200 if (!outlier) {
201 hitCoords(0) += gRandom->Gaus(0, smearVec(0));
202 hitCoords(1) += gRandom->Gaus(0, smearVec(1));
203 hitCoords(2) += gRandom->Gaus(0, smearVec(2));
204 }
205
206
207
208 hitCov.Similarity(rot);
209
212 retVal.push_back(measurement);
213 }
214 break;
215
217 if (
debug_) std::cerr <<
"create StripHit" << std::endl;
218
219 TVector3 vU, vV;
220 vU = planeNorm.Cross(z);
221 vV = (planeNorm.Cross(z)).Cross(planeNorm);
223
224 TVectorD hitCoords(1);
225 if (outlier)
227 else
229
230 TMatrixDSym hitCov(1);
232
237 retVal.push_back(measurement);
238
239
241 if (outlier)
243 else
245
247
251 retVal.push_back(measurement);
252 }
253 }
254 break;
255
257 if (
debug_) std::cerr <<
"create WireHit" << std::endl;
258
259 if (outlier) {
261 }
262
263 TVectorD hitCoords(7);
264 hitCoords(0) = (point-wirePerp-currentWireDir).
X();
265 hitCoords(1) = (point-wirePerp-currentWireDir).
Y();
266 hitCoords(2) = (point-wirePerp-currentWireDir).
Z();
267
268 hitCoords(3) = (point-wirePerp+currentWireDir).
X();
269 hitCoords(4) = (point-wirePerp+currentWireDir).
Y();
270 hitCoords(5) = (point-wirePerp+currentWireDir).
Z();
271
272 if (outlier)
274 else
275 hitCoords(6) = gRandom->Gaus(wirePerp.Mag(),
resolution_);
276
277 TMatrixDSym hitCov(7);
279
280
284 }
286 retVal.push_back(measurement);
287 }
288 break;
289
291 if (
debug_) std::cerr <<
"create WirePointHit" << std::endl;
292
293 if (outlier) {
295 }
296
297 TVectorD hitCoords(8);
298 hitCoords(0) = (point-wirePerp-currentWireDir).
X();
299 hitCoords(1) = (point-wirePerp-currentWireDir).
Y();
300 hitCoords(2) = (point-wirePerp-currentWireDir).
Z();
301
302 hitCoords(3) = (point-wirePerp+currentWireDir).
X();
303 hitCoords(4) = (point-wirePerp+currentWireDir).
Y();
304 hitCoords(5) = (point-wirePerp+currentWireDir).
Z();
305
306 if (outlier) {
309 }
310 else {
311 hitCoords(6) = gRandom->Gaus(wirePerp.Mag(),
resolution_);
313 }
314
315
316 TMatrixDSym hitCov(8);
319
323 }
325 retVal.push_back(measurement);
326 }
327 break;
328
329 default:
330 std::cerr << "measurement type not defined!" << std::endl;
331 exit(0);
332 }
333
334 return retVal;
335
336}
Contains the measurement and covariance in raw detector coordinates.
void getPosDir(double tracklength, TVector3 &pos, TVector3 &dir) const
Measurement class implementing a planar hit geometry (1 or 2D).
Class for measurements implementing a space point hit geometry with a very prolate form of the covari...
Class for measurements implementing a space point hit geometry.
Class for measurements in wire detectors (Straw tubes and drift chambers) which do not measure the co...
Class for measurements in wire detectors (Straw tubes and drift chambers) which can measure the coord...
boost::shared_ptr< genfit::DetPlane > SharedPlanePtr
Shared Pointer to a DetPlane.