21 (
double min,
double max,
double stepSize);
26 (
int ID,
double const* pos,
double error )
41 std::vector<recob::SpacePoint>& spacePoints,
51 int ID = spacePoints.empty()? 1: spacePoints.back().ID() + 1;
52 size_t const origNPoints = spacePoints.size();
53 double const error = stepSize / std::sqrt(12.);
57 std::array<double, 3>
const center
59 std::array<double, 3> point;
60 for (
int ix = indicesX.first; ix <= indicesX.second; ++ix) {
61 point[0] = center[0] + ix * stepSize;
63 for (
int iy = indicesY.first; iy <= indicesY.second; ++iy) {
64 point[1] = center[1] + iy * stepSize;
66 for (
int iz = indicesZ.first; iz <= indicesZ.second; ++iz) {
67 point[2] = center[2] + iz * stepSize;
75 return spacePoints.size() - origNPoints;
81 (
double min,
double max,
double stepSize)
83 if (min >= max)
return { 0, 0 };
85 double const center = (min + max) / 2.;
86 return { -int((center - min) / stepSize), int((max - center) / stepSize) };
Utilities for tests based on space points.
EResult err(const char *call)
double MinX() const
Returns the world x coordinate of the start of the box.
double CenterX() const
Returns the world x coordinate of the center of the box.
double CenterZ() const
Returns the world z coordinate of the center of the box.
double MaxX() const
Returns the world x coordinate of the end of the box.
recob::SpacePoint MakeSpacePoint(int ID, double const *pos, double error=0.)
Creates and returns a new space point.
double MinZ() const
Returns the world z coordinate of the start of the box.
unsigned int FillSpacePointGrid(std::vector< recob::SpacePoint > &spacePoints, geo::BoxBoundedGeo const &box, double stepSize)
Creates space points distributed in a grid.
double MaxY() const
Returns the world y coordinate of the end of the box.
A base class aware of world box coordinatesAn object describing a simple shape can inherit from this ...
double CenterY() const
Returns the world y coordinate of the center of the box.
double MaxZ() const
Returns the world z coordinate of the end of the box.
std::pair< int, int > ComputeRangeIndices(double min, double max, double stepSize)
double MinY() const
Returns the world y coordinate of the start of the box.