LArSoft  v08_29_00
Liquid Argon Software toolkit - http://larsoft.org/
geo::TPCGeo Class Reference

Geometry information for a single TPC. More...

#include "TPCGeo.h"

Inheritance diagram for geo::TPCGeo:
geo::BoxBoundedGeo

Classes

struct  TPCGeoCoordinatesTag
 Tag for vectors in the "local" GDML coordinate frame of the TPC. More...
 

Public Types

using PlaneCollection_t = std::vector< geo::PlaneGeo >
 
using GeoNodePath_t = geo::WireGeo::GeoNodePath_t
 
using ElementIteratorBox = PlaneCollection_t const &
 Type returned by IterateElements(). More...
 
using Projection_t = geo::PlaneGeo::WidthDepthProjection_t
 Type of 2D vector projection on a plane. More...
 
using DecomposedVector_t = geo::PlaneGeo::WDDecomposedVector_t
 Data structure with plane and drift projections of a 3D vector. More...
 
using Coords_t = geo::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 TPC 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::TPCGeo have the same type but are not compatible.

using LocalPoint_t = geo::Point3DBase_t< TPCGeoCoordinatesTag >
 Type of points in the local GDML TPC frame. More...
 
using LocalVector_t = geo::Vector3DBase_t< TPCGeoCoordinatesTag >
 Type of displacement vectors in the local GDML TPC frame. More...
 

Public Member Functions

 TPCGeo (TGeoNode const &node, geo::TransformationMatrix &&trans, PlaneCollection_t &&planes)
 
PlaneGeo const & Plane (geo::View_t view) const
 Return the plane in the tpc with View_t view. More...
 
PlaneGeo const & Plane (unsigned int iplane) const
 
PlaneGeo const * PlanePtr (unsigned int iplane) const
 Returns the plane number iplane from this TPC. More...
 
geo::PlaneGeo const & SmallestPlane () const
 Returns the wire plane with the smallest surface. More...
 
geo::PlaneGeo const & FirstPlane () const
 Returns the first wire plane (the closest to TPC center). More...
 
geo::PlaneGeo const & LastPlane () const
 Returns the last wire plane (the farther from TPC center). More...
 
unsigned int MaxWires () const
 Returns the largest number of wires among the planes in this TPC. More...
 
std::set< geo::View_tViews () const
 Returns a set of all views covered in this TPC. More...
 
short int DetectDriftDirection () const
 Returns the expected drift direction based on geometry. More...
 
void SortSubVolumes (geo::GeoObjectSorter const &sorter)
 Apply sorting to the PlaneGeo objects. More...
 
void UpdateAfterSorting (geo::TPCID tpcid)
 Performs all updates after cryostat has sorted TPCs. More...
 
template<typename Stream >
void PrintTPCInfo (Stream &&out, std::string indent="", unsigned int verbosity=1) const
 Prints information about this TPC. More...
 
std::string TPCInfo (std::string indent="", unsigned int verbosity=1) const
 Returns a string with information about this TPC. More...
 
TPC properties
double ActiveHalfWidth () const
 Half width (associated with x coordinate) of active TPC volume [cm]. More...
 
double ActiveWidth () const
 Width (associated with x coordinate) of active TPC volume [cm]. More...
 
double ActiveHalfHeight () const
 Half height (associated with y coordinate) of active TPC volume [cm]. More...
 
double ActiveHeight () const
 Height (associated with y coordinate) of active TPC volume [cm]. More...
 
double ActiveLength () const
 Length (associated with z coordinate) of active TPC volume [cm]. More...
 
double ActiveHalfLength () const
 Length (associated with z coordinate) of active TPC volume [cm]. More...
 
double HalfWidth () const
 Width is associated with x coordinate [cm]. More...
 
double Width () const
 Width is associated with x coordinate [cm]. More...
 
double HalfHeight () const
 Height is associated with y coordinate [cm]. More...
 
double Height () const
 Height is associated with y coordinate [cm]. More...
 
double Length () const
 Length is associated with z coordinate [cm]. More...
 
double HalfLength () const
 Length is associated with z coordinate [cm]. More...
 
double ActiveMass () const
 Half width (associated with x coordinate) of active TPC volume [cm]. More...
 
const TGeoVolume * ActiveVolume () const
 Half width (associated with x coordinate) of active TPC volume [cm]. More...
 
const TGeoVolume * TotalVolume () const
 Half width (associated with x coordinate) of active TPC volume [cm]. More...
 
template<typename Vector >
decltype(auto) WidthDir () const
 Returns the direction Width() is measured on. More...
 
decltype(auto) WidthDir () const
 Returns the direction Width() is measured on. More...
 
template<typename Vector >
decltype(auto) HeightDir () const
 Returns the direction Height() is measured on. More...
 
decltype(auto) HeightDir () const
 Returns the direction Height() is measured on. More...
 
template<typename Vector >
decltype(auto) LengthDir () const
 Returns the direction Length() is measured on. More...
 
decltype(auto) LengthDir () const
 Returns the direction Length() is measured on. More...
 
DriftDirection_t DriftDirection () const
 Returns an enumerator value describing the drift direction. More...
 
template<typename Vector >
Vector DriftDir () const
 Returns the direction of the drift (vector pointing toward the planes). More...
 
DefaultVector_t DriftDir () const
 Returns the direction of the drift (vector pointing toward the planes). More...
 
double DriftDistance () const
 
Plane access
unsigned int Nplanes () const
 Number of planes in this tpc. More...
 
unsigned int NElements () const
 Number of planes in this tpc. More...
 
bool HasPlane (unsigned int iplane) const
 Returns whether a plane with index iplane is present in this TPC. More...
 
bool HasElement (unsigned int iplane) const
 Returns whether a plane with index iplane is present in this TPC. More...
 
bool HasPlane (geo::PlaneID const &planeid) const
 Returns whether the plane in planeid is present in this TPC. More...
 
bool HasElement (geo::PlaneID const &planeid) const
 Returns whether the plane in planeid is present in this TPC. More...
 
const PlaneGeoPlane (PlaneID const &planeid) const
 Returns the plane in planeid from this TPC. More...
 
const PlaneGeoGetElement (PlaneID const &planeid) const
 Returns the plane in planeid from this TPC. More...
 
PlaneGeo const * PlanePtr (PlaneID const &planeid) const
 Returns the plane in planeid from this TPC. More...
 
PlaneGeo const * GetElementPtr (PlaneID const &planeid) const
 Returns the plane in planeid from this TPC. More...
 
ElementIteratorBox IterateElements () const
 Returns an object for iterating through all geo::PlaneGeo. More...
 
ElementIteratorBox IteratePlanes () const
 Returns an object for iterating through all geo::PlaneGeo. More...
 
TPC geometry properties
template<typename Point >
Point GetCenter () const
 Returns the center of the TPC volume in world coordinates [cm]. More...
 
DefaultPoint_t GetCenter () const
 Returns the center of the TPC volume in world coordinates [cm]. More...
 
template<typename Point >
Point GetActiveVolumeCenter () const
 Returns the center of the TPC active volume in world coordinates [cm]. More...
 
DefaultPoint_t GetActiveVolumeCenter () const
 Returns the center of the TPC active volume in world coordinates [cm]. More...
 
template<typename Point >
Point GetCathodeCenter () const
 
DefaultPoint_t GetCathodeCenter () const
 
template<typename Point >
Point GetFrontFaceCenter () const
 Returns the center of the active TPC volume side facing negative z. More...
 
geo::Point_t GetFrontFaceCenter () const
 Returns the center of the active TPC volume side facing negative z. More...
 
geo::BoxBoundedGeo const & BoundingBox () const
 Returns the bounding box of this TPC. More...
 
geo::BoxBoundedGeo const & ActiveBoundingBox () const
 Returns the box of the active volume of this TPC. More...
 
const double * PlaneLocation (unsigned int p) const
 
double Plane0Pitch (unsigned int p) const
 Returns the center of the TPC volume in world coordinates [cm]. More...
 
double PlanePitch (unsigned int p1=0, unsigned int p2=1) const
 Returns the center of the TPC volume in world coordinates [cm]. More...
 
double WirePitch (unsigned plane=0) const
 Returns the center of the TPC volume in world coordinates [cm]. More...
 
geo::TPCID const & ID () const
 Returns the identifier of this TPC. More...
 
Projection on a wire plane

These methods deal with projection of points and vectors on a plane, using a geometric reference base which is not dependent on the wire direction. Technically, the objects are projected on the reference plane, that happens to be the first wire plane. In practice, the important bit is that all entities are consistently decomposed into a drift component and a remaining component. If which plane the projection happens on should matter, then geo::PlaneGeo can be used directly (but note that geo::PlaneGeo defines two different frames, and the names of the frame equivalent to the one used here are different).

geo::PlaneGeo const & ReferencePlane () const
 Returns the plane used for reference by projection methods. More...
 
geo::PlaneID const & ReferencePlaneID () const
 Returns the ID of the plane used for reference by projection methods. More...
 
template<typename Vector >
Vector RefWidthDir () const
 Return the direction of reference plane width. More...
 
DefaultPoint_t RefWidthDir () const
 Returns the plane used for reference by projection methods. More...
 
template<typename Vector >
Vector RefDepthDir () const
 Return the direction of reference plane depth. More...
 
DefaultPoint_t RefDepthDir () const
 Return the direction of reference plane depth. More...
 
double DistanceFromReferencePlane (geo::Point_t const &point) const
 Returns the distance of the specified point from reference plane. More...
 
double DistanceFromReferencePlane (TVector3 const &point) const
 Returns the distance of the specified point from reference plane. More...
 
void DriftPoint (geo::Point_t &position, double distance) const
 Shifts the position of an electron drifted by a distance. More...
 
void DriftPoint (TVector3 &position, double distance) const
 Shifts the position of an electron drifted by a distance. More...
 
DecomposedVector_t DecomposePoint (geo::Point_t const &point) const
 Decomposes a 3D point in two components. More...
 
DecomposedVector_t DecomposePoint (TVector3 const &point) const
 Decomposes a 3D point in two components. More...
 
template<typename Point >
Point ProjectionReferencePoint () const
 Returns the reference point used by PointProjection(). More...
 
DefaultPoint_t ProjectionReferencePoint () const
 Returns the reference point used by PointProjection(). More...
 
Projection_t Projection (geo::Point_t const &point) const
 Returns the projection of the specified point on the plane. More...
 
Projection_t PointProjection (geo::Point_t const &point) const
 Returns the projection of the specified point on the plane. More...
 
Projection_t PointProjection (TVector3 const &point) const
 Returns the projection of the specified point on the plane. More...
 
Projection_t Projection (geo::Vector_t const &v) const
 Returns the projection of the specified vector on the plane. More...
 
Projection_t VectorProjection (geo::Vector_t const &v) const
 Returns the projection of the specified vector on the plane. More...
 
Projection_t VectorProjection (TVector3 const &v) const
 Returns the projection of the specified vector on the plane. More...
 
template<typename Point >
Point ComposePoint (DecomposedVector_t const &decomp) const
 Returns the 3D vector from composition of projection and distance. More...
 
DefaultPoint_t ComposePoint (DecomposedVector_t const &decomp) const
 Returns the 3D vector from composition of projection and distance. More...
 
template<typename Point >
Point ComposePoint (double distance, Projection_t const &proj) const
 Returns the 3D point from composition of projection and distance. More...
 
DefaultPoint_t ComposePoint (double distance, Projection_t const &proj) const
 Returns the 3D point from composition of projection and distance. More...
 
Coordinate transformation
void LocalToWorld (const double *tpc, double *world) const
 Transform point from local TPC frame to world frame. More...
 
TVector3 LocalToWorld (const TVector3 &local) const
 Transform point from local TPC frame to world frame. More...
 
geo::Point_t toWorldCoords (LocalPoint_t const &local) const
 Transform point from local TPC frame to world frame. More...
 
void LocalToWorldVect (const double *tpc, double *world) const
 Transform direction vector from local to world. More...
 
TVector3 LocalToWorldVect (const TVector3 &local) 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 *tpc) const
 Transform point from world frame to local TPC frame. More...
 
TVector3 WorldToLocal (TVector3 const &world) const
 Transform point from world frame to local TPC frame. More...
 
LocalPoint_t toLocalCoords (geo::Point_t const &world) const
 Transform point from world frame to local TPC frame. More...
 
void WorldToLocalVect (const double *world, double *tpc) const
 Transform direction vector from world to local. More...
 
TVector3 WorldToLocalVect (TVector3 const &world) 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...
 
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...
 
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...
 
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 (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
 
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

– BEGIN – Overlaps ------------------------------------------------—

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...
 
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 (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
 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.)
 
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, 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 (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, geo::Point_t const &value)
 Sets each coordinate of var to the one in value if the latter is larger. More...
 

Static Public Attributes

static constexpr unsigned int MaxVerbosity = 6
 Maximum verbosity supported by PrintTPCInfo(). More...
 

Private Types

using DefaultVector_t = TVector3
 
using DefaultPoint_t = TVector3
 
using LocalTransformation_t = geo::LocalTransformationGeo< ROOT::Math::Transform3D, LocalPoint_t, LocalVector_t >
 

Private Member Functions

void FindPlane (GeoNodePath_t &path, size_t depth)
 
void MakePlane (GeoNodePath_t &path, size_t depth)
 
void ResetDriftDirection ()
 Recomputes the drift direction; needs planes to have been initialised. More...
 
double ComputeDriftDistance () const
 
void UpdatePlaneViewCache ()
 Refills the plane vs. view cache of the TPC. More...
 
void UpdatePlaneCache ()
 Updates plane cached information. More...
 
void InitTPCBoundaries ()
 Recomputes the TPC boundary. More...
 
void SortPlanes (std::vector< geo::PlaneGeo > &) const
 Sorts (in place) the specified PlaneGeo objects by drift distance. More...
 
geo::Point_t GetFrontFaceCenterImpl () const
 
geo::Point_t GetCathodeCenterImpl () const
 

Private Attributes

LocalTransformation_t fTrans
 TPC-to-world transformation. More...
 
PlaneCollection_t fPlanes
 List of planes in this plane. More...
 
TGeoVolume * fActiveVolume
 Active volume of LAr, called volTPCActive in GDML file. More...
 
TGeoVolume * fTotalVolume
 Total volume of TPC, called volTPC in GDML file. More...
 
DriftDirection_t fDriftDirection
 Direction of the electron drift in the TPC. More...
 
std::vector< double > fPlane0Pitch
 Pitch between planes. More...
 
std::vector< std::vector< double > > fPlaneLocation
 xyz locations of planes in the TPC. More...
 
geo::Point_t fActiveCenter
 Center of the active volume, in world coordinates [cm]. More...
 
double fActiveHalfWidth
 Half width of active volume. More...
 
double fActiveHalfHeight
 Half height of active volume. More...
 
double fActiveLength
 Length of active volume. More...
 
double fHalfWidth
 Half width of total volume. More...
 
double fHalfHeight
 Half height of total volume. More...
 
double fLength
 Length of total volume. More...
 
geo::Vector_t fWidthDir
 Direction width refers to. More...
 
geo::Vector_t fHeightDir
 Direction height refers to. More...
 
geo::Vector_t fLengthDir
 Direction length refers to. More...
 
geo::Vector_t fDriftDir
 Direction electrons drift along. More...
 
geo::BoxBoundedGeo fActiveBox
 Box of the active volume. More...
 
geo::TPCID fID
 ID of this TPC. More...
 
std::vector< geo::PlaneID::PlaneID_tfViewToPlaneNumber
 Index of the plane for each view (InvalidID if none). More...
 

Detailed Description

Geometry information for a single TPC.

Definition at line 38 of file TPCGeo.h.

Member Typedef Documentation

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

Type of the coordinate.

Definition at line 36 of file BoxBoundedGeo.h.

Type of the coordinate triplet.

Definition at line 35 of file BoxBoundedGeo.h.

Data structure with plane and drift projections of a 3D vector.

Definition at line 81 of file TPCGeo.h.

using geo::TPCGeo::DefaultPoint_t = TVector3
private

Definition at line 41 of file TPCGeo.h.

using geo::TPCGeo::DefaultVector_t = TVector3
private

Definition at line 40 of file TPCGeo.h.

Type returned by IterateElements().

Definition at line 49 of file TPCGeo.h.

Type of points in the local GDML TPC frame.

Definition at line 70 of file TPCGeo.h.

Definition at line 711 of file TPCGeo.h.

Type of displacement vectors in the local GDML TPC frame.

Definition at line 73 of file TPCGeo.h.

Definition at line 45 of file TPCGeo.h.

Type of 2D vector projection on a plane.

Definition at line 78 of file TPCGeo.h.

Constructor & Destructor Documentation

geo::TPCGeo::TPCGeo ( TGeoNode const &  node,
geo::TransformationMatrix &&  trans,
PlaneCollection_t &&  planes 
)

Definition at line 40 of file TPCGeo.cxx.

References util::abs(), fActiveCenter, fActiveHalfHeight, fActiveHalfWidth, fActiveLength, fActiveVolume, fHalfHeight, fHalfWidth, fHeightDir, fLength, fLengthDir, fTotalVolume, fTrans, fWidthDir, InitTPCBoundaries(), geo::makeTransformationMatrix(), geo::LocalTransformation< StoredMatrix >::Matrix(), MF_LOG_DEBUG, ResetDriftDirection(), geo::vect::toPoint(), geo::Xaxis(), geo::Yaxis(), and geo::Zaxis().

45  : BoxBoundedGeo() // we initialize boundaries at the end of construction
46  , fTrans(std::move(trans))
47  , fPlanes(std::move(planes))
48  , fActiveVolume(0)
49  , fTotalVolume(0)
51  , fWidthDir (geo::Xaxis())
54  , fDriftDir() // null until known
55  {
56 
57  // all planes are going to be contained in the volume named volTPC
58  // now get the total volume of the TPC
59  TGeoVolume *vc = node.GetVolume();
60  if(!vc){
61  throw cet::exception("Geometry") << "cannot find detector outline volume - bail ungracefully\n";
62  }
63 
64  fTotalVolume = vc;
65 
66  // loop over the daughters of this node and look for the active volume
67  int nd = vc->GetNdaughters();
68  TGeoNode const* pActiveVolNode = nullptr;
69  for(int i = 0; i < nd; ++i){
70  if(strncmp(vc->GetNode(i)->GetName(), "volTPCActive", 12) != 0) continue;
71 
72  pActiveVolNode = vc->GetNode(i);
73  TGeoVolume *vca = pActiveVolNode->GetVolume();
74  if(vca) fActiveVolume = vca;
75  break;
76 
77  }// end loop over daughters of the volume
78 
80 
81  MF_LOG_DEBUG("Geometry") << "detector total volume is " << fTotalVolume->GetName()
82  << "\ndetector active volume is " << fActiveVolume->GetName();
83 
84  // compute the active volume transformation too
85  auto ActiveHMatrix(fTrans.Matrix());
86  if (pActiveVolNode) {
87  ActiveHMatrix
88  *= geo::makeTransformationMatrix(*(pActiveVolNode->GetMatrix()));
89  }
90  // we don't keep the active volume information... just store its center:
93 
94 
95  // set the width, height, and lengths
96  fActiveHalfWidth = ((TGeoBBox*)fActiveVolume->GetShape())->GetDX();
97  fActiveHalfHeight = ((TGeoBBox*)fActiveVolume->GetShape())->GetDY();
98  fActiveLength = 2.0*((TGeoBBox*)fActiveVolume->GetShape())->GetDZ();
99 
100  fHalfWidth = ((TGeoBBox*)fTotalVolume->GetShape())->GetDX();
101  fHalfHeight = ((TGeoBBox*)fTotalVolume->GetShape())->GetDY();
102  fLength = 2.0*((TGeoBBox*)fTotalVolume->GetShape())->GetDZ();
103 
104  // check that the rotation matrix to the world is the identity, if not
105  // we need to change the width, height and length values;
106  // the correspondence of these to x, y and z are not guaranteed to be
107  // trivial, so we store the two independently (cartesian dimensions in the
108  // bounding boxes, the sizes in data members directly);
109  // TODO: there must be a more general way to do this...
110  double Rxx, Rxy, Rxz, Ryx, Ryy, Ryz, Rzx, Rzy, Rzz;
111  fTrans.Matrix().Rotation().GetComponents
112  (Rxx, Rxy, Rxz, Ryx, Ryy, Ryz, Rzx, Rzy, Rzz);
113  if(Rxx != 1) {
114  if(std::abs(Rxz) == 1) {
115  fActiveHalfWidth = ((TGeoBBox*)fActiveVolume->GetShape())->GetDZ();
116  fHalfWidth = ((TGeoBBox*)fTotalVolume->GetShape())->GetDZ();
117  fWidthDir = Zaxis();
118  }
119  if(std::abs(Rxy) == 1) {
120  fActiveHalfWidth = ((TGeoBBox*)fActiveVolume->GetShape())->GetDY();
121  fHalfWidth = ((TGeoBBox*)fTotalVolume->GetShape())->GetDY();
122  fWidthDir = Yaxis();
123  }
124  }
125  if(Ryy != 1) {
126  if(std::abs(Rxy) == 1) {
127  fActiveHalfHeight = ((TGeoBBox*)fActiveVolume->GetShape())->GetDX();
128  fHalfHeight = ((TGeoBBox*)fTotalVolume->GetShape())->GetDX();
129  fHeightDir = Xaxis();
130  }
131  if(std::abs(Rzy) == 1) {
132  fActiveHalfHeight = ((TGeoBBox*)fActiveVolume->GetShape())->GetDZ();
133  fHalfHeight = ((TGeoBBox*)fTotalVolume->GetShape())->GetDZ();
134  fHeightDir = Zaxis();
135  }
136  }
137  if(Rzz != 1) {
138  if(std::abs(Rzx) == 1) {
139  fActiveLength = 2.*((TGeoBBox*)fActiveVolume->GetShape())->GetDX();
140  fLength = 2.*((TGeoBBox*)fTotalVolume->GetShape())->GetDX();
141  fLengthDir = Xaxis();
142  }
143  if(std::abs(Ryz) == 1) {
144  fActiveLength = 2.*((TGeoBBox*)fActiveVolume->GetShape())->GetDY();
145  fLength = 2.*((TGeoBBox*)fTotalVolume->GetShape())->GetDY();
146  fLengthDir = Yaxis();
147  }
148  }
149 
152 
153  } // TPCGeo::TPCGeo()
void InitTPCBoundaries()
Recomputes the TPC boundary.
Definition: TPCGeo.cxx:464
Drift direction is unknown.
Definition: geo_types.h:106
double fLength
Length of total volume.
Definition: TPCGeo.h:728
double fActiveHalfWidth
Half width of active volume.
Definition: TPCGeo.h:723
TransformationMatrix_t const & Matrix() const
Direct access to the transformation matrix.
constexpr Vector Yaxis()
Returns a y axis vector of the specified type.
Definition: geo_vectors.h:219
BoxBoundedGeo()=default
Default constructor: sets an empty volume.
::geo::Point_t toPoint(Point const &p)
Convert the specified point into a geo::Point_t.
constexpr auto abs(T v)
Returns the absolute value of the argument.
PlaneCollection_t fPlanes
List of planes in this plane.
Definition: TPCGeo.h:715
geo::Vector_t fHeightDir
Direction height refers to.
Definition: TPCGeo.h:731
geo::Vector_t fWidthDir
Direction width refers to.
Definition: TPCGeo.h:730
double fHalfWidth
Half width of total volume.
Definition: TPCGeo.h:726
double fActiveLength
Length of active volume.
Definition: TPCGeo.h:725
std::tuple< double, double, const reco::ClusterHit3D * > Point
Definitions used by the VoronoiDiagram algorithm.
Definition: DCEL.h:34
constexpr Vector Xaxis()
Returns a x axis vector of the specified type.
Definition: geo_vectors.h:215
decltype(auto) makeTransformationMatrix(Trans &&trans)
Converts a transformation matrix into a geo::TransformationMatrix.
TGeoVolume * fTotalVolume
Total volume of TPC, called volTPC in GDML file.
Definition: TPCGeo.h:717
DriftDirection_t fDriftDirection
Direction of the electron drift in the TPC.
Definition: TPCGeo.h:718
constexpr Vector Zaxis()
Returns a z axis vector of the specified type.
Definition: geo_vectors.h:223
TGeoVolume * fActiveVolume
Active volume of LAr, called volTPCActive in GDML file.
Definition: TPCGeo.h:716
geo::Vector_t fLengthDir
Direction length refers to.
Definition: TPCGeo.h:732
#define MF_LOG_DEBUG(id)
LocalTransformation_t fTrans
TPC-to-world transformation.
Definition: TPCGeo.h:713
void ResetDriftDirection()
Recomputes the drift direction; needs planes to have been initialised.
Definition: TPCGeo.cxx:402
geo::Vector_t fDriftDir
Direction electrons drift along.
Definition: TPCGeo.h:733
geo::Point_t fActiveCenter
Center of the active volume, in world coordinates [cm].
Definition: TPCGeo.h:721
double fHalfHeight
Half height of total volume.
Definition: TPCGeo.h:727
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
double fActiveHalfHeight
Half height of active volume.
Definition: TPCGeo.h:724

Member Function Documentation

geo::BoxBoundedGeo const& geo::TPCGeo::ActiveBoundingBox ( ) const
inline

Returns the box of the active volume of this TPC.

Definition at line 320 of file TPCGeo.h.

References fActiveBox, Plane0Pitch(), PlaneLocation(), PlanePitch(), and WirePitch().

Referenced by GetFrontFaceCenterImpl(), and PrintTPCInfo().

321  { return fActiveBox; }
geo::BoxBoundedGeo fActiveBox
Box of the active volume.
Definition: TPCGeo.h:735
double geo::TPCGeo::ActiveHalfHeight ( ) const
inline

Half height (associated with y coordinate) of active TPC volume [cm].

Definition at line 99 of file TPCGeo.h.

References fActiveHalfHeight.

Referenced by ActiveHeight(), geo::GeometryCore::DetHalfHeight(), evd_tool::ProtoDUNEDrawer::DrawActiveTPCoutline(), evd_tool::StandardDrawer::DrawActiveTPCoutline(), GetCathodeCenterImpl(), InitTPCBoundaries(), and evd::SimulationDrawer::SimulationDrawer().

99 { return fActiveHalfHeight; }
double fActiveHalfHeight
Half height of active volume.
Definition: TPCGeo.h:724
double geo::TPCGeo::ActiveHalfLength ( ) const
inline

Length (associated with z coordinate) of active TPC volume [cm].

Definition at line 105 of file TPCGeo.h.

References fActiveLength.

Referenced by evd_tool::ProtoDUNEDrawer::DrawActiveTPCoutline(), evd_tool::StandardDrawer::DrawActiveTPCoutline(), and InitTPCBoundaries().

105 { return fActiveLength / 2.0; }
double fActiveLength
Length of active volume.
Definition: TPCGeo.h:725
double geo::TPCGeo::ActiveHalfWidth ( ) const
inline

Half width (associated with x coordinate) of active TPC volume [cm].

Definition at line 95 of file TPCGeo.h.

References fActiveHalfWidth.

Referenced by ActiveWidth(), geo::GeometryCore::DetHalfWidth(), evd_tool::ProtoDUNEDrawer::DrawActiveTPCoutline(), evd_tool::StandardDrawer::DrawActiveTPCoutline(), GetCathodeCenterImpl(), InitTPCBoundaries(), and evd::SimulationDrawer::SimulationDrawer().

95 { return fActiveHalfWidth; }
double fActiveHalfWidth
Half width of active volume.
Definition: TPCGeo.h:723
double geo::TPCGeo::ActiveHeight ( ) const
inline

Height (associated with y coordinate) of active TPC volume [cm].

Definition at line 101 of file TPCGeo.h.

References ActiveHalfHeight().

Referenced by PrintTPCInfo().

101 { return 2.0 * ActiveHalfHeight(); }
double ActiveHalfHeight() const
Half height (associated with y coordinate) of active TPC volume [cm].
Definition: TPCGeo.h:99
double geo::TPCGeo::ActiveLength ( ) const
inline

Length (associated with z coordinate) of active TPC volume [cm].

Definition at line 103 of file TPCGeo.h.

References fActiveLength.

Referenced by geo::GeometryCore::DetLength(), GetCathodeCenterImpl(), PrintTPCInfo(), and evd::SimulationDrawer::SimulationDrawer().

103 { return fActiveLength; }
double fActiveLength
Length of active volume.
Definition: TPCGeo.h:725
double geo::TPCGeo::ActiveMass ( ) const
inline

Half width (associated with x coordinate) of active TPC volume [cm].

Definition at line 118 of file TPCGeo.h.

References fActiveVolume.

Referenced by evgen::ActiveVolumeVertexSampler::reconfigure().

118 { return fActiveVolume->Weight(); }
TGeoVolume * fActiveVolume
Active volume of LAr, called volTPCActive in GDML file.
Definition: TPCGeo.h:716
const TGeoVolume* geo::TPCGeo::ActiveVolume ( ) const
inline

Half width (associated with x coordinate) of active TPC volume [cm].

Definition at line 119 of file TPCGeo.h.

References fActiveVolume.

119 { return fActiveVolume; }
TGeoVolume * fActiveVolume
Active volume of LAr, called volTPCActive in GDML file.
Definition: TPCGeo.h:716
double geo::TPCGeo::ActiveWidth ( ) const
inline

Width (associated with x coordinate) of active TPC volume [cm].

Definition at line 97 of file TPCGeo.h.

References ActiveHalfWidth().

Referenced by PrintTPCInfo().

97 { return 2.0 * ActiveHalfWidth(); }
double ActiveHalfWidth() const
Half width (associated with x coordinate) of active TPC volume [cm].
Definition: TPCGeo.h:95
geo::BoxBoundedGeo const& geo::TPCGeo::BoundingBox ( ) const
inline

Returns the bounding box of this TPC.

Definition at line 316 of file TPCGeo.h.

Referenced by PrintTPCInfo().

317  { return *this; }
geo::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 geo::buildDriftVolumes(), geo::CryostatGeo::GetCenter(), and geo::PlaneGeo::UpdatePlaneNormal().

140  { 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.
template<typename Point >
Point geo::TPCGeo::ComposePoint ( DecomposedVector_t const &  decomp) const
inline

Returns the 3D vector from composition of projection and distance.

Template Parameters
Pointtype of point to be returned
Parameters
decompdecomposed point
Returns
the 3D vector from composition of projection and distance
See also
DecomposePoint(), ComposePoint(double, Projection_t const&)

This is the "inverse" operation respect to DecomposePoint(). The argument stores the two components, orthogonal and parallel to the plane, and compose them into a 3D point which departs from the reference point (ProjectionReferencePoint()) by those components. See ComposePoint(double, Projection_t const&) for more details.

Definition at line 524 of file TPCGeo.h.

References geo::PlaneGeo::ComposePoint(), and ReferencePlane().

525  { return ReferencePlane().ComposePoint<Point>(decomp); }
Point ComposePoint(WireDecomposedVector_t const &decomp) const
Returns the 3D vector from composition of projection and distance.
Definition: PlaneGeo.h:899
std::tuple< double, double, const reco::ClusterHit3D * > Point
Definitions used by the VoronoiDiagram algorithm.
Definition: DCEL.h:34
geo::PlaneGeo const & ReferencePlane() const
Returns the plane used for reference by projection methods.
Definition: TPCGeo.h:354
DefaultPoint_t geo::TPCGeo::ComposePoint ( DecomposedVector_t const &  decomp) const
inline

Returns the 3D vector from composition of projection and distance.

Template Parameters
Pointtype of point to be returned
Parameters
decompdecomposed point
Returns
the 3D vector from composition of projection and distance
See also
DecomposePoint(), ComposePoint(double, Projection_t const&)

This is the "inverse" operation respect to DecomposePoint(). The argument stores the two components, orthogonal and parallel to the plane, and compose them into a 3D point which departs from the reference point (ProjectionReferencePoint()) by those components. See ComposePoint(double, Projection_t const&) for more details.

Definition at line 526 of file TPCGeo.h.

527  { return ComposePoint<DefaultPoint_t>(decomp); }
template<typename Point >
Point geo::TPCGeo::ComposePoint ( double  distance,
Projection_t const &  proj 
) const
inline

Returns the 3D point from composition of projection and distance.

Template Parameters
Pointtype of point to be returned
Parameters
distancedistance of the target point from the reference plane
projprojection of the target point on the reference plane
Returns
the 3D point from composition of projection and distance
See also
DecomposePoint()

The returned point is the reference point, translated by two 3D vectors:

  1. a vector parallel to the plane normal, with norm the input distance
  2. a vector lying on the plane, whose projection via PointProjection() gives the input projection

The choice of the projection reference point embodies the same convention used in PointProjection() and DecomposePoint().

Definition at line 550 of file TPCGeo.h.

References geo::PlaneGeo::ComposePoint(), proj, and ReferencePlane().

551  { return ReferencePlane().ComposePoint<Point>(distance, proj); }
Point ComposePoint(WireDecomposedVector_t const &decomp) const
Returns the 3D vector from composition of projection and distance.
Definition: PlaneGeo.h:899
std::tuple< double, double, const reco::ClusterHit3D * > Point
Definitions used by the VoronoiDiagram algorithm.
Definition: DCEL.h:34
geo::PlaneGeo const & ReferencePlane() const
Returns the plane used for reference by projection methods.
Definition: TPCGeo.h:354
Float_t proj
Definition: plot.C:34
DefaultPoint_t geo::TPCGeo::ComposePoint ( double  distance,
Projection_t const &  proj 
) const
inline

Returns the 3D point from composition of projection and distance.

Template Parameters
Pointtype of point to be returned
Parameters
distancedistance of the target point from the reference plane
projprojection of the target point on the reference plane
Returns
the 3D point from composition of projection and distance
See also
DecomposePoint()

The returned point is the reference point, translated by two 3D vectors:

  1. a vector parallel to the plane normal, with norm the input distance
  2. a vector lying on the plane, whose projection via PointProjection() gives the input projection

The choice of the projection reference point embodies the same convention used in PointProjection() and DecomposePoint().

Definition at line 552 of file TPCGeo.h.

References proj.

553  { return ComposePoint<DefaultPoint_t>(distance, proj); }
Float_t proj
Definition: plot.C:34
double geo::TPCGeo::ComputeDriftDistance ( ) const
private

Computes the distance between the cathode and the last wire plane (last respect to the sorting order).

Definition at line 450 of file TPCGeo.cxx.

References util::abs(), geo::PlaneGeo::DistanceFromPlane(), fPlanes, and GetCathodeCenter().

Referenced by DriftDistance().

450  {
451 
452  //
453  // 1. find the center of the face of the TPC opposite to the anode
454  // 2. compute the distance of it from the last wire plane
455  //
456 
457  geo::PlaneGeo const& plane = fPlanes.back();
459 
460  } // TPCGeo::ComputeDriftDistance()
Point GetCathodeCenter() const
Definition: TPCGeo.h:298
constexpr auto abs(T v)
Returns the absolute value of the argument.
PlaneCollection_t fPlanes
List of planes in this plane.
Definition: TPCGeo.h:715
Geometry information for a single wire plane.The plane is represented in the geometry by a solid whic...
Definition: PlaneGeo.h:82
double DistanceFromPlane(geo::Point_t const &point) const
Returns the distance of the specified point from the wire plane.
Definition: PlaneGeo.h:621
bool geo::BoxBoundedGeo::ContainsPosition ( geo::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 205 of file BoxBoundedGeo.h.

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

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

206  {
207  return ContainsX(point.X(), wiggle)
208  && ContainsYZ(point.Y(), point.Z(), wiggle);
209  } // 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(geo::Point_t const&, double) const.

Definition at line 26 of file BoxBoundedGeo.cxx.

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

27  { return ContainsPosition(geo::vect::toPoint(point), wiggle); }
::geo::Point_t toPoint(Point const &p)
Convert the specified point into a geo::Point_t.
bool ContainsPosition(geo::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(geo::Point_t const&, double) const.

Definition at line 31 of file BoxBoundedGeo.cxx.

References geo::vect::makePointFromCoords().

32  { return ContainsPosition(geo::vect::makePointFromCoords(point), wiggle); }
GENVECTOR_CONSTEXPR::geo::Point_t makePointFromCoords(Coords &&coords)
Creates a geo::Point_t from its coordinates (see makeFromCoords()).
bool ContainsPosition(geo::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 159 of file BoxBoundedGeo.h.

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

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

160  { return CoordinateContained(x, MinX(), MaxX(), wiggle); }
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 169 of file BoxBoundedGeo.h.

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

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

170  { return CoordinateContained(y, MinY(), MaxY(), wiggle); }
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 190 of file BoxBoundedGeo.h.

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

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

191  { return ContainsY(y, wiggle) && ContainsZ(z, wiggle); }
Float_t y
Definition: compare.C:6
Double_t z
Definition: plot.C:279
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 179 of file BoxBoundedGeo.h.

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

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

180  { return CoordinateContained(z, MinZ(), MaxZ(), wiggle); }
Double_t z
Definition: plot.C:279
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::TPCGeo::CoordinateContained ( double  c,
double  min,
double  max,
double  wiggle = 1. 
)
inlinestatic

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 692 of file TPCGeo.h.

Referenced by CoordinateContained().

693  {
694  return (c >= (min > 0? min / wiggle: min * wiggle))
695  && (c <= (max < 0? max / wiggle: max * wiggle));
696  } // CoordinateContained()
Int_t max
Definition: plot.C:27
Int_t min
Definition: plot.C:26
static bool geo::TPCGeo::CoordinateContained ( double  c,
double const *  range,
double  wiggle = 1. 
)
inlinestatic

Definition at line 699 of file TPCGeo.h.

References CoordinateContained(), FindPlane(), and MakePlane().

700  { return CoordinateContained(c, range[0], range[1], wiggle); }
static bool CoordinateContained(double c, double min, double max, double wiggle=1.)
Returns whether the specified coordinate is in a range.
Definition: TPCGeo.h:692
DecomposedVector_t geo::TPCGeo::DecomposePoint ( geo::Point_t const &  point) const
inline

Decomposes a 3D point in two components.

Parameters
pointthe point to be decomposed
Returns
the two components of point, on the plane and orthogonal to it

The point is decomposed in:

  1. a component orthogonal to the reference plane, expressed as a signed real number
  2. a component lying on the reference plane, expressed as a 2D vector

The distance is from the reference plane (DistanceFromReferencePlane()). The projection on the plane is obtained following the same convention as PointProjection().

Definition at line 445 of file TPCGeo.h.

References geo::PlaneGeo::DecomposePointWidthDepth(), and ReferencePlane().

Referenced by DecomposePoint().

446  { return ReferencePlane().DecomposePointWidthDepth(point); }
geo::PlaneGeo const & ReferencePlane() const
Returns the plane used for reference by projection methods.
Definition: TPCGeo.h:354
WDDecomposedVector_t DecomposePointWidthDepth(geo::Point_t const &point) const
Decomposes a 3D point in two components.
Definition: PlaneGeo.h:966
DecomposedVector_t geo::TPCGeo::DecomposePoint ( TVector3 const &  point) const
inline

Decomposes a 3D point in two components.

Parameters
pointthe point to be decomposed
Returns
the two components of point, on the plane and orthogonal to it

The point is decomposed in:

  1. a component orthogonal to the reference plane, expressed as a signed real number
  2. a component lying on the reference plane, expressed as a 2D vector

The distance is from the reference plane (DistanceFromReferencePlane()). The projection on the plane is obtained following the same convention as PointProjection().

Definition at line 447 of file TPCGeo.h.

References DecomposePoint(), and geo::vect::toPoint().

448  { return DecomposePoint(geo::vect::toPoint(point)); }
::geo::Point_t toPoint(Point const &p)
Convert the specified point into a geo::Point_t.
DecomposedVector_t DecomposePoint(geo::Point_t const &point) const
Decomposes a 3D point in two components.
Definition: TPCGeo.h:445
short int geo::TPCGeo::DetectDriftDirection ( ) const

Returns the expected drift direction based on geometry.

The return value is coded as follow:

  • +1: positive x
  • +2: positive y
  • +3: positive z
  • -1: negative x
  • -2: negative y
  • -3: negative z
  • 0: other (or algorithm failed)

The current implementation is based on the assumption that electrons in the middle of TPC will drift toward the wire planes, and it "never fails".

Definition at line 157 of file TPCGeo.cxx.

References util::abs(), geo::PlaneGeo::GetBoxCenter(), GetCenter(), ID(), Nplanes(), and Plane().

Referenced by GetCathodeCenterImpl(), nnet::TrainingDataAlg::getProjection(), pma::PMAlgTracker::mergeCoLinear(), detsim::DriftElectronstoPlane::produce(), detsim::SimDriftElectrons::produce(), ResetDriftDirection(), and toLocalCoords().

157  {
158 
159  //
160  // 1. determine the drift axis
161  // 2. determine the drift direction on it
162  //
163  // We assume that all the planes cover most of the TPC face; therefore,
164  // the centre of the plane and the one of the TPC should be very close
165  // to each other, when projected on the same drift plane.
166  // Here we find which is the largest coordinate difference.
167 
168  if (Nplanes() == 0) {
169  // chances are that we get this because stuff is not initialised yet,
170  // and then even the ID might be wrong
171  throw cet::exception("TPCGeo")
172  << "DetectDriftDirection(): no planes in TPC " << std::string(ID())
173  << "\n";
174  }
175 
176  auto const TPCcenter = GetCenter();
177  auto const PlaneCenter = Plane(0).GetBoxCenter(); // any will do
178 
179  auto const driftVector = PlaneCenter - TPCcenter; // approximation!
180 
181  if ((std::abs(driftVector.X()) > std::abs(driftVector.Y()))
182  && (std::abs(driftVector.X()) > std::abs(driftVector.Z())))
183  {
184  // x is the solution
185  return (driftVector.X() > 0)? +1: -1;
186  }
187  else if (std::abs(driftVector.Y()) > std::abs(driftVector.Z()))
188  {
189  // y is the man
190  return (driftVector.Y() > 0)? +2: -2;
191  }
192  else {
193  // z is the winner
194  return (driftVector.Z() > 0)? +3: -3;
195  }
196 
197  } // TPCGeo::DetectDriftDirection()
geo::TPCID const & ID() const
Returns the identifier of this TPC.
Definition: TPCGeo.h:333
unsigned int Nplanes() const
Number of planes in this tpc.
Definition: TPCGeo.h:165
constexpr auto abs(T v)
Returns the absolute value of the argument.
Point GetBoxCenter() const
Returns the centre of the box representing the plane.
Definition: PlaneGeo.h:498
PlaneGeo const & Plane(geo::View_t view) const
Return the plane in the tpc with View_t view.
Definition: TPCGeo.cxx:263
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
Point GetCenter() const
Returns the center of the TPC volume in world coordinates [cm].
Definition: TPCGeo.h:779
double geo::TPCGeo::DistanceFromReferencePlane ( geo::Point_t const &  point) const
inline

Returns the distance of the specified point from reference plane.

Parameters
pointa point in world coordinates [cm]
Returns
the signed distance from the plane

The distance is defined positive if the point lies in the inner side with respect to the reference plane.

It should match the drift distance from that plane.

Definition at line 404 of file TPCGeo.h.

References geo::PlaneGeo::DistanceFromPlane(), and ReferencePlane().

Referenced by DistanceFromReferencePlane().

405  { return ReferencePlane().DistanceFromPlane(point); }
geo::PlaneGeo const & ReferencePlane() const
Returns the plane used for reference by projection methods.
Definition: TPCGeo.h:354
double DistanceFromPlane(geo::Point_t const &point) const
Returns the distance of the specified point from the wire plane.
Definition: PlaneGeo.h:621
double geo::TPCGeo::DistanceFromReferencePlane ( TVector3 const &  point) const
inline

Returns the distance of the specified point from reference plane.

Parameters
pointa point in world coordinates [cm]
Returns
the signed distance from the plane

The distance is defined positive if the point lies in the inner side with respect to the reference plane.

It should match the drift distance from that plane.

Definition at line 406 of file TPCGeo.h.

References DistanceFromReferencePlane(), and geo::vect::toPoint().

double DistanceFromReferencePlane(geo::Point_t const &point) const
Returns the distance of the specified point from reference plane.
Definition: TPCGeo.h:404
::geo::Point_t toPoint(Point const &p)
Convert the specified point into a geo::Point_t.
template<typename Vector >
Vector geo::TPCGeo::DriftDir ( ) const

Returns the direction of the drift (vector pointing toward the planes).

Definition at line 773 of file TPCGeo.h.

References fDriftDir.

Referenced by checkTPCcoords(), DriftDirection(), groupTPCsByDriftDir(), and UpdateAfterSorting().

774  { return geo::vect::convertTo<Vector>(fDriftDir); }
geo::Vector_t fDriftDir
Direction electrons drift along.
Definition: TPCGeo.h:733
DefaultVector_t geo::TPCGeo::DriftDir ( ) const
inline

Returns the direction of the drift (vector pointing toward the planes).

Definition at line 151 of file TPCGeo.h.

151 { return DriftDir<DefaultVector_t>(); }
DriftDirection_t geo::TPCGeo::DriftDirection ( ) const
inline

Returns an enumerator value describing the drift direction.

Definition at line 144 of file TPCGeo.h.

References DriftDir(), and fDriftDirection.

Referenced by util::DetectorPropertiesServiceArgoNeuT::CalculateXTicksParams(), detinfo::DetectorPropertiesStandard::CalculateXTicksParams(), and larg4::LArVoxelReadout::DriftIonizationElectrons().

144 { return fDriftDirection; }
DriftDirection_t fDriftDirection
Direction of the electron drift in the TPC.
Definition: TPCGeo.h:718
double geo::TPCGeo::DriftDistance ( ) const
inline

Drift distance is defined as the distance between the last anode plane and the opposite face of the TPC, in centimeters.

Definition at line 155 of file TPCGeo.h.

References ComputeDriftDistance(), fPlanes, and Nplanes().

Referenced by pma::PMAlgCosmicTagger::GetDimensions(), and PrintTPCInfo().

155 { return ComputeDriftDistance(); }
double ComputeDriftDistance() const
Definition: TPCGeo.cxx:450
void geo::TPCGeo::DriftPoint ( geo::Point_t position,
double  distance 
) const
inline

Shifts the position of an electron drifted by a distance.

Parameters
position_(modified)_ the position of the electron
distancedrift distance to shift the electron by [cm]
See also
geo::Plane::DriftPoint(), ReferencePlane()

This operation is delegated to the reference plane (see geo::Plane::DriftPoint()).

Definition at line 421 of file TPCGeo.h.

References geo::PlaneGeo::DriftPoint(), and ReferencePlane().

422  { ReferencePlane().DriftPoint(position, distance); }
void DriftPoint(geo::Point_t &position, double distance) const
Shifts the position of an electron drifted by a distance.
Definition: PlaneGeo.h:643
geo::PlaneGeo const & ReferencePlane() const
Returns the plane used for reference by projection methods.
Definition: TPCGeo.h:354
void geo::TPCGeo::DriftPoint ( TVector3 &  position,
double  distance 
) const
inline

Shifts the position of an electron drifted by a distance.

Parameters
position_(modified)_ the position of the electron
distancedrift distance to shift the electron by [cm]
See also
geo::Plane::DriftPoint(), ReferencePlane()

This operation is delegated to the reference plane (see geo::Plane::DriftPoint()).

Definition at line 423 of file TPCGeo.h.

References geo::PlaneGeo::DriftPoint(), and ReferencePlane().

424  { ReferencePlane().DriftPoint(position, distance); }
void DriftPoint(geo::Point_t &position, double distance) const
Shifts the position of an electron drifted by a distance.
Definition: PlaneGeo.h:643
geo::PlaneGeo const & ReferencePlane() const
Returns the plane used for reference by projection methods.
Definition: TPCGeo.h:354
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 414 of file BoxBoundedGeo.h.

Referenced by geo::PlaneGeo::BoundingBox(), evd_tool::ProtoDUNEDrawer::DetOutline3D(), evd_tool::StandardDrawer::DetOutline3D(), and lar::example::SpacePointIsolationAlg::fillAlgConfigFromGeometry().

415  { ExtendToInclude(geo::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:279
void ExtendToInclude(Coord_t x, Coord_t y, Coord_t z)
Extends the current box to also include the specified point.
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
Definition: geo_vectors.h:184
void geo::BoxBoundedGeo::ExtendToInclude ( geo::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 421 of file BoxBoundedGeo.h.

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

422  {
423  set_min(c_min, point);
424  set_max(c_max, point);
425  }
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 433 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().

434  {
435  set_min(c_min, box.Min());
436  set_max(c_max, box.Max());
437  } // 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::TPCGeo::FindPlane ( GeoNodePath_t path,
size_t  depth 
)
private

Referenced by CoordinateContained().

geo::PlaneGeo const& geo::TPCGeo::FirstPlane ( ) const
inline

Returns the first wire plane (the closest to TPC center).

Definition at line 245 of file TPCGeo.h.

References fPlanes.

Referenced by ReferencePlane().

245 { return fPlanes[0]; }
PlaneCollection_t fPlanes
List of planes in this plane.
Definition: TPCGeo.h:715
template<typename Point >
Point geo::TPCGeo::GetActiveVolumeCenter ( ) const
inline

Returns the center of the TPC active volume in world coordinates [cm].

Definition at line 288 of file TPCGeo.h.

References fActiveCenter.

Referenced by evd_tool::ProtoDUNEDrawer::DrawActiveTPCoutline(), evd_tool::StandardDrawer::DrawActiveTPCoutline(), and evd::SimulationDrawer::SimulationDrawer().

289  { return geo::vect::convertTo<Point>(fActiveCenter); }
geo::Point_t fActiveCenter
Center of the active volume, in world coordinates [cm].
Definition: TPCGeo.h:721
DefaultPoint_t geo::TPCGeo::GetActiveVolumeCenter ( ) const
inline

Returns the center of the TPC active volume in world coordinates [cm].

Definition at line 292 of file TPCGeo.h.

293  { return GetActiveVolumeCenter<DefaultPoint_t>(); }
template<typename Point >
Point geo::TPCGeo::GetCathodeCenter ( ) const
inline

Returns the center of the active volume face opposite to the wire planes [cm]

Definition at line 298 of file TPCGeo.h.

References GetCathodeCenterImpl().

Referenced by geo::DriftPartitions::computeCoverage(), ComputeDriftDistance(), and larg4::OpFastScintillation::OpFastScintillation().

299  { return geo::vect::convertTo<Point>(GetCathodeCenterImpl()); }
geo::Point_t GetCathodeCenterImpl() const
Definition: TPCGeo.cxx:330
DefaultPoint_t geo::TPCGeo::GetCathodeCenter ( ) const
inline

Returns the center of the active volume face opposite to the wire planes [cm]

Definition at line 303 of file TPCGeo.h.

304  { return GetCathodeCenter<DefaultPoint_t>(); }
geo::Point_t geo::TPCGeo::GetCathodeCenterImpl ( ) const
private

Definition at line 330 of file TPCGeo.cxx.

References ActiveHalfHeight(), ActiveHalfWidth(), ActiveLength(), DetectDriftDirection(), and geo::vect::Xcoord().

Referenced by GetCathodeCenter().

330  {
331 
332  //
333  // 1. find the center of the face of the TPC opposite to the anode
334  // 2. compute the distance of it from the last wire plane
335  //
336 
337  //
338  // find the cathode center
339  //
340  geo::Point_t cathodeCenter = GetActiveVolumeCenter<geo::Point_t>();
341  switch (DetectDriftDirection()) {
342  case -1:
343  geo::vect::Xcoord(cathodeCenter) += ActiveHalfWidth();
344  // cathodeCenter.SetX(cathodeCenter.X() + ActiveHalfWidth());
345  break;
346  case +1:
347  cathodeCenter.SetX(cathodeCenter.X() - ActiveHalfWidth());
348  break;
349  case -2:
350  cathodeCenter.SetY(cathodeCenter.Y() + ActiveHalfHeight());
351  break;
352  case +2:
353  cathodeCenter.SetY(cathodeCenter.Y() - ActiveHalfHeight());
354  break;
355  case -3:
356  cathodeCenter.SetZ(cathodeCenter.Z() + ActiveLength() / 2.0);
357  break;
358  case +3:
359  cathodeCenter.SetZ(cathodeCenter.Z() - ActiveLength() / 2.0);
360  break;
361  case 0:
362  default:
363  // in this case, a better algorithm is probably needed
364  throw cet::exception("TPCGeo")
365  << "CathodeCenter(): Can't determine the cathode plane (code="
366  << DetectDriftDirection() << ")\n";
367  } // switch
368  return cathodeCenter;
369 
370  } // TPCGeo::GetCathodeCenterImpl()
double ActiveHalfHeight() const
Half height (associated with y coordinate) of active TPC volume [cm].
Definition: TPCGeo.h:99
double ActiveHalfWidth() const
Half width (associated with x coordinate) of active TPC volume [cm].
Definition: TPCGeo.h:95
double ActiveLength() const
Length (associated with z coordinate) of active TPC volume [cm].
Definition: TPCGeo.h:103
auto Xcoord(Vector &v)
Returns an object to manage the coordinate X of the vector v.
short int DetectDriftDirection() const
Returns the expected drift direction based on geometry.
Definition: TPCGeo.cxx:157
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
Definition: geo_vectors.h:184
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
template<typename Point >
Point geo::TPCGeo::GetCenter ( ) const

Returns the center of the TPC volume in world coordinates [cm].

Definition at line 779 of file TPCGeo.h.

References toWorldCoords().

Referenced by DetectDriftDirection(), evd_tool::ICARUSDrawer::DetOutline3D(), IteratePlanes(), ResetDriftDirection(), evd::SimulationDrawer::SimulationDrawer(), and SortPlanes().

779  {
780 
781  // convert the origin (default constructed TVector)
782  return geo::vect::convertTo<Point>(toWorldCoords(LocalPoint_t{ 0.0, 0.0, 0.0 }));
783 
784 } // geo::TPCGeo::GetCenter()
geo::Point3DBase_t< TPCGeoCoordinatesTag > LocalPoint_t
Type of points in the local GDML TPC frame.
Definition: TPCGeo.h:70
geo::Point_t toWorldCoords(LocalPoint_t const &local) const
Transform point from local TPC frame to world frame.
Definition: TPCGeo.h:571
DefaultPoint_t geo::TPCGeo::GetCenter ( ) const
inline

Returns the center of the TPC volume in world coordinates [cm].

Definition at line 284 of file TPCGeo.h.

284 { return GetCenter<DefaultPoint_t>(); }
const PlaneGeo& geo::TPCGeo::GetElement ( PlaneID const &  planeid) const
inline

Returns the plane in planeid from this TPC.

Parameters
planeidfull plane ID
Returns
a constant reference to the plane in planeid
Exceptions
cet::exception(category "PlaneOutOfRange") if no such plane

The cryostat and TPC numbers in planeid are ignored, as it is ignored whether planeid is invalid.

Definition at line 214 of file TPCGeo.h.

References Plane().

215  { return Plane(planeid); }
PlaneGeo const & Plane(geo::View_t view) const
Return the plane in the tpc with View_t view.
Definition: TPCGeo.cxx:263
PlaneGeo const* geo::TPCGeo::GetElementPtr ( PlaneID const &  planeid) const
inline

Returns the plane in planeid from this TPC.

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

The cryostat and TPC numbers in planeid are ignored, as it is ignored whether planeid is invalid.

Definition at line 237 of file TPCGeo.h.

References PlanePtr(), and SmallestPlane().

238  { return PlanePtr(planeid); }
PlaneGeo const * PlanePtr(unsigned int iplane) const
Returns the plane number iplane from this TPC.
Definition: TPCGeo.h:223
template<typename Point >
Point geo::TPCGeo::GetFrontFaceCenter ( ) const
inline

Returns the center of the active TPC volume side facing negative z.

Definition at line 308 of file TPCGeo.h.

References GetFrontFaceCenterImpl().

309  { return geo::vect::convertTo<Point>(GetFrontFaceCenterImpl()); }
geo::Point_t GetFrontFaceCenterImpl() const
Definition: TPCGeo.cxx:374
geo::Point_t geo::TPCGeo::GetFrontFaceCenter ( ) const
inline

Returns the center of the active TPC volume side facing negative z.

Definition at line 312 of file TPCGeo.h.

313  { return GetFrontFaceCenter<geo::Point_t>(); }
geo::Point_t geo::TPCGeo::GetFrontFaceCenterImpl ( ) const
private

Definition at line 374 of file TPCGeo.cxx.

References ActiveBoundingBox().

Referenced by GetFrontFaceCenter().

374  {
375  auto const& activeBox = ActiveBoundingBox();
376  return { activeBox.CenterX(), activeBox.CenterY(), activeBox.MinZ() };
377  } // TPCGeo::GetFrontFaceCenterImpl()
geo::BoxBoundedGeo const & ActiveBoundingBox() const
Returns the box of the active volume of this TPC.
Definition: TPCGeo.h:320
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.

Author
Christoph Rudolf von Rohr (crohr.nosp@m.@fna.nosp@m.l.gov)
Date
July 27th, 2015
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 126 of file BoxBoundedGeo.cxx.

Referenced by geo::BoxBoundedGeo::ExtendToInclude(), and geo::BoxBoundedGeo::GetIntersections().

127  {
128  std::vector<TVector3> intersections;
129  for (auto const& point: GetIntersections(geo::Point_t(TrajectoryStart), geo::Vector_t(TrajectoryDirect)))
130  intersections.emplace_back(point.X(), point.Y(), point.Z());
131  return intersections;
132  } // GetIntersections(TVector3)
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space.
Definition: geo_vectors.h:164
std::vector< TVector3 > GetIntersections(TVector3 const &TrajectoryStart, TVector3 const &TrajectoryDirect) const
Calculates the entry and exit points of a trajectory on the box surface.
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
Definition: geo_vectors.h:184
std::vector< geo::Point_t > geo::BoxBoundedGeo::GetIntersections ( geo::Point_t const &  TrajectoryStart,
geo::Vector_t const &  TrajectoryDirect 
) const
inherited

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

Author
Christoph Rudolf von Rohr (crohr.nosp@m.@fna.nosp@m.l.gov)
Date
July 27th, 2015
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 35 of file BoxBoundedGeo.cxx.

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

38  {
39 
40  std::vector<geo::Point_t> IntersectionPoints;
41  std::vector<double> LineParameters;
42 
43  // Generate normal vectors and offsets for every plane of the box
44  // All normal vectors are headed outwards
45  // BUG the double brace syntax is required to work around clang bug 21629
46  // (https://bugs.llvm.org/show_bug.cgi?id=21629)
47  static std::array<geo::Vector_t, 6U> const NormalVectors = {{
48  -geo::Xaxis<geo::Vector_t>(), geo::Xaxis<geo::Vector_t>(), // anode, cathode,
49  -geo::Yaxis<geo::Vector_t>(), geo::Yaxis<geo::Vector_t>(), // bottom, top,
50  -geo::Zaxis<geo::Vector_t>(), geo::Zaxis<geo::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<geo::Point_t, 6U> const NormalVectorOffsets = {{
55  geo::Point_t{ Min().X(), Min().Y(), Min().Z() }, // Anode offset
56  geo::Point_t{ Max().X(), Min().Y(), Min().Z() }, // Cathode
57  geo::Point_t{ Min().X(), Min().Y(), Min().Z() }, // Bottom
58  geo::Point_t{ Min().X(), Max().Y(), Min().Z() }, // Top
59  geo::Point_t{ Min().X(), Min().Y(), Min().Z() }, // upstream
60  geo::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  {
66  // Check if trajectory and surface are not parallel
67  if(NormalVectors[face_no].Dot(TrajectoryDirect))
68  {
69  // Calculate the line parameter for the intersection points
70  LineParameters.push_back( NormalVectors[face_no].Dot(NormalVectorOffsets.at(face_no) - TrajectoryStart)
71  / NormalVectors[face_no].Dot(TrajectoryDirect) );
72  }
73  else 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 Rudolf von Rohr 05/21/2016
79  unsigned int NoCheckCoord;
80 
81  // Calculate NoCheckCoord out of the face_no
82  if(face_no % 2)
83  {
84  // Convert odd face number to coordinate
85  NoCheckCoord = (face_no - 1)/2;
86  }
87  else
88  {
89  // Convert even face number to coordinate
90  NoCheckCoord = face_no/2;
91  }
92 
93  // Loop over all three space coordinates
94  unsigned int coord = 0;
95  for(auto extractCoord: geo::vect::coordReaders<geo::Point_t>())
96  {
97  auto const lastPointCoord = geo::vect::bindCoord(IntersectionPoints.back(), extractCoord);
98  auto const minCoord = geo::vect::bindCoord(c_min, extractCoord);
99  auto const maxCoord = geo::vect::bindCoord(c_max, extractCoord);
100 
101  // Changed by Christoph Rudolf von Rohr 05/21/2016
102  // Then check if point is not within the surface limits at this coordinate, without looking
103  // at the plane normal vector coordinate. We can assume, that our algorithm already found this coordinate correctily.
104  // In rare cases, looking for boundaries in this coordinate causes unexpected behavior due to floating point inaccuracies.
105  if( coord++ != NoCheckCoord && ((lastPointCoord() > maxCoord()) || (lastPointCoord() < minCoord)) )
106  {
107  // if off limits, get rid of the useless data and break the coordinate loop
108  LineParameters.pop_back();
109  IntersectionPoints.pop_back();
110  break;
111  }
112  }// coordinate loop
113  }// Surcaces loop
114 
115  // sort points according to their parameter value (first is entry, second is exit)
116  if(LineParameters.size() == 2 && LineParameters.front() > LineParameters.back())
117  {
118  std::swap(IntersectionPoints.front(),IntersectionPoints.back());
119  }
120 
121  return IntersectionPoints;
122  } // GetIntersections()
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.
geo::Point_t Min() const
Returns the corner point with the smallest coordinates.
Coords_t c_max
maximum coordinates (x, y, z)
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)
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
Definition: geo_vectors.h:184
geo::Point_t Max() const
Returns the corner point with the largest coordinates.
double geo::TPCGeo::HalfHeight ( ) const
inline
double geo::TPCGeo::HalfLength ( ) const
inline

Length is associated with z coordinate [cm].

Definition at line 117 of file TPCGeo.h.

References fLength.

Referenced by InitTPCBoundaries().

117 { return fLength / 2.0; }
double fLength
Length of total volume.
Definition: TPCGeo.h:728
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::TPCGeo::HalfWidth ( ) const
inline
bool geo::TPCGeo::HasElement ( unsigned int  iplane) const
inline

Returns whether a plane with index iplane is present in this TPC.

Parameters
iplaneindex of plane in this TPC
Returns
whether the plane with index iplane is present in this TPC

Definition at line 176 of file TPCGeo.h.

References HasPlane().

176 { return HasPlane(iplane); }
bool HasPlane(unsigned int iplane) const
Returns whether a plane with index iplane is present in this TPC.
Definition: TPCGeo.h:175
bool geo::TPCGeo::HasElement ( geo::PlaneID const &  planeid) const
inline

Returns whether the plane in planeid is present in this TPC.

Parameters
planeidfull plane ID
Returns
whether the plane in planeid is present in this TPC

The cryostat and TPC numbers in planeid are ignored, as it is ignored whether planeid is invalid.

Definition at line 190 of file TPCGeo.h.

References HasPlane(), and Plane().

191  { return HasPlane(planeid); }
bool HasPlane(unsigned int iplane) const
Returns whether a plane with index iplane is present in this TPC.
Definition: TPCGeo.h:175
bool geo::TPCGeo::HasPlane ( unsigned int  iplane) const
inline

Returns whether a plane with index iplane is present in this TPC.

Parameters
iplaneindex of plane in this TPC
Returns
whether the plane with index iplane is present in this TPC

Definition at line 175 of file TPCGeo.h.

References Nplanes().

Referenced by pma::ProjectionMatchingAlg::buildShowerSeg(), pma::VtxCandidate::ComputeMse2D(), pma::PMAlgStitching::GetTPCXOffsets(), pma::ProjectionMatchingAlg::guideEndpoints(), HasElement(), HasPlane(), geo::GeometryCore::HasPlane(), pma::PMAlgTracker::matchCluster(), pma::Node3D::Node3D(), PlanePtr(), trkf::PMAlgTrajFitter::produce(), trkf::PMAlgTrackMaker::produce(), and pma::ProjectionMatchingAlg::TestTrk().

175 { return iplane < Nplanes(); }
unsigned int Nplanes() const
Number of planes in this tpc.
Definition: TPCGeo.h:165
bool geo::TPCGeo::HasPlane ( geo::PlaneID const &  planeid) const
inline

Returns whether the plane in planeid is present in this TPC.

Parameters
planeidfull plane ID
Returns
whether the plane in planeid is present in this TPC

The cryostat and TPC numbers in planeid are ignored, as it is ignored whether planeid is invalid.

Definition at line 188 of file TPCGeo.h.

References HasPlane(), and geo::PlaneID::Plane.

189  { return HasPlane(planeid.Plane); }
bool HasPlane(unsigned int iplane) const
Returns whether a plane with index iplane is present in this TPC.
Definition: TPCGeo.h:175
double geo::TPCGeo::Height ( ) const
inline

Height is associated with y coordinate [cm].

Definition at line 113 of file TPCGeo.h.

References HalfHeight().

Referenced by PrintTPCInfo().

113 { return 2.0 * HalfHeight(); }
double HalfHeight() const
Height is associated with y coordinate [cm].
Definition: TPCGeo.h:111
template<typename Vector >
decltype(auto) geo::TPCGeo::HeightDir ( ) const
inline

Returns the direction Height() is measured on.

Definition at line 131 of file TPCGeo.h.

References fHeightDir.

131 { return geo::vect::convertTo<Vector>(fHeightDir); }
geo::Vector_t fHeightDir
Direction height refers to.
Definition: TPCGeo.h:731
decltype(auto) geo::TPCGeo::HeightDir ( ) const
inline

Returns the direction Height() is measured on.

Definition at line 134 of file TPCGeo.h.

134 { return HeightDir<DefaultVector_t>(); }
geo::TPCID const& geo::TPCGeo::ID ( ) const
inline

Returns the identifier of this TPC.

Definition at line 333 of file TPCGeo.h.

References fID.

Referenced by checkTPCcoords(), DetectDriftDirection(), evd_tool::ICARUSDrawer::DetOutline3D(), geo::GeometryCore::PositionToTPC(), geo::CryostatGeo::PositionToTPCID(), geo::GeometryCore::PositionToTPCID(), and PrintTPCInfo().

333 { return fID; }
geo::TPCID fID
ID of this TPC.
Definition: TPCGeo.h:737
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().

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

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().

252  { 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 272 of file BoxBoundedGeo.h.

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

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

273  {
274  return CoordinateContained(y, MinY() + neg_margin, MaxY() - pos_margin);
275  }
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 282 of file BoxBoundedGeo.h.

References geo::BoxBoundedGeo::InFiducialY().

283  { 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 303 of file BoxBoundedGeo.h.

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

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

304  {
305  return CoordinateContained(z, MinZ() + neg_margin, MaxZ() - pos_margin);
306  }
Double_t z
Definition: plot.C:279
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 313 of file BoxBoundedGeo.h.

References geo::BoxBoundedGeo::InFiducialZ().

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

Recomputes the TPC boundary.

Definition at line 464 of file TPCGeo.cxx.

References ActiveHalfHeight(), ActiveHalfLength(), ActiveHalfWidth(), fActiveBox, HalfHeight(), HalfLength(), HalfWidth(), geo::BoxBoundedGeo::SetBoundaries(), and toWorldCoords().

Referenced by TPCGeo().

464  {
465  // note that this assumes no rotations of the TPC
466  // (except for rotations of a flat angle around one of the three main axes);
467  // to avoid this, we should transform the six vertices
468  // rather than just the centre
469 
470  // we rely on the asumption that the center of TPC is at the local origin
474  );
475 
476  // the center of the active volume may be elsewhere than the local origin:
477  auto const& activeCenter = GetActiveVolumeCenter<geo::Point_t>();
479  activeCenter.X() - ActiveHalfWidth(), activeCenter.X() + ActiveHalfWidth(),
480  activeCenter.Y() - ActiveHalfHeight(), activeCenter.Y() + ActiveHalfHeight(),
481  activeCenter.Z() - ActiveHalfLength(), activeCenter.Z() + ActiveHalfLength()
482  );
483 
484 
485  } // CryostatGeo::InitTPCBoundaries()
geo::BoxBoundedGeo fActiveBox
Box of the active volume.
Definition: TPCGeo.h:735
geo::Point3DBase_t< TPCGeoCoordinatesTag > LocalPoint_t
Type of points in the local GDML TPC frame.
Definition: TPCGeo.h:70
double ActiveHalfHeight() const
Half height (associated with y coordinate) of active TPC volume [cm].
Definition: TPCGeo.h:99
double HalfLength() const
Length is associated with z coordinate [cm].
Definition: TPCGeo.h:117
geo::Point_t toWorldCoords(LocalPoint_t const &local) const
Transform point from local TPC frame to world frame.
Definition: TPCGeo.h:571
double ActiveHalfLength() const
Length (associated with z coordinate) of active TPC volume [cm].
Definition: TPCGeo.h:105
double ActiveHalfWidth() const
Half width (associated with x coordinate) of active TPC volume [cm].
Definition: TPCGeo.h:95
double HalfHeight() const
Height is associated with y coordinate [cm].
Definition: TPCGeo.h:111
void SetBoundaries(Coord_t x_min, Coord_t x_max, Coord_t y_min, Coord_t y_max, Coord_t z_min, Coord_t z_max)
Sets the boundaries in world coordinates as specified.
double HalfWidth() const
Width is associated with x coordinate [cm].
Definition: TPCGeo.h:107
auto geo::TPCGeo::IterateElements ( ) const

Returns an object for iterating through all geo::PlaneGeo.

Returns
an (undisclosed) object for iterating through all geo::PlaneGeo

For example, this snippet computes MaxWires() of TPC (a TPCGeo):

unsigned int maxWires = 0U;
for (geo::PlaneGeo const& plane: TPC.IteratePlanes())
maxWires = std::max(maxWires, plane.Nwires());

The resulting sequence exposes the planes within the TPC in their ID order, from plane 0 to Nplanes() - 1.

Definition at line 308 of file TPCGeo.cxx.

References fPlanes.

Referenced by IteratePlanes(), and LastPlane().

309  { return fPlanes; }
PlaneCollection_t fPlanes
List of planes in this plane.
Definition: TPCGeo.h:715
ElementIteratorBox geo::TPCGeo::IteratePlanes ( ) const
inline

Returns an object for iterating through all geo::PlaneGeo.

Returns
an (undisclosed) object for iterating through all geo::PlaneGeo

For example, this snippet computes MaxWires() of TPC (a TPCGeo):

unsigned int maxWires = 0U;
for (geo::PlaneGeo const& plane: TPC.IteratePlanes())
maxWires = std::max(maxWires, plane.Nwires());

The resulting sequence exposes the planes within the TPC in their ID order, from plane 0 to Nplanes() - 1.

Definition at line 268 of file TPCGeo.h.

References GetCenter(), IterateElements(), and Views().

268 { return IterateElements(); }
ElementIteratorBox IterateElements() const
Returns an object for iterating through all geo::PlaneGeo.
Definition: TPCGeo.cxx:308
geo::PlaneGeo const& geo::TPCGeo::LastPlane ( ) const
inline

Returns the last wire plane (the farther from TPC center).

Definition at line 248 of file TPCGeo.h.

References fPlanes, IterateElements(), MaxWires(), and Nplanes().

Referenced by geo::DriftPartitions::computeCoverage().

248 { return fPlanes[Nplanes() - 1]; }
unsigned int Nplanes() const
Number of planes in this tpc.
Definition: TPCGeo.h:165
PlaneCollection_t fPlanes
List of planes in this plane.
Definition: TPCGeo.h:715
double geo::TPCGeo::Length ( ) const
inline
template<typename Vector >
decltype(auto) geo::TPCGeo::LengthDir ( ) const
inline

Returns the direction Length() is measured on.

Definition at line 138 of file TPCGeo.h.

References fLengthDir.

138 { return geo::vect::convertTo<Vector>(fLengthDir); }
geo::Vector_t fLengthDir
Direction length refers to.
Definition: TPCGeo.h:732
decltype(auto) geo::TPCGeo::LengthDir ( ) const
inline

Returns the direction Length() is measured on.

Definition at line 141 of file TPCGeo.h.

141 { return LengthDir<DefaultVector_t>(); }
TVector3 geo::TPCGeo::LocalToWorld ( const TVector3 &  local) const
inline

Transform point from local TPC frame to world frame.

Definition at line 567 of file TPCGeo.h.

References fTrans, and geo::LocalTransformation< StoredMatrix >::LocalToWorld().

568  { return fTrans.LocalToWorld<TVector3>(local); }
void LocalToWorld(double const *local, double *world) const
Transforms a point from local frame to world frame.
LocalTransformation_t fTrans
TPC-to-world transformation.
Definition: TPCGeo.h:713
void geo::TPCGeo::LocalToWorldVect ( const double *  tpc,
double *  world 
) const
inline

Transform direction vector from local to world.

Definition at line 575 of file TPCGeo.h.

References fTrans, and geo::LocalTransformation< StoredMatrix >::LocalToWorldVect().

576  { fTrans.LocalToWorldVect(tpc, world); }
void LocalToWorldVect(double const *local, double *world) const
Transforms a vector from local frame to world frame.
LocalTransformation_t fTrans
TPC-to-world transformation.
Definition: TPCGeo.h:713
TVector3 geo::TPCGeo::LocalToWorldVect ( const TVector3 &  local) const
inline

Transform direction vector from local to world.

Definition at line 579 of file TPCGeo.h.

References fTrans, and geo::LocalTransformation< StoredMatrix >::LocalToWorldVect().

580  { return fTrans.LocalToWorldVect<TVector3>(local); }
void LocalToWorldVect(double const *local, double *world) const
Transforms a vector from local frame to world frame.
LocalTransformation_t fTrans
TPC-to-world transformation.
Definition: TPCGeo.h:713
void geo::TPCGeo::MakePlane ( GeoNodePath_t path,
size_t  depth 
)
private

Referenced by CoordinateContained().

geo::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::BoxBoundedGeo::ExtendToInclude(), geo::BoxBoundedGeo::GetIntersections(), geo::GeometryCore::MaterialName(), geo::CryostatGeo::PrintCryostatInfo(), and PrintTPCInfo().

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

Returns the largest number of wires among the planes in this TPC.

Definition at line 297 of file TPCGeo.cxx.

References fPlanes.

Referenced by LastPlane(), geo::CryostatGeo::MaxWires(), and PrintTPCInfo().

297  {
298  unsigned int maxWires = 0;
299  for (geo::PlaneGeo const& plane: fPlanes) {
300  unsigned int maxWiresInPlane = plane.Nwires();
301  if (maxWiresInPlane > maxWires) maxWires = maxWiresInPlane;
302  } // for
303  return maxWires;
304  } // TPCGeo::MaxWires()
PlaneCollection_t fPlanes
List of planes in this plane.
Definition: TPCGeo.h:715
Geometry information for a single wire plane.The plane is represented in the geometry by a solid whic...
Definition: PlaneGeo.h:82
geo::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::BoxBoundedGeo::ExtendToInclude(), geo::BoxBoundedGeo::GetIntersections(), geo::GeometryCore::MaterialName(), geo::CryostatGeo::PrintCryostatInfo(), and PrintTPCInfo().

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

Number of planes in this tpc.

Definition at line 166 of file TPCGeo.h.

References fPlanes.

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

166 { return fPlanes.size(); }
PlaneCollection_t fPlanes
List of planes in this plane.
Definition: TPCGeo.h:715
bool geo::BoxBoundedGeo::Overlaps ( geo::BoxBoundedGeo const &  other) const
inlineinherited

Returns if this and other box overlap.

Definition at line 336 of file BoxBoundedGeo.h.

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

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

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

Definition at line 324 of file BoxBoundedGeo.h.

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

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

325  { return std::min(MaxX(), other.MaxX()) > std::max(MinX(), other.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
Int_t max
Definition: plot.C:27
Int_t min
Definition: plot.C:26
bool geo::BoxBoundedGeo::OverlapsY ( geo::BoxBoundedGeo const &  other) const
inlineinherited

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

Definition at line 328 of file BoxBoundedGeo.h.

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

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

329  { return std::min(MaxY(), other.MaxY()) > std::max(MinY(), other.MinY()); }
Int_t max
Definition: plot.C:27
double MaxY() const
Returns the world y coordinate of the end of the box.
Int_t min
Definition: plot.C:26
double MinY() const
Returns the world y coordinate of the start of the box.
bool geo::BoxBoundedGeo::OverlapsZ ( geo::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 max, geo::BoxBoundedGeo::MaxZ(), min, and geo::BoxBoundedGeo::MinZ().

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

333  { return std::min(MaxZ(), other.MaxZ()) > std::max(MinZ(), other.MinZ()); }
Int_t max
Definition: plot.C:27
double MinZ() const
Returns the world z coordinate of the start of the box.
Int_t min
Definition: plot.C:26
double MaxZ() const
Returns the world z coordinate of the end of the box.
const PlaneGeo & geo::TPCGeo::Plane ( geo::View_t  view) const

Return the plane in the tpc with View_t view.

Definition at line 263 of file TPCGeo.cxx.

References fPlanes, fViewToPlaneNumber, and geo::PlaneID::InvalidID.

Referenced by hit::MagDriftAna::analyze(), trkf::SpacePointAna::bookHistograms(), util::DetectorPropertiesServiceArgoNeuT::CalculateXTicksParams(), detinfo::DetectorPropertiesStandard::CalculateXTicksParams(), evd::RecoBaseDrawer::Cluster2D(), pma::CmToWireDrift(), lar_pandora::LArPandoraInput::CreatePandoraHits2D(), lar_pandora::LArPandoraInput::CreatePandoraReadoutGaps(), DetectDriftDirection(), hit::DisambigCheater::DisambigCheater(), evd::RecoBaseDrawer::DrawTrack2D(), evd::RecoBaseDrawer::DrawTrackVertexAssns2D(), larg4::LArVoxelReadout::DriftIonizationElectrons(), cluster::EndPointAlg::EndPoint(), evd::RecoBaseDrawer::EndPoint2D(), evd::RecoBaseDrawer::Event2D(), cluster::HoughBaseAlg::FastTransform(), corner::CornerFinderAlg::get_feature_points_fast(), pma::ProjectionMatchingAlg::GetCloseHits(), GetElement(), pma::GetProjectionToPlane(), lar_pandora::PFParticleHitDumper::GetUVW(), HasElement(), geo::ChannelMapStandardAlg::Initialize(), lar_pandora::LArPandoraGeometry::LoadGeometry(), trkf::SpacePointAlg::makeSpacePoints(), Plane(), geo::GeometryCore::Print(), lar_pandora::LArPandoraTrackCreation::produce(), cluster::ClusterCheater::produce(), evd::RecoBaseDrawer::Prong2D(), evd::RecoBaseDrawer::RecoBaseDrawer(), ResetDriftDirection(), geo::GeometryCore::ThirdPlane_dTdW(), geo::GeometryCore::ThirdPlaneSlope(), cluster::HoughBaseAlg::Transform(), trkf::SpacePointAlg::update(), pma::Node3D::UpdateProj2D(), pma::ProjectionMatchingAlg::validate(), pma::ProjectionMatchingAlg::validate_on_adc_test(), geo::GeometryCore::WireAngleToVertical(), pma::WireDriftToCm(), and WirePitch().

264  {
265  geo::PlaneID::PlaneID_t const p = fViewToPlaneNumber[size_t(view)];
266  if (p == geo::PlaneID::InvalidID) {
267  throw cet::exception("TPCGeo")
268  << "TPCGeo[" << ((void*) this) << "]::Plane(): no plane for view #"
269  << (size_t) view << "\n";
270  }
271  return fPlanes[p];
272  } // TPCGeo::Plane(geo::View_t)
PlaneCollection_t fPlanes
List of planes in this plane.
Definition: TPCGeo.h:715
std::vector< geo::PlaneID::PlaneID_t > fViewToPlaneNumber
Index of the plane for each view (InvalidID if none).
Definition: TPCGeo.h:740
unsigned int PlaneID_t
Type for the ID number.
Definition: geo_types.h:338
static const PlaneID_t InvalidID
Special code for an invalid ID.
Definition: geo_types.h:342
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
const PlaneGeo & geo::TPCGeo::Plane ( unsigned int  iplane) const

Return the iplane'th plane in the TPC.

Exceptions
cet::exception(category "PlaneOutOfRange") if no such plane

Definition at line 252 of file TPCGeo.cxx.

References PlanePtr().

253  {
254  geo::PlaneGeo const* pPlane = PlanePtr(iplane);
255  if (!pPlane){
256  throw cet::exception("PlaneOutOfRange") << "Request for non-existant plane " << iplane << "\n";
257  }
258 
259  return *pPlane;
260  }
Geometry information for a single wire plane.The plane is represented in the geometry by a solid whic...
Definition: PlaneGeo.h:82
PlaneGeo const * PlanePtr(unsigned int iplane) const
Returns the plane number iplane from this TPC.
Definition: TPCGeo.h:223
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
const PlaneGeo& geo::TPCGeo::Plane ( PlaneID const &  planeid) const
inline

Returns the plane in planeid from this TPC.

Parameters
planeidfull plane ID
Returns
a constant reference to the plane in planeid
Exceptions
cet::exception(category "PlaneOutOfRange") if no such plane

The cryostat and TPC numbers in planeid are ignored, as it is ignored whether planeid is invalid.

Definition at line 212 of file TPCGeo.h.

References Plane(), and geo::PlaneID::Plane.

213  { return Plane(planeid.Plane); }
PlaneGeo const & Plane(geo::View_t view) const
Return the plane in the tpc with View_t view.
Definition: TPCGeo.cxx:263
double geo::TPCGeo::Plane0Pitch ( unsigned int  p) const

Returns the center of the TPC volume in world coordinates [cm].

Definition at line 324 of file TPCGeo.cxx.

References fPlane0Pitch.

Referenced by ActiveBoundingBox(), larg4::LArVoxelReadout::DriftIonizationElectrons(), groupByDriftCoordinate(), and trkf::SpacePointAlg::update().

325  {
326  return fPlane0Pitch[p];
327  }
std::vector< double > fPlane0Pitch
Pitch between planes.
Definition: TPCGeo.h:719
const double * geo::TPCGeo::PlaneLocation ( unsigned int  p) const
double geo::TPCGeo::PlanePitch ( unsigned int  p1 = 0,
unsigned int  p2 = 1 
) const

Returns the center of the TPC volume in world coordinates [cm].

Definition at line 388 of file TPCGeo.cxx.

References util::abs(), and fPlane0Pitch.

Referenced by ActiveBoundingBox(), util::DetectorPropertiesServiceArgoNeuT::CalculateXTicksParams(), detinfo::DetectorPropertiesStandard::CalculateXTicksParams(), larg4::LArVoxelReadout::DriftIonizationElectrons(), geo::GeometryCore::PlanePitch(), detsim::DriftElectronstoPlane::produce(), and detsim::SimDriftElectrons::produce().

390  {
391  return std::abs(fPlane0Pitch[p2] - fPlane0Pitch[p1]);
392  }
std::vector< double > fPlane0Pitch
Pitch between planes.
Definition: TPCGeo.h:719
constexpr auto abs(T v)
Returns the absolute value of the argument.
PlaneGeo const* geo::TPCGeo::PlanePtr ( unsigned int  iplane) const
inline

Returns the plane number iplane from this TPC.

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

Definition at line 223 of file TPCGeo.h.

References fPlanes, and HasPlane().

Referenced by GetElementPtr(), Plane(), PlanePtr(), and geo::GeometryCore::PlanePtr().

224  { return HasPlane(iplane)? &(fPlanes[iplane]): nullptr; }
bool HasPlane(unsigned int iplane) const
Returns whether a plane with index iplane is present in this TPC.
Definition: TPCGeo.h:175
PlaneCollection_t fPlanes
List of planes in this plane.
Definition: TPCGeo.h:715
PlaneGeo const* geo::TPCGeo::PlanePtr ( PlaneID const &  planeid) const
inline

Returns the plane in planeid from this TPC.

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

The cryostat and TPC numbers in planeid are ignored, as it is ignored whether planeid is invalid.

Definition at line 235 of file TPCGeo.h.

References geo::PlaneID::Plane, and PlanePtr().

236  { return PlanePtr(planeid.Plane); }
PlaneGeo const * PlanePtr(unsigned int iplane) const
Returns the plane number iplane from this TPC.
Definition: TPCGeo.h:223
Projection_t geo::TPCGeo::PointProjection ( geo::Point_t const &  point) const
inline

Returns the projection of the specified point on the plane.

Parameters
pointthe 3D point to be projected, in world coordinates
Returns
a 2D vector representing the projection of point on the plane

The returned vector is a 2D vector expressing the projection of the point (from world coordinates) on the reference plane. The vector is expressed as $ ( w, d ) $, components following the width direction (RefWidthDir()) and the depth direction (RefDepthDir()) respectively. The origin point is returned by ProjectionReferencePoint(). All coordinates are in centimeters.

Definition at line 482 of file TPCGeo.h.

References Projection().

483  { return Projection(point); }
Projection_t Projection(geo::Point_t const &point) const
Returns the projection of the specified point on the plane.
Definition: TPCGeo.h:480
Projection_t geo::TPCGeo::PointProjection ( TVector3 const &  point) const
inline

Returns the projection of the specified point on the plane.

Parameters
pointthe 3D point to be projected, in world coordinates
Returns
a 2D vector representing the projection of point on the plane

The returned vector is a 2D vector expressing the projection of the point (from world coordinates) on the reference plane. The vector is expressed as $ ( w, d ) $, components following the width direction (RefWidthDir()) and the depth direction (RefDepthDir()) respectively. The origin point is returned by ProjectionReferencePoint(). All coordinates are in centimeters.

Definition at line 484 of file TPCGeo.h.

References Projection(), and geo::vect::toPoint().

485  { return Projection(geo::vect::toPoint(point)); }
::geo::Point_t toPoint(Point const &p)
Convert the specified point into a geo::Point_t.
Projection_t Projection(geo::Point_t const &point) const
Returns the projection of the specified point on the plane.
Definition: TPCGeo.h:480
template<typename Stream >
void geo::TPCGeo::PrintTPCInfo ( Stream &&  out,
std::string  indent = "",
unsigned int  verbosity = 1 
) const

Prints information about this TPC.

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 TPC ID
  • 1 _(default)_: also center and size
  • 2: also drift direction, cathode position and number of planes
  • 3: also maximum number of wires per plane
  • 4: also information on main direction
  • 5: also information on bounding box

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

Definition at line 789 of file TPCGeo.h.

References ActiveBoundingBox(), ActiveHeight(), ActiveLength(), ActiveWidth(), BoundingBox(), DriftDistance(), Height(), ID(), Length(), geo::BoxBoundedGeo::Max(), MaxWires(), geo::BoxBoundedGeo::Min(), Nplanes(), and Width().

Referenced by geo::part::PartitionDataDescriber< geo::TPCGeo >::PartitionDataDescriber(), geo::GeometryCore::Print(), toLocalCoords(), and TPCInfo().

793  {
794 
795  //----------------------------------------------------------------------------
796  out << "TPC " << std::string(ID());
797 
798  if (verbosity-- <= 0) return; // 0
799 
800  //----------------------------------------------------------------------------
801  out
802  << " (" << Width() << " x " << Height() << " x " << Length() << ") cm^3 at "
803  << GetCenter<geo::Point_t>();
804 
805  if (verbosity-- <= 0) return; // 1
806 
807  //----------------------------------------------------------------------------
808 
809  out << "\n" << indent
810  << "drift direction " << DriftDir<geo::Vector_t>()
811  << " from cathode around " << GetCathodeCenter<geo::Point_t>()
812  << " through " << DriftDistance() << " cm toward "
813  << Nplanes() << " wire planes"
814  ;
815 
816  if (verbosity-- <= 0) return; // 2
817 
818  //----------------------------------------------------------------------------
819  out << "\n" << indent
820  << "maximum wires on any plane: " << MaxWires();
821 
822  if (verbosity-- <= 0) return; // 3
823 
824  //----------------------------------------------------------------------------
825  out << "\n" << indent
826  << "active volume ("
827  << ActiveWidth() << " x " << ActiveHeight() << " x " << ActiveLength()
828  << ") cm^3, front face at " << GetFrontFaceCenter<geo::Point_t>()
829  << " cm;"
830  << "\n" << indent << "main directions:"
831  << " width " << WidthDir<geo::Vector_t>()
832  << " height " << HeightDir<geo::Vector_t>()
833  << " length " << LengthDir<geo::Vector_t>()
834  ;
835 
836  if (verbosity-- <= 0) return; // 4
837 
838  //----------------------------------------------------------------------------
839  // print also the containing box
840  geo::BoxBoundedGeo const& box = BoundingBox();
841  out << "\n" << indent
842  << "bounding box: " << box.Min() << " -- " << box.Max();
843 
844 // if (verbosity-- <= 0) return; // 5
845 
846  //----------------------------------------------------------------------------
847  // print also the active box
848  geo::BoxBoundedGeo const& activeBox = ActiveBoundingBox();
849  out << "\n" << indent
850  << "active volume box: " << activeBox.Min() << " -- " << activeBox.Max();
851 
852 // if (verbosity-- <= 0) return; // 6
853 
854  //----------------------------------------------------------------------------
855 } // geo::TPCGeo::PrintTPCInfo()
geo::TPCID const & ID() const
Returns the identifier of this TPC.
Definition: TPCGeo.h:333
unsigned int Nplanes() const
Number of planes in this tpc.
Definition: TPCGeo.h:165
geo::BoxBoundedGeo const & ActiveBoundingBox() const
Returns the box of the active volume of this TPC.
Definition: TPCGeo.h:320
double Width() const
Width is associated with x coordinate [cm].
Definition: TPCGeo.h:109
double Height() const
Height is associated with y coordinate [cm].
Definition: TPCGeo.h:113
double Length() const
Length is associated with z coordinate [cm].
Definition: TPCGeo.h:115
std::string indent(std::size_t const i)
double ActiveHeight() const
Height (associated with y coordinate) of active TPC volume [cm].
Definition: TPCGeo.h:101
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 planes in this TPC.
Definition: TPCGeo.cxx:297
double ActiveLength() const
Length (associated with z coordinate) of active TPC volume [cm].
Definition: TPCGeo.h:103
double DriftDistance() const
Definition: TPCGeo.h:155
A base class aware of world box coordinatesAn object describing a simple shape can inherit from this ...
Definition: BoxBoundedGeo.h:33
double ActiveWidth() const
Width (associated with x coordinate) of active TPC volume [cm].
Definition: TPCGeo.h:97
geo::BoxBoundedGeo const & BoundingBox() const
Returns the bounding box of this TPC.
Definition: TPCGeo.h:316
geo::Point_t Max() const
Returns the corner point with the largest coordinates.
Projection_t geo::TPCGeo::Projection ( geo::Point_t const &  point) const
inline

Returns the projection of the specified point on the plane.

Parameters
pointthe 3D point to be projected, in world coordinates
Returns
a 2D vector representing the projection of point on the plane

The returned vector is a 2D vector expressing the projection of the point (from world coordinates) on the reference plane. The vector is expressed as $ ( w, d ) $, components following the width direction (RefWidthDir()) and the depth direction (RefDepthDir()) respectively. The origin point is returned by ProjectionReferencePoint(). All coordinates are in centimeters.

Definition at line 480 of file TPCGeo.h.

References geo::PlaneGeo::PointWidthDepthProjection(), and ReferencePlane().

Referenced by PointProjection(), and VectorProjection().

481  { return ReferencePlane().PointWidthDepthProjection(point); }
WidthDepthProjection_t PointWidthDepthProjection(geo::Point_t const &point) const
Returns the projection of the specified point on the plane.
Definition: PlaneGeo.h:985
geo::PlaneGeo const & ReferencePlane() const
Returns the plane used for reference by projection methods.
Definition: TPCGeo.h:354
Projection_t geo::TPCGeo::Projection ( geo::Vector_t const &  v) const
inline

Returns the projection of the specified vector on the plane.

Parameters
vthe 3D vector to be projected, in world units [cm]
Returns
a 2D vector representing the projection of v on the plane

The returned vector is a 2D vector expressing the projection of the vector (from world units) on the reference plane. The vector is expressed as $ ( w, d ) $, components following the width direction (RefWidthDir()) and the depth direction (RefDepthDir()) respectively. All coordinates are in centimeters.

Definition at line 501 of file TPCGeo.h.

References ReferencePlane(), and geo::PlaneGeo::VectorWidthDepthProjection().

WidthDepthProjection_t VectorWidthDepthProjection(geo::Vector_t const &v) const
Returns the projection of the specified vector on the plane.
Definition: PlaneGeo.h:1005
geo::PlaneGeo const & ReferencePlane() const
Returns the plane used for reference by projection methods.
Definition: TPCGeo.h:354
template<typename Point >
Point geo::TPCGeo::ProjectionReferencePoint ( ) const
inline

Returns the reference point used by PointProjection().

Template Parameters
Pointtype of point to be returned

The returned point is such that its decomposition results in a null projection and a 0 distance from the plane.

Definition at line 460 of file TPCGeo.h.

References geo::PlaneGeo::GetCenter(), and ReferencePlane().

461  { return ReferencePlane().GetCenter<Point>(); }
std::tuple< double, double, const reco::ClusterHit3D * > Point
Definitions used by the VoronoiDiagram algorithm.
Definition: DCEL.h:34
Point GetCenter() const
Returns the centre of the wire plane in world coordinates [cm].
Definition: PlaneGeo.h:479
geo::PlaneGeo const & ReferencePlane() const
Returns the plane used for reference by projection methods.
Definition: TPCGeo.h:354
DefaultPoint_t geo::TPCGeo::ProjectionReferencePoint ( ) const
inline

Returns the reference point used by PointProjection().

Template Parameters
Pointtype of point to be returned

The returned point is such that its decomposition results in a null projection and a 0 distance from the plane.

Definition at line 462 of file TPCGeo.h.

463  { return ProjectionReferencePoint<DefaultPoint_t>(); }
template<typename Vector >
Vector geo::TPCGeo::RefDepthDir ( ) const
inline

Return the direction of reference plane depth.

Template Parameters
Vectortype of vector to return (current default: TVector3)
See also
RefWidthDir(), DriftDir()

The precise definition of the vector is arbitrary, but it is defined to lie on the wire plane and so that RefWidthDir(), RefDepthDir() and a vector opposite to DriftDir() make a orthonormal base. That base (width, depth, normal) is guaranteed to be positive defined.

Definition at line 388 of file TPCGeo.h.

References geo::PlaneGeo::DepthDir(), and ReferencePlane().

Referenced by geo::buildDriftVolumes().

388 { return ReferencePlane().DepthDir<Vector>(); }
geo::PlaneGeo const & ReferencePlane() const
Returns the plane used for reference by projection methods.
Definition: TPCGeo.h:354
Vector DepthDir() const
Return the direction of plane depth.
Definition: PlaneGeo.h:236
DefaultPoint_t geo::TPCGeo::RefDepthDir ( ) const
inline

Return the direction of reference plane depth.

Template Parameters
Vectortype of vector to return (current default: TVector3)
See also
RefWidthDir(), DriftDir()

The precise definition of the vector is arbitrary, but it is defined to lie on the wire plane and so that RefWidthDir(), RefDepthDir() and a vector opposite to DriftDir() make a orthonormal base. That base (width, depth, normal) is guaranteed to be positive defined.

Definition at line 389 of file TPCGeo.h.

389 { return RefDepthDir<DefaultPoint_t>(); }
geo::PlaneGeo const& geo::TPCGeo::ReferencePlane ( ) const
inline

Returns the plane used for reference by projection methods.

Definition at line 354 of file TPCGeo.h.

References FirstPlane().

Referenced by ComposePoint(), DecomposePoint(), DistanceFromReferencePlane(), DriftPoint(), Projection(), ProjectionReferencePoint(), RefDepthDir(), ReferencePlaneID(), and RefWidthDir().

354 { return FirstPlane(); }
geo::PlaneGeo const & FirstPlane() const
Returns the first wire plane (the closest to TPC center).
Definition: TPCGeo.h:245
geo::PlaneID const& geo::TPCGeo::ReferencePlaneID ( ) const
inline

Returns the ID of the plane used for reference by projection methods.

Definition at line 357 of file TPCGeo.h.

References geo::PlaneGeo::ID(), and ReferencePlane().

358  { return ReferencePlane().ID(); }
geo::PlaneGeo const & ReferencePlane() const
Returns the plane used for reference by projection methods.
Definition: TPCGeo.h:354
geo::PlaneID const & ID() const
Returns the identifier of this plane.
Definition: PlaneGeo.h:203
template<typename Vector >
Vector geo::TPCGeo::RefWidthDir ( ) const
inline

Return the direction of reference plane width.

Template Parameters
Vectortype of vector to return (current default: TVector3)
See also
RefDepthDir(), DriftDir()

The precise definition of the vector is arbitrary, but it is defined to lie on the wire plane and so that RefWidthDir(), RefDepthDir() and a vector opposite to DriftDir() make a orthonormal base. That base (width, depth, normal) is guaranteed to be positive defined.

Definition at line 372 of file TPCGeo.h.

References ReferencePlane(), and geo::PlaneGeo::WidthDir().

Referenced by geo::buildDriftVolumes().

372 { return ReferencePlane().WidthDir<Vector>(); }
geo::PlaneGeo const & ReferencePlane() const
Returns the plane used for reference by projection methods.
Definition: TPCGeo.h:354
Vector WidthDir() const
Return the direction of plane width.
Definition: PlaneGeo.h:221
DefaultPoint_t geo::TPCGeo::RefWidthDir ( ) const
inline

Returns the plane used for reference by projection methods.

Definition at line 373 of file TPCGeo.h.

373 { return RefWidthDir<DefaultPoint_t>(); }
void geo::TPCGeo::ResetDriftDirection ( )
private

Recomputes the drift direction; needs planes to have been initialised.

Definition at line 402 of file TPCGeo.cxx.

References DetectDriftDirection(), e, fDriftDir, fDriftDirection, geo::PlaneGeo::GetBoxCenter(), GetCenter(), geo::kNeg, geo::kNegX, geo::kPos, geo::kPosX, geo::kUnknownDrift, Plane(), geo::vect::round01(), geo::Xaxis(), geo::Yaxis(), and geo::Zaxis().

Referenced by TPCGeo().

402  {
403 
404  auto const driftDirCode = DetectDriftDirection();
405  switch (driftDirCode) {
406  case +1:
407  fDriftDirection = geo::kPosX; // this is the same as kPos!
408  fDriftDir = geo::Xaxis();
409  break;
410  case -1:
411  fDriftDirection = geo::kNegX; // this is the same as kNeg!
412  fDriftDir = -geo::Xaxis();
413  break;
414  case +2:
415  fDriftDir = geo::Yaxis();
417  break;
418  case -2:
419  fDriftDir = -geo::Yaxis();
421  break;
422  case +3:
423  fDriftDir = geo::Zaxis();
425  break;
426  case -3:
427  fDriftDir = -geo::Zaxis();
429  break;
430  default:
431  // TPC ID is likely not yet set
433 
434  // we estimate the drift direction roughly from the geometry
436 
437  mf::LogError("TPCGeo")
438  << "Unable to detect drift direction (result: " << driftDirCode
439  << ", drift: ( " << fDriftDir.X() << " ; " << fDriftDir.Y() << " ; "
440  << fDriftDir.Z() << " )";
441  break;
442  } // switch
443 
445 
446  } // TPCGeo::ResetDriftDirection()
void round01(Vector &v, Scalar tol)
Returns a vector with all components rounded if close to 0, -1 or +1.
Drift direction is unknown.
Definition: geo_types.h:106
Drift towards positive values.
Definition: geo_types.h:107
constexpr Vector Yaxis()
Returns a y axis vector of the specified type.
Definition: geo_vectors.h:219
Point GetBoxCenter() const
Returns the centre of the box representing the plane.
Definition: PlaneGeo.h:498
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
Drift towards negative X values.
Definition: geo_types.h:110
constexpr Vector Xaxis()
Returns a x axis vector of the specified type.
Definition: geo_vectors.h:215
DriftDirection_t fDriftDirection
Direction of the electron drift in the TPC.
Definition: TPCGeo.h:718
constexpr Vector Zaxis()
Returns a z axis vector of the specified type.
Definition: geo_vectors.h:223
Drift towards positive X values.
Definition: geo_types.h:109
short int DetectDriftDirection() const
Returns the expected drift direction based on geometry.
Definition: TPCGeo.cxx:157
Drift towards negative values.
Definition: geo_types.h:108
geo::Vector_t fDriftDir
Direction electrons drift along.
Definition: TPCGeo.h:733
PlaneGeo const & Plane(geo::View_t view) const
Return the plane in the tpc with View_t view.
Definition: TPCGeo.cxx:263
Float_t e
Definition: plot.C:34
Point GetCenter() const
Returns the center of the TPC volume in world coordinates [cm].
Definition: TPCGeo.h:779
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 468 of file BoxBoundedGeo.h.

References fhicl::detail::atom::value().

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

469  { if (value > var) var = value; }
std::string value(std::any const &)
static void geo::BoxBoundedGeo::set_max ( Coords_t var,
geo::Point_t const &  value 
)
inlinestaticinherited

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

Definition at line 480 of file BoxBoundedGeo.h.

481  {
482  if (value.X() > var.X()) var.SetX(value.X());
483  if (value.Y() > var.Y()) var.SetY(value.Y());
484  if (value.Z() > var.Z()) var.SetZ(value.Z());
485  }
std::string value(std::any const &)
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 464 of file BoxBoundedGeo.h.

References fhicl::detail::atom::value().

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

465  { if (value < var) var = value; }
std::string value(std::any const &)
static void geo::BoxBoundedGeo::set_min ( Coords_t var,
geo::Point_t const &  value 
)
inlinestaticinherited

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

Definition at line 472 of file BoxBoundedGeo.h.

473  {
474  if (value.X() < var.X()) var.SetX(value.X());
475  if (value.Y() < var.Y()) var.SetY(value.Y());
476  if (value.Z() < var.Z()) var.SetZ(value.Z());
477  }
std::string value(std::any const &)
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 389 of file BoxBoundedGeo.h.

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

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

394  {
395  c_min.SetXYZ(x_min, y_min, z_min);
396  c_max.SetXYZ(x_max, y_max, z_max);
397  SortCoordinates();
398  }
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 405 of file BoxBoundedGeo.h.

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

406  { c_min = lower; c_max = upper; SortCoordinates(); }
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::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::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::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.
geo::PlaneGeo const & geo::TPCGeo::SmallestPlane ( ) const

Returns the wire plane with the smallest surface.

Definition at line 276 of file TPCGeo.cxx.

References fPlanes.

Referenced by GetElementPtr().

276  {
277 
278  //
279  // Returns the plane with the smallest width x depth. No nonsense here.
280  //
281 
282  auto iPlane = fPlanes.begin(), pend = fPlanes.end();
283  auto smallestPlane = iPlane;
284  double smallestSurface = smallestPlane->Width() * smallestPlane->Depth();
285  while (++iPlane != pend) {
286  double const surface = iPlane->Width() * iPlane->Depth();
287  if (surface > smallestSurface) continue;
288  smallestSurface = surface;
289  smallestPlane = iPlane;
290  } // while
291  return *smallestPlane;
292 
293  } // TPCGeo::SmallestPlane()
PlaneCollection_t fPlanes
List of planes in this plane.
Definition: TPCGeo.h:715
void geo::TPCGeo::SortPlanes ( std::vector< geo::PlaneGeo > &  planes) const
private

Sorts (in place) the specified PlaneGeo objects by drift distance.

Definition at line 529 of file TPCGeo.cxx.

References geo::vect::dot(), GetCenter(), and geo::vect::normalize().

Referenced by SortSubVolumes().

529  {
530  //
531  // Sort planes by increasing drift distance.
532  //
533  // This function should work in bootstrap mode, relying on least things as
534  // possible. Therefore we compute here a proxy of the drift axis.
535  //
536 
537  //
538  // determine the drift axis (or close to): from TPC center to plane center
539  //
540 
541  // Instead of using the plane center, which might be not available yet,
542  // we use the plane box center, which only needs the geometry description
543  // to be available.
544  // We use the first plane -- it does not make any difference.
545  auto const TPCcenter = GetCenter();
546  auto const driftAxis
547  = geo::vect::normalize(planes[0].GetBoxCenter() - TPCcenter);
548 
549  auto by_distance = [&TPCcenter, &driftAxis](auto const& a,
550  auto const& b) {
551  return geo::vect::dot(a.GetBoxCenter() - TPCcenter, driftAxis) <
552  geo::vect::dot(b.GetBoxCenter() - TPCcenter, driftAxis);
553  };
554  cet::sort_all(planes, by_distance);
555 
556  } // TPCGeo::SortPlanes()
constexpr auto dot(Vector const &a, Vector const &b)
Return cross product of two vectors.
Vector normalize(Vector const &v)
Returns a vector parallel to v and with norm 1.
Point GetCenter() const
Returns the center of the TPC volume in world coordinates [cm].
Definition: TPCGeo.h:779
void geo::TPCGeo::SortSubVolumes ( geo::GeoObjectSorter const &  sorter)

Apply sorting to the PlaneGeo objects.

Definition at line 201 of file TPCGeo.cxx.

References fPlanes, fViewToPlaneNumber, geo::PlaneID::InvalidID, geo::kUnknown, Nplanes(), and SortPlanes().

Referenced by geo::CryostatGeo::SortSubVolumes(), and toLocalCoords().

202  {
204 
205  // the PlaneID_t cast convert InvalidID into a rvalue (non-reference);
206  // leaving it a reference would cause C++ to treat it as such,
207  // that can't be because InvalidID is a static member constant without an address
208  // (it is not defined in any translation unit, just declared in header)
209  fViewToPlaneNumber.resize
211  for(size_t p = 0; p < this->Nplanes(); ++p)
212  fViewToPlaneNumber[(size_t) fPlanes[p].View()] = p;
213 
214  for(size_t p = 0; p < fPlanes.size(); ++p) fPlanes[p].SortWires(sorter);
215 
216  }
Unknown view.
Definition: geo_types.h:84
unsigned int Nplanes() const
Number of planes in this tpc.
Definition: TPCGeo.h:165
PlaneCollection_t fPlanes
List of planes in this plane.
Definition: TPCGeo.h:715
std::vector< geo::PlaneID::PlaneID_t > fViewToPlaneNumber
Index of the plane for each view (InvalidID if none).
Definition: TPCGeo.h:740
unsigned int PlaneID_t
Type for the ID number.
Definition: geo_types.h:338
void SortPlanes(std::vector< geo::PlaneGeo > &) const
Sorts (in place) the specified PlaneGeo objects by drift distance.
Definition: TPCGeo.cxx:529
static const PlaneID_t InvalidID
Special code for an invalid ID.
Definition: geo_types.h:342
LocalPoint_t geo::TPCGeo::toLocalCoords ( geo::Point_t const &  world) const
inline

Transform point from world frame to local TPC frame.

Definition at line 595 of file TPCGeo.h.

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

596  { return fTrans.toLocalCoords(world); }
LocalPoint_t toLocalCoords(GlobalPoint_t const &world) const
Transforms a point from world frame to local frame.
LocalTransformation_t fTrans
TPC-to-world transformation.
Definition: TPCGeo.h:713
LocalVector_t geo::TPCGeo::toLocalCoords ( geo::Vector_t const &  world) const
inline

Transform direction vector from world to local.

Definition at line 607 of file TPCGeo.h.

References DetectDriftDirection(), fTrans, art::detail::indent(), PrintTPCInfo(), SortSubVolumes(), geo::LocalTransformationGeo< StoredMatrix, LocalPoint, LocalVector >::toLocalCoords(), TPCInfo(), and UpdateAfterSorting().

608  { return fTrans.toLocalCoords(world); }
LocalPoint_t toLocalCoords(GlobalPoint_t const &world) const
Transforms a point from world frame to local frame.
LocalTransformation_t fTrans
TPC-to-world transformation.
Definition: TPCGeo.h:713
const TGeoVolume* geo::TPCGeo::TotalVolume ( ) const
inline

Half width (associated with x coordinate) of active TPC volume [cm].

Definition at line 120 of file TPCGeo.h.

References fTotalVolume.

120 { return fTotalVolume; }
TGeoVolume * fTotalVolume
Total volume of TPC, called volTPC in GDML file.
Definition: TPCGeo.h:717
geo::Point_t geo::TPCGeo::toWorldCoords ( LocalPoint_t const &  local) const
inline

Transform point from local TPC frame to world frame.

Definition at line 571 of file TPCGeo.h.

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

Referenced by GetCenter(), and InitTPCBoundaries().

572  { return fTrans.toWorldCoords(local); }
LocalTransformation_t fTrans
TPC-to-world transformation.
Definition: TPCGeo.h:713
GlobalPoint_t toWorldCoords(LocalPoint_t const &local) const
Transforms a point from local frame to world frame.
geo::Vector_t geo::TPCGeo::toWorldCoords ( LocalVector_t const &  local) const
inline

Transform direction vector from local to world.

Definition at line 583 of file TPCGeo.h.

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

584  { return fTrans.toWorldCoords(local); }
LocalTransformation_t fTrans
TPC-to-world transformation.
Definition: TPCGeo.h:713
GlobalPoint_t toWorldCoords(LocalPoint_t const &local) const
Transforms a point from local frame to world frame.
std::string geo::TPCGeo::TPCInfo ( std::string  indent = "",
unsigned int  verbosity = 1 
) const

Returns a string with information about this TPC.

See also
PrintTPCInfo()

Arguments and provided information are the same as in PrintTPCInfo().

Definition at line 244 of file TPCGeo.cxx.

References PrintTPCInfo().

Referenced by toLocalCoords(), and UpdateAfterSorting().

245  {
246  std::ostringstream sstr;
247  PrintTPCInfo(sstr, indent, verbosity);
248  return sstr.str();
249  } // TPCGeo::TPCInfo()
void PrintTPCInfo(Stream &&out, std::string indent="", unsigned int verbosity=1) const
Prints information about this TPC.
Definition: TPCGeo.h:789
std::string indent(std::size_t const i)
void geo::TPCGeo::UpdateAfterSorting ( geo::TPCID  tpcid)

Performs all updates after cryostat has sorted TPCs.

Definition at line 220 of file TPCGeo.cxx.

References DriftDir(), e, fID, fPlanes, lar::util::makeVector3DComparison(), Nplanes(), TPCInfo(), UpdatePlaneCache(), and UpdatePlaneViewCache().

Referenced by toLocalCoords().

220  {
221 
222  // reset the ID
223  fID = tpcid;
224 
225  // ask the planes to update; also check
226 
227  for (unsigned int plane = 0; plane < Nplanes(); ++plane) {
228  fPlanes[plane].UpdateAfterSorting(geo::PlaneID(fID, plane), *this);
229 
230  // check that the plane normal is opposite to the TPC drift direction
232  .equal(-(fPlanes[plane].GetNormalDirection()), DriftDir()));
233 
234  } // for
235 
238 
239  } // TPCGeo::UpdateAfterSorting()
Vector DriftDir() const
Returns the direction of the drift (vector pointing toward the planes).
Definition: TPCGeo.h:773
void UpdatePlaneCache()
Updates plane cached information.
Definition: TPCGeo.cxx:506
unsigned int Nplanes() const
Number of planes in this tpc.
Definition: TPCGeo.h:165
The data type to uniquely identify a Plane.
Definition: geo_types.h:337
PlaneCollection_t fPlanes
List of planes in this plane.
Definition: TPCGeo.h:715
geo::TPCID fID
ID of this TPC.
Definition: TPCGeo.h:737
auto makeVector3DComparison(RealType threshold)
Creates a Vector3DComparison from a RealComparisons object.
void UpdatePlaneViewCache()
Refills the plane vs. view cache of the TPC.
Definition: TPCGeo.cxx:489
Float_t e
Definition: plot.C:34
void geo::TPCGeo::UpdatePlaneCache ( )
private

Updates plane cached information.

Definition at line 506 of file TPCGeo.cxx.

References util::abs(), geo::vect::fillCoords(), fPlane0Pitch, fPlaneLocation, fPlanes, and Nplanes().

Referenced by UpdateAfterSorting().

506  {
507 
508  /*
509  * set the plane pitch for this TPC
510  */
511  fPlaneLocation.resize(fPlanes.size());
512  fPlane0Pitch.resize(Nplanes(), 0.);
513  geo::Point_t refPlaneCenter = fPlanes[0].GetCenter<geo::Point_t>();
514  for(size_t p = 0; p < Nplanes(); ++p){
515  geo::Point_t const& center = fPlanes[p].GetCenter<geo::Point_t>();
516  fPlane0Pitch[p] = (p == 0)
517  ? 0.0
518  : fPlane0Pitch[p-1] + std::abs(center.X()-refPlaneCenter.X())
519  ;
520  fPlaneLocation[p].resize(3);
522  refPlaneCenter = center;
523  } // for planes
524 
525  } // TPCGeo::UpdatePlaneViewCache()
std::vector< double > fPlane0Pitch
Pitch between planes.
Definition: TPCGeo.h:719
unsigned int Nplanes() const
Number of planes in this tpc.
Definition: TPCGeo.h:165
constexpr auto abs(T v)
Returns the absolute value of the argument.
PlaneCollection_t fPlanes
List of planes in this plane.
Definition: TPCGeo.h:715
unsigned int fillCoords(Coords &dest, Vector const &src)
Fills a coordinate array with the coordinates of a vector.
std::vector< std::vector< double > > fPlaneLocation
xyz locations of planes in the TPC.
Definition: TPCGeo.h:720
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
Definition: geo_vectors.h:184
void geo::TPCGeo::UpdatePlaneViewCache ( )
private

Refills the plane vs. view cache of the TPC.

Definition at line 489 of file TPCGeo.cxx.

References fPlanes, fViewToPlaneNumber, geo::PlaneID::InvalidID, geo::kUnknown, and Nplanes().

Referenced by UpdateAfterSorting().

489  {
490 
491  // the PlaneID_t cast convert InvalidID into a rvalue (non-reference);
492  // leaving it a reference would cause C++ to treat it as such,
493  // that can't be because InvalidID is a static member constant without an address
494  // (it is not defined in any translation unit, just declared in header)
495  fViewToPlaneNumber.clear();
496  fViewToPlaneNumber.resize
498  for(size_t p = 0; p < Nplanes(); ++p)
499  fViewToPlaneNumber[(size_t) fPlanes[p].View()] = p;
500 
501  } // TPCGeo::UpdatePlaneViewCache()
Unknown view.
Definition: geo_types.h:84
unsigned int Nplanes() const
Number of planes in this tpc.
Definition: TPCGeo.h:165
PlaneCollection_t fPlanes
List of planes in this plane.
Definition: TPCGeo.h:715
std::vector< geo::PlaneID::PlaneID_t > fViewToPlaneNumber
Index of the plane for each view (InvalidID if none).
Definition: TPCGeo.h:740
unsigned int PlaneID_t
Type for the ID number.
Definition: geo_types.h:338
static const PlaneID_t InvalidID
Special code for an invalid ID.
Definition: geo_types.h:342
Projection_t geo::TPCGeo::VectorProjection ( geo::Vector_t const &  v) const
inline

Returns the projection of the specified vector on the plane.

Parameters
vthe 3D vector to be projected, in world units [cm]
Returns
a 2D vector representing the projection of v on the plane

The returned vector is a 2D vector expressing the projection of the vector (from world units) on the reference plane. The vector is expressed as $ ( w, d ) $, components following the width direction (RefWidthDir()) and the depth direction (RefDepthDir()) respectively. All coordinates are in centimeters.

Definition at line 503 of file TPCGeo.h.

References Projection().

504  { return Projection(v); }
Projection_t Projection(geo::Point_t const &point) const
Returns the projection of the specified point on the plane.
Definition: TPCGeo.h:480
Projection_t geo::TPCGeo::VectorProjection ( TVector3 const &  v) const
inline

Returns the projection of the specified vector on the plane.

Parameters
vthe 3D vector to be projected, in world units [cm]
Returns
a 2D vector representing the projection of v on the plane

The returned vector is a 2D vector expressing the projection of the vector (from world units) on the reference plane. The vector is expressed as $ ( w, d ) $, components following the width direction (RefWidthDir()) and the depth direction (RefDepthDir()) respectively. All coordinates are in centimeters.

Definition at line 505 of file TPCGeo.h.

References Projection(), and geo::vect::toVector().

506  { return Projection(geo::vect::toVector(v)); }
::geo::Vector_t toVector(Vector const &v)
Convert the specified vector into a geo::Vector_t.
Projection_t Projection(geo::Point_t const &point) const
Returns the projection of the specified point on the plane.
Definition: TPCGeo.h:480
std::set< geo::View_t > geo::TPCGeo::Views ( ) const

Returns a set of all views covered in this TPC.

Definition at line 313 of file TPCGeo.cxx.

References fPlanes, and geo::PlaneGeo::View().

Referenced by IteratePlanes().

313  {
314  std::set<geo::View_t> views;
315  std::transform(fPlanes.cbegin(), fPlanes.cend(),
316  std::inserter(views, views.begin()), std::mem_fn(&geo::PlaneGeo::View));
317  return views;
318  } // TPCGeo::Views()
PlaneCollection_t fPlanes
List of planes in this plane.
Definition: TPCGeo.h:715
View_t View() const
Which coordinate does this plane measure.
Definition: PlaneGeo.h:184
double geo::TPCGeo::Width ( ) const
inline

Width is associated with x coordinate [cm].

Definition at line 109 of file TPCGeo.h.

References HalfWidth().

Referenced by PrintTPCInfo().

109 { return 2.0 * HalfWidth(); }
double HalfWidth() const
Width is associated with x coordinate [cm].
Definition: TPCGeo.h:107
template<typename Vector >
decltype(auto) geo::TPCGeo::WidthDir ( ) const
inline

Returns the direction Width() is measured on.

Definition at line 124 of file TPCGeo.h.

References fWidthDir.

124 { return geo::vect::convertTo<Vector>(fWidthDir); }
geo::Vector_t fWidthDir
Direction width refers to.
Definition: TPCGeo.h:730
decltype(auto) geo::TPCGeo::WidthDir ( ) const
inline

Returns the direction Width() is measured on.

Definition at line 127 of file TPCGeo.h.

127 { return WidthDir<DefaultVector_t>(); }
double geo::TPCGeo::WirePitch ( unsigned  plane = 0) const

Returns the center of the TPC volume in world coordinates [cm].

Definition at line 396 of file TPCGeo.cxx.

References Plane(), and geo::PlaneGeo::WirePitch().

Referenced by ActiveBoundingBox(), hit::MagDriftAna::analyze(), geo::ChannelMapStandardAlg::Initialize(), and trkf::SpacePointAlg::update().

397  {
398  return this->Plane(plane).WirePitch();
399  }
PlaneGeo const & Plane(geo::View_t view) const
Return the plane in the tpc with View_t view.
Definition: TPCGeo.cxx:263
double WirePitch() const
Return the wire pitch (in centimeters). It is assumed constant.
Definition: PlaneGeo.h:411
void geo::TPCGeo::WorldToLocal ( const double *  world,
double *  tpc 
) const
inline

Transform point from world frame to local TPC frame.

Definition at line 587 of file TPCGeo.h.

References fTrans, and geo::LocalTransformation< StoredMatrix >::WorldToLocal().

588  { fTrans.WorldToLocal(world, tpc); }
void WorldToLocal(double const *world, double *local) const
Transforms a point from world frame to local frame.
LocalTransformation_t fTrans
TPC-to-world transformation.
Definition: TPCGeo.h:713
TVector3 geo::TPCGeo::WorldToLocal ( TVector3 const &  world) const
inline

Transform point from world frame to local TPC frame.

Definition at line 591 of file TPCGeo.h.

References fTrans, and geo::LocalTransformation< StoredMatrix >::WorldToLocal().

592  { return fTrans.WorldToLocal<TVector3>(world); }
void WorldToLocal(double const *world, double *local) const
Transforms a point from world frame to local frame.
LocalTransformation_t fTrans
TPC-to-world transformation.
Definition: TPCGeo.h:713
void geo::TPCGeo::WorldToLocalVect ( const double *  world,
double *  tpc 
) const
inline

Transform direction vector from world to local.

Definition at line 599 of file TPCGeo.h.

References fTrans, and geo::LocalTransformation< StoredMatrix >::WorldToLocalVect().

600  { fTrans.WorldToLocalVect(world, tpc); }
LocalTransformation_t fTrans
TPC-to-world transformation.
Definition: TPCGeo.h:713
void WorldToLocalVect(const double *world, double *local) const
Transforms a vector from world frame to local frame.
TVector3 geo::TPCGeo::WorldToLocalVect ( TVector3 const &  world) const
inline

Transform direction vector from world to local.

Definition at line 603 of file TPCGeo.h.

References fTrans, and geo::LocalTransformation< StoredMatrix >::WorldToLocalVect().

604  { return fTrans.WorldToLocalVect<TVector3>(world); }
LocalTransformation_t fTrans
TPC-to-world transformation.
Definition: TPCGeo.h:713
void WorldToLocalVect(const double *world, double *local) const
Transforms a vector from world frame to local frame.

Member Data Documentation

geo::BoxBoundedGeo geo::TPCGeo::fActiveBox
private

Box of the active volume.

Definition at line 735 of file TPCGeo.h.

Referenced by ActiveBoundingBox(), and InitTPCBoundaries().

geo::Point_t geo::TPCGeo::fActiveCenter
private

Center of the active volume, in world coordinates [cm].

Definition at line 721 of file TPCGeo.h.

Referenced by GetActiveVolumeCenter(), and TPCGeo().

double geo::TPCGeo::fActiveHalfHeight
private

Half height of active volume.

Definition at line 724 of file TPCGeo.h.

Referenced by ActiveHalfHeight(), and TPCGeo().

double geo::TPCGeo::fActiveHalfWidth
private

Half width of active volume.

Definition at line 723 of file TPCGeo.h.

Referenced by ActiveHalfWidth(), and TPCGeo().

double geo::TPCGeo::fActiveLength
private

Length of active volume.

Definition at line 725 of file TPCGeo.h.

Referenced by ActiveHalfLength(), ActiveLength(), and TPCGeo().

TGeoVolume* geo::TPCGeo::fActiveVolume
private

Active volume of LAr, called volTPCActive in GDML file.

Definition at line 716 of file TPCGeo.h.

Referenced by ActiveMass(), ActiveVolume(), and TPCGeo().

geo::Vector_t geo::TPCGeo::fDriftDir
private

Direction electrons drift along.

Definition at line 733 of file TPCGeo.h.

Referenced by DriftDir(), and ResetDriftDirection().

DriftDirection_t geo::TPCGeo::fDriftDirection
private

Direction of the electron drift in the TPC.

Definition at line 718 of file TPCGeo.h.

Referenced by DriftDirection(), and ResetDriftDirection().

double geo::TPCGeo::fHalfHeight
private

Half height of total volume.

Definition at line 727 of file TPCGeo.h.

Referenced by HalfHeight(), and TPCGeo().

double geo::TPCGeo::fHalfWidth
private

Half width of total volume.

Definition at line 726 of file TPCGeo.h.

Referenced by HalfWidth(), and TPCGeo().

geo::Vector_t geo::TPCGeo::fHeightDir
private

Direction height refers to.

Definition at line 731 of file TPCGeo.h.

Referenced by HeightDir(), and TPCGeo().

geo::TPCID geo::TPCGeo::fID
private

ID of this TPC.

Definition at line 737 of file TPCGeo.h.

Referenced by ID(), and UpdateAfterSorting().

double geo::TPCGeo::fLength
private

Length of total volume.

Definition at line 728 of file TPCGeo.h.

Referenced by HalfLength(), Length(), and TPCGeo().

geo::Vector_t geo::TPCGeo::fLengthDir
private

Direction length refers to.

Definition at line 732 of file TPCGeo.h.

Referenced by LengthDir(), and TPCGeo().

std::vector<double> geo::TPCGeo::fPlane0Pitch
private

Pitch between planes.

Definition at line 719 of file TPCGeo.h.

Referenced by Plane0Pitch(), PlanePitch(), and UpdatePlaneCache().

std::vector< std::vector<double> > geo::TPCGeo::fPlaneLocation
private

xyz locations of planes in the TPC.

Definition at line 720 of file TPCGeo.h.

Referenced by PlaneLocation(), and UpdatePlaneCache().

TGeoVolume* geo::TPCGeo::fTotalVolume
private

Total volume of TPC, called volTPC in GDML file.

Definition at line 717 of file TPCGeo.h.

Referenced by TotalVolume(), and TPCGeo().

LocalTransformation_t geo::TPCGeo::fTrans
private

TPC-to-world transformation.

Definition at line 713 of file TPCGeo.h.

Referenced by LocalToWorld(), LocalToWorldVect(), toLocalCoords(), toWorldCoords(), TPCGeo(), WorldToLocal(), and WorldToLocalVect().

std::vector<geo::PlaneID::PlaneID_t> geo::TPCGeo::fViewToPlaneNumber
private

Index of the plane for each view (InvalidID if none).

Definition at line 740 of file TPCGeo.h.

Referenced by Plane(), SortSubVolumes(), and UpdatePlaneViewCache().

geo::Vector_t geo::TPCGeo::fWidthDir
private

Direction width refers to.

Definition at line 730 of file TPCGeo.h.

Referenced by TPCGeo(), and WidthDir().

constexpr unsigned int geo::TPCGeo::MaxVerbosity = 6
static

Maximum verbosity supported by PrintTPCInfo().

Definition at line 677 of file TPCGeo.h.

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


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