24 #include <PlanarMeasurement.h>
26 #include <SpacepointMeasurement.h>
50 idealLRResolution_(
true),
54 measurementCounter_(0),
65 std::vector<AbsMeasurement*> retVal;
72 TVector3 planeNorm(dir);
75 static const TVector3
z(0,0,1);
76 static const TVector3
x(1,0,0);
93 currentWireDir.SetMag(1.);
97 wirePerp = dir.Cross(currentWireDir);
98 if (gRandom->Uniform(-1,1) >= 0) {
107 if(
debug_) std::cerr <<
"create outlier" << std::endl;
113 if (
debug_) std::cerr <<
"create PixHit" << std::endl;
117 TVectorD hitCoords(2);
127 TMatrixDSym hitCov(2);
133 retVal.push_back(measurement);
138 if (
debug_) std::cerr <<
"create SpacepointHit" << std::endl;
140 TVectorD hitCoords(3);
147 hitCoords(0) = gRandom->Gaus(point.X(),
resolution_);
148 hitCoords(1) = gRandom->Gaus(point.Y(),
resolution_);
149 hitCoords(2) = gRandom->Gaus(point.Z(),
resolution_);
152 TMatrixDSym hitCov(3);
158 retVal.push_back(measurement);
163 if (
debug_) std::cerr <<
"create ProlateSpacepointHit" << std::endl;
165 TVectorD hitCoords(3);
172 hitCoords(0) = point.X();
173 hitCoords(1) = point.Y();
174 hitCoords(2) = point.Z();
177 TMatrixDSym hitCov(3);
183 TVector3 xp = currentWireDir.Orthogonal();
185 TVector3 yp = currentWireDir.Cross(xp);
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();
195 TVectorD smearVec(3);
201 hitCoords(0) += gRandom->Gaus(0, smearVec(0));
202 hitCoords(1) += gRandom->Gaus(0, smearVec(1));
203 hitCoords(2) += gRandom->Gaus(0, smearVec(2));
208 hitCov.Similarity(rot);
212 retVal.push_back(measurement);
217 if (
debug_) std::cerr <<
"create StripHit" << std::endl;
220 vU = planeNorm.Cross(z);
221 vV = (planeNorm.Cross(z)).Cross(planeNorm);
224 TVectorD hitCoords(1);
230 TMatrixDSym hitCov(1);
237 retVal.push_back(measurement);
244 hitCoords(0) = gRandom->Gaus(0,resolution_);
251 retVal.push_back(measurement);
257 if (
debug_) std::cerr <<
"create WireHit" << std::endl;
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();
268 hitCoords(3) = (point-wirePerp+currentWireDir).
X();
269 hitCoords(4) = (point-wirePerp+currentWireDir).
Y();
270 hitCoords(5) = (point-wirePerp+currentWireDir).
Z();
275 hitCoords(6) = gRandom->Gaus(wirePerp.Mag(),
resolution_);
277 TMatrixDSym hitCov(7);
286 retVal.push_back(measurement);
291 if (
debug_) std::cerr <<
"create WirePointHit" << std::endl;
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();
302 hitCoords(3) = (point-wirePerp+currentWireDir).
X();
303 hitCoords(4) = (point-wirePerp+currentWireDir).
Y();
304 hitCoords(5) = (point-wirePerp+currentWireDir).
Z();
311 hitCoords(6) = gRandom->Gaus(wirePerp.Mag(),
resolution_);
316 TMatrixDSym hitCov(8);
325 retVal.push_back(measurement);
330 std::cerr <<
"measurement type not defined!" << std::endl;