11 #include <boost/test/data/test_case.hpp>
12 #include <boost/test/unit_test.hpp>
35 constexpr
unsigned int dim = 2;
40 return {global.x(), global.y()};
45 std::array<double, dim> lowerLeft{{0., 0.}};
46 std::array<double, dim> upperRight{{1., 1.}};
49 std::array<Acts::Material::ParametersVector, 4> matArray = {mat, mat, mat,
79 for (
size_t i = 0;
i <
grid.size();
i++) {
89 matMap.getMaterialCell({0.5, 0.5, 0.5});
93 std::vector<size_t> nBins = matMap.getNBins();
94 BOOST_CHECK_EQUAL(nBins[0], 3
u);
95 BOOST_CHECK_EQUAL(nBins[1], 3
u);
98 std::vector<double> limits = matMap.getMin();
103 limits = matMap.getMax();
108 BOOST_CHECK_EQUAL(matMap.isInside(
Vector3(1., 1., 1.)),
true);
109 BOOST_CHECK_EQUAL(matMap.isInside(
Vector3(-1., 0., 0.)),
false);
110 BOOST_CHECK_EQUAL(matMap.isInside(
Vector3(0., -1., 0.)),
false);
111 BOOST_CHECK_EQUAL(matMap.isInside(
Vector3(0., 0., -1.)),
true);
112 BOOST_CHECK_EQUAL(matMap.isInside(
Vector3(4., 0., 0.)),
false);
113 BOOST_CHECK_EQUAL(matMap.isInside(
Vector3(0., 4., 0.)),
false);
114 BOOST_CHECK_EQUAL(matMap.isInside(
Vector3(0., 0., 4.)),
true);
117 auto matMapGrid = matMap.getGrid();
118 for (
unsigned int i = 0;
i <
dim;
i++) {
119 BOOST_CHECK_EQUAL(
grid.numLocalBins()[
i], matMapGrid.numLocalBins()[
i]);
120 BOOST_CHECK_EQUAL(
grid.minPosition()[
i], matMapGrid.minPosition()[
i]);
121 BOOST_CHECK_EQUAL(
grid.maxPosition()[
i], matMapGrid.maxPosition()[
i]);
123 for (
size_t i = 0;
i <
grid.size();
i++) {
136 mat << 1, 2, 3, 4, 5;
138 for (
size_t i = 0;
i <
grid.size();
i++) {
149 std::array<double, dim> lowerLeft{{0., 0.}};
150 std::array<double, dim> upperRight{{1., 1.}};
151 std::array<Acts::Material::ParametersVector, 4> matArray = {mat, mat, mat,
154 MaterialMapper<grid_t>::MaterialCell materialCell(
156 InterpolatedMaterialMap<MaterialMapper<grid_t>>::Cache cache;
157 cache.matCell = materialCell;
158 cache.initialized =
true;
160 Material(mat), 1
e-4);
163 BOOST_CHECK_EQUAL(ipolMatMap.isInside(
Vector3(1., 1., 1.)),
true);
164 BOOST_CHECK_EQUAL(ipolMatMap.isInside(
Vector3(-1., 0., 0.)),
false);
165 BOOST_CHECK_EQUAL(ipolMatMap.isInside(
Vector3(0., -1., 0.)),
false);
166 BOOST_CHECK_EQUAL(ipolMatMap.isInside(
Vector3(0., 0., -1.)),
true);
167 BOOST_CHECK_EQUAL(ipolMatMap.isInside(
Vector3(4., 0., 0.)),
false);
168 BOOST_CHECK_EQUAL(ipolMatMap.isInside(
Vector3(0., 4., 0.)),
false);
169 BOOST_CHECK_EQUAL(ipolMatMap.isInside(
Vector3(0., 0., 4.)),
true);