18 #ifndef LAREXAMPLES_ALGORITHMS_REMOVEISOLATEDSPACEPOINTS_SPACEPARTITION_H
19 #define LAREXAMPLES_ALGORITHMS_REMOVEISOLATEDSPACEPOINTS_SPACEPARTITION_H
85 template <
typename Po
int>
89 template <
typename Po
int>
93 template <
typename Po
int>
101 template <
typename Coord>
134 template <
typename Coord>
221 template <
typename Po
intIter>
267 {
return data[index]; }
295 template <
typename Cont,
typename Data>
297 static Data x(Cont
const&
p) {
return p[0]; }
298 static Data y(Cont
const&
p) {
return p[1]; }
299 static Data z(Cont
const&
p) {
return p[2]; }
302 template <
typename Po
int>
305 template <
typename Po
int>
308 template <
typename Po
int>
312 template <
typename Po
int>
313 struct PointTraits_t {
321 template <
typename T>
327 template <
typename T>
334 template <
typename T>
355 template <
typename Coord>
379 template <
typename Coord>
381 {
return (lower <= c) && (upper >= c); }
383 template <
typename Coord>
388 template <
typename Coord>
390 {
return lower <= upper; }
392 template <
typename Coord>
394 {
return upper - lower; }
396 template <
typename Coord>
398 {
return (upper == as.
upper) && (lower == as.
lower); }
400 template <
typename Coord>
402 {
return (upper != than.
upper) || (lower != than.
lower); }
408 template <
typename Coord>
411 :
Base_t(low, high), cellSize(cs)
414 template <
typename Coord>
417 :
Base_t(range), cellSize(cs)
421 template <
typename Coord>
429 template <
typename Po
intIter>
451 template <
typename Po
intIter>
456 PointIter it =
begin;
459 data.insert(pointIndex(*it), it);
467 template <
typename Po
intIter>
474 if (!data.hasX(xc)) {
475 throw std::runtime_error
481 if (!data.hasY(yc)) {
482 throw std::runtime_error
488 if (!data.hasZ(zc)) {
489 throw std::runtime_error
494 return data.index(
CellID_t{{ xc, yc, zc }});
501 #endif // LAREXAMPLES_ALGORITHMS_REMOVEISOLATEDSPACEPOINTS_SPACEPARTITION_H
A container of points sorted in cells.
process_name opflash particleana ie ie ie z
double std(const std::vector< short > &wf, const double ped_mean, size_t start, size_t nsample)
Grid_t::const_iterator end() const
Returns a constant iterator pointing after the last cell.
Range_t zRange
coordinates of the contained volume on z axis
BEGIN_PROLOG TPC Trig offset(g4 rise time) ProjectToHeight
Range_t yRange
coordinates of the contained volume on z axis
Coord_t size() const
Returns the size of the range (no check)
process_name opflash particleana ie x
Indexer_t const & indexManager() const
Returns the index manager of the grid.
Coord_t cellSize
length of the side of each cubic cell
std::vector< Datum_t > Cell_t
type of a single cell container
typename Cells_t::const_iterator const_iterator
type of iterator to all cells
CellIndexOffset_t pointIndex(Point_t const &point) const
Grid_t::const_iterator begin() const
Returns a constant iterator pointing to the first cell.
Range_t xRange
coordinates of the contained volume on x axis
typename details::PointTraits_t< Point >::Coord_t ExtractCoordType_t
type of Point coordinate
typename Grid_t::Indexer_t Indexer_t
type of index manager of the grid
Coord_t cellSize
size of a single cell
bool contains(Coord_t c) const
Returns whether c is contained in the range (inclusve)
details::ExtractCoordType_t< Point_t > Coord_t
type of point coordinate
bool has(CellIndexOffset_t ofs) const
Returns whether there is a cell with the specified index (signed!)
standard_dbscan3dalg useful for diagnostics hits not in a line will not be clustered on on only for track like only for track like on on the smaller the less shower like tracks low
Coord_t upper
upper boundary
std::array< size_t, 3 > diceVolume(CoordRangeCells< Coord > const &rangeX, CoordRangeCells< Coord > const &rangeY, CoordRangeCells< Coord > const &rangeZ)
Returns the dimensions of a grid diced with the specified size.
Coord_t lower
lower boundary
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
auto extractPositionY(Point const &point)
bool operator!=(const Range_t &than) const
Returns whether the specified range has limits different than this.
SpacePartition(Range_t rangeX, Range_t rangeY, Range_t rangeZ)
Constructs the partition in a given volume with the given cell size.
bool valid() const
Returns whether the range is valid (empty is also valid)
then echo ***************************************echo array
process_name opflash particleana ie ie y
decltype(*(PointIter())) Point_t
type of the point
std::tuple< double, double, const reco::ClusterHit3D * > Point
Definitions used by the VoronoiDiagram algorithm.
Coord_t offset(Coord_t c) const
Returns the distance of the specified coordinate from the lower bound.
auto end(FixedBins< T, C > const &) noexcept
typename Indexer_t::CellIndexOffset_t CellIndexOffset_t
type of difference between cell indices
typename Grid_t::Cell_t Cell_t
type of cell
decltype(extractPositionX(std::decay_t< Point >())) Coord_t
type of Point coordinate
bool operator==(const Range_t &as) const
Returns whether the specified range has the same limits as this.
bool empty() const
Returns whether the range is empty.
auto begin(FixedBins< T, C > const &) noexcept
typename Indexer_t::CellDimIndex_t CellDimIndex_t
type of difference between indices
bool has(CellIndexOffset_t index) const
Returns whether the specified index is valid.
Grid_t data
container of points
std::string to_string(WindowPattern const &pattern)
CoordRange< Coord > Range_t
this type
auto extractPositionX(Point const &point)
typename Grid_t::CellDimIndex_t CellDimIndex_t
typename Indexer_t::CellID_t CellID_t
type of cell index
std::ptrdiff_t findCell(Coord_t c) const
Returns the index of the cell for coordinate c.
Containers with indices in 1, 2 and 3 dimensions.
Indexer_t const & indexManager() const
Returns the index manager of the grid.
auto extractPositionZ(Point const &point)
CoordRangeCells(Coord_t low, Coord_t high, Coord_t cs)
Constructor: assigns range and cell size.
Coord_t Coord_t
data type for coordinate
Base class for a container of data arranged on a 3D-grid.
Cell_t const & operator[](CellIndex_t index) const
Returns the cell with the specified index.
void fill(PointIter begin, PointIter end)
typename Indexer_t::CellIndex_t CellIndex_t