9 #include <boost/test/data/test_case.hpp>
10 #include <boost/test/tools/output_test_stream.hpp>
11 #include <boost/test/unit_test.hpp>
21 using namespace Acts::UnitLiterals;
33 const int mainGridSize = 400;
34 const int trkGridSize = 15;
37 double zMinMax = mainGridSize / 2 * binSize;
45 covMat << 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0,
46 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1;
49 paramVec1 << 0.01, 0.15, 0, 0, 0, 0;
52 paramVec2 << trkGridSize * binSize - 0.1, 0.15, 0, 0, 0, 0;
55 paramVec3 << trkGridSize * binSize + 0.01, 0.15, 0, 0, 0, 0;
58 paramVec3_1 << -(trkGridSize * binSize + 0.01), 0.15, 0, 0, 0, 0;
61 paramVec4 << 0.01, 19.95, 0, 0, 0, 0;
64 paramVec5 << 0.01, -19.95, 0, 0, 0, 0;
67 paramVec6 << 0.01, -100.0, 0, 0, 0, 0;
70 paramVec7 << 0.01, +100.0, 0, 0, 0, 0;
73 std::shared_ptr<PerigeeSurface> perigeeSurface =
74 Surface::makeShared<PerigeeSurface>(
Vector3D(0., 0., 0.));
90 std::pair<int, Acts::ActsVectorF<trkGridSize>> binAndTrackGrid;
93 binAndTrackGrid = grid.
addTrack(params3, mainGrid);
94 binAndTrackGrid = grid.
addTrack(params3_1, mainGrid);
96 binAndTrackGrid = grid.
addTrack(params6, mainGrid);
97 binAndTrackGrid = grid.
addTrack(params7, mainGrid);
104 binAndTrackGrid = grid.
addTrack(params1, mainGrid);
105 auto gridCopy = mainGrid;
108 binAndTrackGrid = grid.
addTrack(params2, mainGrid);
112 BOOST_CHECK(gridCopy.sum() > mainGrid.sum());
116 binAndTrackGrid = grid.
addTrack(params1, mainGrid);
117 BOOST_CHECK(gridCopy.sum() < mainGrid.sum());
119 binAndTrackGrid = grid.
addTrack(params4, mainGrid);
122 BOOST_CHECK_EQUAL(mainGrid(mainGridSize -
int((trkGridSize - 1) / 2) - 2),
124 BOOST_CHECK(mainGrid(mainGridSize -
int((trkGridSize - 1) / 2) - 1) > 0.);
125 BOOST_CHECK(mainGrid(mainGridSize - 1) > 0.);
127 binAndTrackGrid = grid.
addTrack(params5, mainGrid);
129 BOOST_CHECK_EQUAL(mainGrid(
int((trkGridSize - 1) / 2) + 1), 0.);
130 BOOST_CHECK(mainGrid(
int((trkGridSize - 1) / 2)) > 0.);
131 BOOST_CHECK(mainGrid(0) > 0.);
135 int maxBin = (*maxRes / binSize) + mainGridSize / 2;
136 BOOST_CHECK_EQUAL(maxBin, mainGridSize / 2 + 1);
141 BOOST_CHECK(!maxResErr.ok());
144 binAndTrackGrid = grid.
addTrack(params1, mainGrid);
145 binAndTrackGrid = grid.
addTrack(params2, mainGrid);
148 binAndTrackGrid = grid.
addTrack(params4, mainGrid);
150 BOOST_CHECK(gridCopy != mainGrid);
152 int zBin = binAndTrackGrid.first;
153 auto trackGrid = binAndTrackGrid.second;
156 BOOST_CHECK_EQUAL(gridCopy, mainGrid);
162 const int mainGridSize = 50;
163 const int trkGridSize = 11;
165 double binSize = 0.1;
166 double zMinMax = mainGridSize / 2 * binSize;
175 covMat << 1
e-2, 0, 0, 0, 0, 0, 0, 1e-2, 0, 0, 0, 0, 0, 0, 1e-2, 0, 0, 0, 0, 0,
176 0, 1e-2, 0, 0, 0, 0, 0, 0, 1e-2, 0, 0, 0, 0, 0, 0, 1e-2;
178 const double posZ1 = -1.75;
179 const double posZ2 = 1.75;
184 paramVec1 << 0.01, posZ1, 0, 0, 0, 0;
186 paramVec2 << 0.015, posZ2, 0, 0, 0, 0;
189 std::shared_ptr<PerigeeSurface> perigeeSurface =
190 Surface::makeShared<PerigeeSurface>(
Vector3D(0., 0., 0.));
200 std::pair<int, Acts::ActsVectorF<trkGridSize>> binAndTrackGrid;
202 binAndTrackGrid = grid.
addTrack(params1, mainGrid);
203 binAndTrackGrid = grid.
addTrack(params2, mainGrid);
206 int maxZbin = (posZ2 / binSize + mainGridSize / 2.);
207 mainGrid(maxZbin - 1) += 1;
208 mainGrid(maxZbin + 1) += 1;
214 BOOST_CHECK(maxRes.ok());
215 BOOST_CHECK_EQUAL(*maxRes, posZ2);
221 const int mainGridSize = 50;
222 const int trkGridSize = 11;
224 double binSize = 0.1;
225 double zMinMax = mainGridSize / 2 * binSize;
234 covMat << 1
e-2, 0, 0, 0, 0, 0, 0, 1e-2, 0, 0, 0, 0, 0, 0, 1e-2, 0, 0, 0, 0, 0,
235 0, 1e-2, 0, 0, 0, 0, 0, 0, 1e-2, 0, 0, 0, 0, 0, 0, 1e-2;
237 const double posZ1 = -1.75;
238 const double posZ2 = 1.75;
243 paramVec1 << 0.01, posZ1, 0, 0, 0, 0;
245 paramVec2 << 0.015, posZ2, 0, 0, 0, 0;
248 std::shared_ptr<PerigeeSurface> perigeeSurface =
249 Surface::makeShared<PerigeeSurface>(
Vector3D(0., 0., 0.));
259 std::pair<int, Acts::ActsVectorF<trkGridSize>> binAndTrackGrid;
261 binAndTrackGrid = grid.
addTrack(params1, mainGrid);
262 binAndTrackGrid = grid.
addTrack(params2, mainGrid);
265 int maxZbin = (posZ2 / binSize + mainGridSize / 2.);
266 mainGrid(maxZbin - 1) += 1;
267 mainGrid(maxZbin + 1) += 1;
274 BOOST_CHECK(maxRes.ok());
275 double z = (*maxRes).first;
276 double width = (*maxRes).second;
278 BOOST_CHECK_EQUAL(z, posZ2);
280 BOOST_CHECK(width != 0.);