LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
lar::example::CoordRange< Coord > Struct Template Reference

Range of coordinates. More...

#include "SpacePartition.h"

Inheritance diagram for lar::example::CoordRange< Coord >:
lar::example::CoordRangeCells< Coord >

Public Types

using Range_t = CoordRange< Coord >
 this type More...
 
using Coord_t = Coord
 data type for coordinate More...
 

Public Member Functions

bool contains (Coord_t c) const
 Returns whether c is contained in the range (inclusve) More...
 
bool empty () const
 Returns whether the range is empty. More...
 
bool valid () const
 Returns whether the range is valid (empty is also valid) More...
 
Coord_t size () const
 Returns the size of the range (no check) More...
 
Coord_t offset (Coord_t c) const
 Returns the distance of the specified coordinate from the lower bound. More...
 
bool operator== (const Range_t &as) const
 Returns whether the specified range has the same limits as this. More...
 
bool operator!= (const Range_t &than) const
 Returns whether the specified range has limits different than this. More...
 

Public Attributes

Coord_t lower
 lower boundary More...
 
Coord_t upper
 upper boundary More...
 

Detailed Description

template<typename Coord>
struct lar::example::CoordRange< Coord >

Range of coordinates.

Definition at line 102 of file SpacePartition.h.

Member Typedef Documentation

template<typename Coord>
using lar::example::CoordRange< Coord >::Coord_t = Coord

data type for coordinate

Definition at line 104 of file SpacePartition.h.

template<typename Coord>
using lar::example::CoordRange< Coord >::Range_t = CoordRange<Coord>

this type

Definition at line 103 of file SpacePartition.h.

Member Function Documentation

template<typename Coord >
bool lar::example::CoordRange< Coord >::contains ( Coord_t  c) const

Returns whether c is contained in the range (inclusve)

Definition at line 380 of file SpacePartition.h.

381  { return (lower <= c) && (upper >= c); }
Coord_t upper
upper boundary
Coord_t lower
lower boundary
template<typename Coord >
bool lar::example::CoordRange::Range_t::empty ( ) const

Returns whether the range is empty.

Definition at line 384 of file SpacePartition.h.

385  { return lower == upper; }
Coord_t upper
upper boundary
Coord_t lower
lower boundary
template<typename Coord>
Coord_t lar::example::CoordRange< Coord >::offset ( Coord_t  c) const
inline

Returns the distance of the specified coordinate from the lower bound.

Definition at line 122 of file SpacePartition.h.

122 { return c - lower; }
Coord_t lower
lower boundary
template<typename Coord >
bool lar::example::CoordRange< Coord >::operator!= ( const Range_t than) const

Returns whether the specified range has limits different than this.

Definition at line 401 of file SpacePartition.h.

References lar::example::CoordRangeCells< Coord >::CoordRangeCells(), lar::example::CoordRange< Coord >::lower, and lar::example::CoordRange< Coord >::upper.

402  { return (upper != than.upper) || (lower != than.lower); }
Coord_t upper
upper boundary
Coord_t lower
lower boundary
template<typename Coord >
bool lar::example::CoordRange< Coord >::operator== ( const Range_t as) const

Returns whether the specified range has the same limits as this.

Definition at line 397 of file SpacePartition.h.

References lar::example::CoordRange< Coord >::lower, and lar::example::CoordRange< Coord >::upper.

398  { return (upper == as.upper) && (lower == as.lower); }
Coord_t upper
upper boundary
Coord_t lower
lower boundary
template<typename Coord >
Coord lar::example::CoordRange< Coord >::size ( ) const

Returns the size of the range (no check)

Definition at line 393 of file SpacePartition.h.

Referenced by lar::example::details::diceVolume().

394  { return upper - lower; }
Coord_t upper
upper boundary
Coord_t lower
lower boundary
template<typename Coord >
bool lar::example::CoordRange< Coord >::valid ( ) const

Returns whether the range is valid (empty is also valid)

Definition at line 389 of file SpacePartition.h.

Referenced by lar::example::PointIsolationAlg< Coord >::validateConfiguration().

390  { return lower <= upper; }
Coord_t upper
upper boundary
Coord_t lower
lower boundary

Member Data Documentation


The documentation for this struct was generated from the following file: