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);
73 const std::vector<const BoundTrackParameters*> emptyVector;
79 billoirFitter.fit(emptyVector, linearizer, vfOptions, state).value();
88 billoirFitter.fit(emptyVector, linearizer, vfOptions, state).value();
90 BOOST_CHECK_EQUAL(fittedVertex.position(),
origin);
91 BOOST_CHECK_EQUAL(fittedVertex.fullCovariance(), zeroMat);
95 std::uniform_real_distribution<>
vXYDist(-0.1_mm, 0.1_mm);
97 std::uniform_real_distribution<>
vZDist(-20_mm, 20_mm);
99 std::uniform_real_distribution<>
d0Dist(-0.01_mm, 0.01_mm);
101 std::uniform_real_distribution<>
z0Dist(-0.2_mm, 0.2_mm);
103 std::uniform_real_distribution<>
pTDist(0.4_GeV, 10_GeV);
109 std::uniform_real_distribution<>
qDist(-1, 1);
111 std::uniform_real_distribution<>
resIPDist(0., 100_um);
113 std::uniform_real_distribution<>
resAngDist(0., 0.1);
115 std::uniform_real_distribution<>
resQoPDist(-0.1, 0.1);
117 std::uniform_int_distribution<>
nTracksDist(3, 10);
126 std::mt19937 gen(mySeed);
134 std::make_shared<Propagator<EigenStepper<ConstantBField>>>(
stepper);
141 for (
int eventIdx = 0; eventIdx <
nEvents; ++eventIdx) {
155 myCovMat(0, 0) = 30.;
156 myCovMat(1, 1) = 30.;
157 myCovMat(2, 2) = 30.;
158 myCovMat(3, 3) = 30.;
172 std::shared_ptr<PerigeeSurface> perigeeSurface =
173 Surface::makeShared<PerigeeSurface>(
Vector3D(0., 0., 0.));
175 double d0V = sqrt(x * x + y * y);
179 std::vector<BoundTrackParameters> tracks;
183 for (
unsigned int iTrack = 0; iTrack < nTracks; iTrack++) {
185 double q =
qDist(gen) < 0 ? -1. : 1.;
202 covMat << resD0 * resD0, 0., 0., 0., 0., 0., 0., resZ0 * resZ0, 0., 0.,
203 0., 0., 0., 0., resPh * resPh, 0., 0., 0., 0., 0., 0., resTh * resTh,
204 0., 0., 0., 0., 0., 0., resQp * resQp, 0., 0., 0., 0., 0., 0., 1.;
209 std::vector<const BoundTrackParameters*> tracksPtr;
210 for (
const auto& trk : tracks) {
211 tracksPtr.push_back(&trk);
216 billoirFitter.fit(tracksPtr, linearizer, vfOptions, state).value();
217 if (fittedVertex.
tracks().size() > 0) {
222 billoirFitter.fit(tracksPtr, linearizer, vfOptionsConstr, state)
224 if (fittedVertexConstraint.
tracks().size() > 0) {
228 std::cout <<
"Fitting nTracks: " << nTracks << std::endl;
229 std::cout <<
"True Vertex: " << x <<
", " << y <<
", " << z << std::endl;
230 std::cout <<
"Fitted Vertex: " << fittedVertex.
position() << std::endl;
231 std::cout <<
"Fitted constraint Vertex: "
232 << fittedVertexConstraint.
position() << std::endl;
255 std::mt19937 gen(mySeed);
265 std::make_shared<Propagator<EigenStepper<ConstantBField>>>(
stepper);
272 for (
int eventIdx = 0; eventIdx <
nEvents; ++eventIdx) {
277 std::function<BoundTrackParameters(InputTrack)> extractParameters =
278 [](
InputTrack params) {
return params.parameters(); };
283 VertexFitter billoirFitter(vertexFitterCfg, extractParameters);
290 myCovMat(0, 0) = 30.;
291 myCovMat(1, 1) = 30.;
292 myCovMat(2, 2) = 30.;
293 myCovMat(3, 3) = 30.;
308 std::shared_ptr<PerigeeSurface> perigeeSurface =
309 Surface::makeShared<PerigeeSurface>(
Vector3D(0., 0., 0.));
312 double d0V = sqrt(x * x + y * y);
316 std::vector<InputTrack> tracks;
320 for (
unsigned int iTrack = 0; iTrack < nTracks; iTrack++) {
322 double q =
qDist(gen) < 0 ? -1. : 1.;
339 covMat << resD0 * resD0, 0., 0., 0., 0., 0., 0., resZ0 * resZ0, 0., 0.,
340 0., 0., 0., 0., resPh * resPh, 0., 0., 0., 0., 0., 0., resTh * resTh,
341 0., 0., 0., 0., 0., 0., resQp * resQp, 0., 0., 0., 0., 0., 0., 1.;
346 std::vector<const InputTrack*> tracksPtr;
347 for (
const auto& trk : tracks) {
348 tracksPtr.push_back(&trk);
353 billoirFitter.fit(tracksPtr, linearizer, vfOptions, state).value();
354 if (fittedVertex.
tracks().size() > 0) {
359 billoirFitter.fit(tracksPtr, linearizer, vfOptionsConstr, state)
361 if (fittedVertexConstraint.
tracks().size() > 0) {
365 std::cout <<
"Fitting nTracks: " << nTracks << std::endl;
366 std::cout <<
"True Vertex: " << x <<
", " << y <<
", " << z << std::endl;
367 std::cout <<
"Fitted Vertex: " << fittedVertex.
position() << std::endl;
368 std::cout <<
"Fitted constraint Vertex: "
369 << fittedVertexConstraint.
position() << std::endl;