9 template <
typename external_spacepo
int_t>
10 template <
typename spacepo
int_iterator_t>
12 spacepoint_iterator_t spBegin, spacepoint_iterator_t spEnd,
22 typename std::iterator_traits<spacepoint_iterator_t>::value_type,
23 const external_spacepoint_t*>::
value,
24 "Iterator does not contain type this class was templated with");
28 float phiMax = config.
phiMax;
29 float zMin = config.
zMin;
30 float zMax = config.
zMax;
36 size_t numRBins = (config.
rMax + config.
beamPos.norm());
37 std::vector<std::vector<
38 std::unique_ptr<const InternalSpacePoint<external_spacepoint_t>>>>
40 for (spacepoint_iterator_t
it = spBegin;
it != spEnd;
it++) {
44 const external_spacepoint_t&
sp = **
it;
49 if (spZ > zMax || spZ < zMin) {
52 float spPhi = std::atan2(spY, spX);
53 if (spPhi > phiMax || spPhi < phiMin) {
62 std::make_unique<const InternalSpacePoint<external_spacepoint_t>>(
63 sp, spPosition, config.
beamPos, variance);
66 size_t rIndex = isp->radius();
68 if (rIndex >= numRBins) {
71 rBins[rIndex].push_back(std::move(isp));
75 for (
auto& rbin : rBins) {
76 for (
auto& isp : rbin) {
79 std::unique_ptr<const InternalSpacePoint<external_spacepoint_t>>>&
80 bin = grid->atPosition(spLocation);
81 bin.push_back(std::move(isp));
84 m_binnedSP = std::move(grid);
85 m_bottomBinFinder = botBinFinder;
86 m_topBinFinder = tBinFinder;