9 #include <boost/test/data/test_case.hpp>
10 #include <boost/test/tools/output_test_stream.hpp>
11 #include <boost/test/unit_test.hpp>
26 using namespace Acts::UnitLiterals;
33 HelicalTrackLinearizer<Propagator<EigenStepper<ConstantBField>>>;
50 std::make_shared<Propagator<EigenStepper<ConstantBField>>>(
stepper);
71 const std::vector<const BoundParameters*> emptyVector;
77 billoirFitter.
fit(emptyVector, linearizer, vfOptions).value();
85 fittedVertex = billoirFitter.
fit(emptyVector, linearizer, vfOptions).value();
87 BOOST_CHECK_EQUAL(fittedVertex.position(),
origin);
88 BOOST_CHECK_EQUAL(fittedVertex.fullCovariance(), zeroMat);
96 std::uniform_real_distribution<>
d0Dist(-0.01
_mm, 0.01
_mm);
98 std::uniform_real_distribution<>
z0Dist(-0.2
_mm, 0.2
_mm);
106 std::uniform_real_distribution<>
qDist(-1, 1);
110 std::uniform_real_distribution<>
resAngDist(0., 0.1);
112 std::uniform_real_distribution<>
resQoPDist(-0.1, 0.1);
114 std::uniform_int_distribution<>
nTracksDist(3, 10);
124 std::mt19937 gen(mySeed);
132 std::make_shared<Propagator<EigenStepper<ConstantBField>>>(
stepper);
139 for (
int eventIdx = 0; eventIdx <
nEvents; ++eventIdx) {
152 myCovMat(0, 0) = 30.;
153 myCovMat(1, 1) = 30.;
154 myCovMat(2, 2) = 30.;
155 myCovMat(3, 3) = 30.;
168 std::shared_ptr<PerigeeSurface> perigeeSurface =
169 Surface::makeShared<PerigeeSurface>(
Vector3D(0., 0., 0.));
171 double d0V = sqrt(x * x + y * y);
175 std::vector<BoundParameters> tracks;
179 for (
unsigned int iTrack = 0; iTrack < nTracks; iTrack++) {
181 double q =
qDist(gen) < 0 ? -1. : 1.;
198 covMat << resD0 * resD0, 0., 0., 0., 0., 0., 0., resZ0 * resZ0, 0., 0.,
199 0., 0., 0., 0., resPh * resPh, 0., 0., 0., 0., 0., 0., resTh * resTh,
200 0., 0., 0., 0., 0., 0., resQp * resQp, 0., 0., 0., 0., 0., 0., 1.;
205 std::vector<const BoundParameters*> tracksPtr;
206 for (
const auto& trk : tracks) {
207 tracksPtr.push_back(&trk);
212 billoirFitter.
fit(tracksPtr, linearizer, vfOptions).value();
213 if (fittedVertex.
tracks().size() > 0) {
218 billoirFitter.
fit(tracksPtr, linearizer, vfOptionsConstr).value();
219 if (fittedVertexConstraint.
tracks().size() > 0) {
224 std::cout <<
"Fitting nTracks: " << nTracks << std::endl;
225 std::cout <<
"True Vertex: " << x <<
", " << y <<
", " << z << std::endl;
226 std::cout <<
"Fitted Vertex: " << fittedVertex.
position() << std::endl;
227 std::cout <<
"Fitted constraint Vertex: "
228 << fittedVertexConstraint.
position() << std::endl;
254 std::mt19937 gen(mySeed);
264 std::make_shared<Propagator<EigenStepper<ConstantBField>>>(
stepper);
271 for (
int eventIdx = 0; eventIdx <
nEvents; ++eventIdx) {
276 std::function<BoundParameters(InputTrack)> extractParameters =
277 [](
InputTrack params) {
return params.parameters(); };
282 vertexFitterCfg, extractParameters);
288 myCovMat(0, 0) = 30.;
289 myCovMat(1, 1) = 30.;
290 myCovMat(2, 2) = 30.;
291 myCovMat(3, 3) = 30.;
306 std::shared_ptr<PerigeeSurface> perigeeSurface =
307 Surface::makeShared<PerigeeSurface>(
Vector3D(0., 0., 0.));
310 double d0V = sqrt(x * x + y * y);
314 std::vector<InputTrack> tracks;
318 for (
unsigned int iTrack = 0; iTrack < nTracks; iTrack++) {
320 double q =
qDist(gen) < 0 ? -1. : 1.;
337 covMat << resD0 * resD0, 0., 0., 0., 0., 0., 0., resZ0 * resZ0, 0., 0.,
338 0., 0., 0., 0., resPh * resPh, 0., 0., 0., 0., 0., 0., resTh * resTh,
339 0., 0., 0., 0., 0., 0., resQp * resQp, 0., 0., 0., 0., 0., 0., 1.;
341 paramVec, perigeeSurface)));
344 std::vector<const InputTrack*> tracksPtr;
345 for (
const auto& trk : tracks) {
346 tracksPtr.push_back(&trk);
351 billoirFitter.
fit(tracksPtr, linearizer, vfOptions).value();
352 if (fittedVertex.
tracks().size() > 0) {
357 billoirFitter.
fit(tracksPtr, linearizer, vfOptionsConstr).value();
358 if (fittedVertexConstraint.
tracks().size() > 0) {
363 std::cout <<
"Fitting nTracks: " << nTracks << std::endl;
364 std::cout <<
"True Vertex: " << x <<
", " << y <<
", " << z << std::endl;
365 std::cout <<
"Fitted Vertex: " << fittedVertex.
position() << std::endl;
366 std::cout <<
"Fitted constraint Vertex: "
367 << fittedVertexConstraint.
position() << std::endl;