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, coord2,
158 return {coord1(pos), coord2(pos)};
168 std::array<double, 3> gridAxis1;
169 std::array<double, 3> gridAxis2;
170 std::array<double, 3> gridAxis3;
172 bool isCartesian =
false;
173 bool isCylindrical =
false;
175 for (
size_t b = 0; b < bu.size(); b++) {
180 isCylindrical =
true;
183 if (!(isCartesian || isCylindrical) || (isCylindrical && isCartesian)) {
184 throw std::invalid_argument(
"Incorrect bin, should be x,y,z or r,phi,z");
187 gridAxis1[0] = bu[0].min;
188 gridAxis1[1] = bu[0].max;
189 gridAxis1[2] = bu[0].bins();
191 gridAxis2[0] = bu[1].min;
192 gridAxis2[1] = bu[1].max;
193 gridAxis2[2] = bu[1].bins();
195 gridAxis3[0] = bu[2].min;
196 gridAxis3[1] = bu[2].max;
197 gridAxis3[2] = bu[2].bins();
199 std::function<double(Acts::Vector3D)> coord1 =
201 std::function<double(Acts::Vector3D)> coord2 =
203 std::function<double(Acts::Vector3D)> coord3 =
207 transfoGlobalToLocal = [coord1, coord2, coord3,
210 return {coord1(pos), coord2(pos), coord3(pos)};
213 std::move(gridAxis3)));
220 for (
const auto& rm : mPoints) {
222 for (
const auto&
point : rm.second) {
241 for (
size_t index = 0; index < grid.
size(); index++) {
242 mGrid.
at(index) = grid.
at(index).average().parameters();
252 for (
const auto& rm : mPoints) {
254 for (
const auto&
point : rm.second) {
274 for (
size_t index = 0; index < grid.
size(); index++) {
275 mGrid.
at(index) = grid.
at(index).average().parameters();