12 std::array<double, 3> gridAxis2) {
14 size_t nBinsAxis1 = gridAxis1[2];
15 size_t nBinsAxis2 = gridAxis2[2];
18 double minAxis1 = gridAxis1[0];
19 double minAxis2 = gridAxis2[0];
20 double maxAxis1 = gridAxis1[1];
21 double maxAxis2 = gridAxis2[1];
25 double stepAxis1 = std::fabs(maxAxis1 - minAxis1) / (nBinsAxis1 - 1);
26 double stepAxis2 = std::fabs(maxAxis2 - minAxis2) / (nBinsAxis2 - 1);
27 maxAxis1 += stepAxis1;
28 maxAxis2 += stepAxis2;
35 return Acts::Grid2D(std::make_tuple(std::move(axis1), std::move(axis2)));
39 std::array<double, 3> gridAxis2,
40 std::array<double, 3> gridAxis3) {
42 size_t nBinsAxis1 = gridAxis1[2];
43 size_t nBinsAxis2 = gridAxis2[2];
44 size_t nBinsAxis3 = gridAxis3[2];
47 double minAxis1 = gridAxis1[0];
48 double minAxis2 = gridAxis2[0];
49 double minAxis3 = gridAxis3[0];
50 double maxAxis1 = gridAxis1[1];
51 double maxAxis2 = gridAxis2[1];
52 double maxAxis3 = gridAxis3[1];
56 double stepAxis1 = std::fabs(maxAxis1 - minAxis1) / (nBinsAxis1 - 1);
57 double stepAxis2 = std::fabs(maxAxis2 - minAxis2) / (nBinsAxis2 - 1);
58 double stepAxis3 = std::fabs(maxAxis3 - minAxis3) / (nBinsAxis3 - 1);
59 maxAxis1 += stepAxis1;
60 maxAxis2 += stepAxis2;
61 maxAxis3 += stepAxis3;
70 std::make_tuple(std::move(axis1), std::move(axis2), std::move(axis3)));
75 std::function<double(Acts::Vector3D)> transfoGlobalToLocal;
113 throw std::invalid_argument(
"Incorrect bin, should be x,y,z,r,phi,z");
116 return transfoGlobalToLocal;
124 std::array<double, 3> gridAxis1;
125 std::array<double, 3> gridAxis2;
127 bool isCartesian =
false;
128 bool isCylindrical =
false;
130 for (
size_t b = 0;
b < bu.size();
b++) {
135 isCylindrical =
true;
138 if (!(isCartesian || isCylindrical) || (isCylindrical && isCartesian)) {
139 throw std::invalid_argument(
"Incorrect bin, should be x,y,z or r,phi,z");
142 gridAxis1[0] = bu[0].min;
143 gridAxis1[1] = bu[0].max;
144 gridAxis1[2] = bu[0].bins();
146 gridAxis2[0] = bu[1].min;
147 gridAxis2[1] = bu[1].max;
148 gridAxis2[2] = bu[1].bins();
150 std::function<double(Acts::Vector3D)> coord1 =
152 std::function<double(Acts::Vector3D)> coord2 =
155 transfoGlobalToLocal = [coord1,
157 return {coord1(
pos), coord2(
pos)};
167 std::array<double, 3> gridAxis1;
168 std::array<double, 3> gridAxis2;
169 std::array<double, 3> gridAxis3;
171 bool isCartesian =
false;
172 bool isCylindrical =
false;
174 for (
size_t b = 0;
b < bu.size();
b++) {
179 isCylindrical =
true;
182 if (!(isCartesian || isCylindrical) || (isCylindrical && isCartesian)) {
183 throw std::invalid_argument(
"Incorrect bin, should be x,y,z or r,phi,z");
186 gridAxis1[0] = bu[0].min;
187 gridAxis1[1] = bu[0].max;
188 gridAxis1[2] = bu[0].bins();
190 gridAxis2[0] = bu[1].min;
191 gridAxis2[1] = bu[1].max;
192 gridAxis2[2] = bu[1].bins();
194 gridAxis3[0] = bu[2].min;
195 gridAxis3[1] = bu[2].max;
196 gridAxis3[2] = bu[2].bins();
198 std::function<double(Acts::Vector3D)> coord1 =
200 std::function<double(Acts::Vector3D)> coord2 =
202 std::function<double(Acts::Vector3D)> coord3 =
205 transfoGlobalToLocal = [coord1, coord2,
207 return {coord1(
pos), coord2(
pos), coord3(
pos)};
210 std::move(gridAxis3)));
217 for (
const auto& rm : mPoints) {
235 for (
size_t index = 0; index < grid.
size(); index++) {
236 mGrid.
at(index) = grid.
at(index).average().classificationNumbers();
246 for (
const auto& rm : mPoints) {
265 for (
size_t index = 0; index < grid.
size(); index++) {
266 mGrid.
at(index) = grid.
at(index).average().classificationNumbers();