LArSoft  v06_85_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 GeoNodePath_t = geo::WireGeo::GeoNodePath_t
 
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 (GeoNodePath_t &path, size_t depth)
 
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...
 
template<typename Point = DefaultPoint_t>
Point ProjectionReferencePoint () const
 Returns the reference point used by PointProjection(). More...
 
template<typename Point = DefaultPoint_t>
Point ComposePoint (DecomposedVector_t const &decomp) const
 Returns the 3D vector from composition of projection and distance. More...
 
template<typename Point = DefaultPoint_t>
Point ComposePoint (double distance, Projection_t const &proj) const
 Returns the 3D point from composition of projection and distance. 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...
 
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 = DefaultVector_t>
decltype(auto) WidthDir () const
 Returns the direction Width() is measured on. More...
 
template<typename Vector = DefaultVector_t>
decltype(auto) HeightDir () const
 Returns the direction Height() is measured on. More...
 
template<typename Vector = DefaultVector_t>
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 = DefaultVector_t>
Vector 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...
 
TPC geometry properties
template<typename Point = DefaultPoint_t>
Point GetCenter () const
 Returns the center of the TPC volume in world coordinates [cm]. More...
 
template<typename Point = DefaultPoint_t>
Point GetActiveVolumeCenter () const
 Returns the center of the TPC active volume in world coordinates [cm]. More...
 
template<typename Point = DefaultPoint_t>
Point GetCathodeCenter () const
 
template<typename Point = geo::Point_t>
Point 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
 Returns the coordinates of the center of the specified plane [cm]. More...
 
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 = DefaultPoint_t>
Vector RefWidthDir () const
 Return the direction of reference plane width. More...
 
template<typename Vector = DefaultPoint_t>
Vector 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 plane used for reference by projection methods. 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...
 
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...
 
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...
 
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< TGeoHMatrix, 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 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...
 
std::vector< PlaneGeofPlanes
 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 37 of file TPCGeo.h.

Member Typedef Documentation

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

Type of the coordinate.

Definition at line 38 of file BoxBoundedGeo.h.

Type of the coordinate triplet.

Definition at line 37 of file BoxBoundedGeo.h.

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

Definition at line 76 of file TPCGeo.h.

using geo::TPCGeo::DefaultPoint_t = TVector3
private

Definition at line 40 of file TPCGeo.h.

using geo::TPCGeo::DefaultVector_t = TVector3
private

Definition at line 39 of file TPCGeo.h.

Type of points in the local GDML TPC frame.

Definition at line 65 of file TPCGeo.h.

Definition at line 628 of file TPCGeo.h.

Type of displacement vectors in the local GDML TPC frame.

Definition at line 68 of file TPCGeo.h.

Type of 2D vector projection on a plane.

Definition at line 73 of file TPCGeo.h.

Constructor & Destructor Documentation

geo::TPCGeo::TPCGeo ( GeoNodePath_t path,
size_t  depth 
)

Definition at line 37 of file TPCGeo.cxx.

References fActiveCenter, fActiveHalfHeight, fActiveHalfWidth, fActiveLength, fActiveVolume, fHalfHeight, fHalfWidth, fHeightDir, FindPlane(), fLength, fLengthDir, fTotalVolume, fTrans, fWidthDir, InitTPCBoundaries(), LOG_DEBUG, geo::LocalTransformation< StoredMatrix >::Matrix(), ResetDriftDirection(), geo::Xaxis(), geo::Yaxis(), and geo::Zaxis().

38  : BoxBoundedGeo() // we initialize boundaries at the end of construction
39  , fTrans(path, depth)
40  , fActiveVolume(0)
41  , fTotalVolume(0)
43  , fWidthDir (geo::Xaxis())
46  , fDriftDir() // null until known
47  {
48 
49  // all planes are going to be contained in the volume named volTPC
50  // now get the total volume of the TPC
51  TGeoVolume *vc = path[depth]->GetVolume();
52  if(!vc){
53  throw cet::exception("Geometry") << "cannot find detector outline volume - bail ungracefully\n";
54  }
55 
56  fTotalVolume = vc;
57 
58  // loop over the daughters of this node and look for the active volume
59  int nd = vc->GetNdaughters();
60  TGeoNode const* pActiveVolNode = nullptr;
61  for(int i = 0; i < nd; ++i){
62  if(strncmp(vc->GetNode(i)->GetName(), "volTPCActive", 12) != 0) continue;
63 
64  pActiveVolNode = vc->GetNode(i);
65  TGeoVolume *vca = pActiveVolNode->GetVolume();
66  if(vca) fActiveVolume = vca;
67  break;
68 
69  }// end loop over daughters of the volume
70 
72 
73  LOG_DEBUG("Geometry") << "detector total volume is " << fTotalVolume->GetName()
74  << "\ndetector active volume is " << fActiveVolume->GetName();
75 
76  // compute the active volume transformation too
77  TGeoHMatrix ActiveHMatrix(fTrans.Matrix());
78  if (pActiveVolNode) ActiveHMatrix.Multiply(pActiveVolNode->GetMatrix());
79  // we don't keep the active volume information... just store its center:
80  std::array<double, 3> localActiveCenter, worldActiveCenter;
81  localActiveCenter.fill(0.0);
82  ActiveHMatrix.LocalToMaster
83  (localActiveCenter.data(), worldActiveCenter.data());
84  fActiveCenter = geo::vect::makeFromCoords<geo::Point_t>(worldActiveCenter);
85 
86 
87  // find the wires for the plane so that you can use them later
88  this->FindPlane(path, depth);
89 
90  // set the width, height, and lengths
91  fActiveHalfWidth = ((TGeoBBox*)fActiveVolume->GetShape())->GetDX();
92  fActiveHalfHeight = ((TGeoBBox*)fActiveVolume->GetShape())->GetDY();
93  fActiveLength = 2.0*((TGeoBBox*)fActiveVolume->GetShape())->GetDZ();
94 
95  fHalfWidth = ((TGeoBBox*)fTotalVolume->GetShape())->GetDX();
96  fHalfHeight = ((TGeoBBox*)fTotalVolume->GetShape())->GetDY();
97  fLength = 2.0*((TGeoBBox*)fTotalVolume->GetShape())->GetDZ();
98 
99  // check that the rotation matrix to the world is the identity, if not
100  // we need to change the width, height and length values;
101  // the correspondence of these to x, y and z are not guaranteed to be
102  // trivial, so we store the two independently (cartesian dimensions in the
103  // bounding boxes, the sizes in data members directly)
104  double const* rotMatrix = fTrans.Matrix().GetRotationMatrix();
105  if(rotMatrix[0] != 1){
106  if(std::abs(rotMatrix[2]) == 1){
107  fActiveHalfWidth = ((TGeoBBox*)fActiveVolume->GetShape())->GetDZ();
108  fHalfWidth = ((TGeoBBox*)fTotalVolume->GetShape())->GetDZ();
109  fWidthDir = Zaxis();
110  }
111  if(std::abs(rotMatrix[1]) == 1){
112  fActiveHalfWidth = ((TGeoBBox*)fActiveVolume->GetShape())->GetDY();
113  fHalfWidth = ((TGeoBBox*)fTotalVolume->GetShape())->GetDY();
114  fWidthDir = Yaxis();
115  }
116  }
117  if(rotMatrix[4] != 1){
118  if(std::abs(rotMatrix[3]) == 1){
119  fActiveHalfHeight = ((TGeoBBox*)fActiveVolume->GetShape())->GetDX();
120  fHalfHeight = ((TGeoBBox*)fTotalVolume->GetShape())->GetDX();
121  fHeightDir = Xaxis();
122  }
123  if(std::abs(rotMatrix[5]) == 1){
124  fActiveHalfHeight = ((TGeoBBox*)fActiveVolume->GetShape())->GetDZ();
125  fHalfHeight = ((TGeoBBox*)fTotalVolume->GetShape())->GetDZ();
126  fHeightDir = Zaxis();
127  }
128  }
129  if(rotMatrix[8] != 1){
130  if(std::abs(rotMatrix[6]) == 1){
131  fActiveLength = 2.*((TGeoBBox*)fActiveVolume->GetShape())->GetDX();
132  fLength = 2.*((TGeoBBox*)fTotalVolume->GetShape())->GetDX();
133  fLengthDir = Xaxis();
134  }
135  if(std::abs(rotMatrix[7]) == 1){
136  fActiveLength = 2.*((TGeoBBox*)fActiveVolume->GetShape())->GetDY();
137  fLength = 2.*((TGeoBBox*)fTotalVolume->GetShape())->GetDY();
138  fLengthDir = Yaxis();
139  }
140  }
141 
144 
145  } // TPCGeo::TPCGeo()
void InitTPCBoundaries()
Recomputes the TPC boundary.
Definition: TPCGeo.cxx:494
Drift direction is unknown.
Definition: geo_types.h:105
void FindPlane(GeoNodePath_t &path, size_t depth)
Definition: TPCGeo.cxx:148
double fLength
Length of total volume.
Definition: TPCGeo.h:645
double fActiveHalfWidth
Half width of active volume.
Definition: TPCGeo.h:640
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:222
BoxBoundedGeo()=default
Default constructor: sets an empty volume.
geo::Vector_t fHeightDir
Direction height refers to.
Definition: TPCGeo.h:648
geo::Vector_t fWidthDir
Direction width refers to.
Definition: TPCGeo.h:647
double fHalfWidth
Half width of total volume.
Definition: TPCGeo.h:643
double fActiveLength
Length of active volume.
Definition: TPCGeo.h:642
constexpr Vector Xaxis()
Returns a x axis vector of the specified type.
Definition: geo_vectors.h:218
TGeoVolume * fTotalVolume
Total volume of TPC, called volTPC in GDML file.
Definition: TPCGeo.h:634
DriftDirection_t fDriftDirection
Direction of the electron drift in the TPC.
Definition: TPCGeo.h:635
constexpr Vector Zaxis()
Returns a z axis vector of the specified type.
Definition: geo_vectors.h:226
TGeoVolume * fActiveVolume
Active volume of LAr, called volTPCActive in GDML file.
Definition: TPCGeo.h:633
geo::Vector_t fLengthDir
Direction length refers to.
Definition: TPCGeo.h:649
LocalTransformation_t fTrans
TPC-to-world transformation.
Definition: TPCGeo.h:630
void ResetDriftDirection()
Recomputes the drift direction; needs planes to have been initialised.
Definition: TPCGeo.cxx:432
#define LOG_DEBUG(id)
geo::Vector_t fDriftDir
Direction electrons drift along.
Definition: TPCGeo.h:650
geo::Point_t fActiveCenter
Center of the active volume, in world coordinates [cm].
Definition: TPCGeo.h:638
double fHalfHeight
Half height of total volume.
Definition: TPCGeo.h:644
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
double fActiveHalfHeight
Half height of active volume.
Definition: TPCGeo.h:641

Member Function Documentation

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

Returns the box of the active volume of this TPC.

Definition at line 266 of file TPCGeo.h.

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

Referenced by GetFrontFaceCenterImpl(), and PrintTPCInfo().

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

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

Definition at line 91 of file TPCGeo.h.

References fActiveHalfHeight.

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

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

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

Definition at line 97 of file TPCGeo.h.

References fActiveLength.

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

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

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

Definition at line 87 of file TPCGeo.h.

References fActiveHalfWidth.

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

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

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

Definition at line 93 of file TPCGeo.h.

References ActiveHalfHeight().

Referenced by PrintTPCInfo().

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

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

Definition at line 95 of file TPCGeo.h.

References fActiveLength.

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

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

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

Definition at line 110 of file TPCGeo.h.

References fActiveVolume.

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

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

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

Definition at line 111 of file TPCGeo.h.

References fActiveVolume.

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

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

Definition at line 89 of file TPCGeo.h.

References ActiveHalfWidth().

Referenced by PrintTPCInfo().

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

Returns the bounding box of this TPC.

Definition at line 262 of file TPCGeo.h.

Referenced by PrintTPCInfo().

263  { return *this; }
geo::Point_t geo::BoxBoundedGeo::Center ( ) const
inlineinherited

Returns the center point of the box.

Definition at line 141 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().

142  { return { CenterX(), CenterY(), CenterZ() }; }
double CenterX() const
Returns the world x coordinate of the center of the box.
Definition: BoxBoundedGeo.h:96
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 96 of file BoxBoundedGeo.h.

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

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

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

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

Definition at line 111 of file BoxBoundedGeo.h.

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

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

111 { 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 126 of file BoxBoundedGeo.h.

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

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

126 { 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 = DefaultPoint_t>
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 458 of file TPCGeo.h.

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

459  { 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:818
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:299
template<typename Point = DefaultPoint_t>
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 480 of file TPCGeo.h.

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

481  { 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:818
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:299
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 480 of file TPCGeo.cxx.

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

Referenced by DriftDistance().

480  {
481 
482  //
483  // 1. find the center of the face of the TPC opposite to the anode
484  // 2. compute the distance of it from the last wire plane
485  //
486 
487  geo::PlaneGeo const& plane = fPlanes.back();
488  return std::abs(plane.DistanceFromPlane(GetCathodeCenter()));
489 
490  } // TPCGeo::ComputeDriftDistance()
Point GetCathodeCenter() const
Definition: TPCGeo.h:253
std::vector< PlaneGeo > fPlanes
List of planes in this plane.
Definition: TPCGeo.h:632
Geometry information for a single wire plane.The plane is represented in the geometry by a solid whic...
Definition: PlaneGeo.h:78
double DistanceFromPlane(geo::Point_t const &point) const
Returns the distance of the specified point from the wire plane.
Definition: PlaneGeo.h:557
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 207 of file BoxBoundedGeo.h.

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

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

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

Definition at line 18 of file BoxBoundedGeo.cxx.

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

19  { 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 23 of file BoxBoundedGeo.cxx.

References geo::vect::makePointFromCoords().

24  { 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 161 of file BoxBoundedGeo.h.

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

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

162  { 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:90
double MaxX() const
Returns the world x coordinate of the end of the box.
Definition: BoxBoundedGeo.h:93
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 171 of file BoxBoundedGeo.h.

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

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

172  { 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 192 of file BoxBoundedGeo.h.

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

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

193  { 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 181 of file BoxBoundedGeo.h.

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

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

182  { 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 610 of file TPCGeo.h.

Referenced by CoordinateContained().

611  {
612  return (c >= (min > 0? min / wiggle: min * wiggle))
613  && (c <= (max < 0? max / wiggle: max * wiggle));
614  } // 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 617 of file TPCGeo.h.

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

618  { 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:610
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 384 of file TPCGeo.h.

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

Referenced by DecomposePoint().

385  { return ReferencePlane().DecomposePointWidthDepth(point); }
geo::PlaneGeo const & ReferencePlane() const
Returns the plane used for reference by projection methods.
Definition: TPCGeo.h:299
WDDecomposedVector_t DecomposePointWidthDepth(geo::Point_t const &point) const
Decomposes a 3D point in two components.
Definition: PlaneGeo.h:878
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 386 of file TPCGeo.h.

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

387  { 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:384
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 181 of file TPCGeo.cxx.

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

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

181  {
182 
183  //
184  // 1. determine the drift axis
185  // 2. determine the drift direction on it
186  //
187  // We assume that all the planes cover most of the TPC face; therefore,
188  // the centre of the plane and the one of the TPC should be very close
189  // to each other, when projected on the same drift plane.
190  // Here we find which is the largest coordinate difference.
191 
192  if (Nplanes() == 0) {
193  // chances are that we get this because stuff is not initialised yet,
194  // and then even the ID might be wrong
195  throw cet::exception("TPCGeo")
196  << "DetectDriftDirection(): no planes in TPC " << std::string(ID())
197  << "\n";
198  }
199 
200  auto const TPCcenter = GetCenter();
201  auto const PlaneCenter = Plane(0).GetBoxCenter(); // any will do
202 
203  auto const driftVector = PlaneCenter - TPCcenter; // approximation!
204 
205  if ((std::abs(driftVector.X()) > std::abs(driftVector.Y()))
206  && (std::abs(driftVector.X()) > std::abs(driftVector.Z())))
207  {
208  // x is the solution
209  return (driftVector.X() > 0)? +1: -1;
210  }
211  else if (std::abs(driftVector.Y()) > std::abs(driftVector.Z()))
212  {
213  // y is the man
214  return (driftVector.Y() > 0)? +2: -2;
215  }
216  else {
217  // z is the winner
218  return (driftVector.Z() > 0)? +3: -3;
219  }
220 
221  } // TPCGeo::DetectDriftDirection()
geo::TPCID const & ID() const
Returns the identifier of this TPC.
Definition: TPCGeo.h:278
unsigned int Nplanes() const
Number of planes in this tpc.
Definition: TPCGeo.h:145
Point GetBoxCenter() const
Returns the centre of the box representing the plane.
Definition: PlaneGeo.h:441
PlaneGeo const & Plane(geo::View_t view) const
Return the plane in the tpc with View_t view.
Definition: TPCGeo.cxx:298
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:693
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 343 of file TPCGeo.h.

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

Referenced by DistanceFromReferencePlane().

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

Returns the plane used for reference by projection methods.

Definition at line 345 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:343
::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 687 of file TPCGeo.h.

References fDriftDir.

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

688  { return geo::vect::convertTo<Vector>(fDriftDir); }
geo::Vector_t fDriftDir
Direction electrons drift along.
Definition: TPCGeo.h:650
DriftDirection_t geo::TPCGeo::DriftDirection ( ) const
inline

Returns an enumerator value describing the drift direction.

Definition at line 127 of file TPCGeo.h.

References DriftDir(), and fDriftDirection.

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

127 { return fDriftDirection; }
DriftDirection_t fDriftDirection
Direction of the electron drift in the TPC.
Definition: TPCGeo.h:635
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 135 of file TPCGeo.h.

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

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

135 { return ComputeDriftDistance(); }
double ComputeDriftDistance() const
Definition: TPCGeo.cxx:480
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 360 of file TPCGeo.h.

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

361  { 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:579
geo::PlaneGeo const & ReferencePlane() const
Returns the plane used for reference by projection methods.
Definition: TPCGeo.h:299
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 362 of file TPCGeo.h.

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

363  { 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:579
geo::PlaneGeo const & ReferencePlane() const
Returns the plane used for reference by projection methods.
Definition: TPCGeo.h:299
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 392 of file BoxBoundedGeo.h.

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

393  { 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:187
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 399 of file BoxBoundedGeo.h.

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

400  {
401  set_min(c_min, point);
402  set_max(c_max, point);
403  }
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 411 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().

412  {
413  set_min(c_min, box.Min());
414  set_max(c_max, box.Max());
415  } // 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

Definition at line 148 of file TPCGeo.cxx.

References MakePlane().

Referenced by CoordinateContained(), and TPCGeo().

149  {
150 
151  const char* nm = path[depth]->GetName();
152  if( (strncmp(nm, "volTPCPlane", 11) == 0) ){
153  this->MakePlane(path,depth);
154  return;
155  }
156 
157  //explore the next layer down
158  unsigned int deeper = depth+1;
159  if(deeper >= path.size()){
160  throw cet::exception("BadTGeoNode") << "exceeded maximum TGeoNode depth\n";
161  }
162 
163  const TGeoVolume *v = path[depth]->GetVolume();
164  int nd = v->GetNdaughters();
165  for(int i = 0; i < nd; ++i){
166  path[deeper] = v->GetNode(i);
167  this->FindPlane(path, deeper);
168  }
169 
170  }
void MakePlane(GeoNodePath_t &path, size_t depth)
Definition: TPCGeo.cxx:174
void FindPlane(GeoNodePath_t &path, size_t depth)
Definition: TPCGeo.cxx:148
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
geo::PlaneGeo const& geo::TPCGeo::FirstPlane ( ) const
inline

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

Definition at line 225 of file TPCGeo.h.

References fPlanes.

Referenced by ReferencePlane().

225 { return fPlanes[0]; }
std::vector< PlaneGeo > fPlanes
List of planes in this plane.
Definition: TPCGeo.h:632
template<typename Point = DefaultPoint_t>
Point geo::TPCGeo::GetActiveVolumeCenter ( ) const
inline

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

Definition at line 247 of file TPCGeo.h.

References fActiveCenter.

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

248  { return geo::vect::convertTo<Point>(fActiveCenter); }
geo::Point_t fActiveCenter
Center of the active volume, in world coordinates [cm].
Definition: TPCGeo.h:638
template<typename Point = DefaultPoint_t>
Point geo::TPCGeo::GetCathodeCenter ( ) const
inline

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

Definition at line 253 of file TPCGeo.h.

References GetCathodeCenterImpl().

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

254  { return geo::vect::convertTo<Point>(GetCathodeCenterImpl()); }
geo::Point_t GetCathodeCenterImpl() const
Definition: TPCGeo.cxx:360
geo::Point_t geo::TPCGeo::GetCathodeCenterImpl ( ) const
private

Definition at line 360 of file TPCGeo.cxx.

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

Referenced by GetCathodeCenter().

360  {
361 
362  //
363  // 1. find the center of the face of the TPC opposite to the anode
364  // 2. compute the distance of it from the last wire plane
365  //
366 
367  //
368  // find the cathode center
369  //
370  geo::Point_t cathodeCenter = GetActiveVolumeCenter<geo::Point_t>();
371  switch (DetectDriftDirection()) {
372  case -1:
373  geo::vect::Xcoord(cathodeCenter) += ActiveHalfWidth();
374  // cathodeCenter.SetX(cathodeCenter.X() + ActiveHalfWidth());
375  break;
376  case +1:
377  cathodeCenter.SetX(cathodeCenter.X() - ActiveHalfWidth());
378  break;
379  case -2:
380  cathodeCenter.SetY(cathodeCenter.Y() + ActiveHalfHeight());
381  break;
382  case +2:
383  cathodeCenter.SetY(cathodeCenter.Y() - ActiveHalfHeight());
384  break;
385  case -3:
386  cathodeCenter.SetZ(cathodeCenter.Z() + ActiveLength() / 2.0);
387  break;
388  case +3:
389  cathodeCenter.SetZ(cathodeCenter.Z() - ActiveLength() / 2.0);
390  break;
391  case 0:
392  default:
393  // in this case, a better algorithm is probably needed
394  throw cet::exception("TPCGeo")
395  << "CathodeCenter(): Can't determine the cathode plane (code="
396  << DetectDriftDirection() << ")\n";
397  } // switch
398  return cathodeCenter;
399 
400  } // TPCGeo::GetCathodeCenterImpl()
double ActiveHalfHeight() const
Half height (associated with y coordinate) of active TPC volume [cm].
Definition: TPCGeo.h:91
double ActiveHalfWidth() const
Half width (associated with x coordinate) of active TPC volume [cm].
Definition: TPCGeo.h:87
double ActiveLength() const
Length (associated with z coordinate) of active TPC volume [cm].
Definition: TPCGeo.h:95
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:181
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:187
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 693 of file TPCGeo.h.

References toWorldCoords().

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

693  {
694 
695  // convert the origin (default constructed TVector)
696  return geo::vect::convertTo<Point>(toWorldCoords(LocalPoint_t{ 0.0, 0.0, 0.0 }));
697 
698 } // geo::TPCGeo::GetCenter()
geo::Point3DBase_t< TPCGeoCoordinatesTag > LocalPoint_t
Type of points in the local GDML TPC frame.
Definition: TPCGeo.h:65
geo::Point_t toWorldCoords(LocalPoint_t const &local) const
Transform point from local TPC frame to world frame.
Definition: TPCGeo.h:498
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 194 of file TPCGeo.h.

References Plane().

195  { return Plane(planeid); }
PlaneGeo const & Plane(geo::View_t view) const
Return the plane in the tpc with View_t view.
Definition: TPCGeo.cxx:298
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 217 of file TPCGeo.h.

References PlanePtr(), and SmallestPlane().

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

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

Definition at line 258 of file TPCGeo.h.

References GetFrontFaceCenterImpl().

259  { return geo::vect::convertTo<Point>(GetFrontFaceCenterImpl()); }
geo::Point_t GetFrontFaceCenterImpl() const
Definition: TPCGeo.cxx:404
geo::Point_t geo::TPCGeo::GetFrontFaceCenterImpl ( ) const
private

Definition at line 404 of file TPCGeo.cxx.

References ActiveBoundingBox().

Referenced by GetFrontFaceCenter().

404  {
405  auto const& activeBox = ActiveBoundingBox();
406  return { activeBox.CenterX(), activeBox.CenterY(), activeBox.MinZ() };
407  } // TPCGeo::GetFrontFaceCenterImpl()
geo::BoxBoundedGeo const & ActiveBoundingBox() const
Returns the box of the active volume of this TPC.
Definition: TPCGeo.h:266
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 118 of file BoxBoundedGeo.cxx.

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

119  {
120  std::vector<TVector3> intersections;
121  for (auto const& point: GetIntersections(geo::Point_t(TrajectoryStart), geo::Vector_t(TrajectoryDirect)))
122  intersections.emplace_back(point.X(), point.Y(), point.Z());
123  return intersections;
124  } // 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:167
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:187
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 27 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().

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

References fLength.

Referenced by InitTPCBoundaries().

109 { return fLength / 2.0; }
double fLength
Length of total volume.
Definition: TPCGeo.h:645
double geo::BoxBoundedGeo::HalfSizeX ( ) const
inlineinherited

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

Definition at line 102 of file BoxBoundedGeo.h.

References geo::BoxBoundedGeo::SizeX().

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

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

Definition at line 117 of file BoxBoundedGeo.h.

References geo::BoxBoundedGeo::SizeY().

117 { 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 132 of file BoxBoundedGeo.h.

References geo::BoxBoundedGeo::SizeZ().

132 { 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 156 of file TPCGeo.h.

References HasPlane().

156 { return HasPlane(iplane); }
bool HasPlane(unsigned int iplane) const
Returns whether a plane with index iplane is present in this TPC.
Definition: TPCGeo.h:155
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 170 of file TPCGeo.h.

References HasPlane(), and Plane().

171  { return HasPlane(planeid); }
bool HasPlane(unsigned int iplane) const
Returns whether a plane with index iplane is present in this TPC.
Definition: TPCGeo.h:155
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 155 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().

155 { return iplane < Nplanes(); }
unsigned int Nplanes() const
Number of planes in this tpc.
Definition: TPCGeo.h:145
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 168 of file TPCGeo.h.

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

169  { 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:155
double geo::TPCGeo::Height ( ) const
inline

Height is associated with y coordinate [cm].

Definition at line 105 of file TPCGeo.h.

References HalfHeight().

Referenced by PrintTPCInfo().

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

Returns the direction Height() is measured on.

Definition at line 120 of file TPCGeo.h.

References fHeightDir.

120 { return geo::vect::convertTo<Vector>(fHeightDir); }
geo::Vector_t fHeightDir
Direction height refers to.
Definition: TPCGeo.h:648
geo::TPCID const& geo::TPCGeo::ID ( ) const
inline

Returns the identifier of this TPC.

Definition at line 278 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().

278 { return fID; }
geo::TPCID fID
ID of this TPC.
Definition: TPCGeo.h:654
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 243 of file BoxBoundedGeo.h.

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

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

244  {
245  return CoordinateContained(x, MinX() + neg_margin, MaxX() - pos_margin);
246  }
Float_t x
Definition: compare.C:6
double MinX() const
Returns the world x coordinate of the start of the box.
Definition: BoxBoundedGeo.h:90
double MaxX() const
Returns the world x coordinate of the end of the box.
Definition: BoxBoundedGeo.h:93
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 253 of file BoxBoundedGeo.h.

References geo::BoxBoundedGeo::InFiducialX().

254  { 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 274 of file BoxBoundedGeo.h.

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

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

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

References geo::BoxBoundedGeo::InFiducialY().

285  { 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 305 of file BoxBoundedGeo.h.

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

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

306  {
307  return CoordinateContained(z, MinZ() + neg_margin, MaxZ() - pos_margin);
308  }
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 315 of file BoxBoundedGeo.h.

References geo::BoxBoundedGeo::CoordinateContained(), and geo::BoxBoundedGeo::InFiducialZ().

316  { 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 494 of file TPCGeo.cxx.

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

Referenced by TPCGeo().

494  {
495  // note that this assumes no rotations of the TPC
496  // (except for rotations of a flat angle around one of the three main axes);
497  // to avoid this, we should transform the six vertices
498  // rather than just the centre
499 
500  // we rely on the asumption that the center of TPC is at the local origin
504  );
505 
506  // the center of the active volume may be elsewhere than the local origin:
507  auto const& activeCenter = GetActiveVolumeCenter<geo::Point_t>();
509  activeCenter.X() - ActiveHalfWidth(), activeCenter.X() + ActiveHalfWidth(),
510  activeCenter.Y() - ActiveHalfHeight(), activeCenter.Y() + ActiveHalfHeight(),
511  activeCenter.Z() - ActiveHalfLength(), activeCenter.Z() + ActiveHalfLength()
512  );
513 
514 
515  } // CryostatGeo::InitTPCBoundaries()
geo::BoxBoundedGeo fActiveBox
Box of the active volume.
Definition: TPCGeo.h:652
geo::Point3DBase_t< TPCGeoCoordinatesTag > LocalPoint_t
Type of points in the local GDML TPC frame.
Definition: TPCGeo.h:65
double ActiveHalfHeight() const
Half height (associated with y coordinate) of active TPC volume [cm].
Definition: TPCGeo.h:91
double HalfLength() const
Length is associated with z coordinate [cm].
Definition: TPCGeo.h:109
geo::Point_t toWorldCoords(LocalPoint_t const &local) const
Transform point from local TPC frame to world frame.
Definition: TPCGeo.h:498
double ActiveHalfLength() const
Length (associated with z coordinate) of active TPC volume [cm].
Definition: TPCGeo.h:97
double ActiveHalfWidth() const
Half width (associated with x coordinate) of active TPC volume [cm].
Definition: TPCGeo.h:87
double HalfHeight() const
Height is associated with y coordinate [cm].
Definition: TPCGeo.h:103
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:99
geo::PlaneGeo const& geo::TPCGeo::LastPlane ( ) const
inline

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

Definition at line 228 of file TPCGeo.h.

References fPlanes, GetCenter(), MaxWires(), Nplanes(), and Views().

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

228 { return fPlanes[Nplanes() - 1]; }
unsigned int Nplanes() const
Number of planes in this tpc.
Definition: TPCGeo.h:145
std::vector< PlaneGeo > fPlanes
List of planes in this plane.
Definition: TPCGeo.h:632
double geo::TPCGeo::Length ( ) const
inline
template<typename Vector = DefaultVector_t>
decltype(auto) geo::TPCGeo::LengthDir ( ) const
inline

Returns the direction Length() is measured on.

Definition at line 124 of file TPCGeo.h.

References fLengthDir.

124 { return geo::vect::convertTo<Vector>(fLengthDir); }
geo::Vector_t fLengthDir
Direction length refers to.
Definition: TPCGeo.h:649
void geo::TPCGeo::LocalToWorld ( const double *  tpc,
double *  world 
) const
inline
TVector3 geo::TPCGeo::LocalToWorld ( const TVector3 &  local) const
inline

Transform point from local TPC frame to world frame.

Definition at line 494 of file TPCGeo.h.

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

495  { 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:630
void geo::TPCGeo::LocalToWorldVect ( const double *  tpc,
double *  world 
) const
inline

Transform direction vector from local to world.

Definition at line 502 of file TPCGeo.h.

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

503  { 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:630
TVector3 geo::TPCGeo::LocalToWorldVect ( const TVector3 &  local) const
inline

Transform direction vector from local to world.

Definition at line 506 of file TPCGeo.h.

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

507  { 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:630
void geo::TPCGeo::MakePlane ( GeoNodePath_t path,
size_t  depth 
)
private

Definition at line 174 of file TPCGeo.cxx.

References fPlanes.

Referenced by CoordinateContained(), and FindPlane().

175  {
176  fPlanes.emplace_back(path, depth);
177  }
std::vector< PlaneGeo > fPlanes
List of planes in this plane.
Definition: TPCGeo.h:632
geo::Point_t geo::BoxBoundedGeo::Max ( ) const
inlineinherited

Returns the corner point with the largest coordinates.

Definition at line 138 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().

138 { 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 332 of file TPCGeo.cxx.

References fPlanes.

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

332  {
333  unsigned int maxWires = 0;
334  for (geo::PlaneGeo const& plane: fPlanes) {
335  unsigned int maxWiresInPlane = plane.Nwires();
336  if (maxWiresInPlane > maxWires) maxWires = maxWiresInPlane;
337  } // for
338  return maxWires;
339  } // TPCGeo::MaxWires()
std::vector< PlaneGeo > fPlanes
List of planes in this plane.
Definition: TPCGeo.h:632
Geometry information for a single wire plane.The plane is represented in the geometry by a solid whic...
Definition: PlaneGeo.h:78
geo::Point_t geo::BoxBoundedGeo::Min ( ) const
inlineinherited

Returns the corner point with the smallest coordinates.

Definition at line 135 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().

135 { 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 146 of file TPCGeo.h.

References fPlanes.

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

146 { return fPlanes.size(); }
std::vector< PlaneGeo > fPlanes
List of planes in this plane.
Definition: TPCGeo.h:632
unsigned int geo::TPCGeo::Nplanes ( ) const
inline

Number of planes in this tpc.

Definition at line 145 of file TPCGeo.h.

Referenced by calo::LinearEnergyAlg::CalculateEnergy(), util::DetectorPropertiesServiceArgoNeuT::CalculateXTicksParams(), detinfo::DetectorPropertiesStandard::CalculateXTicksParams(), DetectDriftDirection(), hit::DisambigCheater::DisambigCheater(), DriftDistance(), larg4::LArVoxelReadout::DriftIonizationElectrons(), trkf::SpacePointAlg::fillComplexSpacePoint(), tca::FillWireHitRange(), vertex::FeatureVertexFinder::Find2dClusterVertexCandidates(), tca::FindShowers3D(), trkf::BezierTrack::GetProjectedPointUVWT(), trkf::BezierTrack::GetProjectedPointUVWX(), trkf::BezierTrack::GetTrackPitch(), groupByDriftCoordinate(), HasPlane(), geo::ChannelMapStandardAlg::Initialize(), LastPlane(), trkf::SpacePointAlg::makeSpacePoints(), tca::TruthMatcher::MatchTruth(), geo::CryostatGeo::MaxPlanes(), tca::MergePFPTjs(), geo::GeometryCore::Print(), PrintTPCInfo(), detsim::SimDriftElectrons::produce(), vertex::FeatureVertexFinder::produce(), cluster::ClusterCrawlerAlg::RunCrawler(), tca::TrajClusterAlg::RunTrajClusterAlg(), SortSubVolumes(), trkf::CosmicTrackerAlg::TrackTrajectory(), trkf::SpacePointAlg::update(), UpdateAfterSorting(), UpdatePlaneViewCache(), pma::Node3D::UpdateProj2D(), trkf::VertexFitAlg::VertexFit(), cluster::ClusterCrawlerAlg::VtxMatch(), and geo::GeometryCore::WireAngleToVertical().

145 { return fPlanes.size(); }
std::vector< PlaneGeo > fPlanes
List of planes in this plane.
Definition: TPCGeo.h:632
const PlaneGeo & geo::TPCGeo::Plane ( geo::View_t  view) const

Return the plane in the tpc with View_t view.

Definition at line 298 of file TPCGeo.cxx.

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

Referenced by hit::MagDriftAna::analyze(), 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(), trkf::BezierTrack::GetTrackPitch(), lar_pandora::PFParticleHitDumper::GetUVW(), HasElement(), geo::ChannelMapStandardAlg::Initialize(), lar_pandora::LArPandoraGeometry::LoadGeometry(), trkf::SpacePointAlg::makeSpacePoints(), Plane(), geo::GeometryCore::Print(), cluster::ClusterCheater::produce(), vertex::HarrisVertexFinder::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().

299  {
300  geo::PlaneID::PlaneID_t const p = fViewToPlaneNumber[size_t(view)];
301  if (p == geo::PlaneID::InvalidID) {
302  throw cet::exception("TPCGeo")
303  << "TPCGeo[" << ((void*) this) << "]::Plane(): no plane for view #"
304  << (size_t) view << "\n";
305  }
306  return fPlanes[p];
307  } // TPCGeo::Plane(geo::View_t)
std::vector< geo::PlaneID::PlaneID_t > fViewToPlaneNumber
Index of the plane for each view (InvalidID if none).
Definition: TPCGeo.h:657
std::vector< PlaneGeo > fPlanes
List of planes in this plane.
Definition: TPCGeo.h:632
unsigned int PlaneID_t
Type for the ID number.
Definition: geo_types.h:251
static const PlaneID_t InvalidID
Special code for an invalid ID.
Definition: geo_types.h:255
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 287 of file TPCGeo.cxx.

References PlanePtr().

288  {
289  geo::PlaneGeo const* pPlane = PlanePtr(iplane);
290  if (!pPlane){
291  throw cet::exception("PlaneOutOfRange") << "Request for non-existant plane " << iplane << "\n";
292  }
293 
294  return *pPlane;
295  }
Geometry information for a single wire plane.The plane is represented in the geometry by a solid whic...
Definition: PlaneGeo.h:78
PlaneGeo const * PlanePtr(unsigned int iplane) const
Returns the plane number iplane from this TPC.
Definition: TPCGeo.h:203
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 192 of file TPCGeo.h.

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

193  { 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:298
double geo::TPCGeo::Plane0Pitch ( unsigned int  p) const

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

Definition at line 354 of file TPCGeo.cxx.

References fPlane0Pitch.

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

355  {
356  return fPlane0Pitch[p];
357  }
std::vector< double > fPlane0Pitch
Pitch between planes.
Definition: TPCGeo.h:636
const double * geo::TPCGeo::PlaneLocation ( unsigned int  p) const

Returns the coordinates of the center of the specified plane [cm].

Definition at line 412 of file TPCGeo.cxx.

References fPlaneLocation.

Referenced by ActiveBoundingBox(), util::DetectorPropertiesServiceArgoNeuT::CalculateXTicksParams(), detinfo::DetectorPropertiesStandard::CalculateXTicksParams(), larg4::LArVoxelReadout::DriftIonizationElectrons(), pma::PMAlgStitching::GetTPCXOffsets(), detsim::SimDriftElectrons::produce(), DUNE::NeutrinoTrackingEff::truthLength(), and trkf::SpacePointAlg::update().

413  {
414  return &fPlaneLocation[p][0];
415  }
std::vector< std::vector< double > > fPlaneLocation
xyz locations of planes in the TPC.
Definition: TPCGeo.h:637
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 418 of file TPCGeo.cxx.

References fPlane0Pitch.

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

420  {
421  return std::abs(fPlane0Pitch[p2] - fPlane0Pitch[p1]);
422  }
std::vector< double > fPlane0Pitch
Pitch between planes.
Definition: TPCGeo.h:636
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 203 of file TPCGeo.h.

References fPlanes, and HasPlane().

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

204  { 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:155
std::vector< PlaneGeo > fPlanes
List of planes in this plane.
Definition: TPCGeo.h:632
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 215 of file TPCGeo.h.

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

216  { return PlanePtr(planeid.Plane); }
PlaneGeo const * PlanePtr(unsigned int iplane) const
Returns the plane number iplane from this TPC.
Definition: TPCGeo.h:203
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 417 of file TPCGeo.h.

References Projection().

418  { 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:415
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 419 of file TPCGeo.h.

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

420  { 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:415
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 703 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(), and toLocalCoords().

707  {
708 
709  //----------------------------------------------------------------------------
710  out << "TPC " << std::string(ID());
711 
712  if (verbosity-- <= 0) return; // 0
713 
714  //----------------------------------------------------------------------------
715  out
716  << " (" << Width() << " x " << Height() << " x " << Length() << ") cm^3 at "
717  << GetCenter<geo::Point_t>();
718 
719  if (verbosity-- <= 0) return; // 1
720 
721  //----------------------------------------------------------------------------
722 
723  out << "\n" << indent
724  << "drift direction " << DriftDir<geo::Vector_t>()
725  << " from cathode around " << GetCathodeCenter<geo::Point_t>()
726  << " through " << DriftDistance() << " cm toward "
727  << Nplanes() << " wire planes"
728  ;
729 
730  if (verbosity-- <= 0) return; // 2
731 
732  //----------------------------------------------------------------------------
733  out << "\n" << indent
734  << "maximum wires on any plane: " << MaxWires();
735 
736  if (verbosity-- <= 0) return; // 3
737 
738  //----------------------------------------------------------------------------
739  out << "\n" << indent
740  << "active volume ("
741  << ActiveWidth() << " x " << ActiveHeight() << " x " << ActiveLength()
742  << ") cm^3, front face at " << GetFrontFaceCenter<geo::Point_t>()
743  << " cm;"
744  << "\n" << indent << "main directions:"
745  << " width " << WidthDir<geo::Vector_t>()
746  << " height " << HeightDir<geo::Vector_t>()
747  << " length " << LengthDir<geo::Vector_t>()
748  ;
749 
750  if (verbosity-- <= 0) return; // 4
751 
752  //----------------------------------------------------------------------------
753  // print also the containing box
754  geo::BoxBoundedGeo const& box = BoundingBox();
755  out << "\n" << indent
756  << "bounding box: " << box.Min() << " -- " << box.Max();
757 
758 // if (verbosity-- <= 0) return; // 5
759 
760  //----------------------------------------------------------------------------
761  // print also the active box
762  geo::BoxBoundedGeo const& activeBox = ActiveBoundingBox();
763  out << "\n" << indent
764  << "active volume box: " << activeBox.Min() << " -- " << activeBox.Max();
765 
766 // if (verbosity-- <= 0) return; // 6
767 
768  //----------------------------------------------------------------------------
769 } // geo::TPCGeo::PrintTPCInfo()
geo::TPCID const & ID() const
Returns the identifier of this TPC.
Definition: TPCGeo.h:278
unsigned int Nplanes() const
Number of planes in this tpc.
Definition: TPCGeo.h:145
geo::BoxBoundedGeo const & ActiveBoundingBox() const
Returns the box of the active volume of this TPC.
Definition: TPCGeo.h:266
double Width() const
Width is associated with x coordinate [cm].
Definition: TPCGeo.h:101
double Height() const
Height is associated with y coordinate [cm].
Definition: TPCGeo.h:105
double Length() const
Length is associated with z coordinate [cm].
Definition: TPCGeo.h:107
std::string indent(std::size_t const i)
double ActiveHeight() const
Height (associated with y coordinate) of active TPC volume [cm].
Definition: TPCGeo.h:93
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:332
double ActiveLength() const
Length (associated with z coordinate) of active TPC volume [cm].
Definition: TPCGeo.h:95
double DriftDistance() const
Definition: TPCGeo.h:135
A base class aware of world box coordinatesAn object describing a simple shape can inherit from this ...
Definition: BoxBoundedGeo.h:35
double ActiveWidth() const
Width (associated with x coordinate) of active TPC volume [cm].
Definition: TPCGeo.h:89
geo::BoxBoundedGeo const & BoundingBox() const
Returns the bounding box of this TPC.
Definition: TPCGeo.h:262
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 415 of file TPCGeo.h.

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

Referenced by PointProjection(), and VectorProjection().

416  { 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:897
geo::PlaneGeo const & ReferencePlane() const
Returns the plane used for reference by projection methods.
Definition: TPCGeo.h:299
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 436 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:917
geo::PlaneGeo const & ReferencePlane() const
Returns the plane used for reference by projection methods.
Definition: TPCGeo.h:299
template<typename Point = DefaultPoint_t>
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 398 of file TPCGeo.h.

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

399  { 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:426
geo::PlaneGeo const & ReferencePlane() const
Returns the plane used for reference by projection methods.
Definition: TPCGeo.h:299
template<typename Vector = DefaultPoint_t>
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 329 of file TPCGeo.h.

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

Referenced by geo::buildDriftVolumes().

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

Returns the plane used for reference by projection methods.

Definition at line 299 of file TPCGeo.h.

References FirstPlane().

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

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

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

Definition at line 302 of file TPCGeo.h.

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

303  { return ReferencePlane().ID(); }
geo::PlaneGeo const & ReferencePlane() const
Returns the plane used for reference by projection methods.
Definition: TPCGeo.h:299
geo::PlaneID const & ID() const
Returns the identifier of this plane.
Definition: PlaneGeo.h:190
template<typename Vector = DefaultPoint_t>
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 316 of file TPCGeo.h.

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

Referenced by geo::buildDriftVolumes().

316 { return ReferencePlane().WidthDir<Vector>(); }
geo::PlaneGeo const & ReferencePlane() const
Returns the plane used for reference by projection methods.
Definition: TPCGeo.h:299
Vector WidthDir() const
Return the direction of plane width.
Definition: PlaneGeo.h:207
void geo::TPCGeo::ResetDriftDirection ( )
private

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

Definition at line 432 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().

432  {
433 
434  auto const driftDirCode = DetectDriftDirection();
435  switch (driftDirCode) {
436  case +1:
437  fDriftDirection = geo::kPosX; // this is the same as kPos!
438  fDriftDir = geo::Xaxis();
439  break;
440  case -1:
441  fDriftDirection = geo::kNegX; // this is the same as kNeg!
442  fDriftDir = -geo::Xaxis();
443  break;
444  case +2:
445  fDriftDir = geo::Yaxis();
447  break;
448  case -2:
449  fDriftDir = -geo::Yaxis();
451  break;
452  case +3:
453  fDriftDir = geo::Zaxis();
455  break;
456  case -3:
457  fDriftDir = -geo::Zaxis();
459  break;
460  default:
461  // TPC ID is likely not yet set
463 
464  // we estimate the drift direction roughly from the geometry
466 
467  mf::LogError("TPCGeo")
468  << "Unable to detect drift direction (result: " << driftDirCode
469  << ", drift: ( " << fDriftDir.X() << " ; " << fDriftDir.Y() << " ; "
470  << fDriftDir.Z() << " )";
471  break;
472  } // switch
473 
475 
476  } // 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:105
Drift towards positive values.
Definition: geo_types.h:106
constexpr Vector Yaxis()
Returns a y axis vector of the specified type.
Definition: geo_vectors.h:222
Point GetBoxCenter() const
Returns the centre of the box representing the plane.
Definition: PlaneGeo.h:441
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
Drift towards negative X values.
Definition: geo_types.h:109
constexpr Vector Xaxis()
Returns a x axis vector of the specified type.
Definition: geo_vectors.h:218
DriftDirection_t fDriftDirection
Direction of the electron drift in the TPC.
Definition: TPCGeo.h:635
constexpr Vector Zaxis()
Returns a z axis vector of the specified type.
Definition: geo_vectors.h:226
Drift towards positive X values.
Definition: geo_types.h:108
short int DetectDriftDirection() const
Returns the expected drift direction based on geometry.
Definition: TPCGeo.cxx:181
Drift towards negative values.
Definition: geo_types.h:107
geo::Vector_t fDriftDir
Direction electrons drift along.
Definition: TPCGeo.h:650
PlaneGeo const & Plane(geo::View_t view) const
Return the plane in the tpc with View_t view.
Definition: TPCGeo.cxx:298
Float_t e
Definition: plot.C:34
Point GetCenter() const
Returns the center of the TPC volume in world coordinates [cm].
Definition: TPCGeo.h:693
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 446 of file BoxBoundedGeo.h.

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

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

447  { if (value > var) var = value; }
std::string value(boost::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 458 of file BoxBoundedGeo.h.

459  {
460  if (value.X() > var.X()) var.SetX(value.X());
461  if (value.Y() > var.Y()) var.SetY(value.Y());
462  if (value.Z() > var.Z()) var.SetZ(value.Z());
463  }
std::string value(boost::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 442 of file BoxBoundedGeo.h.

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

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

443  { if (value < var) var = value; }
std::string value(boost::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 450 of file BoxBoundedGeo.h.

451  {
452  if (value.X() < var.X()) var.SetX(value.X());
453  if (value.Y() < var.Y()) var.SetY(value.Y());
454  if (value.Z() < var.Z()) var.SetZ(value.Z());
455  }
std::string value(boost::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 367 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().

372  {
373  c_min.SetXYZ(x_min, y_min, z_min);
374  c_max.SetXYZ(x_max, y_max, z_max);
375  SortCoordinates();
376  }
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 383 of file BoxBoundedGeo.h.

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

384  { 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 99 of file BoxBoundedGeo.h.

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

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

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

Returns the full size in the Y dimension.

Definition at line 114 of file BoxBoundedGeo.h.

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

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

114 { 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 129 of file BoxBoundedGeo.h.

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

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

129 { 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 311 of file TPCGeo.cxx.

References fPlanes.

Referenced by GetElementPtr().

311  {
312 
313  //
314  // Returns the plane with the smallest width x depth. No nonsense here.
315  //
316 
317  auto iPlane = fPlanes.begin(), pend = fPlanes.end();
318  auto smallestPlane = iPlane;
319  double smallestSurface = smallestPlane->Width() * smallestPlane->Depth();
320  while (++iPlane != pend) {
321  double const surface = iPlane->Width() * iPlane->Depth();
322  if (surface > smallestSurface) continue;
323  smallestSurface = surface;
324  smallestPlane = iPlane;
325  } // while
326  return *smallestPlane;
327 
328  } // TPCGeo::SmallestPlane()
std::vector< PlaneGeo > fPlanes
List of planes in this plane.
Definition: TPCGeo.h:632
void geo::TPCGeo::SortPlanes ( std::vector< geo::PlaneGeo > &  planes) const
private

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

Definition at line 535 of file TPCGeo.cxx.

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

Referenced by SortSubVolumes().

535  {
536  //
537  // Sort planes by increasing drift distance.
538  //
539  // This function should work in bootstrap mode, relying on least things as
540  // possible. Therefore we compute here a proxy of the drift axis.
541  //
542 
543  //
544  // determine the drift axis (or close to): from TPC center to plane center
545  //
546 
547  // Instead of using the plane center, which might be not available yet,
548  // we use the plane box center, which only needs the geometry description
549  // to be available.
550  // We use the first plane -- it does not make any difference.
551  decltype(auto) TPCcenter = GetCenter();
552  auto driftAxis
553  = geo::vect::normalize(planes[0].GetBoxCenter() - TPCcenter);
554 
555  //
556  // associate each plane with its distance from the center of TPC
557  //
558  decltype(auto) center = GetCenter();
559  // pair: <plane pointer,drift distance>
560  std::vector<std::pair<geo::PlaneGeo*, double>> planesWithDistance;
561  planesWithDistance.reserve(planes.size());
562  for (geo::PlaneGeo& plane: planes) {
563  double const driftDistance
564  = geo::vect::dot(plane.GetBoxCenter() - TPCcenter, driftAxis);
565  planesWithDistance.emplace_back(&plane, driftDistance);
566  } // for
567 
568  //
569  // sort by distance
570  //
571  std::sort(planesWithDistance.begin(), planesWithDistance.end(),
572  [](auto const& a, auto const& b){ return a.second < b.second; }
573  );
574 
575  //
576  // extract the result
577  //
578  std::vector<geo::PlaneGeo> sortedPlanes;
579  sortedPlanes.reserve(planesWithDistance.size());
580  for (auto const& pair: planesWithDistance)
581  sortedPlanes.push_back(std::move(*(pair.first)));
582 
583  planes = std::move(sortedPlanes);
584 
585  } // TPCGeo::SortPlanes()
constexpr auto dot(Vector const &a, Vector const &b)
Return cross product of two vectors.
STL namespace.
for(int i=0;i< 401;i++)
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:265
Vector normalize(Vector const &v)
Returns a vector parallel to v and with norm 1.
Namespace collecting geometry-related classes utilities.
Point GetCenter() const
Returns the center of the TPC volume in world coordinates [cm].
Definition: TPCGeo.h:693
void geo::TPCGeo::SortSubVolumes ( geo::GeoObjectSorter const &  sorter)

Apply sorting to the PlaneGeo objects.

Definition at line 225 of file TPCGeo.cxx.

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

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

226  {
228 
229  double origin[3] = {0.};
230 
231  // set the plane pitch for this TPC
232  double xyz[3] = {0.};
233  fPlanes[0].LocalToWorld(origin,xyz);
234  double xyz1[3] = {0.};
235  fPlaneLocation.clear();
236  fPlaneLocation.resize(fPlanes.size());
237  for(unsigned int i = 0; i < fPlaneLocation.size(); ++i) fPlaneLocation[i].resize(3);
238  fPlane0Pitch.clear();
239  fPlane0Pitch.resize(this->Nplanes(), 0.);
240  for(size_t p = 0; p < this->Nplanes(); ++p){
241  fPlanes[p].LocalToWorld(origin,xyz1);
242  if(p > 0) fPlane0Pitch[p] = fPlane0Pitch[p-1] + std::abs(xyz1[0]-xyz[0]);
243  else fPlane0Pitch[p] = 0.;
244  xyz[0] = xyz1[0];
245  fPlaneLocation[p][0] = xyz1[0];
246  fPlaneLocation[p][1] = xyz1[1];
247  fPlaneLocation[p][2] = xyz1[2];
248  }
249 
250  // the PlaneID_t cast convert InvalidID into a rvalue (non-reference);
251  // leaving it a reference would cause C++ to treat it as such,
252  // that can't be because InvalidID is a static member constant without an address
253  // (it is not defined in any translation unit, just declared in header)
254  fViewToPlaneNumber.resize
256  for(size_t p = 0; p < this->Nplanes(); ++p)
257  fViewToPlaneNumber[(size_t) fPlanes[p].View()] = p;
258 
259  for(size_t p = 0; p < fPlanes.size(); ++p) fPlanes[p].SortWires(sorter);
260 
261  }
std::vector< double > fPlane0Pitch
Pitch between planes.
Definition: TPCGeo.h:636
Unknown view.
Definition: geo_types.h:83
unsigned int Nplanes() const
Number of planes in this tpc.
Definition: TPCGeo.h:145
std::vector< geo::PlaneID::PlaneID_t > fViewToPlaneNumber
Index of the plane for each view (InvalidID if none).
Definition: TPCGeo.h:657
std::vector< PlaneGeo > fPlanes
List of planes in this plane.
Definition: TPCGeo.h:632
unsigned int PlaneID_t
Type for the ID number.
Definition: geo_types.h:251
void SortPlanes(std::vector< geo::PlaneGeo > &) const
Sorts (in place) the specified PlaneGeo objects by drift distance.
Definition: TPCGeo.cxx:535
std::vector< std::vector< double > > fPlaneLocation
xyz locations of planes in the TPC.
Definition: TPCGeo.h:637
static const PlaneID_t InvalidID
Special code for an invalid ID.
Definition: geo_types.h:255
constexpr Point origin()
Returns a origin position with a point of the specified type.
Definition: geo_vectors.h:230
LocalPoint_t geo::TPCGeo::toLocalCoords ( geo::Point_t const &  world) const
inline

Transform point from world frame to local TPC frame.

Definition at line 522 of file TPCGeo.h.

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

523  { 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:630
LocalVector_t geo::TPCGeo::toLocalCoords ( geo::Vector_t const &  world) const
inline

Transform direction vector from world to local.

Definition at line 534 of file TPCGeo.h.

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

535  { 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:630
const TGeoVolume* geo::TPCGeo::TotalVolume ( ) const
inline

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

Definition at line 112 of file TPCGeo.h.

References fTotalVolume.

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

Transform point from local TPC frame to world frame.

Definition at line 498 of file TPCGeo.h.

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

Referenced by GetCenter(), and InitTPCBoundaries().

499  { return fTrans.toWorldCoords(local); }
LocalTransformation_t fTrans
TPC-to-world transformation.
Definition: TPCGeo.h:630
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 510 of file TPCGeo.h.

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

511  { return fTrans.toWorldCoords(local); }
LocalTransformation_t fTrans
TPC-to-world transformation.
Definition: TPCGeo.h:630
GlobalPoint_t toWorldCoords(LocalPoint_t const &local) const
Transforms a point from local frame to world frame.
void geo::TPCGeo::UpdateAfterSorting ( geo::TPCID  tpcid)

Performs all updates after cryostat has sorted TPCs.

Definition at line 265 of file TPCGeo.cxx.

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

Referenced by toLocalCoords().

265  {
266 
267  // reset the ID
268  fID = tpcid;
269 
270  // ask the planes to update; also check
271 
272  for (unsigned int plane = 0; plane < Nplanes(); ++plane) {
273  fPlanes[plane].UpdateAfterSorting(geo::PlaneID(fID, plane), *this);
274 
275  // check that the plane normal is opposite to the TPC drift direction
277  .equal(-(fPlanes[plane].GetNormalDirection()), DriftDir()));
278 
279  } // for
280 
282 
283  } // TPCGeo::UpdateAfterSorting()
Vector DriftDir() const
Returns the direction of the drift (vector pointing toward the planes).
Definition: TPCGeo.h:687
unsigned int Nplanes() const
Number of planes in this tpc.
Definition: TPCGeo.h:145
The data type to uniquely identify a Plane.
Definition: geo_types.h:250
std::vector< PlaneGeo > fPlanes
List of planes in this plane.
Definition: TPCGeo.h:632
geo::TPCID fID
ID of this TPC.
Definition: TPCGeo.h:654
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:519
Float_t e
Definition: plot.C:34
void geo::TPCGeo::UpdatePlaneViewCache ( )
private

Refills the plane vs. view cache of the TPC.

Definition at line 519 of file TPCGeo.cxx.

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

Referenced by UpdateAfterSorting().

519  {
520 
521  // the PlaneID_t cast convert InvalidID into a rvalue (non-reference);
522  // leaving it a reference would cause C++ to treat it as such,
523  // that can't be because InvalidID is a static member constant without an address
524  // (it is not defined in any translation unit, just declared in header)
525  fViewToPlaneNumber.clear();
526  fViewToPlaneNumber.resize
528  for(size_t p = 0; p < Nplanes(); ++p)
529  fViewToPlaneNumber[(size_t) fPlanes[p].View()] = p;
530 
531  } // TPCGeo::UpdatePlaneViewCache()
Unknown view.
Definition: geo_types.h:83
unsigned int Nplanes() const
Number of planes in this tpc.
Definition: TPCGeo.h:145
std::vector< geo::PlaneID::PlaneID_t > fViewToPlaneNumber
Index of the plane for each view (InvalidID if none).
Definition: TPCGeo.h:657
std::vector< PlaneGeo > fPlanes
List of planes in this plane.
Definition: TPCGeo.h:632
unsigned int PlaneID_t
Type for the ID number.
Definition: geo_types.h:251
static const PlaneID_t InvalidID
Special code for an invalid ID.
Definition: geo_types.h:255
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 438 of file TPCGeo.h.

References Projection().

439  { 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:415
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 440 of file TPCGeo.h.

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

441  { 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:415
std::set< geo::View_t > geo::TPCGeo::Views ( ) const

Returns a set of all views covered in this TPC.

Definition at line 343 of file TPCGeo.cxx.

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

Referenced by LastPlane().

343  {
344  std::set<geo::View_t> views;
345  std::transform(fPlanes.cbegin(), fPlanes.cend(),
346  std::inserter(views, views.begin()), std::mem_fn(&geo::PlaneGeo::View));
347  return views;
348  } // TPCGeo::Views()
std::vector< PlaneGeo > fPlanes
List of planes in this plane.
Definition: TPCGeo.h:632
View_t View() const
Which coordinate does this plane measure.
Definition: PlaneGeo.h:171
double geo::TPCGeo::Width ( ) const
inline

Width is associated with x coordinate [cm].

Definition at line 101 of file TPCGeo.h.

References HalfWidth().

Referenced by PrintTPCInfo().

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

Returns the direction Width() is measured on.

Definition at line 116 of file TPCGeo.h.

References fWidthDir.

116 { return geo::vect::convertTo<Vector>(fWidthDir); }
geo::Vector_t fWidthDir
Direction width refers to.
Definition: TPCGeo.h:647
double geo::TPCGeo::WirePitch ( unsigned  plane = 0) const

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

Definition at line 426 of file TPCGeo.cxx.

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

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

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

Transform point from world frame to local TPC frame.

Definition at line 514 of file TPCGeo.h.

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

515  { 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:630
TVector3 geo::TPCGeo::WorldToLocal ( TVector3 const &  world) const
inline

Transform point from world frame to local TPC frame.

Definition at line 518 of file TPCGeo.h.

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

519  { 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:630
void geo::TPCGeo::WorldToLocalVect ( const double *  world,
double *  tpc 
) const
inline

Transform direction vector from world to local.

Definition at line 526 of file TPCGeo.h.

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

527  { fTrans.WorldToLocalVect(world, tpc); }
LocalTransformation_t fTrans
TPC-to-world transformation.
Definition: TPCGeo.h:630
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 530 of file TPCGeo.h.

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

531  { return fTrans.WorldToLocalVect<TVector3>(world); }
LocalTransformation_t fTrans
TPC-to-world transformation.
Definition: TPCGeo.h:630
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 652 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 638 of file TPCGeo.h.

Referenced by GetActiveVolumeCenter(), and TPCGeo().

double geo::TPCGeo::fActiveHalfHeight
private

Half height of active volume.

Definition at line 641 of file TPCGeo.h.

Referenced by ActiveHalfHeight(), and TPCGeo().

double geo::TPCGeo::fActiveHalfWidth
private

Half width of active volume.

Definition at line 640 of file TPCGeo.h.

Referenced by ActiveHalfWidth(), and TPCGeo().

double geo::TPCGeo::fActiveLength
private

Length of active volume.

Definition at line 642 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 633 of file TPCGeo.h.

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

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

Direction electrons drift along.

Definition at line 650 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 635 of file TPCGeo.h.

Referenced by DriftDirection(), and ResetDriftDirection().

double geo::TPCGeo::fHalfHeight
private

Half height of total volume.

Definition at line 644 of file TPCGeo.h.

Referenced by HalfHeight(), and TPCGeo().

double geo::TPCGeo::fHalfWidth
private

Half width of total volume.

Definition at line 643 of file TPCGeo.h.

Referenced by HalfWidth(), and TPCGeo().

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

Direction height refers to.

Definition at line 648 of file TPCGeo.h.

Referenced by HeightDir(), and TPCGeo().

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

ID of this TPC.

Definition at line 654 of file TPCGeo.h.

Referenced by ID(), and UpdateAfterSorting().

double geo::TPCGeo::fLength
private

Length of total volume.

Definition at line 645 of file TPCGeo.h.

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

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

Direction length refers to.

Definition at line 649 of file TPCGeo.h.

Referenced by LengthDir(), and TPCGeo().

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

Pitch between planes.

Definition at line 636 of file TPCGeo.h.

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

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

xyz locations of planes in the TPC.

Definition at line 637 of file TPCGeo.h.

Referenced by PlaneLocation(), and SortSubVolumes().

std::vector<PlaneGeo> geo::TPCGeo::fPlanes
private
TGeoVolume* geo::TPCGeo::fTotalVolume
private

Total volume of TPC, called volTPC in GDML file.

Definition at line 634 of file TPCGeo.h.

Referenced by TotalVolume(), and TPCGeo().

LocalTransformation_t geo::TPCGeo::fTrans
private

TPC-to-world transformation.

Definition at line 630 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 657 of file TPCGeo.h.

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

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

Direction width refers to.

Definition at line 647 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 595 of file TPCGeo.h.

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


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