Commit dd96373a authored by Alejandro Homs Puron's avatar Alejandro Homs Puron Committed by operator for beamline
Browse files

Port to function-based geometry iterator helpers

parent a239fe46
Subproject commit b2fda94b915626fd17e05791467f68c870adb7ea Subproject commit 529de4ec9a1d6a71e03a39451e0aefe28bb1960a
...@@ -87,21 +87,14 @@ void Jungfrau::GainPed::Impl<M>::getDefaultCalib(Calib& calib) ...@@ -87,21 +87,14 @@ void Jungfrau::GainPed::Impl<M>::getDefaultCalib(Calib& calib)
} }
auto f = [&](auto det_geom) { auto f = [&](auto det_geom) {
using namespace sls::Geom; using namespace sls::Geom;
det_for_each_mod(det_geom, mod, mod_geom, det_for_each_pixel(det_geom,
mod_for_each_recv(mod_geom, recv, recv_geom, [&](auto &chip_view, auto &pixel) {
recv_for_each_iface(recv_geom, iface, iface_geom, int i = chip_view.calcMapPixelIndex(pixel);
iface_for_each_chip(iface_geom, chip, chip_view, for (int g = 0; g < 3; ++g) {
view_for_each_pixel(chip_view, pixel, p[g][0][i] = M::DefaultCoeffs[g][0];
int i = chip_view.calcMapPixelIndex(pixel); p[g][1][i] = M::DefaultCoeffs[g][1];
for (int g = 0; g < 3; ++g) { }
p[g][0][i] = M::DefaultCoeffs[g][0]; });
p[g][1][i] = M::DefaultCoeffs[g][1];
}
);
);
);
);
);
}; };
applyDetGeom(m_jungfrau, f, m_raw); applyDetGeom(m_jungfrau, f, m_raw);
} }
...@@ -831,19 +824,15 @@ void Jungfrau::getDetMap(Data& det_map) ...@@ -831,19 +824,15 @@ void Jungfrau::getDetMap(Data& det_map)
using namespace sls::Geom; using namespace sls::Geom;
unsigned int *p = (unsigned int *) det_map.data(); unsigned int *p = (unsigned int *) det_map.data();
int chip_idx = 0; int chip_idx = 0;
det_for_each_mod(det_geom, mod, mod_geom, det_for_each_chip(det_geom,
mod_for_each_recv(mod_geom, recv, recv_geom, [&](auto &chip, auto &chip_view) {
recv_for_each_iface(recv_geom, iface, iface_geom, view_for_each_pixel(chip_view,
iface_for_each_chip(iface_geom, chip, chip_view, [&](auto &chip_view, auto &pixel) {
view_for_each_pixel(chip_view, pixel, int i = chip_view.calcMapPixelIndex(pixel);
int i = chip_view.calcMapPixelIndex(pixel); p[i] = chip_idx;
p[i] = chip_idx; });
); ++chip_idx;
++chip_idx; });
);
);
);
);
}; };
applyDetGeom(this, f, raw); applyDetGeom(this, f, raw);
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment