LArSoft  v10_04_05
Liquid Argon Software toolkit - https://larsoft.org/
geo::CryostatGeo Class Reference

Geometry information for a single cryostat. More...

#include "CryostatGeo.h"

Inheritance diagram for geo::CryostatGeo:
geo::BoxBoundedGeo

Classes

struct  CryostatGeoCoordinatesTag
 Tag for vectors in the "local" GDML coordinate frame of the cryostat. More...
 

Public Types

using ID_t = CryostatID
 
using TPCList_t = std::vector< TPCGeo >
 Type used internally to store the TPCs. More...
 
using OpDetList_t = std::vector< OpDetGeo >
 Type used internally to store the optical detectors. More...
 
using GeoNodePath_t = WireGeo::GeoNodePath_t
 
using ElementIteratorBox = TPCList_t const &
 Type returned by IterateElements(). More...
 
using Coords_t = Point_t
 Type of the coordinate triplet. More...
 
using Coord_t = Coords_t::Scalar
 Type of the coordinate. More...
 
Types for geometry-local reference vectors.

These types represents points and displacement vectors in the reference frame defined in the cryostat geometry box from the GDML geometry description.

No alias is explicitly defined for the LArSoft global vector types, geo::Point_t and geo::Vector_t.

Remember the LocalPoint_t and LocalVector_t vectors from different instances of geo::CryostatGeo have the same type but are not compatible.

using LocalPoint_t = Point3DBase_t< CryostatGeoCoordinatesTag >
 Type of points in the local GDML cryostat frame. More...
 
using LocalVector_t = Vector3DBase_t< CryostatGeoCoordinatesTag >
 Type of displacement vectors in the local GDML cryostat frame. More...
 

Public Member Functions

 CryostatGeo (TGeoNode const *node, TransformationMatrix &&trans, TPCList_t &&TPCs, OpDetList_t &&OpDets)
 Construct a representation of a single cryostat of the detector. More...
 
void SortSubVolumes (GeoObjectSorter const &sorter)
 Method to sort TPCGeo objects. More...
 
void UpdateAfterSorting (CryostatID cryoid)
 Performs all needed updates after geometry has sorted the cryostats. More...
 
TPC access
unsigned int NTPC () const
 Number of TPCs in this cryostat. More...
 
unsigned int NElements () const
 Alias for NTPC(). More...
 
bool HasTPC (unsigned int itpc) const
 Returns whether a TPC with index itpc is present in this cryostat. More...
 
bool HasElement (unsigned int itpc) const
 Alias for HasTPC(). More...
 
bool HasTPC (TPCID const &tpcid) const
 Returns whether the TPC in tpcid is present in this cryostat. More...
 
bool HasElement (TPCID const &tpcid) const
 Alias for HasTPC(geo::TPCID const&) More...
 
TPCGeo const & TPC (unsigned int itpc) const
 Return the itpc'th TPC in the cryostat. More...
 
TPCGeo const & TPC (TPCID const &tpcid) const
 Returns the TPC in tpcid from this cryostat. More...
 
TPCGeo const & GetElement (TPCID const &tpcid) const
 Alias for TPC(). More...
 
ElementIteratorBox IterateElements () const
 Returns an object suitable for iterating through all TPCs. More...
 
ElementIteratorBox IterateTPCs () const
 Returns an object suitable for iterating through all TPCs. More...
 
TPCGeo const * TPCPtr (unsigned int itpc) const
 Returns the TPC number itpc from this cryostat. More...
 
TPCGeo const * TPCPtr (TPCID const &tpcid) const
 Returns the TPC in tpcid from this cryostat. More...
 
TPCGeo const * GetElementPtr (TPCID const &tpcid) const
 Alias for TPCPtr(). More...
 
TPCID PositionToTPCID (Point_t const &point, double wiggle) const
 Returns the ID of the TPC at specified location. More...
 
TPCGeo const & PositionToTPC (Point_t const &point, double wiggle) const
 Returns the ID of the TPC at specified location. More...
 
TPCGeo const & PositionToTPC (double const worldLoc[3], double wiggle) const
 Returns the ID of the TPC at specified location. More...
 
TPCGeo const * PositionToTPCptr (Point_t const &point, double wiggle) const
 Returns a pointer to the TPC at specified location. More...
 
unsigned int MaxPlanes () const
 Returns the largest number of planes among the TPCs in this cryostat. More...
 
unsigned int MaxWires () const
 Returns the largest number of wires among the TPCs in this cryostat. More...
 
Optical detector access
unsigned int NOpDet () const
 Number of optical detectors in this TPC. More...
 
OpDetGeo const & OpDet (unsigned int iopdet) const
 Return the iopdet'th optical detector in the cryostat. More...
 
unsigned int GetClosestOpDet (Point_t const &point) const
 
unsigned int GetClosestOpDet (double const *point) const
 
OpDetGeo const * GetClosestOpDetPtr (Point_t const &point) const
 
std::string OpDetGeoName () const
 Get name of opdet geometry element. More...
 
Coordinate transformation
Point_t toWorldCoords (LocalPoint_t const &local) const
 Transform point from local cryostat frame to world frame. More...
 
Vector_t toWorldCoords (LocalVector_t const &local) const
 Transform direction vector from local to world. More...
 
LocalPoint_t toLocalCoords (Point_t const &world) const
 Transform point from world frame to local cryostat frame. More...
 
LocalVector_t toLocalCoords (Vector_t const &world) const
 Transform direction vector from world to local. More...
 
Dimension queries
double MinX () const
 Returns the world x coordinate of the start of the box. More...
 
double MaxX () const
 Returns the world x coordinate of the end of the box. More...
 
double CenterX () const
 Returns the world x coordinate of the center of the box. More...
 
double SizeX () const
 Returns the full size in the X dimension. More...
 
double HalfSizeX () const
 Returns the size from the center to the border on X dimension. More...
 
double MinY () const
 Returns the world y coordinate of the start of the box. More...
 
double MaxY () const
 Returns the world y coordinate of the end of the box. More...
 
double CenterY () const
 Returns the world y coordinate of the center of the box. More...
 
double SizeY () const
 Returns the full size in the Y dimension. More...
 
double HalfSizeY () const
 Returns the size from the center to the border on Y dimension. More...
 
double MinZ () const
 Returns the world z coordinate of the start of the box. More...
 
double MaxZ () const
 Returns the world z coordinate of the end of the box. More...
 
double CenterZ () const
 Returns the world z coordinate of the center of the box. More...
 
double SizeZ () const
 Returns the full size in the Z dimension. More...
 
double HalfSizeZ () const
 Returns the size from the center to the border on Z dimension. More...
 
Point_t Min () const
 Returns the corner point with the smallest coordinates. More...
 
Point_t Max () const
 Returns the corner point with the largest coordinates. More...
 
Point_t Center () const
 Returns the center point of the box. More...
 
Containment in the full volume
bool ContainsX (double x, double const wiggle=1) const
 Returns whether this TPC contains the specified world x coordinate. More...
 
bool ContainsY (double y, double const wiggle=1) const
 Returns whether this TPC contains the specified world y coordinate. More...
 
bool ContainsZ (double z, double const wiggle=1) const
 Returns whether this TPC contains the specified world z coordinate. More...
 
bool ContainsYZ (double y, double z, double const wiggle=1) const
 Returns if TPC contains the specified world y and z coordinates. More...
 
bool ContainsPosition (Point_t const &point, double wiggle=1.0) const
 Returns whether this volume contains the specified point. More...
 
bool ContainsPosition (TVector3 const &point, double wiggle=1.0) const
 
bool ContainsPosition (double const *point, double wiggle=1.0) const
 
Containment in a fiducial volume
bool InFiducialX (double x, double neg_margin, double pos_margin) const
 Returns whether TPC fiducial volume contains world x coordinate. More...
 
bool InFiducialX (double x, double margin) const
 Returns whether TPC fiducial volume contains world x coordinate. More...
 
bool InFiducialY (double y, double neg_margin, double pos_margin) const
 Returns whether TPC fiducial volume contains world y coordinate. More...
 
bool InFiducialY (double y, double margin) const
 Returns whether TPC fiducial volume contains world y coordinate. More...
 
bool InFiducialZ (double z, double neg_margin, double pos_margin) const
 Returns whether TPC fiducial volume contains world z coordinate. More...
 
bool InFiducialZ (double z, double margin) const
 Returns whether TPC fiducial volume contains world z coordinate. More...
 
Overlaps
bool OverlapsX (BoxBoundedGeo const &other) const
 Returns if the x coordinates covered by this and other box overlap. More...
 
bool OverlapsY (BoxBoundedGeo const &other) const
 Returns if the y coordinates covered by this and other box overlap. More...
 
bool OverlapsZ (BoxBoundedGeo const &other) const
 Returns if the z coordinates covered by this and other box overlap. More...
 
bool Overlaps (BoxBoundedGeo const &other) const
 Returns if this and other box overlap. More...
 
Setting dimensions
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. More...
 
void SetBoundaries (Coords_t lower, Coords_t upper)
 Sets the boundaries in world coordinates as specified. More...
 
void ExtendToInclude (Coord_t x, Coord_t y, Coord_t z)
 Extends the current box to also include the specified point. More...
 
void ExtendToInclude (Point_t const &point)
 Extends the current box to also include the specified point. More...
 
void ExtendToInclude (BoxBoundedGeo const &box)
 Extends the current box to also include the specified one. More...
 
std::vector< TVector3 > GetIntersections (TVector3 const &TrajectoryStart, TVector3 const &TrajectoryDirect) const
 Calculates the entry and exit points of a trajectory on the box surface. More...
 
std::vector< Point_tGetIntersections (Point_t const &TrajectoryStart, Vector_t const &TrajectoryDirect) const
 Calculates the entry and exit points of a trajectory on the box surface. More...
 

Static Public Member Functions

static bool CoordinateContained (double c, double min, double max, double wiggle=1.)
 Returns whether the specified coordinate is in a range. More...
 
static bool CoordinateContained (double c, double const *range, double wiggle=1.)
 Returns whether the specified coordinate is in a range. More...
 
static void set_min (Coord_t &var, Coord_t value)
 Sets var to value if value is smaller than the current var value. More...
 
static void set_min (Coords_t &var, Point_t const &value)
 Sets each coordinate of var to the one in value if the latter is smaller. More...
 
static void set_max (Coord_t &var, Coord_t value)
 Sets var to value if value is larger than the current var value. More...
 
static void set_max (Coords_t &var, Point_t const &value)
 Sets each coordinate of var to the one in value if the latter is larger. More...
 

Private Types

using LocalTransformation_t = LocalTransformationGeo< ROOT::Math::Transform3D, LocalPoint_t, LocalVector_t >
 

Private Member Functions

void FindTPC (std::vector< const TGeoNode * > &path, unsigned int depth)
 
void MakeTPC (std::vector< const TGeoNode * > &path, int depth)
 
void FindOpDet (std::vector< const TGeoNode * > &path, unsigned int depth)
 
void MakeOpDet (std::vector< const TGeoNode * > &path, int depth)
 
void InitCryoBoundaries ()
 Fill the boundary information of the cryostat. More...
 

Private Attributes

LocalTransformation_t fTrans
 Cryostat-to-world transformation. More...
 
TPCList_t fTPCs
 List of tpcs in this cryostat. More...
 
OpDetList_t fOpDets
 List of opdets in this cryostat. More...
 
TGeoVolume * fVolume
 Total volume of cryostat, called volCryostat in GDML file. More...
 
std::string fOpDetGeoName {"volOpDetSensitive"}
 Name of opdet geometry elements in gdml. More...
 
CryostatID fID {}
 ID of this cryostat. More...
 

Cryostat geometry information

static constexpr unsigned int MaxVerbosity = 3
 Maximum verbosity supported by PrintCryostatInfo(). More...
 
double HalfWidth () const
 Half width of the cryostat [cm]. More...
 
double HalfHeight () const
 Half height of the cryostat [cm]. More...
 
double HalfLength () const
 Half height of the cryostat [cm]. More...
 
double Width () const
 Full width of the cryostat [cm]. More...
 
double Height () const
 Full height of the cryostat [cm]. More...
 
double Length () const
 Length of the cryostat [cm]. More...
 
double Mass () const
 Mass of the cryostat. More...
 
const TGeoVolume * Volume () const
 Pointer to ROOT's volume descriptor. More...
 
BoxBoundedGeo const & Boundaries () const
 Returns boundaries of the cryostat (in centimetres). More...
 
void Boundaries (double *boundaries) const
 Fills boundaries of the cryostat (in centimetres). More...
 
Point_t GetCenter () const
 Returns the geometrical center of the cryostat. More...
 
BoxBoundedGeo const & BoundingBox () const
 Returns the bounding box of this cryostat. More...
 
CryostatID const & ID () const
 Returns the identifier of this cryostat. More...
 
template<typename Stream >
void PrintCryostatInfo (Stream &&out, std::string indent="", unsigned int verbosity=1) const
 Prints information about this cryostat. More...
 
std::string CryostatInfo (std::string indent="", unsigned int verbosity=1) const
 Returns a string with cryostat information. More...
 

Detailed Description

Geometry information for a single cryostat.

Definition at line 42 of file CryostatGeo.h.

Member Typedef Documentation

using geo::BoxBoundedGeo::Coord_t = Coords_t::Scalar
inherited

Type of the coordinate.

Definition at line 34 of file BoxBoundedGeo.h.

Type of the coordinate triplet.

Definition at line 33 of file BoxBoundedGeo.h.

Type returned by IterateElements().

Definition at line 56 of file CryostatGeo.h.

Definition at line 45 of file CryostatGeo.h.

Type of points in the local GDML cryostat frame.

Definition at line 78 of file CryostatGeo.h.

Definition at line 375 of file CryostatGeo.h.

Type of displacement vectors in the local GDML cryostat frame.

Definition at line 81 of file CryostatGeo.h.

Type used internally to store the optical detectors.

Definition at line 51 of file CryostatGeo.h.

using geo::CryostatGeo::TPCList_t = std::vector<TPCGeo>

Type used internally to store the TPCs.

Definition at line 48 of file CryostatGeo.h.

Constructor & Destructor Documentation

geo::CryostatGeo::CryostatGeo ( TGeoNode const *  node,
TransformationMatrix &&  trans,
TPCList_t &&  TPCs,
OpDetList_t &&  OpDets 
)

Construct a representation of a single cryostat of the detector.

Definition at line 31 of file CryostatGeo.cxx.

References fVolume, InitCryoBoundaries(), and MF_LOG_DEBUG.

35  : fTrans(std::move(trans))
36  , fTPCs(std::move(TPCs))
37  , fOpDets(std::move(OpDets))
38  , fVolume(node->GetVolume())
39  {
40  // all planes are going to be contained in the volume named volCryostat
41  if (!fVolume) throw cet::exception("CryostatGeo") << "cannot find cryostat outline volume\n";
42 
43  MF_LOG_DEBUG("Geometry") << "cryostat volume is " << fVolume->GetName();
44 
45  // set the bounding box
47  }
void InitCryoBoundaries()
Fill the boundary information of the cryostat.
TGeoVolume * fVolume
Total volume of cryostat, called volCryostat in GDML file.
Definition: CryostatGeo.h:380
OpDetList_t fOpDets
List of opdets in this cryostat.
Definition: CryostatGeo.h:379
TPCList_t fTPCs
List of tpcs in this cryostat.
Definition: CryostatGeo.h:378
#define MF_LOG_DEBUG(id)
LocalTransformation_t fTrans
Cryostat-to-world transformation.
Definition: CryostatGeo.h:377
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33

Member Function Documentation

BoxBoundedGeo const& geo::CryostatGeo::Boundaries ( ) const
inline

Returns boundaries of the cryostat (in centimetres).

Returns
boundaries in a geo::BoxBoundedGeo

Definition at line 113 of file CryostatGeo.h.

References BoundingBox().

Referenced by opdet::SimPhotonCounter::beginJob(), GetCenter(), evgen::PhotonGen::PhotonGen(), and phot::PhotonVisibilityService::reconfigure().

113 { return BoundingBox(); }
BoxBoundedGeo const & BoundingBox() const
Returns the bounding box of this cryostat.
Definition: CryostatGeo.h:123
void geo::CryostatGeo::Boundaries ( double *  boundaries) const

Fills boundaries of the cryostat (in centimetres).

Parameters
boundariesfilled as: [0] -x [1] +x [2] -y [3] +y [4] -z [5] +z

Definition at line 146 of file CryostatGeo.cxx.

References geo::BoxBoundedGeo::MaxX(), geo::BoxBoundedGeo::MaxY(), geo::BoxBoundedGeo::MaxZ(), geo::BoxBoundedGeo::MinX(), geo::BoxBoundedGeo::MinY(), and geo::BoxBoundedGeo::MinZ().

147  {
148  boundaries[0] = MinX();
149  boundaries[1] = MaxX();
150  boundaries[2] = MinY();
151  boundaries[3] = MaxY();
152  boundaries[4] = MinZ();
153  boundaries[5] = MaxZ();
154  }
double MinX() const
Returns the world x coordinate of the start of the box.
Definition: BoxBoundedGeo.h:88
double MaxX() const
Returns the world x coordinate of the end of the box.
Definition: BoxBoundedGeo.h:91
double MinZ() const
Returns the world z coordinate of the start of the box.
double MaxY() const
Returns the world y coordinate of the end of the box.
double MaxZ() const
Returns the world z coordinate of the end of the box.
double MinY() const
Returns the world y coordinate of the start of the box.
BoxBoundedGeo const& geo::CryostatGeo::BoundingBox ( ) const
inline

Returns the bounding box of this cryostat.

Definition at line 123 of file CryostatGeo.h.

Referenced by Boundaries(), PrintCryostatInfo(), and phot::PhotonVisibilityService::reconfigure().

123 { return static_cast<BoxBoundedGeo const&>(*this); }
BoxBoundedGeo()=default
Default constructor: sets an empty volume.
Point_t geo::BoxBoundedGeo::Center ( ) const
inlineinherited

Returns the center point of the box.

Definition at line 139 of file BoxBoundedGeo.h.

References geo::BoxBoundedGeo::CenterX(), geo::BoxBoundedGeo::CenterY(), and geo::BoxBoundedGeo::CenterZ().

Referenced by GetCenter(), and geo::PlaneGeo::UpdatePlaneNormal().

139 { return {CenterX(), CenterY(), CenterZ()}; }
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 CenterY() const
Returns the world y coordinate of the center of the box.
double geo::BoxBoundedGeo::CenterX ( ) const
inlineinherited

Returns the world x coordinate of the center of the box.

Definition at line 94 of file BoxBoundedGeo.h.

References geo::BoxBoundedGeo::MaxX(), and geo::BoxBoundedGeo::MinX().

Referenced by geo::BoxBoundedGeo::Center().

94 { return (MinX() + MaxX()) / 2.; }
double MinX() const
Returns the world x coordinate of the start of the box.
Definition: BoxBoundedGeo.h:88
double MaxX() const
Returns the world x coordinate of the end of the box.
Definition: BoxBoundedGeo.h:91
double geo::BoxBoundedGeo::CenterY ( ) const
inlineinherited

Returns the world y coordinate of the center of the box.

Definition at line 109 of file BoxBoundedGeo.h.

References geo::BoxBoundedGeo::MaxY(), and geo::BoxBoundedGeo::MinY().

Referenced by geo::BoxBoundedGeo::Center().

109 { return (MinY() + MaxY()) / 2.; }
double MaxY() const
Returns the world y coordinate of the end of the box.
double MinY() const
Returns the world y coordinate of the start of the box.
double geo::BoxBoundedGeo::CenterZ ( ) const
inlineinherited

Returns the world z coordinate of the center of the box.

Definition at line 124 of file BoxBoundedGeo.h.

References geo::BoxBoundedGeo::MaxZ(), and geo::BoxBoundedGeo::MinZ().

Referenced by geo::BoxBoundedGeo::Center().

124 { return (MinZ() + MaxZ()) / 2.; }
double MinZ() const
Returns the world z coordinate of the start of the box.
double MaxZ() const
Returns the world z coordinate of the end of the box.
bool geo::BoxBoundedGeo::ContainsPosition ( Point_t const &  point,
double  wiggle = 1.0 
) const
inlineinherited

Returns whether this volume contains the specified point.

Parameters
pointthe point [cm]
wiggleexpansion factor for the range
Returns
whether the specified coordinate is in this volume

If the wiggle is larger than 1, each size of the volume is expanded by the wiggle factor. If the wiggle is less than 1, each size is shrinked.

Definition at line 208 of file BoxBoundedGeo.h.

References geo::BoxBoundedGeo::ContainsX(), and geo::BoxBoundedGeo::ContainsYZ().

Referenced by geo::BoxBoundedGeo::ContainsPosition(), and geo::GeometryCore::MaterialName().

209  {
210  return ContainsX(point.X(), wiggle) && ContainsYZ(point.Y(), point.Z(), wiggle);
211  } // ContainsPosition()
bool ContainsX(double x, double const wiggle=1) const
Returns whether this TPC contains the specified world x coordinate.
bool ContainsYZ(double y, double z, double const wiggle=1) const
Returns if TPC contains the specified world y and z coordinates.
bool geo::BoxBoundedGeo::ContainsPosition ( TVector3 const &  point,
double  wiggle = 1.0 
) const
inherited
See also
ContainsPosition(Point_t const&, double) const.

Definition at line 22 of file BoxBoundedGeo.cxx.

References geo::BoxBoundedGeo::ContainsPosition(), and geo::vect::toPoint().

23  {
24  return ContainsPosition(vect::toPoint(point), wiggle);
25  }
Point_t toPoint(Point const &p)
Convert the specified point into a geo::Point_t.
bool ContainsPosition(Point_t const &point, double wiggle=1.0) const
Returns whether this volume contains the specified point.
bool geo::BoxBoundedGeo::ContainsPosition ( double const *  point,
double  wiggle = 1.0 
) const
inherited
See also
ContainsPosition(Point_t const&, double) const.

Definition at line 28 of file BoxBoundedGeo.cxx.

References geo::BoxBoundedGeo::ContainsPosition(), and geo::vect::makePointFromCoords().

29  {
30  return ContainsPosition(vect::makePointFromCoords(point), wiggle);
31  }
GENVECTOR_CONSTEXPR Point_t makePointFromCoords(Coords &&coords)
Creates a geo::Point_t from its coordinates (see makeFromCoords()).
bool ContainsPosition(Point_t const &point, double wiggle=1.0) const
Returns whether this volume contains the specified point.
bool geo::BoxBoundedGeo::ContainsX ( double  x,
double const  wiggle = 1 
) const
inlineinherited

Returns whether this TPC contains the specified world x coordinate.

Parameters
xthe absolute ("world") coordinate x
wiggleexpansion factor for the range (see ContainsPosition())
Returns
whether the specified coordinate is in this TPC
See also
ContainsPosition()

Note that x is by definition the drift direction, and a reconstructed x typically depends on an assumption respect to the event time.

Definition at line 156 of file BoxBoundedGeo.h.

References geo::BoxBoundedGeo::CoordinateContained(), geo::BoxBoundedGeo::MaxX(), and geo::BoxBoundedGeo::MinX().

Referenced by geo::BoxBoundedGeo::ContainsPosition().

157  {
158  return CoordinateContained(x, MinX(), MaxX(), wiggle);
159  }
Float_t x
Definition: compare.C:6
double MinX() const
Returns the world x coordinate of the start of the box.
Definition: BoxBoundedGeo.h:88
double MaxX() const
Returns the world x coordinate of the end of the box.
Definition: BoxBoundedGeo.h:91
static bool CoordinateContained(double c, double min, double max, double wiggle=1.)
Returns whether the specified coordinate is in a range.
bool geo::BoxBoundedGeo::ContainsY ( double  y,
double const  wiggle = 1 
) const
inlineinherited

Returns whether this TPC contains the specified world y coordinate.

Parameters
ythe absolute ("world") coordinate y
wiggleexpansion factor for the range (see ContainsPosition())
Returns
whether the specified coordinate is in this TPC
See also
ContainsPosition()

Definition at line 168 of file BoxBoundedGeo.h.

References geo::BoxBoundedGeo::CoordinateContained(), geo::BoxBoundedGeo::MaxY(), and geo::BoxBoundedGeo::MinY().

Referenced by geo::BoxBoundedGeo::ContainsYZ().

169  {
170  return CoordinateContained(y, MinY(), MaxY(), wiggle);
171  }
Float_t y
Definition: compare.C:6
double MaxY() const
Returns the world y coordinate of the end of the box.
static bool CoordinateContained(double c, double min, double max, double wiggle=1.)
Returns whether the specified coordinate is in a range.
double MinY() const
Returns the world y coordinate of the start of the box.
bool geo::BoxBoundedGeo::ContainsYZ ( double  y,
double  z,
double const  wiggle = 1 
) const
inlineinherited

Returns if TPC contains the specified world y and z coordinates.

Parameters
ythe absolute ("world") coordinate y
zthe absolute ("world") coordinate z
wiggleexpansion factor for the range (see ContainsPosition())
Returns
whether the specified coordinate is in this TPC
See also
ContainsPosition()

Definition at line 193 of file BoxBoundedGeo.h.

References geo::BoxBoundedGeo::ContainsY(), and geo::BoxBoundedGeo::ContainsZ().

Referenced by geo::BoxBoundedGeo::ContainsPosition().

194  {
195  return ContainsY(y, wiggle) && ContainsZ(z, wiggle);
196  }
Float_t y
Definition: compare.C:6
Double_t z
Definition: plot.C:276
bool ContainsY(double y, double const wiggle=1) const
Returns whether this TPC contains the specified world y coordinate.
bool ContainsZ(double z, double const wiggle=1) const
Returns whether this TPC contains the specified world z coordinate.
bool geo::BoxBoundedGeo::ContainsZ ( double  z,
double const  wiggle = 1 
) const
inlineinherited

Returns whether this TPC contains the specified world z coordinate.

Parameters
zthe absolute ("world") coordinate z
wiggleexpansion factor for the range (see ContainsPosition())
Returns
whether the specified coordinate is in this TPC
See also
ContainsPosition()

Definition at line 180 of file BoxBoundedGeo.h.

References geo::BoxBoundedGeo::CoordinateContained(), geo::BoxBoundedGeo::MaxZ(), and geo::BoxBoundedGeo::MinZ().

Referenced by geo::BoxBoundedGeo::ContainsYZ().

181  {
182  return CoordinateContained(z, MinZ(), MaxZ(), wiggle);
183  }
Double_t z
Definition: plot.C:276
double MinZ() const
Returns the world z coordinate of the start of the box.
double MaxZ() const
Returns the world z coordinate of the end of the box.
static bool CoordinateContained(double c, double min, double max, double wiggle=1.)
Returns whether the specified coordinate is in a range.
static bool geo::BoxBoundedGeo::CoordinateContained ( double  c,
double  min,
double  max,
double  wiggle = 1. 
)
inlinestaticinherited

Returns whether the specified coordinate is in a range.

Parameters
cthe coordinate
minlower boundary of the range
maxupper boundary of the range
wiggleexpansion factor for the range
Returns
whether the specified coordinate is in a range

If the wiggle is larger than 1, the range is expanded by the wiggle factor. If the wiggle is less than 1, the range is shrinked.

Definition at line 357 of file BoxBoundedGeo.h.

Referenced by geo::BoxBoundedGeo::ContainsX(), geo::BoxBoundedGeo::ContainsY(), geo::BoxBoundedGeo::ContainsZ(), geo::BoxBoundedGeo::CoordinateContained(), geo::BoxBoundedGeo::InFiducialX(), geo::BoxBoundedGeo::InFiducialY(), and geo::BoxBoundedGeo::InFiducialZ().

358  {
359  return (c >= (min > 0 ? min / wiggle : min * wiggle)) &&
360  (c <= (max < 0 ? max / wiggle : max * wiggle));
361  } // CoordinateContained()
static bool geo::BoxBoundedGeo::CoordinateContained ( double  c,
double const *  range,
double  wiggle = 1. 
)
inlinestaticinherited

Returns whether the specified coordinate is in a range.

Parameters
cthe coordinate
rangepointer to [ lower boundary, upper boundary ] of the range
wiggleexpansion factor for the range
Returns
whether the specified coordinate is in a range
See also
CoordinateContained(double, double, double, double)

If the wiggle is larger than 1, the range is expanded by the wiggle factor. If the wiggle is less than 1, the range is shrinked.

Definition at line 374 of file BoxBoundedGeo.h.

References geo::BoxBoundedGeo::CoordinateContained().

375  {
376  return CoordinateContained(c, range[0], range[1], wiggle);
377  }
static bool CoordinateContained(double c, double min, double max, double wiggle=1.)
Returns whether the specified coordinate is in a range.
std::string geo::CryostatGeo::CryostatInfo ( std::string  indent = "",
unsigned int  verbosity = 1 
) const

Returns a string with cryostat information.

See also
PrintCryostatInfo()

The arguments and provided information are the same as in PrintCryostatInfo().

Definition at line 157 of file CryostatGeo.cxx.

References PrintCryostatInfo().

Referenced by ID().

159  {
160  std::ostringstream sstr;
161  PrintCryostatInfo(sstr, indent, verbosity);
162  return sstr.str();
163  }
void PrintCryostatInfo(Stream &&out, std::string indent="", unsigned int verbosity=1) const
Prints information about this cryostat.
Definition: CryostatGeo.h:390
std::string indent(std::size_t const i)
void geo::BoxBoundedGeo::ExtendToInclude ( Coord_t  x,
Coord_t  y,
Coord_t  z 
)
inlineinherited

Extends the current box to also include the specified point.

Parameters
xx coordinate of the point to include
yy coordinate of the point to include
zz coordinate of the point to include

Definition at line 421 of file BoxBoundedGeo.h.

References geo::BoxBoundedGeo::ExtendToInclude().

Referenced by geo::PlaneGeo::BoundingBox(), evd_tool::StandardDrawer::DetOutline3D(), evd_tool::ProtoDUNEDrawer::DetOutline3D(), geo::BoxBoundedGeo::ExtendToInclude(), larg4::ISTPC::extractActiveLArVolume(), larg4::OpFastScintillation::extractActiveVolumes(), and phot::PhotonVisibilityService::reconfigure().

421 { ExtendToInclude(Point_t(x, y, z)); }
Float_t x
Definition: compare.C:6
Float_t y
Definition: compare.C:6
Double_t z
Definition: plot.C:276
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:180
void ExtendToInclude(Coord_t x, Coord_t y, Coord_t z)
Extends the current box to also include the specified point.
void geo::BoxBoundedGeo::ExtendToInclude ( Point_t const &  point)
inlineinherited

Extends the current box to also include the specified point.

Parameters
pointcoordinates of the point to include

Definition at line 427 of file BoxBoundedGeo.h.

References geo::BoxBoundedGeo::c_max, geo::BoxBoundedGeo::c_min, geo::BoxBoundedGeo::set_max(), and geo::BoxBoundedGeo::set_min().

428  {
429  set_min(c_min, point);
430  set_max(c_max, point);
431  }
static void set_min(Coord_t &var, Coord_t value)
Sets var to value if value is smaller than the current var value.
static void set_max(Coord_t &var, Coord_t value)
Sets var to value if value is larger than the current var value.
Coords_t c_max
maximum coordinates (x, y, z)
Coords_t c_min
minimum coordinates (x, y, z)
void geo::BoxBoundedGeo::ExtendToInclude ( BoxBoundedGeo const &  box)
inlineinherited

Extends the current box to also include the specified one.

Parameters
boxthe box to include

It is assumed that the box has its boundaries properly sorted.

Definition at line 439 of file BoxBoundedGeo.h.

References geo::BoxBoundedGeo::c_max, geo::BoxBoundedGeo::c_min, geo::BoxBoundedGeo::GetIntersections(), geo::BoxBoundedGeo::Max(), geo::BoxBoundedGeo::Min(), geo::BoxBoundedGeo::set_max(), and geo::BoxBoundedGeo::set_min().

440  {
441  set_min(c_min, box.Min());
442  set_max(c_max, box.Max());
443  } // ExtendToInclude()
static void set_min(Coord_t &var, Coord_t value)
Sets var to value if value is smaller than the current var value.
static void set_max(Coord_t &var, Coord_t value)
Sets var to value if value is larger than the current var value.
Coords_t c_max
maximum coordinates (x, y, z)
Coords_t c_min
minimum coordinates (x, y, z)
void geo::CryostatGeo::FindOpDet ( std::vector< const TGeoNode * > &  path,
unsigned int  depth 
)
private

Referenced by toLocalCoords().

void geo::CryostatGeo::FindTPC ( std::vector< const TGeoNode * > &  path,
unsigned int  depth 
)
private

Referenced by toLocalCoords().

Point_t geo::CryostatGeo::GetCenter ( ) const
inline

Returns the geometrical center of the cryostat.

Definition at line 120 of file CryostatGeo.h.

References Boundaries(), and geo::BoxBoundedGeo::Center().

Referenced by PrintCryostatInfo().

120 { return Boundaries().Center(); }
Point_t Center() const
Returns the center point of the box.
BoxBoundedGeo const & Boundaries() const
Returns boundaries of the cryostat (in centimetres).
Definition: CryostatGeo.h:113
unsigned int geo::CryostatGeo::GetClosestOpDet ( Point_t const &  point) const

Returns the index of the optical detector in this cryostat closest to point.

Definition at line 175 of file CryostatGeo.cxx.

References geo::OpDetGeo::DistanceToPoint(), NOpDet(), and OpDet().

Referenced by GetClosestOpDet(), geo::GeometryCore::GetClosestOpDet(), GetClosestOpDetPtr(), and NOpDet().

176  {
177  unsigned int ClosestDet = std::numeric_limits<unsigned int>::max();
178  double ClosestDist = std::numeric_limits<double>::max();
179 
180  for (unsigned int o = 0U; o < NOpDet(); ++o) {
181  double const ThisDist = OpDet(o).DistanceToPoint(point);
182  if (ThisDist < ClosestDist) {
183  ClosestDist = ThisDist;
184  ClosestDet = o;
185  }
186  } // for
187  return ClosestDet;
188  }
OpDetGeo const & OpDet(unsigned int iopdet) const
Return the iopdet&#39;th optical detector in the cryostat.
Definition: CryostatGeo.cxx:83
double DistanceToPoint(Point_t const &point) const
Returns the distance of the specified point from detector center [cm].
Definition: OpDetGeo.cxx:94
unsigned int NOpDet() const
Number of optical detectors in this TPC.
Definition: CryostatGeo.h:317
unsigned int geo::CryostatGeo::GetClosestOpDet ( double const *  point) const
See also
GetClosestOpDet(geo::Point_t const&) const

Definition at line 191 of file CryostatGeo.cxx.

References GetClosestOpDet(), and geo::vect::makePointFromCoords().

192  {
194  }
unsigned int GetClosestOpDet(Point_t const &point) const
GENVECTOR_CONSTEXPR Point_t makePointFromCoords(Coords &&coords)
Creates a geo::Point_t from its coordinates (see makeFromCoords()).
OpDetGeo const * geo::CryostatGeo::GetClosestOpDetPtr ( Point_t const &  point) const

Returns the optical detector det in this cryostat nearest to point. If there are no optical detectors, nullptr is returned.

Definition at line 168 of file CryostatGeo.cxx.

References GetClosestOpDet(), and OpDet().

Referenced by NOpDet().

169  {
170  unsigned int iOpDet = GetClosestOpDet(point);
171  return (iOpDet == std::numeric_limits<double>::max()) ? nullptr : &OpDet(iOpDet);
172  }
OpDetGeo const & OpDet(unsigned int iopdet) const
Return the iopdet&#39;th optical detector in the cryostat.
Definition: CryostatGeo.cxx:83
unsigned int GetClosestOpDet(Point_t const &point) const
TPCGeo const& geo::CryostatGeo::GetElement ( TPCID const &  tpcid) const
inline

Alias for TPC().

Definition at line 212 of file CryostatGeo.h.

References IterateElements(), and TPC().

212 { return TPC(tpcid); }
TPCGeo const & TPC(unsigned int itpc) const
Return the itpc&#39;th TPC in the cryostat.
Definition: CryostatGeo.cxx:73
TPCGeo const* geo::CryostatGeo::GetElementPtr ( TPCID const &  tpcid) const
inline

Alias for TPCPtr().

Definition at line 267 of file CryostatGeo.h.

References PositionToTPC(), PositionToTPCID(), and TPCPtr().

267 { return TPCPtr(tpcid); }
TPCGeo const * TPCPtr(unsigned int itpc) const
Returns the TPC number itpc from this cryostat.
Definition: CryostatGeo.h:252
std::vector< TVector3 > geo::BoxBoundedGeo::GetIntersections ( TVector3 const &  TrajectoryStart,
TVector3 const &  TrajectoryDirect 
) const
inherited

Calculates the entry and exit points of a trajectory on the box surface.

Parameters
TrajectoryStartposition of the trajectory source
TrajectoryDirectdirection vector of the trajectory

This member is public since it just gives an output and does not change any member. The algorithm works only for a box shaped active volume with facing walls parallel to axis. If the return std::vector is empty the trajectory does not intersect with the box. Normally the return value should have one (if the trajectory originates in the box) or two (else) entries. If the return value has two entries the first represents the entry point and the second the exit point

Definition at line 123 of file BoxBoundedGeo.cxx.

Referenced by geo::BoxBoundedGeo::ExtendToInclude().

125  {
126  std::vector<TVector3> intersections;
127  for (auto const& point : GetIntersections(Point_t(TrajectoryStart), Vector_t(TrajectoryDirect)))
128  intersections.emplace_back(point.X(), point.Y(), point.Z());
129  return intersections;
130  }
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space.
Definition: geo_vectors.h:160
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:180
std::vector< TVector3 > GetIntersections(TVector3 const &TrajectoryStart, TVector3 const &TrajectoryDirect) const
Calculates the entry and exit points of a trajectory on the box surface.
std::vector< Point_t > geo::BoxBoundedGeo::GetIntersections ( Point_t const &  TrajectoryStart,
Vector_t const &  TrajectoryDirect 
) const
inherited

Calculates the entry and exit points of a trajectory on the box surface.

Parameters
TrajectoryStartposition of the trajectory source
TrajectoryDirectdirection vector of the trajectory

This member is public since it just gives an output and does not change any member. The algorithm works only for a box shaped active volume with facing walls parallel to axis. If the return std::vector is empty the trajectory does not intersect with the box. Normally the return value should have one (if the trajectory originates in the box) or two (else) entries. If the return value has two entries the first represents the entry point and the second the exit point

Definition at line 34 of file BoxBoundedGeo.cxx.

References geo::vect::bindCoord(), geo::BoxBoundedGeo::c_max, geo::BoxBoundedGeo::c_min, geo::vect::coord(), geo::BoxBoundedGeo::Max(), and geo::BoxBoundedGeo::Min().

36  {
37  std::vector<Point_t> IntersectionPoints;
38  std::vector<double> LineParameters;
39 
40  // Generate normal vectors and offsets for every plane of the box
41  // All normal vectors are headed outwards
42  // BUG the double brace syntax is required to work around clang bug 21629
43  // (https://bugs.llvm.org/show_bug.cgi?id=21629)
44  static std::array<Vector_t, 6U> const NormalVectors = {{
45  -Xaxis<Vector_t>(),
46  Xaxis<Vector_t>(), // anode, cathode,
47  -Yaxis<Vector_t>(),
48  Yaxis<Vector_t>(), // bottom, top,
49  -Zaxis<Vector_t>(),
50  Zaxis<Vector_t>() // upstream, downstream
51  }};
52  // BUG the double brace syntax is required to work around clang bug 21629
53  // (https://bugs.llvm.org/show_bug.cgi?id=21629)
54  std::array<Point_t, 6U> const NormalVectorOffsets = {{
55  Point_t{Min().X(), Min().Y(), Min().Z()}, // Anode offset
56  Point_t{Max().X(), Min().Y(), Min().Z()}, // Cathode
57  Point_t{Min().X(), Min().Y(), Min().Z()}, // Bottom
58  Point_t{Min().X(), Max().Y(), Min().Z()}, // Top
59  Point_t{Min().X(), Min().Y(), Min().Z()}, // upstream
60  Point_t{Min().X(), Min().Y(), Max().Z()} // downstream
61  }};
62 
63  // Loop over all surfaces of the box
64  for (unsigned int face_no = 0; face_no < NormalVectors.size(); face_no++) {
65  // Check if trajectory and surface are not parallel
66  if (NormalVectors[face_no].Dot(TrajectoryDirect)) {
67  // Calculate the line parameter for the intersection points
68  LineParameters.push_back(
69  NormalVectors[face_no].Dot(NormalVectorOffsets.at(face_no) - TrajectoryStart) /
70  NormalVectors[face_no].Dot(TrajectoryDirect));
71  }
72  else
73  continue;
74 
75  // Calculate intersection point using the line parameter
76  IntersectionPoints.push_back(TrajectoryStart + LineParameters.back() * TrajectoryDirect);
77 
78  // Coordinate which should be ignored when checking for limits added by Christoph
79  // Rudolf von Rohr 05/21/2016
80  unsigned int NoCheckCoord;
81 
82  // Calculate NoCheckCoord out of the face_no
83  if (face_no % 2) {
84  // Convert odd face number to coordinate
85  NoCheckCoord = (face_no - 1) / 2;
86  }
87  else {
88  // Convert even face number to coordinate
89  NoCheckCoord = face_no / 2;
90  }
91 
92  // Loop over all three space coordinates
93  unsigned int coord = 0;
94  for (auto extractCoord : vect::coordReaders<Point_t>()) {
95  auto const lastPointCoord = vect::bindCoord(IntersectionPoints.back(), extractCoord);
96  auto const minCoord = vect::bindCoord(c_min, extractCoord);
97  auto const maxCoord = vect::bindCoord(c_max, extractCoord);
98 
99  // Changed by Christoph Rudolf von Rohr 05/21/2016 Then check if point is not
100  // within the surface limits at this coordinate, without looking at the plane
101  // normal vector coordinate. We can assume, that our algorithm already found this
102  // coordinate correctily. In rare cases, looking for boundaries in this
103  // coordinate causes unexpected behavior due to floating point inaccuracies.
104  if (coord++ != NoCheckCoord &&
105  ((lastPointCoord() > maxCoord()) || (lastPointCoord() < minCoord))) {
106  // if off limits, get rid of the useless data and break the coordinate loop
107  LineParameters.pop_back();
108  IntersectionPoints.pop_back();
109  break;
110  }
111  } // coordinate loop
112  } // Surcaces loop
113 
114  // sort points according to their parameter value (first is entry, second is exit)
115  if (LineParameters.size() == 2 && LineParameters.front() > LineParameters.back()) {
116  std::swap(IntersectionPoints.front(), IntersectionPoints.back());
117  }
118 
119  return IntersectionPoints;
120  } // GetIntersections()
Point_t Max() const
Returns the corner point with the largest coordinates.
auto coord(Vector &v, unsigned int n) noexcept
Returns an object to manage the coordinate n of a vector.
constexpr auto bindCoord(Vector const &v, CoordReader_t< Vector > helper)
Binds the specified constant vector to the coordinate reader.
recob::tracking::Point_t Point_t
Coords_t c_max
maximum coordinates (x, y, z)
Point_t Min() const
Returns the corner point with the smallest coordinates.
Coords_t c_min
minimum coordinates (x, y, z)
void swap(lar::deep_const_fwd_iterator_nested< CITER, INNERCONTEXTRACT > &a, lar::deep_const_fwd_iterator_nested< CITER, INNERCONTEXTRACT > &b)
double geo::CryostatGeo::HalfHeight ( ) const

Half height of the cryostat [cm].

Definition at line 134 of file CryostatGeo.cxx.

References fVolume.

Referenced by Height(), and InitCryoBoundaries().

135  {
136  return static_cast<TGeoBBox const*>(fVolume->GetShape())->GetDY();
137  }
TGeoVolume * fVolume
Total volume of cryostat, called volCryostat in GDML file.
Definition: CryostatGeo.h:380
double geo::CryostatGeo::HalfLength ( ) const

Half height of the cryostat [cm].

Definition at line 140 of file CryostatGeo.cxx.

References fVolume.

Referenced by InitCryoBoundaries(), and Length().

141  {
142  return static_cast<TGeoBBox const*>(fVolume->GetShape())->GetDZ();
143  }
TGeoVolume * fVolume
Total volume of cryostat, called volCryostat in GDML file.
Definition: CryostatGeo.h:380
double geo::BoxBoundedGeo::HalfSizeX ( ) const
inlineinherited

Returns the size from the center to the border on X dimension.

Definition at line 100 of file BoxBoundedGeo.h.

References geo::BoxBoundedGeo::SizeX().

100 { return SizeX() / 2.0; }
double SizeX() const
Returns the full size in the X dimension.
Definition: BoxBoundedGeo.h:97
double geo::BoxBoundedGeo::HalfSizeY ( ) const
inlineinherited

Returns the size from the center to the border on Y dimension.

Definition at line 115 of file BoxBoundedGeo.h.

References geo::BoxBoundedGeo::SizeY().

115 { return SizeY() / 2.0; }
double SizeY() const
Returns the full size in the Y dimension.
double geo::BoxBoundedGeo::HalfSizeZ ( ) const
inlineinherited

Returns the size from the center to the border on Z dimension.

Definition at line 130 of file BoxBoundedGeo.h.

References geo::BoxBoundedGeo::SizeZ().

130 { return SizeZ() / 2.0; }
double SizeZ() const
Returns the full size in the Z dimension.
double geo::CryostatGeo::HalfWidth ( ) const

Half width of the cryostat [cm].

Definition at line 128 of file CryostatGeo.cxx.

References fVolume.

Referenced by InitCryoBoundaries(), and Width().

129  {
130  return static_cast<TGeoBBox const*>(fVolume->GetShape())->GetDX();
131  }
TGeoVolume * fVolume
Total volume of cryostat, called volCryostat in GDML file.
Definition: CryostatGeo.h:380
bool geo::CryostatGeo::HasElement ( unsigned int  itpc) const
inline

Alias for HasTPC().

Definition at line 183 of file CryostatGeo.h.

References HasTPC().

183 { return HasTPC(itpc); }
bool HasTPC(unsigned int itpc) const
Returns whether a TPC with index itpc is present in this cryostat.
Definition: CryostatGeo.h:180
bool geo::CryostatGeo::HasElement ( TPCID const &  tpcid) const
inline

Alias for HasTPC(geo::TPCID const&)

Definition at line 195 of file CryostatGeo.h.

References HasTPC(), and TPC().

195 { return HasTPC(tpcid); }
bool HasTPC(unsigned int itpc) const
Returns whether a TPC with index itpc is present in this cryostat.
Definition: CryostatGeo.h:180
bool geo::CryostatGeo::HasTPC ( unsigned int  itpc) const
inline

Returns whether a TPC with index itpc is present in this cryostat.

Parameters
itpcindex of TPC in this cryostat
Returns
whether the TPC with index itpc is present in this cryostat

Definition at line 180 of file CryostatGeo.h.

References NTPC().

Referenced by HasElement(), geo::GeometryCore::HasTPC(), and TPCPtr().

180 { return itpc < NTPC(); }
unsigned int NTPC() const
Number of TPCs in this cryostat.
Definition: CryostatGeo.h:171
bool geo::CryostatGeo::HasTPC ( TPCID const &  tpcid) const
inline

Returns whether the TPC in tpcid is present in this cryostat.

Parameters
tpcidfull TPC ID
Returns
whether the TPC in tpcid is present in this cryostat

The cryostat number in tpcid is ignored, as it is ignored whether tpcid is invalid.

Definition at line 193 of file CryostatGeo.h.

References HasTPC(), and geo::TPCID::TPC.

Referenced by HasTPC().

193 { return HasTPC(tpcid.TPC); }
bool HasTPC(unsigned int itpc) const
Returns whether a TPC with index itpc is present in this cryostat.
Definition: CryostatGeo.h:180
double geo::CryostatGeo::Height ( ) const
inline

Full height of the cryostat [cm].

Definition at line 103 of file CryostatGeo.h.

References HalfHeight().

Referenced by PrintCryostatInfo().

103 { return 2. * HalfHeight(); }
double HalfHeight() const
Half height of the cryostat [cm].
CryostatID const& geo::CryostatGeo::ID ( ) const
inline

Returns the identifier of this cryostat.

Definition at line 126 of file CryostatGeo.h.

References CryostatInfo(), fID, art::detail::indent(), and PrintCryostatInfo().

Referenced by geo::GeometryCore::GetClosestOpDet(), geo::GeometryCore::PositionToCryostatID(), PositionToTPC(), and PrintCryostatInfo().

126 { return fID; }
CryostatID fID
ID of this cryostat.
Definition: CryostatGeo.h:382
bool geo::BoxBoundedGeo::InFiducialX ( double  x,
double  neg_margin,
double  pos_margin 
) const
inlineinherited

Returns whether TPC fiducial volume contains world x coordinate.

Parameters
xthe absolute ("world") coordinate x
neg_marginhow far within the TPC the fiducial region starts
pos_marginhow far before the TPC the fiducial region ends
Returns
whether the specified coordinate is in this TPC fiducial volume

The fiducial volume is defined by the specified margins, that denote how much of the coordinate is not fiducial. For example,

bool bWithin = tpc->InFiducialX(x, 5., 8.);

on a TPC with x from 0 to 100 (cm, presumably) will return true for all x between 5 and 92. If positive margin is not specified, it's assumed to be the same as the negative one. Specifying a negative mergin effectively extends the TPC volume. Note that x is by definition the drift direction, and a reconstructed x typically depends on an assumption respect to the event time.

Definition at line 241 of file BoxBoundedGeo.h.

References geo::BoxBoundedGeo::CoordinateContained(), geo::BoxBoundedGeo::MaxX(), and geo::BoxBoundedGeo::MinX().

242  {
243  return CoordinateContained(x, MinX() + neg_margin, MaxX() - pos_margin);
244  }
Float_t x
Definition: compare.C:6
double MinX() const
Returns the world x coordinate of the start of the box.
Definition: BoxBoundedGeo.h:88
double MaxX() const
Returns the world x coordinate of the end of the box.
Definition: BoxBoundedGeo.h:91
static bool CoordinateContained(double c, double min, double max, double wiggle=1.)
Returns whether the specified coordinate is in a range.
bool geo::BoxBoundedGeo::InFiducialX ( double  x,
double  margin 
) const
inlineinherited

Returns whether TPC fiducial volume contains world x coordinate.

See also
InFiducialX(double, double, double) const

Margins are symmetric.

Definition at line 251 of file BoxBoundedGeo.h.

References geo::BoxBoundedGeo::InFiducialX().

Referenced by geo::BoxBoundedGeo::InFiducialX().

251 { return InFiducialX(x, margin, margin); }
Float_t x
Definition: compare.C:6
bool InFiducialX(double x, double neg_margin, double pos_margin) const
Returns whether TPC fiducial volume contains world x coordinate.
bool geo::BoxBoundedGeo::InFiducialY ( double  y,
double  neg_margin,
double  pos_margin 
) const
inlineinherited

Returns whether TPC fiducial volume contains world y coordinate.

Parameters
ythe absolute ("world") coordinate y
neg_marginhow far within the TPC the fiducial region starts
pos_marginhow far before the TPC the fiducial region ends
Returns
whether the specified coordinate is in this TPC fiducial volume

The fiducial volume is defined by the specified margins, that denote how much of the coordinate is not fiducial. For example,

bool bWithin = tpc->InFiducialY(y, 5., 8.);

on a TPC with y from 0 to 100 (cm, presumably) will return true for all y between 5 and 92. If positive margin is not specified, it's assumed to be the same as the negative one. Specifying a negative mergin effectively extends the TPC volume.

Definition at line 271 of file BoxBoundedGeo.h.

References geo::BoxBoundedGeo::CoordinateContained(), geo::BoxBoundedGeo::MaxY(), and geo::BoxBoundedGeo::MinY().

272  {
273  return CoordinateContained(y, MinY() + neg_margin, MaxY() - pos_margin);
274  }
Float_t y
Definition: compare.C:6
double MaxY() const
Returns the world y coordinate of the end of the box.
static bool CoordinateContained(double c, double min, double max, double wiggle=1.)
Returns whether the specified coordinate is in a range.
double MinY() const
Returns the world y coordinate of the start of the box.
bool geo::BoxBoundedGeo::InFiducialY ( double  y,
double  margin 
) const
inlineinherited

Returns whether TPC fiducial volume contains world y coordinate.

See also
InFiducialY(double, double, double) const

Margins are symmetric.

Definition at line 281 of file BoxBoundedGeo.h.

References geo::BoxBoundedGeo::InFiducialY().

Referenced by geo::BoxBoundedGeo::InFiducialY().

281 { return InFiducialY(y, margin, margin); }
Float_t y
Definition: compare.C:6
bool InFiducialY(double y, double neg_margin, double pos_margin) const
Returns whether TPC fiducial volume contains world y coordinate.
bool geo::BoxBoundedGeo::InFiducialZ ( double  z,
double  neg_margin,
double  pos_margin 
) const
inlineinherited

Returns whether TPC fiducial volume contains world z coordinate.

Parameters
zthe absolute ("world") coordinate y
neg_marginhow far within the TPC the fiducial region starts
pos_marginhow far before the TPC the fiducial region ends
Returns
whether the specified coordinate is in this TPC fiducial volume

The fiducial volume is defined by the specified margins, that denote how much of the coordinate is not fiducial. For example,

bool bWithin = tpc->InFiducialZ(z, 5., 8.);

on a TPC with z from 0 to 100 (cm, presumably) will return true for all z between 5 and 92. If positive margin is not specified, it's assumed to be the same as the negative one. Specifying a negative mergin effectively extends the TPC volume.

Definition at line 301 of file BoxBoundedGeo.h.

References geo::BoxBoundedGeo::CoordinateContained(), geo::BoxBoundedGeo::MaxZ(), and geo::BoxBoundedGeo::MinZ().

302  {
303  return CoordinateContained(z, MinZ() + neg_margin, MaxZ() - pos_margin);
304  }
Double_t z
Definition: plot.C:276
double MinZ() const
Returns the world z coordinate of the start of the box.
double MaxZ() const
Returns the world z coordinate of the end of the box.
static bool CoordinateContained(double c, double min, double max, double wiggle=1.)
Returns whether the specified coordinate is in a range.
bool geo::BoxBoundedGeo::InFiducialZ ( double  z,
double  margin 
) const
inlineinherited

Returns whether TPC fiducial volume contains world z coordinate.

See also
InFiducialZ(double, double, double) const

Margins are symmetric.

Definition at line 311 of file BoxBoundedGeo.h.

References geo::BoxBoundedGeo::InFiducialZ().

Referenced by geo::BoxBoundedGeo::InFiducialZ().

311 { return InFiducialZ(z, margin, margin); }
Double_t z
Definition: plot.C:276
bool InFiducialZ(double z, double neg_margin, double pos_margin) const
Returns whether TPC fiducial volume contains world z coordinate.
void geo::CryostatGeo::InitCryoBoundaries ( )
private

Fill the boundary information of the cryostat.

Definition at line 197 of file CryostatGeo.cxx.

References HalfHeight(), HalfLength(), HalfWidth(), geo::BoxBoundedGeo::SetBoundaries(), toWorldCoords(), and Volume().

Referenced by CryostatGeo(), and toLocalCoords().

198  {
199  // check that this is indeed a box
200  if (!dynamic_cast<TGeoBBox*>(Volume()->GetShape())) {
201  // at initialisation time we don't know yet our real ID
202  throw cet::exception("CryostatGeo")
203  << "Cryostat is not a box! (it is a " << Volume()->GetShape()->IsA()->GetName() << ")\n";
204  }
205 
206  // get the half width, height, etc of the cryostat
207  double const halflength = HalfLength();
208  double const halfwidth = HalfWidth();
209  double const halfheight = HalfHeight();
210 
211  SetBoundaries(toWorldCoords(LocalPoint_t{-halfwidth, -halfheight, -halflength}),
212  toWorldCoords(LocalPoint_t{+halfwidth, +halfheight, +halflength}));
213  }
double HalfLength() const
Half height of the cryostat [cm].
Point_t toWorldCoords(LocalPoint_t const &local) const
Transform point from local cryostat frame to world frame.
Definition: CryostatGeo.h:343
const TGeoVolume * Volume() const
Pointer to ROOT&#39;s volume descriptor.
Definition: CryostatGeo.h:109
double HalfWidth() const
Half width of the cryostat [cm].
double HalfHeight() const
Half height of the cryostat [cm].
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.
Point3DBase_t< CryostatGeoCoordinatesTag > LocalPoint_t
Type of points in the local GDML cryostat frame.
Definition: CryostatGeo.h:78
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
auto geo::CryostatGeo::IterateElements ( ) const

Returns an object suitable for iterating through all TPCs.

See also
IterateTPCs()

The returned value can be used in a range-for loop like:

for (geo::TPCGeo const& tpc: cryo.IterateElements()) { ... }

The resulting sequence exposes the TPCs within the cryostat in their ID order, from TPC 0 to NTPC() - 1.

This method is designed for templated code, where the object obj.IterateElements() may be a geo::CryostatGeo or some other one. For non-template code, prefer IterateTPCs() for clarity.

Definition at line 92 of file CryostatGeo.cxx.

References fTPCs.

Referenced by GetElement(), and IterateTPCs().

93  {
94  return fTPCs;
95  }
TPCList_t fTPCs
List of tpcs in this cryostat.
Definition: CryostatGeo.h:378
ElementIteratorBox geo::CryostatGeo::IterateTPCs ( ) const
inline

Returns an object suitable for iterating through all TPCs.

See also
IterateElements()

The returned value can be used in a range-for loop like:

for (geo::TPCGeo const& tpc: cryo.IterateTPCs()) { ... }

The resulting sequence exposes the TPCs within the cryostat in their ID order, from TPC 0 to NTPC() - 1.

A version of this functionality designed for template code is provided under the generic name IterateElements().

Definition at line 245 of file CryostatGeo.h.

References IterateElements().

Referenced by geo::WireReadoutDumper::dumpCryostat(), and PositionToTPCptr().

245 { return IterateElements(); }
ElementIteratorBox IterateElements() const
Returns an object suitable for iterating through all TPCs.
Definition: CryostatGeo.cxx:92
double geo::CryostatGeo::Length ( ) const
inline

Length of the cryostat [cm].

Definition at line 105 of file CryostatGeo.h.

References HalfLength().

Referenced by PrintCryostatInfo().

105 { return 2. * HalfLength(); }
double HalfLength() const
Half height of the cryostat [cm].
void geo::CryostatGeo::MakeOpDet ( std::vector< const TGeoNode * > &  path,
int  depth 
)
private

Referenced by toLocalCoords().

void geo::CryostatGeo::MakeTPC ( std::vector< const TGeoNode * > &  path,
int  depth 
)
private

Referenced by toLocalCoords().

double geo::CryostatGeo::Mass ( ) const
inline

Mass of the cryostat.

Definition at line 107 of file CryostatGeo.h.

References fVolume.

107 { return fVolume->Weight(); }
TGeoVolume * fVolume
Total volume of cryostat, called volCryostat in GDML file.
Definition: CryostatGeo.h:380
Point_t geo::BoxBoundedGeo::Max ( ) const
inlineinherited

Returns the corner point with the largest coordinates.

Definition at line 136 of file BoxBoundedGeo.h.

References geo::BoxBoundedGeo::c_max.

Referenced by geo::WireReadoutDumper::dumpDetectorInfo(), geo::BoxBoundedGeo::ExtendToInclude(), geo::BoxBoundedGeo::GetIntersections(), geo::GeometryCore::MaterialName(), PrintCryostatInfo(), and geo::TPCGeo::PrintTPCInfo().

136 { return c_max; }
Coords_t c_max
maximum coordinates (x, y, z)
unsigned int geo::CryostatGeo::MaxPlanes ( ) const

Returns the largest number of planes among the TPCs in this cryostat.

Referenced by PositionToTPC().

unsigned int geo::CryostatGeo::MaxWires ( ) const

Returns the largest number of wires among the TPCs in this cryostat.

Referenced by PositionToTPC().

Point_t geo::BoxBoundedGeo::Min ( ) const
inlineinherited

Returns the corner point with the smallest coordinates.

Definition at line 133 of file BoxBoundedGeo.h.

References geo::BoxBoundedGeo::c_min.

Referenced by geo::WireReadoutDumper::dumpDetectorInfo(), geo::BoxBoundedGeo::ExtendToInclude(), geo::BoxBoundedGeo::GetIntersections(), geo::GeometryCore::MaterialName(), PrintCryostatInfo(), and geo::TPCGeo::PrintTPCInfo().

133 { return c_min; }
Coords_t c_min
minimum coordinates (x, y, z)
unsigned int geo::CryostatGeo::NElements ( ) const
inline

Alias for NTPC().

Definition at line 173 of file CryostatGeo.h.

References fTPCs.

Referenced by geo::GeometryCore::NTPC().

173 { return fTPCs.size(); }
TPCList_t fTPCs
List of tpcs in this cryostat.
Definition: CryostatGeo.h:378
unsigned int geo::CryostatGeo::NOpDet ( ) const
inline
unsigned int geo::CryostatGeo::NTPC ( ) const
inline

Number of TPCs in this cryostat.

Definition at line 171 of file CryostatGeo.h.

References fTPCs.

Referenced by larg4::LArVoxelReadoutGeometry::Construct(), HasTPC(), trkf::SpacePointAlg::makeSpacePoints(), PrintCryostatInfo(), larg4::LArG4::produce(), and UpdateAfterSorting().

171 { return fTPCs.size(); }
TPCList_t fTPCs
List of tpcs in this cryostat.
Definition: CryostatGeo.h:378
OpDetGeo const & geo::CryostatGeo::OpDet ( unsigned int  iopdet) const

Return the iopdet'th optical detector in the cryostat.

Definition at line 83 of file CryostatGeo.cxx.

References fOpDets.

Referenced by geo::WireReadoutDumper::dumpCryostat(), cosmic::BeamFlashTrackMatchTaggerAlg::FillFlashProperties(), opdet::FlashHypothesisAnaAlg::FillOpDetPositions(), GetClosestOpDet(), GetClosestOpDetPtr(), NOpDet(), and geo::GeometryCore::OpDetGeoFromOpDet().

84  {
85  if (iopdet >= fOpDets.size()) {
86  throw cet::exception("OpDetOutOfRange") << "Request for non-existant OpDet " << iopdet;
87  }
88  return fOpDets[iopdet];
89  }
OpDetList_t fOpDets
List of opdets in this cryostat.
Definition: CryostatGeo.h:379
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
std::string geo::CryostatGeo::OpDetGeoName ( ) const
inline

Get name of opdet geometry element.

Definition at line 333 of file CryostatGeo.h.

References fOpDetGeoName.

Referenced by larg4::LArG4::beginJob().

333 { return fOpDetGeoName; }
std::string fOpDetGeoName
Name of opdet geometry elements in gdml.
Definition: CryostatGeo.h:381
bool geo::BoxBoundedGeo::Overlaps ( BoxBoundedGeo const &  other) const
inlineinherited

Returns if this and other box overlap.

Definition at line 338 of file BoxBoundedGeo.h.

References geo::BoxBoundedGeo::OverlapsX(), geo::BoxBoundedGeo::OverlapsY(), and geo::BoxBoundedGeo::OverlapsZ().

339  {
340  return OverlapsX(other) && OverlapsY(other) && OverlapsZ(other);
341  }
bool OverlapsZ(BoxBoundedGeo const &other) const
Returns if the z coordinates covered by this and other box overlap.
bool OverlapsY(BoxBoundedGeo const &other) const
Returns if the y coordinates covered by this and other box overlap.
bool OverlapsX(BoxBoundedGeo const &other) const
Returns if the x coordinates covered by this and other box overlap.
bool geo::BoxBoundedGeo::OverlapsX ( BoxBoundedGeo const &  other) const
inlineinherited

Returns if the x coordinates covered by this and other box overlap.

Definition at line 320 of file BoxBoundedGeo.h.

References geo::BoxBoundedGeo::MaxX(), and geo::BoxBoundedGeo::MinX().

Referenced by geo::BoxBoundedGeo::Overlaps().

321  {
322  return std::min(MaxX(), other.MaxX()) > std::max(MinX(), other.MinX());
323  }
double MinX() const
Returns the world x coordinate of the start of the box.
Definition: BoxBoundedGeo.h:88
double MaxX() const
Returns the world x coordinate of the end of the box.
Definition: BoxBoundedGeo.h:91
bool geo::BoxBoundedGeo::OverlapsY ( BoxBoundedGeo const &  other) const
inlineinherited

Returns if the y coordinates covered by this and other box overlap.

Definition at line 326 of file BoxBoundedGeo.h.

References geo::BoxBoundedGeo::MaxY(), and geo::BoxBoundedGeo::MinY().

Referenced by geo::BoxBoundedGeo::Overlaps().

327  {
328  return std::min(MaxY(), other.MaxY()) > std::max(MinY(), other.MinY());
329  }
double MaxY() const
Returns the world y coordinate of the end of the box.
double MinY() const
Returns the world y coordinate of the start of the box.
bool geo::BoxBoundedGeo::OverlapsZ ( BoxBoundedGeo const &  other) const
inlineinherited

Returns if the z coordinates covered by this and other box overlap.

Definition at line 332 of file BoxBoundedGeo.h.

References geo::BoxBoundedGeo::MaxZ(), and geo::BoxBoundedGeo::MinZ().

Referenced by geo::BoxBoundedGeo::Overlaps().

333  {
334  return std::min(MaxZ(), other.MaxZ()) > std::max(MinZ(), other.MinZ());
335  }
double MinZ() const
Returns the world z coordinate of the start of the box.
double MaxZ() const
Returns the world z coordinate of the end of the box.
TPCGeo const & geo::CryostatGeo::PositionToTPC ( Point_t const &  point,
double  wiggle 
) const

Returns the ID of the TPC at specified location.

Parameters
pointthe location (world reference frame)
wigglea small factor (like 1+epsilon) to avoid rounding errors
Returns
the ID of the TPC at the specified point (invalid ID if none)

Definition at line 109 of file CryostatGeo.cxx.

References ID(), and PositionToTPCptr().

Referenced by GetElementPtr(), and PositionToTPC().

110  {
111  TPCGeo const* tpc = PositionToTPCptr(point, wiggle);
112  if (!tpc) {
113  throw cet::exception("CryostatGeo")
114  << "Can't find any TPC for position " << point << " within " << ID() << "\n";
115  }
116  return *tpc;
117  }
CryostatID const & ID() const
Returns the identifier of this cryostat.
Definition: CryostatGeo.h:126
TPCGeo const * PositionToTPCptr(Point_t const &point, double wiggle) const
Returns a pointer to the TPC at specified location.
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
TPCGeo const& geo::CryostatGeo::PositionToTPC ( double const  worldLoc[3],
double  wiggle 
) const
inline

Returns the ID of the TPC at specified location.

Parameters
worldLoc3D coordinates of the point (world reference frame)
wigglea small factor (like 1+epsilon) to avoid rounding errors
Returns
the ID of the TPC at the specified point (invalid ID if none)

Definition at line 290 of file CryostatGeo.h.

References geo::vect::makePointFromCoords(), MaxPlanes(), MaxWires(), PositionToTPC(), and PositionToTPCptr().

291  {
292  return PositionToTPC(vect::makePointFromCoords(worldLoc), wiggle);
293  }
GENVECTOR_CONSTEXPR Point_t makePointFromCoords(Coords &&coords)
Creates a geo::Point_t from its coordinates (see makeFromCoords()).
TPCGeo const & PositionToTPC(Point_t const &point, double wiggle) const
Returns the ID of the TPC at specified location.
TPCID geo::CryostatGeo::PositionToTPCID ( Point_t const &  point,
double  wiggle 
) const

Returns the ID of the TPC at specified location.

Parameters
point3D coordinates of the point (world reference frame)
wigglea small factor (like 1+epsilon) to avoid rounding errors
Returns
the ID of the TPC at the specified point (invalid ID if none)

Definition at line 100 of file CryostatGeo.cxx.

References geo::TPCGeo::ID(), and PositionToTPCptr().

Referenced by geo::GeometryCore::FindTPCAtPosition(), and GetElementPtr().

101  {
102  TPCGeo const* tpc = PositionToTPCptr(point, wiggle);
103  return tpc ? tpc->ID() : TPCID{};
104  }
IDparameter< geo::TPCID > TPCID
Member type of validated geo::TPCID parameter.
TPCGeo const * PositionToTPCptr(Point_t const &point, double wiggle) const
Returns a pointer to the TPC at specified location.
TPCGeo const * geo::CryostatGeo::PositionToTPCptr ( Point_t const &  point,
double  wiggle 
) const

Returns a pointer to the TPC at specified location.

Parameters
pointposition in space [cm]
wigglea small factor (like 1+ε) to avoid rounding errors
Returns
a pointer to the geo::TPCGeo at point (nullptr if none)

Definition at line 120 of file CryostatGeo.cxx.

References IterateTPCs().

Referenced by PositionToTPC(), PositionToTPCID(), and geo::GeometryCore::PositionToTPCptr().

121  {
122  for (auto const& tpc : IterateTPCs())
123  if (tpc.ContainsPosition(point, wiggle)) return &tpc;
124  return nullptr;
125  }
ElementIteratorBox IterateTPCs() const
Returns an object suitable for iterating through all TPCs.
Definition: CryostatGeo.h:245
template<typename Stream >
void geo::CryostatGeo::PrintCryostatInfo ( Stream &&  out,
std::string  indent = "",
unsigned int  verbosity = 1 
) const

Prints information about this cryostat.

Template Parameters
Streamtype of output stream to use
Parameters
outstream to send the information to
indentprepend each line with this string
verbosityamount of information printed

Note that the first line out the output is not indented.

Verbosity levels

  • 0: only cryostat ID
  • 1 _(default)_: also center and size
  • 2: also number of TPCs, optical detectors, and maximum wires per plane
  • and of planes for TPC
  • 3: also information on bounding box

The constant MaxVerbosity is set to the highest supported verbosity level.

Definition at line 390 of file CryostatGeo.h.

References BoundingBox(), GetCenter(), Height(), ID(), Length(), geo::BoxBoundedGeo::Max(), geo::BoxBoundedGeo::Min(), NOpDet(), NTPC(), and Width().

Referenced by CryostatInfo(), geo::WireReadoutDumper::dumpCryostat(), and ID().

394 {
395  //----------------------------------------------------------------------------
396  out << "Cryostat " << std::string(ID());
397 
398  if (verbosity-- <= 0) return; // 0
399 
400  //----------------------------------------------------------------------------
401  out << " (" << Width() << " x " << Height() << " x " << Length() << ") cm^3 at " << GetCenter();
402 
403  if (verbosity-- <= 0) return; // 1
404 
405  //----------------------------------------------------------------------------
406 
407  out << "\n" << indent << "hosts " << NTPC() << " TPCs and " << NOpDet() << " optical detectors";
408 
409  if (verbosity-- <= 0) return; // 2
410 
411  //----------------------------------------------------------------------------
412  // print also the containing box
413  BoxBoundedGeo const& box = BoundingBox();
414  out << "\n" << indent << "bounding box: " << box.Min() << " -- " << box.Max();
415 }
BoxBoundedGeo()=default
Default constructor: sets an empty volume.
BoxBoundedGeo const & BoundingBox() const
Returns the bounding box of this cryostat.
Definition: CryostatGeo.h:123
double Height() const
Full height of the cryostat [cm].
Definition: CryostatGeo.h:103
std::string indent(std::size_t const i)
double Width() const
Full width of the cryostat [cm].
Definition: CryostatGeo.h:101
Point_t GetCenter() const
Returns the geometrical center of the cryostat.
Definition: CryostatGeo.h:120
unsigned int NTPC() const
Number of TPCs in this cryostat.
Definition: CryostatGeo.h:171
CryostatID const & ID() const
Returns the identifier of this cryostat.
Definition: CryostatGeo.h:126
unsigned int NOpDet() const
Number of optical detectors in this TPC.
Definition: CryostatGeo.h:317
double Length() const
Length of the cryostat [cm].
Definition: CryostatGeo.h:105
static void geo::BoxBoundedGeo::set_max ( Coord_t var,
Coord_t  value 
)
inlinestaticinherited

Sets var to value if value is larger than the current var value.

Definition at line 472 of file BoxBoundedGeo.h.

References value.

Referenced by geo::BoxBoundedGeo::ExtendToInclude().

473  {
474  if (value > var) var = value;
475  }
double value
Definition: spectrum.C:18
static void geo::BoxBoundedGeo::set_max ( Coords_t var,
Point_t const &  value 
)
inlinestaticinherited

Sets each coordinate of var to the one in value if the latter is larger.

Definition at line 486 of file BoxBoundedGeo.h.

487  {
488  if (value.X() > var.X()) var.SetX(value.X());
489  if (value.Y() > var.Y()) var.SetY(value.Y());
490  if (value.Z() > var.Z()) var.SetZ(value.Z());
491  }
double value
Definition: spectrum.C:18
static void geo::BoxBoundedGeo::set_min ( Coord_t var,
Coord_t  value 
)
inlinestaticinherited

Sets var to value if value is smaller than the current var value.

Definition at line 466 of file BoxBoundedGeo.h.

References value.

Referenced by geo::BoxBoundedGeo::ExtendToInclude().

467  {
468  if (value < var) var = value;
469  }
double value
Definition: spectrum.C:18
static void geo::BoxBoundedGeo::set_min ( Coords_t var,
Point_t const &  value 
)
inlinestaticinherited

Sets each coordinate of var to the one in value if the latter is smaller.

Definition at line 478 of file BoxBoundedGeo.h.

479  {
480  if (value.X() < var.X()) var.SetX(value.X());
481  if (value.Y() < var.Y()) var.SetY(value.Y());
482  if (value.Z() < var.Z()) var.SetZ(value.Z());
483  }
double value
Definition: spectrum.C:18
void geo::BoxBoundedGeo::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 
)
inlineinherited

Sets the boundaries in world coordinates as specified.

Parameters
x_minlower x coordinate
x_maxupper x coordinate
y_minlower y coordinate
y_maxupper y coordinate
z_minlower z coordinate
z_maxupper z coordinate

Definition at line 391 of file BoxBoundedGeo.h.

References geo::BoxBoundedGeo::c_max, geo::BoxBoundedGeo::c_min, and geo::BoxBoundedGeo::SortCoordinates().

Referenced by geo::PlaneGeo::BoundingBox(), InitCryoBoundaries(), and geo::TPCGeo::InitTPCBoundaries().

397  {
398  c_min.SetXYZ(x_min, y_min, z_min);
399  c_max.SetXYZ(x_max, y_max, z_max);
400  SortCoordinates();
401  }
double x_min
Definition: berger.C:15
Coords_t c_max
maximum coordinates (x, y, z)
double x_max
Definition: berger.C:16
Coords_t c_min
minimum coordinates (x, y, z)
void SortCoordinates()
Makes sure each coordinate of the minimum point is smaller than maximum.
void geo::BoxBoundedGeo::SetBoundaries ( Coords_t  lower,
Coords_t  upper 
)
inlineinherited

Sets the boundaries in world coordinates as specified.

Parameters
lowerlower coordinates (x, y, z)
upperupper coordinates (x, y, z)

Definition at line 408 of file BoxBoundedGeo.h.

References geo::BoxBoundedGeo::c_max, geo::BoxBoundedGeo::c_min, and geo::BoxBoundedGeo::SortCoordinates().

409  {
410  c_min = lower;
411  c_max = upper;
412  SortCoordinates();
413  }
Coords_t c_max
maximum coordinates (x, y, z)
Coords_t c_min
minimum coordinates (x, y, z)
void SortCoordinates()
Makes sure each coordinate of the minimum point is smaller than maximum.
double geo::BoxBoundedGeo::SizeX ( ) const
inlineinherited

Returns the full size in the X dimension.

Definition at line 97 of file BoxBoundedGeo.h.

References geo::BoxBoundedGeo::MaxX(), and geo::BoxBoundedGeo::MinX().

Referenced by geo::WireReadoutDumper::dumpDetectorInfo(), and geo::BoxBoundedGeo::HalfSizeX().

97 { return MaxX() - MinX(); }
double MinX() const
Returns the world x coordinate of the start of the box.
Definition: BoxBoundedGeo.h:88
double MaxX() const
Returns the world x coordinate of the end of the box.
Definition: BoxBoundedGeo.h:91
double geo::BoxBoundedGeo::SizeY ( ) const
inlineinherited

Returns the full size in the Y dimension.

Definition at line 112 of file BoxBoundedGeo.h.

References geo::BoxBoundedGeo::MaxY(), and geo::BoxBoundedGeo::MinY().

Referenced by geo::WireReadoutDumper::dumpDetectorInfo(), and geo::BoxBoundedGeo::HalfSizeY().

112 { return MaxY() - MinY(); }
double MaxY() const
Returns the world y coordinate of the end of the box.
double MinY() const
Returns the world y coordinate of the start of the box.
double geo::BoxBoundedGeo::SizeZ ( ) const
inlineinherited

Returns the full size in the Z dimension.

Definition at line 127 of file BoxBoundedGeo.h.

References geo::BoxBoundedGeo::MaxZ(), and geo::BoxBoundedGeo::MinZ().

Referenced by geo::WireReadoutDumper::dumpDetectorInfo(), and geo::BoxBoundedGeo::HalfSizeZ().

127 { return MaxZ() - MinZ(); }
double MinZ() const
Returns the world z coordinate of the start of the box.
double MaxZ() const
Returns the world z coordinate of the end of the box.
void geo::CryostatGeo::SortSubVolumes ( GeoObjectSorter const &  sorter)

Method to sort TPCGeo objects.

Definition at line 51 of file CryostatGeo.cxx.

References fOpDets, fTPCs, and geo::GeoObjectSorter::sort().

Referenced by toLocalCoords().

52  {
53  sorter.sort(fTPCs);
54  sorter.sort(fOpDets);
55  }
OpDetList_t fOpDets
List of opdets in this cryostat.
Definition: CryostatGeo.h:379
TPCList_t fTPCs
List of tpcs in this cryostat.
Definition: CryostatGeo.h:378
LocalPoint_t geo::CryostatGeo::toLocalCoords ( Point_t const &  world) const
inline

Transform point from world frame to local cryostat frame.

Definition at line 349 of file CryostatGeo.h.

References fTrans, and geo::LocalTransformationGeo< StoredMatrix, LocalPoint, LocalVector >::toLocalCoords().

349 { return fTrans.toLocalCoords(world); }
LocalPoint_t toLocalCoords(GlobalPoint_t const &world) const
Transforms a point from world frame to local frame.
LocalTransformation_t fTrans
Cryostat-to-world transformation.
Definition: CryostatGeo.h:377
LocalVector_t geo::CryostatGeo::toLocalCoords ( Vector_t const &  world) const
inline

Transform direction vector from world to local.

Definition at line 352 of file CryostatGeo.h.

References FindOpDet(), FindTPC(), fTrans, InitCryoBoundaries(), MakeOpDet(), MakeTPC(), SortSubVolumes(), geo::LocalTransformationGeo< StoredMatrix, LocalPoint, LocalVector >::toLocalCoords(), and UpdateAfterSorting().

352 { return fTrans.toLocalCoords(world); }
LocalPoint_t toLocalCoords(GlobalPoint_t const &world) const
Transforms a point from world frame to local frame.
LocalTransformation_t fTrans
Cryostat-to-world transformation.
Definition: CryostatGeo.h:377
Point_t geo::CryostatGeo::toWorldCoords ( LocalPoint_t const &  local) const
inline

Transform point from local cryostat frame to world frame.

Definition at line 343 of file CryostatGeo.h.

References fTrans, and geo::LocalTransformationGeo< StoredMatrix, LocalPoint, LocalVector >::toWorldCoords().

Referenced by geo::GeoObjectSorterStandard::compareCryostats(), and InitCryoBoundaries().

343 { return fTrans.toWorldCoords(local); }
LocalTransformation_t fTrans
Cryostat-to-world transformation.
Definition: CryostatGeo.h:377
GlobalPoint_t toWorldCoords(LocalPoint_t const &local) const
Transforms a point from local frame to world frame.
Vector_t geo::CryostatGeo::toWorldCoords ( LocalVector_t const &  local) const
inline

Transform direction vector from local to world.

Definition at line 346 of file CryostatGeo.h.

References fTrans, and geo::LocalTransformationGeo< StoredMatrix, LocalPoint, LocalVector >::toWorldCoords().

346 { return fTrans.toWorldCoords(local); }
LocalTransformation_t fTrans
Cryostat-to-world transformation.
Definition: CryostatGeo.h:377
GlobalPoint_t toWorldCoords(LocalPoint_t const &local) const
Transforms a point from local frame to world frame.
TPCGeo const & geo::CryostatGeo::TPC ( unsigned int  itpc) const

Return the itpc'th TPC in the cryostat.

Exceptions
cet::exception(category "TPCOutOfRange") if no such TPC

Definition at line 73 of file CryostatGeo.cxx.

References TPCPtr().

Referenced by GetElement(), HasElement(), phot::PhotonVisibilityService::reconfigure(), and geo::GeometryCore::TPC().

74  {
75  TPCGeo const* pTPC = TPCPtr(itpc);
76  if (!pTPC) {
77  throw cet::exception("TPCOutOfRange") << "Request for non-existant TPC " << itpc << "\n";
78  }
79  return *pTPC;
80  }
TPCGeo const * TPCPtr(unsigned int itpc) const
Returns the TPC number itpc from this cryostat.
Definition: CryostatGeo.h:252
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
TPCGeo const& geo::CryostatGeo::TPC ( TPCID const &  tpcid) const
inline

Returns the TPC in tpcid from this cryostat.

Parameters
tpcidfull TPC ID
Returns
a constant reference to the TPC in tpcid
Exceptions
cet::exception(category "TPCOutOfRange") if no such TPC

The cryostat number in tpcid is ignored, as it is ignored whether tpcid is invalid.

Definition at line 210 of file CryostatGeo.h.

References TPC(), and geo::TPCID::TPC.

Referenced by TPC().

210 { return TPC(tpcid.TPC); }
TPCGeo const & TPC(unsigned int itpc) const
Return the itpc&#39;th TPC in the cryostat.
Definition: CryostatGeo.cxx:73
TPCGeo const* geo::CryostatGeo::TPCPtr ( unsigned int  itpc) const
inline

Returns the TPC number itpc from this cryostat.

Parameters
itpcthe number of local TPC
Returns
a constant pointer to the TPC, or nullptr if it does not exist

Definition at line 252 of file CryostatGeo.h.

References fTPCs, and HasTPC().

Referenced by GetElementPtr(), TPC(), and geo::GeometryCore::TPCPtr().

253  {
254  return HasTPC(itpc) ? &(fTPCs[itpc]) : nullptr;
255  }
TPCList_t fTPCs
List of tpcs in this cryostat.
Definition: CryostatGeo.h:378
bool HasTPC(unsigned int itpc) const
Returns whether a TPC with index itpc is present in this cryostat.
Definition: CryostatGeo.h:180
TPCGeo const* geo::CryostatGeo::TPCPtr ( TPCID const &  tpcid) const
inline

Returns the TPC in tpcid from this cryostat.

Parameters
tpcidfull TPC ID
Returns
a constant pointer to the TPC, or nullptr if it does not exist

The cryostat number in tpcid is ignored, as it is ignored whether tpcid is invalid.

Definition at line 265 of file CryostatGeo.h.

References geo::TPCID::TPC, and TPCPtr().

Referenced by TPCPtr().

265 { return TPCPtr(tpcid.TPC); }
TPCGeo const * TPCPtr(unsigned int itpc) const
Returns the TPC number itpc from this cryostat.
Definition: CryostatGeo.h:252
void geo::CryostatGeo::UpdateAfterSorting ( CryostatID  cryoid)

Performs all needed updates after geometry has sorted the cryostats.

Definition at line 58 of file CryostatGeo.cxx.

References fID, fOpDets, fTPCs, NOpDet(), and NTPC().

Referenced by toLocalCoords().

59  {
60  // update the cryostat ID
61  fID = cryoid;
62 
63  // trigger all the optical detectors to update
64  for (unsigned int opdet = 0; opdet < NOpDet(); ++opdet)
66 
67  // trigger all the TPCs to update as well
68  for (unsigned int tpc = 0; tpc < NTPC(); ++tpc)
69  fTPCs[tpc].UpdateAfterSorting(TPCID(fID, tpc));
70  }
IDparameter< geo::OpDetID > OpDetID
Member type of validated geo::OpDetID parameter.
OpDetList_t fOpDets
List of opdets in this cryostat.
Definition: CryostatGeo.h:379
void UpdateAfterSorting(CryostatID cryoid)
Performs all needed updates after geometry has sorted the cryostats.
Definition: CryostatGeo.cxx:58
unsigned int NTPC() const
Number of TPCs in this cryostat.
Definition: CryostatGeo.h:171
TPCList_t fTPCs
List of tpcs in this cryostat.
Definition: CryostatGeo.h:378
unsigned int NOpDet() const
Number of optical detectors in this TPC.
Definition: CryostatGeo.h:317
IDparameter< geo::TPCID > TPCID
Member type of validated geo::TPCID parameter.
CryostatID fID
ID of this cryostat.
Definition: CryostatGeo.h:382
const TGeoVolume* geo::CryostatGeo::Volume ( ) const
inline

Pointer to ROOT's volume descriptor.

Definition at line 109 of file CryostatGeo.h.

References fVolume.

Referenced by InitCryoBoundaries().

109 { return fVolume; }
TGeoVolume * fVolume
Total volume of cryostat, called volCryostat in GDML file.
Definition: CryostatGeo.h:380
double geo::CryostatGeo::Width ( ) const
inline

Full width of the cryostat [cm].

Definition at line 101 of file CryostatGeo.h.

References HalfWidth().

Referenced by PrintCryostatInfo().

101 { return 2. * HalfWidth(); }
double HalfWidth() const
Half width of the cryostat [cm].

Member Data Documentation

CryostatID geo::CryostatGeo::fID {}
private

ID of this cryostat.

Definition at line 382 of file CryostatGeo.h.

Referenced by ID(), and UpdateAfterSorting().

std::string geo::CryostatGeo::fOpDetGeoName {"volOpDetSensitive"}
private

Name of opdet geometry elements in gdml.

Definition at line 381 of file CryostatGeo.h.

Referenced by OpDetGeoName().

OpDetList_t geo::CryostatGeo::fOpDets
private

List of opdets in this cryostat.

Definition at line 379 of file CryostatGeo.h.

Referenced by NOpDet(), OpDet(), SortSubVolumes(), and UpdateAfterSorting().

TPCList_t geo::CryostatGeo::fTPCs
private

List of tpcs in this cryostat.

Definition at line 378 of file CryostatGeo.h.

Referenced by IterateElements(), NElements(), NTPC(), SortSubVolumes(), TPCPtr(), and UpdateAfterSorting().

LocalTransformation_t geo::CryostatGeo::fTrans
private

Cryostat-to-world transformation.

Definition at line 377 of file CryostatGeo.h.

Referenced by toLocalCoords(), and toWorldCoords().

TGeoVolume* geo::CryostatGeo::fVolume
private

Total volume of cryostat, called volCryostat in GDML file.

Definition at line 380 of file CryostatGeo.h.

Referenced by CryostatGeo(), HalfHeight(), HalfLength(), HalfWidth(), Mass(), and Volume().

constexpr unsigned int geo::CryostatGeo::MaxVerbosity = 3
static

Maximum verbosity supported by PrintCryostatInfo().

Definition at line 162 of file CryostatGeo.h.

Referenced by geo::WireReadoutDumper::dumpCryostat().


The documentation for this class was generated from the following files: