Classes | Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
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 TPCList_t = std::vector< geo::TPCGeo >
 Type used internally to store the TPCs. More...
 
using OpDetList_t = std::vector< geo::OpDetGeo >
 Type used internally to store the optical detectors. More...
 
using GeoNodePath_t = geo::WireGeo::GeoNodePath_t
 
using ElementIteratorBox = TPCList_t const &
 Type returned by IterateElements(). 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 = geo::Point3DBase_t< CryostatGeoCoordinatesTag >
 Type of points in the local GDML cryostat frame. More...
 
using LocalVector_t = geo::Vector3DBase_t< CryostatGeoCoordinatesTag >
 Type of displacement vectors in the local GDML cryostat frame. More...
 
- Public Types inherited from geo::BoxBoundedGeo
using Coords_t = geo::Point_t
 Type of the coordinate triplet. More...
 
using Coord_t = Coords_t::Scalar
 Type of the coordinate. More...
 

Public Member Functions

 CryostatGeo (TGeoNode const &node, geo::TransformationMatrix &&trans, TPCList_t &&TPCs, OpDetList_t &&OpDets)
 Construct a representation of a single cryostat of the detector. More...
 
void SortSubVolumes (geo::GeoObjectSorter const &sorter)
 Method to sort TPCGeo objects. More...
 
void UpdateAfterSorting (geo::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 (geo::TPCID const &tpcid) const
 Returns whether the TPC in tpcid is present in this cryostat. More...
 
bool HasElement (geo::TPCID const &tpcid) const
 Alias for HasTPC(geo::TPCID const&) More...
 
const TPCGeoTPC (unsigned int itpc) const
 Return the itpc'th TPC in the cryostat. More...
 
const TPCGeoTPC (TPCID const &tpcid) const
 Returns the TPC in tpcid from this cryostat. More...
 
const TPCGeoGetElement (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...
 
auto const & TPCs () 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...
 
geo::TPCID::TPCID_t FindTPCAtPosition (double const worldLoc[3], double const wiggle) const
 Returns the index of the TPC at specified location. More...
 
geo::TPCID PositionToTPCID (geo::Point_t const &point, double wiggle) const
 Returns the ID of the TPC at specified location. More...
 
TPCGeo const & PositionToTPC (geo::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...
 
geo::TPCGeo const * PositionToTPCptr (geo::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...
 
const OpDetGeoOpDet (unsigned int iopdet) const
 Return the iopdet'th optical detector in the cryostat. More...
 
unsigned int GetClosestOpDet (geo::Point_t const &point) const
 
unsigned int GetClosestOpDet (double const *point) const
 
geo::OpDetGeo const * GetClosestOpDetPtr (geo::Point_t const &point) const
 
std::string OpDetGeoName () const
 Get name of opdet geometry element. More...
 
Coordinate transformation
void LocalToWorld (const double *cryo, double *world) const
 Transform point from local cryostat frame to world frame. More...
 
template<typename Point >
Point LocalToWorld (Point const &local) const
 
geo::Point_t toWorldCoords (LocalPoint_t const &local) const
 Transform point from local cryostat frame to world frame. More...
 
void LocalToWorldVect (const double *cryo, double *world) const
 Transform direction vector from local to world. More...
 
geo::Vector_t toWorldCoords (LocalVector_t const &local) const
 Transform direction vector from local to world. More...
 
void WorldToLocal (const double *world, double *cryo) const
 Transform point from world frame to local cryostat frame. More...
 
template<typename Point >
Point WorldToLocal (Point const &world) const
 
LocalPoint_t toLocalCoords (geo::Point_t const &world) const
 Transform point from world frame to local cryostat frame. More...
 
void WorldToLocalVect (const double *world, double *cryo) const
 Transform direction vector from world to local. More...
 
LocalVector_t toLocalCoords (geo::Vector_t const &world) const
 Transform direction vector from world to local. More...
 
- Public Member Functions inherited from geo::BoxBoundedGeo
 BoxBoundedGeo ()=default
 Default constructor: sets an empty volume. More...
 
 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. More...
 
 BoxBoundedGeo (Coords_t lower, Coords_t upper)
 Constructor: sets the boundaries in world coordinates as specified. More...
 
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...
 
geo::Point_t Min () const
 Returns the corner point with the smallest coordinates. More...
 
geo::Point_t Max () const
 Returns the corner point with the largest coordinates. More...
 
geo::Point_t Center () const
 Returns the center point of the box. More...
 
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 (geo::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
 
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...
 
bool OverlapsX (geo::BoxBoundedGeo const &other) const
 Returns if the x coordinates covered by this and other box overlap. More...
 
bool OverlapsY (geo::BoxBoundedGeo const &other) const
 Returns if the y coordinates covered by this and other box overlap. More...
 
bool OverlapsZ (geo::BoxBoundedGeo const &other) const
 Returns if the z coordinates covered by this and other box overlap. More...
 
bool Overlaps (geo::BoxBoundedGeo const &other) const
 Returns if this and other box overlap. More...
 
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 (geo::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< geo::Point_tGetIntersections (geo::Point_t const &TrajectoryStart, geo::Vector_t const &TrajectoryDirect) const
 

Private Types

using LocalTransformation_t = geo::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
 Name of opdet geometry elements in gdml. More...
 
geo::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...
 
geo::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...
 
geo::Point_t GetCenter () const
 Returns the geometrical center of the cryostat. More...
 
geo::BoxBoundedGeo const & BoundingBox () const
 Returns the bounding box of this cryostat. More...
 
geo::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...
 

Additional Inherited Members

- Static Public Member Functions inherited from geo::BoxBoundedGeo
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_max (Coord_t &var, Coord_t value)
 Sets var to value if value is larger than the current var value. More...
 
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. More...
 
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. More...
 

Detailed Description

Geometry information for a single cryostat.

Definition at line 43 of file CryostatGeo.h.

Member Typedef Documentation

Type returned by IterateElements().

Definition at line 56 of file CryostatGeo.h.

Definition at line 53 of file CryostatGeo.h.

Type of points in the local GDML cryostat frame.

Definition at line 78 of file CryostatGeo.h.

Definition at line 472 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.

Type used internally to store the TPCs.

Definition at line 48 of file CryostatGeo.h.

Constructor & Destructor Documentation

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

Construct a representation of a single cryostat of the detector.

Definition at line 33 of file CryostatGeo.cxx.

38  : fTrans(std::move(trans))
39  , fTPCs(std::move(TPCs))
40  , fOpDets(std::move(OpDets))
41  , fVolume(nullptr)
42  {
43 
44  // all planes are going to be contained in the volume named volCryostat
45  // now get the total volume of the Cryostat
46  fVolume = node.GetVolume();
47  if(!fVolume)
48  throw cet::exception("CryostatGeo") << "cannot find cryostat outline volume\n";
49 
50  MF_LOG_DEBUG("Geometry") << "cryostat volume is " << fVolume->GetName();
51 
52  // set the bounding box
54 
55  // Set OpDetName;
56  fOpDetGeoName = "volOpDetSensitive";
57 
58  }
void InitCryoBoundaries()
Fill the boundary information of the cryostat.
TGeoVolume * fVolume
Total volume of cryostat, called volCryostat in GDML file.
Definition: CryostatGeo.h:477
OpDetList_t fOpDets
List of opdets in this cryostat.
Definition: CryostatGeo.h:476
std::string fOpDetGeoName
Name of opdet geometry elements in gdml.
Definition: CryostatGeo.h:478
def move(depos, offset)
Definition: depos.py:107
auto const & TPCs() const
Returns an object suitable for iterating through all TPCs.
Definition: CryostatGeo.h:275
TPCList_t fTPCs
List of tpcs in this cryostat.
Definition: CryostatGeo.h:475
#define MF_LOG_DEBUG(id)
LocalTransformation_t fTrans
Cryostat-to-world transformation.
Definition: CryostatGeo.h:474
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33

Member Function Documentation

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

Returns boundaries of the cryostat (in centimetres).

Returns
boundaries in a geo::BoxBoundedGeo

Definition at line 115 of file CryostatGeo.h.

116  { return BoundingBox(); }
geo::BoxBoundedGeo const & BoundingBox() const
Returns the bounding box of this cryostat.
Definition: CryostatGeo.h:128
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 208 of file CryostatGeo.cxx.

208  {
209  boundaries[0] = MinX();
210  boundaries[1] = MaxX();
211  boundaries[2] = MinY();
212  boundaries[3] = MaxY();
213  boundaries[4] = MinZ();
214  boundaries[5] = MaxZ();
215  } // CryostatGeo::CryostatBoundaries(double*)
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.
geo::BoxBoundedGeo const& geo::CryostatGeo::BoundingBox ( ) const
inline

Returns the bounding box of this cryostat.

Definition at line 128 of file CryostatGeo.h.

129  { return static_cast<geo::BoxBoundedGeo const&>(*this); }
A base class aware of world box coordinatesAn object describing a simple shape can inherit from this ...
Definition: BoxBoundedGeo.h:33
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 220 of file CryostatGeo.cxx.

221  {
222  std::ostringstream sstr;
223  PrintCryostatInfo(sstr, indent, verbosity);
224  return sstr.str();
225  } // CryostatGeo::CryostatInfo()
void PrintCryostatInfo(Stream &&out, std::string indent="", unsigned int verbosity=1) const
Prints information about this cryostat.
Definition: CryostatGeo.h:489
void geo::CryostatGeo::FindOpDet ( std::vector< const TGeoNode * > &  path,
unsigned int  depth 
)
private
void geo::CryostatGeo::FindTPC ( std::vector< const TGeoNode * > &  path,
unsigned int  depth 
)
private
geo::TPCID::TPCID_t geo::CryostatGeo::FindTPCAtPosition ( double const  worldLoc[3],
double const  wiggle 
) const

Returns the index 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 TPC index, or geo::TPCID::InvalidID if no TPC is there
Deprecated:
Use PositionToTPCID() instead

Definition at line 127 of file CryostatGeo.cxx.

128  {
129  geo::TPCID tpcid
130  = PositionToTPCID(geo::vect::makePointFromCoords(worldLoc), wiggle);
131  return tpcid? tpcid.TPC: geo::TPCID::InvalidID;
132  } // CryostatGeo::FindTPCAtPosition()
static constexpr TPCID_t InvalidID
Special code for an invalid ID.
Definition: geo_types.h:403
GENVECTOR_CONSTEXPR::geo::Point_t makePointFromCoords(Coords &&coords)
Creates a geo::Point_t from its coordinates (see makeFromCoords()).
The data type to uniquely identify a TPC.
Definition: geo_types.h:386
TPCID_t TPC
Index of the TPC within its cryostat.
Definition: geo_types.h:406
geo::TPCID PositionToTPCID(geo::Point_t const &point, double wiggle) const
Returns the ID of the TPC at specified location.
geo::Point_t geo::CryostatGeo::GetCenter ( ) const
inline

Returns the geometrical center of the cryostat.

Definition at line 124 of file CryostatGeo.h.

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

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

Definition at line 239 of file CryostatGeo.cxx.

239  {
240  unsigned int ClosestDet = std::numeric_limits<unsigned int>::max();
241  double ClosestDist = std::numeric_limits<double>::max();
242 
243  for(unsigned int o = 0U; o < NOpDet(); ++o) {
244  double const ThisDist = OpDet(o).DistanceToPoint(point);
245  if(ThisDist < ClosestDist) {
246  ClosestDist = ThisDist;
247  ClosestDet = o;
248  }
249  } // for
250  return ClosestDet;
251  } // CryostatGeo::GetClosestOpDet(geo::Point_t)
const OpDetGeo & OpDet(unsigned int iopdet) const
Return the iopdet&#39;th optical detector in the cryostat.
static int max(int a, int b)
double DistanceToPoint(geo::Point_t const &point) const
Returns the distance of the specified point from detector center [cm].
Definition: OpDetGeo.cxx:123
unsigned int NOpDet() const
Number of optical detectors in this TPC.
Definition: CryostatGeo.h:361
unsigned int geo::CryostatGeo::GetClosestOpDet ( double const *  point) const
See also
GetClosestOpDet(geo::Point_t const&) const

Definition at line 254 of file CryostatGeo.cxx.

unsigned int GetClosestOpDet(geo::Point_t const &point) const
GENVECTOR_CONSTEXPR::geo::Point_t makePointFromCoords(Coords &&coords)
Creates a geo::Point_t from its coordinates (see makeFromCoords()).
geo::OpDetGeo const * geo::CryostatGeo::GetClosestOpDetPtr ( geo::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 231 of file CryostatGeo.cxx.

232  {
233  unsigned int iOpDet = GetClosestOpDet(point);
234  return
235  (iOpDet == std::numeric_limits<double>::max())? nullptr: &OpDet(iOpDet);
236  }
unsigned int GetClosestOpDet(geo::Point_t const &point) const
const OpDetGeo & OpDet(unsigned int iopdet) const
Return the iopdet&#39;th optical detector in the cryostat.
static int max(int a, int b)
const TPCGeo& geo::CryostatGeo::GetElement ( TPCID const &  tpcid) const
inline

Alias for TPC().

Definition at line 223 of file CryostatGeo.h.

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

Alias for TPCPtr().

Definition at line 297 of file CryostatGeo.h.

298  { return TPCPtr(tpcid); }
TPCGeo const * TPCPtr(unsigned int itpc) const
Returns the TPC number itpc from this cryostat.
Definition: CryostatGeo.h:283
double geo::CryostatGeo::HalfHeight ( ) const

Half height of the cryostat [cm].

Definition at line 196 of file CryostatGeo.cxx.

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

Half height of the cryostat [cm].

Definition at line 202 of file CryostatGeo.cxx.

203  {
204  return static_cast<TGeoBBox const*>(fVolume->GetShape())->GetDZ();
205  }
TGeoVolume * fVolume
Total volume of cryostat, called volCryostat in GDML file.
Definition: CryostatGeo.h:477
double geo::CryostatGeo::HalfWidth ( ) const

Half width of the cryostat [cm].

Definition at line 190 of file CryostatGeo.cxx.

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

Alias for HasTPC().

Definition at line 193 of file CryostatGeo.h.

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

Alias for HasTPC(geo::TPCID const&)

Definition at line 205 of file CryostatGeo.h.

205 { return HasTPC(tpcid); }
bool HasTPC(unsigned int itpc) const
Returns whether a TPC with index itpc is present in this cryostat.
Definition: CryostatGeo.h:190
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 190 of file CryostatGeo.h.

190 { return itpc < NTPC(); }
unsigned int NTPC() const
Number of TPCs in this cryostat.
Definition: CryostatGeo.h:181
bool geo::CryostatGeo::HasTPC ( geo::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 203 of file CryostatGeo.h.

203 { 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:190
double geo::CryostatGeo::Height ( ) const
inline

Full height of the cryostat [cm].

Definition at line 105 of file CryostatGeo.h.

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

Returns the identifier of this cryostat.

Definition at line 132 of file CryostatGeo.h.

132 { return fID; }
geo::CryostatID fID
ID of this cryostat.
Definition: CryostatGeo.h:479
void geo::CryostatGeo::InitCryoBoundaries ( )
private

Fill the boundary information of the cryostat.

Definition at line 258 of file CryostatGeo.cxx.

258  {
259 
260  // check that this is indeed a box
261  if (!dynamic_cast<TGeoBBox*>(Volume()->GetShape())) {
262  // at initialisation time we don't know yet our real ID
263  throw cet::exception("CryostatGeo") << "Cryostat is not a box! (it is a "
264  << Volume()->GetShape()->IsA()->GetName() << ")\n";
265  }
266 
267  // get the half width, height, etc of the cryostat
268  const double halflength = HalfLength();
269  const double halfwidth = HalfWidth();
270  const double halfheight = HalfHeight();
271 
273  toWorldCoords(LocalPoint_t{ -halfwidth, -halfheight, -halflength }),
274  toWorldCoords(LocalPoint_t{ +halfwidth, +halfheight, +halflength })
275  );
276 
277  } // CryostatGeo::InitCryoBoundaries()
double HalfLength() const
Half height of the cryostat [cm].
const TGeoVolume * Volume() const
Pointer to ROOT&#39;s volume descriptor.
Definition: CryostatGeo.h:111
geo::Point3DBase_t< CryostatGeoCoordinatesTag > LocalPoint_t
Type of points in the local GDML cryostat frame.
Definition: CryostatGeo.h:78
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.
geo::Point_t toWorldCoords(LocalPoint_t const &local) const
Transform point from local cryostat frame to world frame.
Definition: CryostatGeo.h:403
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 119 of file CryostatGeo.cxx.

120  { return fTPCs; }
TPCList_t fTPCs
List of tpcs in this cryostat.
Definition: CryostatGeo.h:475
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 258 of file CryostatGeo.h.

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

Length of the cryostat [cm].

Definition at line 107 of file CryostatGeo.h.

107 { return 2. * HalfLength(); }
double HalfLength() const
Half height of the cryostat [cm].
void geo::CryostatGeo::LocalToWorld ( const double *  cryo,
double *  world 
) const
inline

Transform point from local cryostat frame to world frame.

Definition at line 387 of file CryostatGeo.h.

388  { fTrans.LocalToWorld(cryo, world); }
void LocalToWorld(double const *local, double *world) const
Transforms a point from local frame to world frame.
LocalTransformation_t fTrans
Cryostat-to-world transformation.
Definition: CryostatGeo.h:474
template<typename Point >
Point geo::CryostatGeo::LocalToWorld ( Point const &  local) const
inline

Transform point from local cryostat frame to world frame.

Deprecated:
This method breaks the distinction between local and global vectors, since input and output vectors share the same type; use the "official" vector types geo::Point_t, geo::CryostatGeo::LocalPoint_t, geo::Vector_t and geo::CryostatGeo::LocalVector_t, and then use the method geo::CryostatGeo::toWorldCoords() instead.

Definition at line 399 of file CryostatGeo.h.

400  { return fTrans.LocalToWorld(local); }
void LocalToWorld(double const *local, double *world) const
Transforms a point from local frame to world frame.
LocalTransformation_t fTrans
Cryostat-to-world transformation.
Definition: CryostatGeo.h:474
void geo::CryostatGeo::LocalToWorldVect ( const double *  cryo,
double *  world 
) const
inline

Transform direction vector from local to world.

Definition at line 407 of file CryostatGeo.h.

408  { fTrans.LocalToWorldVect(cryo, world); }
void LocalToWorldVect(double const *local, double *world) const
Transforms a vector from local frame to world frame.
LocalTransformation_t fTrans
Cryostat-to-world transformation.
Definition: CryostatGeo.h:474
void geo::CryostatGeo::MakeOpDet ( std::vector< const TGeoNode * > &  path,
int  depth 
)
private
void geo::CryostatGeo::MakeTPC ( std::vector< const TGeoNode * > &  path,
int  depth 
)
private
double geo::CryostatGeo::Mass ( void  ) const
inline

Mass of the cryostat.

Definition at line 109 of file CryostatGeo.h.

109 { return fVolume->Weight(); }
TGeoVolume * fVolume
Total volume of cryostat, called volCryostat in GDML file.
Definition: CryostatGeo.h:477
unsigned int geo::CryostatGeo::MaxPlanes ( ) const

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

Definition at line 170 of file CryostatGeo.cxx.

170  {
171  unsigned int maxPlanes = 0;
172  for (geo::TPCGeo const& TPC: fTPCs) {
173  unsigned int maxPlanesInTPC = TPC.Nplanes();
174  if (maxPlanesInTPC > maxPlanes) maxPlanes = maxPlanesInTPC;
175  } // for
176  return maxPlanes;
177  } // CryostatGeo::MaxPlanes()
unsigned int Nplanes() const
Number of planes in this tpc.
Definition: TPCGeo.h:165
Geometry information for a single TPC.
Definition: TPCGeo.h:38
TPCList_t fTPCs
List of tpcs in this cryostat.
Definition: CryostatGeo.h:475
const TPCGeo & TPC(unsigned int itpc) const
Return the itpc&#39;th TPC in the cryostat.
Definition: CryostatGeo.cxx:93
unsigned int geo::CryostatGeo::MaxWires ( ) const

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

Definition at line 180 of file CryostatGeo.cxx.

180  {
181  unsigned int maxWires = 0;
182  for (geo::TPCGeo const& TPC: fTPCs) {
183  unsigned int maxWiresInTPC = TPC.MaxWires();
184  if (maxWiresInTPC > maxWires) maxWires = maxWiresInTPC;
185  } // for
186  return maxWires;
187  } // CryostatGeo::MaxWires()
Geometry information for a single TPC.
Definition: TPCGeo.h:38
unsigned int MaxWires() const
Returns the largest number of wires among the planes in this TPC.
Definition: TPCGeo.cxx:297
TPCList_t fTPCs
List of tpcs in this cryostat.
Definition: CryostatGeo.h:475
const TPCGeo & TPC(unsigned int itpc) const
Return the itpc&#39;th TPC in the cryostat.
Definition: CryostatGeo.cxx:93
unsigned int geo::CryostatGeo::NElements ( ) const
inline

Alias for NTPC().

Definition at line 183 of file CryostatGeo.h.

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

Number of optical detectors in this TPC.

Definition at line 361 of file CryostatGeo.h.

361 { return fOpDets.size(); }
OpDetList_t fOpDets
List of opdets in this cryostat.
Definition: CryostatGeo.h:476
unsigned int geo::CryostatGeo::NTPC ( ) const
inline

Number of TPCs in this cryostat.

Definition at line 181 of file CryostatGeo.h.

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

Return the iopdet'th optical detector in the cryostat.

Definition at line 107 of file CryostatGeo.cxx.

108  {
109  if(iopdet >= fOpDets.size()){
110  throw cet::exception("OpDetOutOfRange") << "Request for non-existant OpDet "
111  << iopdet;
112  }
113 
114  return fOpDets[iopdet];
115  }
OpDetList_t fOpDets
List of opdets in this cryostat.
Definition: CryostatGeo.h:476
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 377 of file CryostatGeo.h.

377 { return fOpDetGeoName; }
std::string fOpDetGeoName
Name of opdet geometry elements in gdml.
Definition: CryostatGeo.h:478
TPCGeo const & geo::CryostatGeo::PositionToTPC ( geo::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 148 of file CryostatGeo.cxx.

149  {
150  geo::TPCGeo const* tpc = PositionToTPCptr(point, wiggle);
151  if (!tpc) {
152  throw cet::exception("CryostatGeo")
153  << "Can't find any TPC for position " << point << " within " << ID()
154  << "\n";
155  }
156  return *tpc;
157  }
Geometry information for a single TPC.
Definition: TPCGeo.h:38
geo::TPCGeo const * PositionToTPCptr(geo::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
geo::CryostatID const & ID() const
Returns the identifier of this cryostat.
Definition: CryostatGeo.h:132
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 334 of file CryostatGeo.h.

335  { return PositionToTPC(geo::vect::makePointFromCoords(worldLoc), wiggle); }
GENVECTOR_CONSTEXPR::geo::Point_t makePointFromCoords(Coords &&coords)
Creates a geo::Point_t from its coordinates (see makeFromCoords()).
TPCGeo const & PositionToTPC(geo::Point_t const &point, double wiggle) const
Returns the ID of the TPC at specified location.
geo::TPCID geo::CryostatGeo::PositionToTPCID ( geo::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 138 of file CryostatGeo.cxx.

139  {
140  geo::TPCGeo const* tpc = PositionToTPCptr(point, wiggle);
141  return tpc? tpc->ID(): geo::TPCID{};
142  }
geo::TPCID const & ID() const
Returns the identifier of this TPC.
Definition: TPCGeo.h:333
Geometry information for a single TPC.
Definition: TPCGeo.h:38
geo::TPCGeo const * PositionToTPCptr(geo::Point_t const &point, double wiggle) const
Returns a pointer to the TPC at specified location.
The data type to uniquely identify a TPC.
Definition: geo_types.h:386
geo::TPCGeo const * geo::CryostatGeo::PositionToTPCptr ( geo::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 161 of file CryostatGeo.cxx.

162  {
163  for (auto const& tpc: IterateTPCs())
164  if (tpc.ContainsPosition(point, wiggle)) return &tpc;
165  return nullptr;
166  } // CryostatGeo::PositionToTPCptr()
ElementIteratorBox IterateTPCs() const
Returns an object suitable for iterating through all TPCs.
Definition: CryostatGeo.h:258
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 489 of file CryostatGeo.h.

493  {
494 
495  //----------------------------------------------------------------------------
496  out << "Cryostat " << std::string(ID());
497 
498  if (verbosity-- <= 0) return; // 0
499 
500  //----------------------------------------------------------------------------
501  out
502  << " (" << Width() << " x " << Height() << " x " << Length() << ") cm^3 at "
503  << GetCenter();
504 
505  if (verbosity-- <= 0) return; // 1
506 
507  //----------------------------------------------------------------------------
508 
509  out << "\n" << indent
510  << "hosts " << NTPC() << " TPCs (largest number of planes: " << MaxPlanes()
511  << ", of wires: " << MaxWires() << ") and "
512  << NOpDet() << " optical detectors"
513  ;
514 
515  if (verbosity-- <= 0) return; // 2
516 
517  //----------------------------------------------------------------------------
518  // print also the containing box
519  geo::BoxBoundedGeo const& box = BoundingBox();
520  out << "\n" << indent
521  << "bounding box: " << box.Min() << " -- " << box.Max();
522 
523 // if (verbosity-- <= 0) return; // 3
524 
525  //----------------------------------------------------------------------------
526 } // geo::CryostatGeo::PrintCryostatInfo()
geo::Point_t GetCenter() const
Returns the geometrical center of the cryostat.
Definition: CryostatGeo.h:124
unsigned int MaxPlanes() const
Returns the largest number of planes among the TPCs in this cryostat.
std::string string
Definition: nybbler.cc:12
geo::BoxBoundedGeo const & BoundingBox() const
Returns the bounding box of this cryostat.
Definition: CryostatGeo.h:128
double Height() const
Full height of the cryostat [cm].
Definition: CryostatGeo.h:105
double Width() const
Full width of the cryostat [cm].
Definition: CryostatGeo.h:103
unsigned int NTPC() const
Number of TPCs in this cryostat.
Definition: CryostatGeo.h:181
geo::Point_t Min() const
Returns the corner point with the smallest coordinates.
unsigned int MaxWires() const
Returns the largest number of wires among the TPCs in this cryostat.
A base class aware of world box coordinatesAn object describing a simple shape can inherit from this ...
Definition: BoxBoundedGeo.h:33
unsigned int NOpDet() const
Number of optical detectors in this TPC.
Definition: CryostatGeo.h:361
geo::Point_t Max() const
Returns the corner point with the largest coordinates.
double Length() const
Length of the cryostat [cm].
Definition: CryostatGeo.h:107
geo::CryostatID const & ID() const
Returns the identifier of this cryostat.
Definition: CryostatGeo.h:132
void geo::CryostatGeo::SortSubVolumes ( geo::GeoObjectSorter const &  sorter)

Method to sort TPCGeo objects.

Definition at line 63 of file CryostatGeo.cxx.

64  {
65  sorter.SortTPCs(fTPCs);
66 
67  for (geo::TPCGeo& TPC: fTPCs) {
68  TPC.SortSubVolumes(sorter);
69  }
70 
71  sorter.SortOpDets(fOpDets);
72  } // CryostatGeo::SortSubVolumes()
Geometry information for a single TPC.
Definition: TPCGeo.h:38
OpDetList_t fOpDets
List of opdets in this cryostat.
Definition: CryostatGeo.h:476
void SortSubVolumes(geo::GeoObjectSorter const &sorter)
Apply sorting to the PlaneGeo objects.
Definition: TPCGeo.cxx:201
TPCList_t fTPCs
List of tpcs in this cryostat.
Definition: CryostatGeo.h:475
const TPCGeo & TPC(unsigned int itpc) const
Return the itpc&#39;th TPC in the cryostat.
Definition: CryostatGeo.cxx:93
LocalPoint_t geo::CryostatGeo::toLocalCoords ( geo::Point_t const &  world) const
inline

Transform point from world frame to local cryostat frame.

Definition at line 431 of file CryostatGeo.h.

432  { 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:474
LocalVector_t geo::CryostatGeo::toLocalCoords ( geo::Vector_t const &  world) const
inline

Transform direction vector from world to local.

Definition at line 439 of file CryostatGeo.h.

440  { 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:474
geo::Point_t geo::CryostatGeo::toWorldCoords ( LocalPoint_t const &  local) const
inline

Transform point from local cryostat frame to world frame.

Definition at line 403 of file CryostatGeo.h.

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

Transform direction vector from local to world.

Definition at line 411 of file CryostatGeo.h.

412  { return fTrans.toWorldCoords(local); }
LocalTransformation_t fTrans
Cryostat-to-world transformation.
Definition: CryostatGeo.h:474
GlobalPoint_t toWorldCoords(LocalPoint_t const &local) const
Transforms a point from local frame to world frame.
const TPCGeo & 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 93 of file CryostatGeo.cxx.

94  {
95  TPCGeo const* pTPC = TPCPtr(itpc);
96  if(!pTPC){
97  throw cet::exception("TPCOutOfRange") << "Request for non-existant TPC "
98  << itpc << "\n";
99  }
100 
101  return *pTPC;
102  }
TPCGeo const * TPCPtr(unsigned int itpc) const
Returns the TPC number itpc from this cryostat.
Definition: CryostatGeo.h:283
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
const TPCGeo& 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 220 of file CryostatGeo.h.

221  { return TPC(tpcid.TPC); }
const TPCGeo & TPC(unsigned int itpc) const
Return the itpc&#39;th TPC in the cryostat.
Definition: CryostatGeo.cxx:93
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 283 of file CryostatGeo.h.

284  { return HasTPC(itpc)? &(fTPCs[itpc]): nullptr; }
TPCList_t fTPCs
List of tpcs in this cryostat.
Definition: CryostatGeo.h:475
bool HasTPC(unsigned int itpc) const
Returns whether a TPC with index itpc is present in this cryostat.
Definition: CryostatGeo.h:190
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 294 of file CryostatGeo.h.

295  { return TPCPtr(tpcid.TPC); }
TPCGeo const * TPCPtr(unsigned int itpc) const
Returns the TPC number itpc from this cryostat.
Definition: CryostatGeo.h:283
auto const& geo::CryostatGeo::TPCs ( ) const
inline

Returns an object suitable for iterating through all TPCs.

See also
IterateTPCs(), IterateElements()

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

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

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

Deprecated:
TPCs() is informally deprecated because it used to return a collection of geo::TPCGeo and it might soon be unable to do so. For iterations, IterateTPCs() is just as good.

Definition at line 275 of file CryostatGeo.h.

275 { return fTPCs; }
TPCList_t fTPCs
List of tpcs in this cryostat.
Definition: CryostatGeo.h:475
void geo::CryostatGeo::UpdateAfterSorting ( geo::CryostatID  cryoid)

Performs all needed updates after geometry has sorted the cryostats.

Definition at line 76 of file CryostatGeo.cxx.

76  {
77 
78  // update the cryostat ID
79  fID = cryoid;
80 
81  // trigger all the optical detectors to update
82  for (unsigned int opdet = 0; opdet < NOpDet(); ++opdet)
84 
85  // trigger all the TPCs to update as well
86  for (unsigned int tpc = 0; tpc < NTPC(); ++tpc)
88 
89  } // CryostatGeo::UpdateAfterSorting()
OpDetList_t fOpDets
List of opdets in this cryostat.
Definition: CryostatGeo.h:476
unsigned int NTPC() const
Number of TPCs in this cryostat.
Definition: CryostatGeo.h:181
geo::CryostatID fID
ID of this cryostat.
Definition: CryostatGeo.h:479
The data type to uniquely identify a TPC.
Definition: geo_types.h:386
void UpdateAfterSorting(geo::CryostatID cryoid)
Performs all needed updates after geometry has sorted the cryostats.
Definition: CryostatGeo.cxx:76
TPCList_t fTPCs
List of tpcs in this cryostat.
Definition: CryostatGeo.h:475
unsigned int NOpDet() const
Number of optical detectors in this TPC.
Definition: CryostatGeo.h:361
The data type to uniquely identify a optical detector.
Definition: geo_types.h:297
const TGeoVolume* geo::CryostatGeo::Volume ( ) const
inline

Pointer to ROOT's volume descriptor.

Definition at line 111 of file CryostatGeo.h.

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

Full width of the cryostat [cm].

Definition at line 103 of file CryostatGeo.h.

103 { return 2. * HalfWidth(); }
double HalfWidth() const
Half width of the cryostat [cm].
void geo::CryostatGeo::WorldToLocal ( const double *  world,
double *  cryo 
) const
inline

Transform point from world frame to local cryostat frame.

Definition at line 415 of file CryostatGeo.h.

416  { fTrans.WorldToLocal(world, cryo); }
void WorldToLocal(double const *world, double *local) const
Transforms a point from world frame to local frame.
LocalTransformation_t fTrans
Cryostat-to-world transformation.
Definition: CryostatGeo.h:474
template<typename Point >
Point geo::CryostatGeo::WorldToLocal ( Point const &  world) const
inline

Transform point from world frame to local cryostat frame.

Deprecated:
This method breaks the distinction between local and global vectors, since input and output vectors share the same type; use the "official" vector types geo::Point_t, geo::CryostatGeo::LocalPoint_t, geo::Vector_t and geo::CryostatGeo::LocalVector_t, and then use the method geo::CryostatGeo::toLocalCoords() instead.

Definition at line 427 of file CryostatGeo.h.

428  { return fTrans.WorldToLocal(world); }
void WorldToLocal(double const *world, double *local) const
Transforms a point from world frame to local frame.
LocalTransformation_t fTrans
Cryostat-to-world transformation.
Definition: CryostatGeo.h:474
void geo::CryostatGeo::WorldToLocalVect ( const double *  world,
double *  cryo 
) const
inline

Transform direction vector from world to local.

Definition at line 435 of file CryostatGeo.h.

436  { fTrans.WorldToLocalVect(world, cryo); }
LocalTransformation_t fTrans
Cryostat-to-world transformation.
Definition: CryostatGeo.h:474
void WorldToLocalVect(const double *world, double *local) const
Transforms a vector from world frame to local frame.

Member Data Documentation

geo::CryostatID geo::CryostatGeo::fID
private

ID of this cryostat.

Definition at line 479 of file CryostatGeo.h.

std::string geo::CryostatGeo::fOpDetGeoName
private

Name of opdet geometry elements in gdml.

Definition at line 478 of file CryostatGeo.h.

OpDetList_t geo::CryostatGeo::fOpDets
private

List of opdets in this cryostat.

Definition at line 476 of file CryostatGeo.h.

TPCList_t geo::CryostatGeo::fTPCs
private

List of tpcs in this cryostat.

Definition at line 475 of file CryostatGeo.h.

LocalTransformation_t geo::CryostatGeo::fTrans
private

Cryostat-to-world transformation.

Definition at line 474 of file CryostatGeo.h.

TGeoVolume* geo::CryostatGeo::fVolume
private

Total volume of cryostat, called volCryostat in GDML file.

Definition at line 477 of file CryostatGeo.h.

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

Maximum verbosity supported by PrintCryostatInfo().

Definition at line 171 of file CryostatGeo.h.


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