10 #ifndef LARCOREALG_GEOMETRY_BOXBOUNDEDGEO_H 11 #define LARCOREALG_GEOMETRY_BOXBOUNDEDGEO_H 361 return (c >= (min > 0 ? min / wiggle : min * wiggle)) &&
362 (c <= (max < 0 ? max / wiggle : max * wiggle));
400 c_min.SetXYZ(x_min, y_min, z_min);
401 c_max.SetXYZ(x_max, y_max, z_max);
467 TVector3
const& TrajectoryDirect)
const;
475 if (value < var) var =
value;
481 if (value > var) var =
value;
487 if (value.X() < var.X()) var.SetX(value.X());
488 if (value.Y() < var.Y()) var.SetY(value.Y());
489 if (value.Z() < var.Z()) var.SetZ(value.Z());
495 if (value.X() > var.X()) var.SetX(value.X());
496 if (value.Y() > var.Y()) var.SetY(value.Y());
497 if (value.Z() > var.Z()) var.SetZ(value.Z());
512 #endif // LARCOREALG_GEOMETRY_BOXBOUNDEDGEO_H
bool OverlapsX(geo::BoxBoundedGeo const &other) const
Returns if the x coordinates covered by this and other box overlap.
static void set_min(Coords_t &var, geo::Point_t const &value)
Sets each coordinate of var to the one in value if the latter is smaller.
void SetBoundaries(Coords_t lower, Coords_t upper)
Sets the boundaries in world coordinates as specified.
Coords_t::Scalar Coord_t
Type of the coordinate.
double SizeX() const
Returns the full size in the X dimension.
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space.
bool InFiducialX(double x, double margin) const
Returns whether TPC fiducial volume contains world x coordinate.
BoxBoundedGeo(Coord_t x_min, Coord_t x_max, Coord_t y_min, Coord_t y_max, Coord_t z_min, Coord_t z_max)
Constructor: sets the boundaries in world coordinates as specified.
double MinX() const
Returns the world x coordinate of the start of the box.
bool OverlapsZ(geo::BoxBoundedGeo const &other) const
Returns if the z coordinates covered by this and other box overlap.
BoxBoundedGeo()=default
Default constructor: sets an empty volume.
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.
bool InFiducialZ(double z, double margin) const
Returns whether TPC fiducial volume contains world z coordinate.
double SizeY() const
Returns the full size in the Y dimension.
static void set_min(Coord_t &var, Coord_t value)
Sets var to value if value is smaller than the current var value.
bool OverlapsY(geo::BoxBoundedGeo const &other) const
Returns if the y coordinates covered by this and other box overlap.
double HalfSizeZ() const
Returns the size from the center to the border on Z dimension.
Definitions of geometry vector data types.
double MinZ() const
Returns the world z coordinate of the start of the box.
static void set_max(Coord_t &var, Coord_t value)
Sets var to value if value is larger than the current var value.
geo::Point_t Coords_t
Type of the coordinate triplet.
geo::Point_t Min() const
Returns the corner point with the smallest coordinates.
void ExtendToInclude(geo::Point_t const &point)
Extends the current box to also include the specified point.
bool InFiducialY(double y, double margin) const
Returns whether TPC fiducial volume contains world y coordinate.
bool Overlaps(geo::BoxBoundedGeo const &other) const
Returns if this and other box overlap.
double MaxY() const
Returns the world y coordinate of the end of the box.
Coords_t c_max
maximum coordinates (x, y, z)
double SizeZ() const
Returns the full size in the Z dimension.
double HalfSizeX() const
Returns the size from the center to the border on X dimension.
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
bool InFiducialY(double y, double neg_margin, double pos_margin) const
Returns whether TPC fiducial volume contains world y coordinate.
bool ContainsX(double x, double const wiggle=1) const
Returns whether this TPC contains the specified world x coordinate.
Coords_t c_min
minimum coordinates (x, y, z)
A base class aware of world box coordinatesAn object describing a simple shape can inherit from this ...
void ExtendToInclude(BoxBoundedGeo const &box)
Extends the current box to also include the specified one.
void SortCoordinates()
Makes sure each coordinate of the minimum point is smaller than maximum.
double CenterY() const
Returns the world y coordinate of the center of the box.
void SetBoundaries(Coord_t x_min, Coord_t x_max, Coord_t y_min, Coord_t y_max, Coord_t z_min, Coord_t z_max)
Sets the boundaries in world coordinates as specified.
double MaxZ() const
Returns the world z coordinate of the end of the box.
BoxBoundedGeo(Coords_t lower, Coords_t upper)
Constructor: sets the boundaries in world coordinates as specified.
void ExtendToInclude(Coord_t x, Coord_t y, Coord_t z)
Extends the current box to also include the specified point.
double HalfSizeY() const
Returns the size from the center to the border on Y dimension.
std::vector< TVector3 > GetIntersections(TVector3 const &TrajectoryStart, TVector3 const &TrajectoryDirect) const
Calculates the entry and exit points of a trajectory on the box surface.
static bool CoordinateContained(double c, double min, double max, double wiggle=1.)
Returns whether the specified coordinate is in a range.
bool ContainsYZ(double y, double z, double const wiggle=1) const
Returns if TPC contains the specified world y and z coordinates.
static bool CoordinateContained(double c, double const *range, double wiggle=1.)
Returns whether the specified coordinate is in a range.
bool InFiducialX(double x, double neg_margin, double pos_margin) const
Returns whether TPC fiducial volume contains world x coordinate.
bool InFiducialZ(double z, double neg_margin, double pos_margin) const
Returns whether TPC fiducial volume contains world z coordinate.
Namespace collecting geometry-related classes utilities.
double MinY() const
Returns the world y coordinate of the start of the box.
bool ContainsY(double y, double const wiggle=1) const
Returns whether this TPC contains the specified world y coordinate.
static void set_max(Coords_t &var, geo::Point_t const &value)
Sets each coordinate of var to the one in value if the latter is larger.
geo::Point_t Max() const
Returns the corner point with the largest coordinates.
bool ContainsPosition(geo::Point_t const &point, double wiggle=1.0) const
Returns whether this volume contains the specified point.
bool ContainsZ(double z, double const wiggle=1) const
Returns whether this TPC contains the specified world z coordinate.
geo::Point_t Center() const
Returns the center point of the box.