All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BoxBoundedGeo.h
Go to the documentation of this file.
1 /**
2  * @file larcorealg/Geometry/BoxBoundedGeo.h
3  * @brief Provides a base class aware of world box coordinates
4  * @author Gianluca Petrillo (petrillo@fnal.gov)
5  * @date April 9th, 2015
6  * @see larcorealg/Geometry/BoxBoundedGeo.cpp
7  * @ingroup Geometry
8  */
9 
10 #ifndef LARCOREALG_GEOMETRY_BOXBOUNDEDGEO_H
11 #define LARCOREALG_GEOMETRY_BOXBOUNDEDGEO_H
12 
13 // LArSoft libraries
15 
16 // ROOT library
17 #include "TVector3.h"
18 
19 // C/C++ standard library
20 #include <algorithm>
21 #include <vector>
22 
23 namespace geo {
24  /**
25  * @brief A base class aware of world box coordinates
26  * @ingroup Geometry
27  *
28  * An object describing a simple shape can inherit from this one to gain
29  * access to a common boundary checking interface.
30  *
31  * The boundary is a simple box with axes parallel to the coordinate system.
32  */
33  class BoxBoundedGeo {
34  public:
35  using Coords_t = geo::Point_t; ///< Type of the coordinate triplet.
36  using Coord_t = Coords_t::Scalar; ///< Type of the coordinate.
37 
38  /**
39  * @brief Default constructor: sets an empty volume
40  * @see SetBoundaries
41  *
42  * We allow for a default construction since the derived object might need
43  * some specific action before being aware of its boundaries.
44  * In that case, SetBoundaries() will set the boundaries.
45  */
46  BoxBoundedGeo() = default;
47 
48 
49  /**
50  * @brief Constructor: sets the boundaries in world coordinates as specified
51  * @param x_min lower x coordinate
52  * @param x_max upper x coordinate
53  * @param y_min lower y coordinate
54  * @param y_max upper y coordinate
55  * @param z_min lower z coordinate
56  * @param z_max upper z coordinate
57  * @see `SetBoundaries()`
58  *
59  * Note that is assumed that each minimum is larger than its maximum,
60  * and no check is performed.
61  */
63  Coord_t x_min, Coord_t x_max,
64  Coord_t y_min, Coord_t y_max,
65  Coord_t z_min, Coord_t z_max
66  ):
67  c_min{ x_min, y_min, z_min }, c_max{ x_max, y_max, z_max }
68  { SortCoordinates(); }
69 
70  /**
71  * @brief Constructor: sets the boundaries in world coordinates as specified
72  * @param lower lower coordinates (x, y, z)
73  * @param upper upper coordinates (x, y, z)
74  * @see `SetBoundaries()`
75  *
76  * Note that is assumed that each minimum is larger than its maximum,
77  * and no check is performed.
78  */
80  c_min(lower), c_max(upper)
81  { SortCoordinates(); }
82 
83 
84  /// @{
85  /// @name Dimension queries
86 
87  /// Returns the world x coordinate of the start of the box.
88  double MinX() const { return c_min.X(); }
89 
90  /// Returns the world x coordinate of the end of the box.
91  double MaxX() const { return c_max.X(); }
92 
93  /// Returns the world x coordinate of the center of the box.
94  double CenterX() const { return (MinX() + MaxX()) / 2.; }
95 
96  /// Returns the full size in the X dimension.
97  double SizeX() const { return MaxX() - MinX(); }
98 
99  /// Returns the size from the center to the border on X dimension.
100  double HalfSizeX() const { return SizeX() / 2.0; }
101 
102  /// Returns the world y coordinate of the start of the box.
103  double MinY() const { return c_min.Y(); }
104 
105  /// Returns the world y coordinate of the end of the box.
106  double MaxY() const { return c_max.Y(); }
107 
108  /// Returns the world y coordinate of the center of the box.
109  double CenterY() const { return (MinY() + MaxY()) / 2.; }
110 
111  /// Returns the full size in the Y dimension.
112  double SizeY() const { return MaxY() - MinY(); }
113 
114  /// Returns the size from the center to the border on Y dimension.
115  double HalfSizeY() const { return SizeY() / 2.0; }
116 
117  /// Returns the world z coordinate of the start of the box.
118  double MinZ() const { return c_min.Z(); }
119 
120  /// Returns the world z coordinate of the end of the box.
121  double MaxZ() const { return c_max.Z(); }
122 
123  /// Returns the world z coordinate of the center of the box.
124  double CenterZ() const { return (MinZ() + MaxZ()) / 2.; }
125 
126  /// Returns the full size in the Z dimension.
127  double SizeZ() const { return MaxZ() - MinZ(); }
128 
129  /// Returns the size from the center to the border on Z dimension.
130  double HalfSizeZ() const { return SizeZ() / 2.0; }
131 
132  /// Returns the corner point with the smallest coordinates.
133  geo::Point_t Min() const { return c_min; }
134 
135  /// Returns the corner point with the largest coordinates.
136  geo::Point_t Max() const { return c_max; }
137 
138  /// Returns the center point of the box.
140  { return { CenterX(), CenterY(), CenterZ() }; }
141 
142  /// @}
143 
144 
145 
146  /// @name Containment in the full volume
147  /// @{
148 
149  /**
150  * @brief Returns whether this TPC contains the specified world x coordinate
151  * @param x the absolute ("world") coordinate x
152  * @param wiggle expansion factor for the range (see ContainsPosition())
153  * @return whether the specified coordinate is in this TPC
154  * @see ContainsPosition()
155  *
156  * Note that x is by definition the drift direction, and a reconstructed x
157  * typically depends on an assumption respect to the event time.
158  */
159  bool ContainsX(double x, double const wiggle = 1) const
160  { return CoordinateContained(x, MinX(), MaxX(), wiggle); }
161 
162  /**
163  * @brief Returns whether this TPC contains the specified world y coordinate
164  * @param y the absolute ("world") coordinate y
165  * @param wiggle expansion factor for the range (see ContainsPosition())
166  * @return whether the specified coordinate is in this TPC
167  * @see ContainsPosition()
168  */
169  bool ContainsY(double y, double const wiggle = 1) const
170  { return CoordinateContained(y, MinY(), MaxY(), wiggle); }
171 
172  /**
173  * @brief Returns whether this TPC contains the specified world z coordinate
174  * @param z the absolute ("world") coordinate z
175  * @param wiggle expansion factor for the range (see ContainsPosition())
176  * @return whether the specified coordinate is in this TPC
177  * @see ContainsPosition()
178  */
179  bool ContainsZ(double z, double const wiggle = 1) const
180  { return CoordinateContained(z, MinZ(), MaxZ(), wiggle); }
181 
182  /**
183  * @brief Returns if TPC contains the specified world y and z coordinates
184  * @param y the absolute ("world") coordinate y
185  * @param z the absolute ("world") coordinate z
186  * @param wiggle expansion factor for the range (see ContainsPosition())
187  * @return whether the specified coordinate is in this TPC
188  * @see ContainsPosition()
189  */
190  bool ContainsYZ(double y, double z, double const wiggle = 1) const
191  { return ContainsY(y, wiggle) && ContainsZ(z, wiggle); }
192 
193 
194  /**
195  * @brief Returns whether this volume contains the specified point.
196  * @param point the point [cm]
197  * @param wiggle expansion factor for the range
198  * @return whether the specified coordinate is in this volume
199  *
200  * If the wiggle is larger than 1, each size of the volume is expanded by
201  * the wiggle factor.
202  * If the wiggle is less than 1, each size is shrinked.
203  */
204  bool ContainsPosition
205  (geo::Point_t const& point, double wiggle = 1.0) const
206  {
207  return ContainsX(point.X(), wiggle)
208  && ContainsYZ(point.Y(), point.Z(), wiggle);
209  } // ContainsPosition()
210  /// @see `ContainsPosition(geo::Point_t const&, double) const`.
211  bool ContainsPosition(TVector3 const& point, double wiggle = 1.0) const;
212  /// @see `ContainsPosition(geo::Point_t const&, double) const`.
213  bool ContainsPosition(double const* point, double wiggle = 1.0) const;
214 
215 
216  /// @}
217 
218 
219  /// @name Containment in a fiducial volume
220  /// @{
221  /**
222  * @brief Returns whether TPC fiducial volume contains world x coordinate.
223  * @param x the absolute ("world") coordinate x
224  * @param neg_margin how far within the TPC the fiducial region starts
225  * @param pos_margin how far before the TPC the fiducial region ends
226  * @return whether the specified coordinate is in this TPC fiducial volume
227  *
228  * The fiducial volume is defined by the specified margins, that denote how
229  * much of the coordinate is not fiducial. For example,
230  *
231  * bool bWithin = tpc->InFiducialX(x, 5., 8.);
232  *
233  * on a TPC with x from 0 to 100 (cm, presumably) will return true for all
234  * `x` between 5 and 92.
235  * If positive margin is not specified, it's assumed to be the same as the
236  * negative one.
237  * Specifying a negative mergin effectively extends the TPC volume.
238  * Note that x is by definition the drift direction, and a reconstructed x
239  * typically depends on an assumption respect to the event time.
240  */
241  bool InFiducialX(double x, double neg_margin, double pos_margin) const
242  {
243  return CoordinateContained(x, MinX() + neg_margin, MaxX() - pos_margin);
244  }
245  /**
246  * @brief Returns whether TPC fiducial volume contains world x coordinate.
247  * @see `InFiducialX(double, double, double) const`
248  *
249  * Margins are symmetric.
250  */
251  bool InFiducialX(double x, double margin) const
252  { return InFiducialX(x, margin, margin); }
253 
254  /**
255  * @brief Returns whether TPC fiducial volume contains world y coordinate
256  * @param y the absolute ("world") coordinate y
257  * @param neg_margin how far within the TPC the fiducial region starts
258  * @param pos_margin how far before the TPC the fiducial region ends
259  * @return whether the specified coordinate is in this TPC fiducial volume
260  *
261  * The fiducial volume is defined by the specified margins, that denote how
262  * much of the coordinate is not fiducial. For example,
263  *
264  * bool bWithin = tpc->InFiducialY(y, 5., 8.);
265  *
266  * on a TPC with y from 0 to 100 (cm, presumably) will return true for all
267  * `y` between 5 and 92.
268  * If positive margin is not specified, it's assumed to be the same as the
269  * negative one.
270  * Specifying a negative mergin effectively extends the TPC volume.
271  */
272  bool InFiducialY(double y, double neg_margin, double pos_margin) const
273  {
274  return CoordinateContained(y, MinY() + neg_margin, MaxY() - pos_margin);
275  }
276  /**
277  * @brief Returns whether TPC fiducial volume contains world y coordinate.
278  * @see `InFiducialY(double, double, double) const`
279  *
280  * Margins are symmetric.
281  */
282  bool InFiducialY(double y, double margin) const
283  { return InFiducialY(y, margin, margin); }
284 
285  /**
286  * @brief Returns whether TPC fiducial volume contains world z coordinate
287  * @param z the absolute ("world") coordinate y
288  * @param neg_margin how far within the TPC the fiducial region starts
289  * @param pos_margin how far before the TPC the fiducial region ends
290  * @return whether the specified coordinate is in this TPC fiducial volume
291  *
292  * The fiducial volume is defined by the specified margins, that denote how
293  * much of the coordinate is not fiducial. For example,
294  *
295  * bool bWithin = tpc->InFiducialZ(z, 5., 8.);
296  *
297  * on a TPC with z from 0 to 100 (cm, presumably) will return true for all
298  * `z` between 5 and 92.
299  * If positive margin is not specified, it's assumed to be the same as the
300  * negative one.
301  * Specifying a negative mergin effectively extends the TPC volume.
302  */
303  bool InFiducialZ(double z, double neg_margin, double pos_margin) const
304  {
305  return CoordinateContained(z, MinZ() + neg_margin, MaxZ() - pos_margin);
306  }
307  /**
308  * @brief Returns whether TPC fiducial volume contains world z coordinate.
309  * @see `InFiducialZ(double, double, double) const`
310  *
311  * Margins are symmetric.
312  */
313  bool InFiducialZ(double z, double margin) const
314  { return InFiducialZ(z, margin, margin); }
315 
316  /// @}
317 
318 
319  // -- BEGIN -- Overlaps ----------------------------------------------------
320  /// @name Overlaps
321  /// @{
322 
323  /// Returns if the _x_ coordinates covered by this and `other` box overlap.
324  bool OverlapsX(geo::BoxBoundedGeo const& other) const
325  { return std::min(MaxX(), other.MaxX()) > std::max(MinX(), other.MinX()); }
326 
327  /// Returns if the _y_ coordinates covered by this and `other` box overlap.
328  bool OverlapsY(geo::BoxBoundedGeo const& other) const
329  { return std::min(MaxY(), other.MaxY()) > std::max(MinY(), other.MinY()); }
330 
331  /// Returns if the _z_ coordinates covered by this and `other` box overlap.
332  bool OverlapsZ(geo::BoxBoundedGeo const& other) const
333  { return std::min(MaxZ(), other.MaxZ()) > std::max(MinZ(), other.MinZ()); }
334 
335  /// Returns if this and `other` box overlap.
336  bool Overlaps(geo::BoxBoundedGeo const& other) const
337  { return OverlapsX(other) && OverlapsY(other) && OverlapsZ(other); }
338 
339  /// @}
340  // -- END -- Overlaps ------------------------------------------------------
341 
342 
343  /**
344  * @brief Returns whether the specified coordinate is in a range
345  * @param c the coordinate
346  * @param min lower boundary of the range
347  * @param max upper boundary of the range
348  * @param wiggle expansion factor for the range
349  * @return whether the specified coordinate is in a range
350  *
351  * If the wiggle is larger than 1, the range is expanded by the wiggle factor.
352  * If the wiggle is less than 1, the range is shrinked.
353  */
354  static bool CoordinateContained
355  (double c, double min, double max, double wiggle = 1.)
356  {
357  return (c >= (min > 0? min / wiggle: min * wiggle))
358  && (c <= (max < 0? max / wiggle: max * wiggle));
359  } // CoordinateContained()
360 
361  /**
362  * @brief Returns whether the specified coordinate is in a range
363  * @param c the coordinate
364  * @param range pointer to [ lower boundary, upper boundary ] of the range
365  * @param wiggle expansion factor for the range
366  * @return whether the specified coordinate is in a range
367  * @see `CoordinateContained(double, double, double, double)`
368  *
369  * If the wiggle is larger than 1, the range is expanded by the wiggle factor.
370  * If the wiggle is less than 1, the range is shrinked.
371  */
372  static bool CoordinateContained
373  (double c, double const* range, double wiggle = 1.)
374  { return CoordinateContained(c, range[0], range[1], wiggle); }
375 
376 
377  /// @{
378  /// @name Setting dimensions
379 
380  /**
381  * @brief Sets the boundaries in world coordinates as specified.
382  * @param x_min lower x coordinate
383  * @param x_max upper x coordinate
384  * @param y_min lower y coordinate
385  * @param y_max upper y coordinate
386  * @param z_min lower z coordinate
387  * @param z_max upper z coordinate
388  */
390  Coord_t x_min, Coord_t x_max,
391  Coord_t y_min, Coord_t y_max,
392  Coord_t z_min, Coord_t z_max
393  )
394  {
395  c_min.SetXYZ(x_min, y_min, z_min);
396  c_max.SetXYZ(x_max, y_max, z_max);
397  SortCoordinates();
398  }
399 
400  /**
401  * @brief Sets the boundaries in world coordinates as specified.
402  * @param lower lower coordinates (x, y, z)
403  * @param upper upper coordinates (x, y, z)
404  */
405  void SetBoundaries(Coords_t lower, Coords_t upper)
406  { c_min = lower; c_max = upper; SortCoordinates(); }
407 
408  /**
409  * @brief Extends the current box to also include the specified point.
410  * @param x x coordinate of the point to include
411  * @param y y coordinate of the point to include
412  * @param z z coordinate of the point to include
413  */
415  { ExtendToInclude(geo::Point_t(x, y, z)); }
416 
417  /**
418  * @brief Extends the current box to also include the specified point.
419  * @param point coordinates of the point to include
420  */
421  void ExtendToInclude(geo::Point_t const& point)
422  {
423  set_min(c_min, point);
424  set_max(c_max, point);
425  }
426 
427  /**
428  * @brief Extends the current box to also include the specified one
429  * @param box the box to include
430  *
431  * It is assumed that the box has its boundaries properly sorted.
432  */
434  {
435  set_min(c_min, box.Min());
436  set_max(c_max, box.Max());
437  } // ExtendToInclude()
438 
439  /// @}
440 
441 
442  //@{
443  /**
444  * @brief Calculates the entry and exit points of a trajectory on the box surface
445  * @author Christoph Rudolf von Rohr (crohr@fnal.gov)
446  * @date July 27th, 2015
447  * @param TrajectoryStart position of the trajectory source
448  * @param TrajectoryDirect direction vector of the trajectory
449  *
450  * This member is public since it just gives an output and does not change any member.
451  * The algorithm works only for a box shaped active volume with facing walls parallel to axis.
452  * If the return std::vector is empty the trajectory does not intersect with the box.
453  * Normally the return value should have one (if the trajectory originates in the box) or two (else) entries.
454  * If the return value has two entries the first represents the entry point and the second the exit point
455  */
456  std::vector<TVector3> GetIntersections
457  (TVector3 const& TrajectoryStart, TVector3 const& TrajectoryDirect) const;
458  std::vector<geo::Point_t> GetIntersections
459  (geo::Point_t const& TrajectoryStart, geo::Vector_t const& TrajectoryDirect) const;
460  //@}
461 
462 
463  /// Sets var to value if value is smaller than the current var value.
464  static void set_min(Coord_t& var, Coord_t value)
465  { if (value < var) var = value; }
466 
467  /// Sets var to value if value is larger than the current var value.
468  static void set_max(Coord_t& var, Coord_t value)
469  { if (value > var) var = value; }
470 
471  /// Sets each coordinate of var to the one in value if the latter is smaller.
472  static void set_min(Coords_t& var, geo::Point_t const& value)
473  {
474  if (value.X() < var.X()) var.SetX(value.X());
475  if (value.Y() < var.Y()) var.SetY(value.Y());
476  if (value.Z() < var.Z()) var.SetZ(value.Z());
477  }
478 
479  /// Sets each coordinate of var to the one in value if the latter is larger.
480  static void set_max(Coords_t& var, geo::Point_t const& value)
481  {
482  if (value.X() > var.X()) var.SetX(value.X());
483  if (value.Y() > var.Y()) var.SetY(value.Y());
484  if (value.Z() > var.Z()) var.SetZ(value.Z());
485  }
486 
487 
488  private:
489  // we don't allow the derived classes to mess with the boundaries
490  Coords_t c_min; ///< minimum coordinates (x, y, z)
491  Coords_t c_max; ///< maximum coordinates (x, y, z)
492 
493  /// Makes sure each coordinate of the minimum point is smaller than maximum.
494  void SortCoordinates();
495 
496  }; // class BoxBoundedGeo
497 
498 } // namespace geo
499 
500 
501 
502 #endif // LARCOREALG_GEOMETRY_BOXBOUNDEDGEO_H
bool OverlapsX(geo::BoxBoundedGeo const &other) const
Returns if the x coordinates covered by this and other box overlap.
process_name opflash particleana ie ie ie z
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space.
Definition: geo_vectors.h:164
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.
Definition: BoxBoundedGeo.h:36
double SizeX() const
Returns the full size in the X dimension.
Definition: BoxBoundedGeo.h:97
process_name opflash particleana ie x
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.
Definition: BoxBoundedGeo.h:62
double MinX() const
Returns the world x coordinate of the start of the box.
Definition: BoxBoundedGeo.h:88
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.
Definition: BoxBoundedGeo.h:94
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.
Definition: BoxBoundedGeo.h:91
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.
process_name opflash particleana ie ie y
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.
Definition: BoxBoundedGeo.h:35
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.
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 ...
Definition: BoxBoundedGeo.h:33
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.
Definition: BoxBoundedGeo.h:79
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.
temporary value
bool ContainsYZ(double y, double z, double const wiggle=1) const
Returns if TPC contains the specified world y and z coordinates.
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.
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
Definition: geo_vectors.h:184
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.