Namespaces | Classes | Typedefs | Functions

LArSoft geometry interface. More...

Namespaces

 CRU
 
 details
 
 dune
 
 fhicl
 FHiCL objects representing geometry classes as configuration parameters.
 
 iterators
 
 part
 Partition-related utilities.
 
 vect
 Utilities to manipulate geometry vectors.The utilities include generic vector interface facilities allowing to use different vector types via templates.
 

Classes

class  AffinePlaneBase
 
class  AuxDetChannelMapAlg
 
class  AuxDetExptGeoHelperInterface
 Interface to a service with detector-specific geometry knowledge. More...
 
class  AuxDetGeo
 
class  AuxDetGeometry
 The geometry of one entire detector, as served by art. More...
 
class  AuxDetGeometryCore
 Description of geometry of one set of auxiliary detectors. More...
 
struct  AuxDetGeometryData_t
 
class  AuxDetGeoObjectSorter
 
class  AuxDetSensitiveGeo
 
class  BoxBoundedGeo
 A base class aware of world box coordinatesAn object describing a simple shape can inherit from this one to gain access to a common boundary checking interface. More...
 
class  ChannelMap35Alg
 
class  ChannelMap35OptAlg
 
class  ChannelMapAlg
 Interface for a class providing readout channel mapping to geometry. More...
 
class  ChannelMapAPAAlg
 
class  ChannelMapCRMAlg
 
class  ChannelMapCRUAlg
 
class  ChannelMapSetupTool
 Interface for a tool creating a channel mapping object. More...
 
class  ChannelMapStandardAlg
 
class  ChannelMapStandardTestAlg
 
class  ColdBoxChannelMapAlg
 
struct  CollectNodesByName
 
struct  CollectPathsByName
 
class  CryostatGeo
 Geometry information for a single cryostat. More...
 
struct  CryostatID
 The data type to uniquely identify a cryostat. More...
 
struct  DecomposedVector
 
class  Decomposer
 Class with methods to decompose and compose back vectors. More...
 
class  DriftPartitions
 Set of drift volumes. More...
 
class  DumpChannelMap
 Prints on screen the current channel-wire and optical detector maps. More...
 
class  DumpGeometry
 Describes on screen the current geometry. More...
 
class  DuneApaChannelMapAlg
 
struct  ElementLevel
 
class  ExptGeoHelperInterface
 Interface to a service with detector-specific geometry knowledge. More...
 
class  GeoIDdataContainer
 Container with one element per geometry TPC. More...
 
class  GeoIDmapper
 Class managing the mapping between geometry/readout ID and flat index. More...
 
class  Geometry
 The geometry of one entire detector, as served by art. More...
 
class  GeometryBuilder
 Manages the extraction of LArSoft geometry information from ROOT. More...
 
class  GeometryBuilderStandard
 Extracts of LArSoft geometry information from ROOT. More...
 
class  GeometryBuilderWireless
 Geometry builder which ignores wires on wire planes. More...
 
class  GeometryConfigurationWriter
 Writes geometry configuration information into art runs. More...
 
class  GeometryCore
 Description of geometry of one entire detector. More...
 
struct  GeometryData_t
 Data in the geometry description. More...
 
class  GeometryGeoIDTestAlg
 
class  GeometryInfoCheck
 
class  GeometryIteratorLoopTest
 Performs tests on the geometry as seen by Geometry service. More...
 
class  GeometryIteratorLoopTestAlg
 
class  GeometryIteratorTestAlg
 
class  GeometryTest
 Performs tests on the geometry as seen by Geometry service. More...
 
class  GeometryTestAlg
 Performs tests on the geometry as seen by Geometry service. More...
 
class  GeoNodePath
 Representation of a node and its ancestry. More...
 
class  GeoObjectSorter
 
class  GeoObjectSorter35
 
class  GeoObjectSorterAPA
 
class  GeoObjectSorterCRM
 
class  GeoObjectSorterCRU
 
class  GeoObjectSorterStandard
 
struct  IntersectionPointAndOffsets
 Data structure for return values of LineClosestPointAndOffsets(). More...
 
class  InvalidWireError
 Exception thrown on invalid wire number. More...
 
class  InvalidWireIDError
 Exception thrown on invalid wire number (e.g. NearestWireID()) More...
 
class  IteratorBox
 
class  LegacyGeometryInfoWriter
 
class  LocalIteratorBox
 
class  LocalTransformation
 Class to transform between world and local coordinates. More...
 
class  LocalTransformationGeo
 Class to transform between world and local coordinates. More...
 
class  MuonCounter35Alg
 
struct  NodeNameMatcherClass
 
class  OpDetGeo
 
struct  OpDetID
 The data type to uniquely identify a optical detector. More...
 
struct  OpticalLocalCoordinateSystemTag
 The tag defining the optical detector local reference frame. More...
 
class  PlaneBase
 A base for a plane in space. More...
 
class  PlaneDataContainer
 Container with one element per geometry wire plane. More...
 
class  PlaneDecomposer
 Class with methods for projection of vectors on a plane. More...
 
class  PlaneGeo
 Geometry information for a single wire plane.The plane is represented in the geometry by a solid which contains wires. Currently, only box solids are well supported. The box which is representation of the plane has some thickness, and it should not be assumed that the wires are in the median section of it, that is, the center of the box may not lie on the plane defined by the wires. More...
 
struct  PlaneID
 The data type to uniquely identify a Plane. More...
 
class  PlaneIDmapper
 Mapping for sensitive plane identifiers. More...
 
class  ProtoDUNEChannelMapAlg
 
class  ProtoDUNEChannelMapAlgv7
 
class  ProtoDUNEChannelMapAlgv8
 
class  ROOTGeometryNavigator
 Executes an operation on all the nodes of the ROOT geometry. More...
 
class  ROOTGeoNodeForwardIterator
 Iterator to navigate through all the nodes. More...
 
struct  sortWire35
 
class  StandardGeometryHelper
 Simple implementation of channel mapping. More...
 
class  TPCDataContainer
 Container with one element per geometry TPC. More...
 
class  TPCGeo
 Geometry information for a single TPC. More...
 
struct  TPCID
 The data type to uniquely identify a TPC. More...
 
class  TPCIDmapper
 Mapping for TPC identifiers. More...
 
class  WireGeo
 Geometry description of a TPC wireThe wire is a single straight segment on a wire plane. Different wires may be connected to the same readout channel. That is of no relevance for the geometry description. More...
 
struct  WireID
 
struct  WireIDIntersection
 

Typedefs

using GeoNodeIterator_t = std::vector< TGeoNode const * >::const_iterator
 
using WirePtr = WireGeo const *
 
using TransformationMatrix = ROOT::Math::Transform3D
 Type of transformation matrix used in geometry. More...
 
Generic vector types.
template<typename T , typename C = ROOT::Math::GlobalCoordinateSystemTag>
using GenVector3DBase_t = ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< T >, C >
 
template<typename T , typename C = ROOT::Math::GlobalCoordinateSystemTag>
using GenPoint3DBase_t = ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< T >, C >
 
template<typename C >
using Vector3DBase_t = GenVector3DBase_t< double, C >
 
template<typename C >
using Point3DBase_t = GenPoint3DBase_t< double, C >
 Type of 3D point with representation in double precision. More...
 
using cryostat_id_iterator = details::cryostat_id_iterator_base< geo::CryostatID >
 Forward iterator browsing all cryostats in the detector. More...
 
using cryostat_iterator = details::geometry_element_iterator< cryostat_id_iterator >
 Forward iterator browsing all cryostats in the detector. More...
 
using TPC_id_iterator = details::TPC_id_iterator_base< geo::TPCID >
 Forward iterator browsing all TPCs in the detector. More...
 
using TPC_iterator = details::geometry_element_iterator< TPC_id_iterator >
 Forward iterator browsing all TPCs in the detector. More...
 
using plane_id_iterator = details::plane_id_iterator_base< geo::PlaneID >
 Forward iterator browsing all planes in the detector. More...
 
using plane_iterator = details::geometry_element_iterator< plane_id_iterator >
 Forward iterator browsing all planes in the detector. More...
 
using wire_id_iterator = details::wire_id_iterator_base< geo::WireID >
 Forward iterator browsing all wires in the detector. More...
 
using wire_iterator = details::geometry_element_iterator< wire_id_iterator >
 Forward iterator browsing all wires in the detector. More...
 
using TPCset_id_iterator = details::TPCset_id_iterator_base< readout::TPCsetID >
 Forward iterator browsing all TPC sets in the detector. More...
 
using ROP_id_iterator = details::ROP_id_iterator_base< readout::ROPID >
 Forward iterator browsing all readout planes in the detector. More...
 
Optical detector vector types.

Special tags for a generic "optical detector local coordinate system" are defined here, together with data types using them.

While the world coordinate system makes sense to be defined in this way, a local system depends by definition by the object it is anchored to: while two world coordinate vectors are always compatible, two local coordinate vectors are compatible only if they belong to the same local object. The purpose of these definitions is to declare the incompatibility between world coordinate vectors and the ones local to optical detectors, without attempting to claim that two of the latter are necessarily compatible.

template<typename T >
using OpticalVector3DBase_t = GenVector3DBase_t< T, OpticalLocalCoordinateSystemTag >
 
template<typename T >
using OpticalPoint3DBase_t = GenPoint3DBase_t< T, OpticalLocalCoordinateSystemTag >
 
using OpticalVector_t = OpticalVector3DBase_t< double >
 
using OpticalPoint_t = OpticalPoint3DBase_t< double >
 Type of optical 3D point with representation in double precision. More...
 

Functions

static bool sortAuxDet35 (const AuxDetGeo &ad1, const AuxDetGeo &ad2)
 
static bool sortAuxDetSensitive35 (const AuxDetSensitiveGeo &ad1, const AuxDetSensitiveGeo &ad2)
 
static bool sortCryo35 (const CryostatGeo &c1, const CryostatGeo &c2)
 
static bool sortTPC35 (const TPCGeo &t1, const TPCGeo &t2)
 
static bool sortPlane35 (const PlaneGeo &p1, const PlaneGeo &p2)
 
static bool sortAuxDetAPA (const AuxDetGeo &ad1, const AuxDetGeo &ad2)
 
static bool sortAuxDetSensitiveAPA (const AuxDetSensitiveGeo &ad1, const AuxDetSensitiveGeo &ad2)
 
static bool sortCryoAPA (const CryostatGeo &c1, const CryostatGeo &c2)
 
static bool sortTPCAPA (const TPCGeo &t1, const TPCGeo &t2)
 
static bool sortPlaneAPA (const PlaneGeo &p1, const PlaneGeo &p2)
 
bool sortWireAPA (WireGeo &w1, WireGeo &w2)
 
static bool sortAuxDetCRM (const AuxDetGeo &ad1, const AuxDetGeo &ad2)
 
static bool sortAuxDetSensitiveCRM (const AuxDetSensitiveGeo &ad1, const AuxDetSensitiveGeo &ad2)
 
static bool sortCryoCRM (const CryostatGeo &c1, const CryostatGeo &c2)
 
static bool sortTPCCRM (const TPCGeo &t1, const TPCGeo &t2)
 
static bool sortPlaneCRM (const PlaneGeo &p1, const PlaneGeo &p2)
 
bool sortWireCRM (WireGeo const &w1, WireGeo const &w2)
 
bool sortorderOpDet (const OpDetGeo &t1, const OpDetGeo &t2)
 
void ProjectToBoxEdge (const double xyz[], const double dxyz[], double xlo, double xhi, double ylo, double yhi, double zlo, double zhi, double xyzout[])
 
double ClosestApproach (const double point[], const double intercept[], const double slopes[], double closest[])
 
bool CrossesBoundary (double x0[], double gradient[], double x_lo, double x_hi, double y_lo, double y_hi, double z_lo, double z_hi, double point[])
 
template<>
geo::TPCID GeometryCore::GetBeginID< geo::TPCID, geo::CryostatID > (geo::CryostatID const &id) const
 
template<>
geo::TPCID GeometryCore::GetEndID< geo::TPCID, geo::CryostatID > (geo::CryostatID const &id) const
 
template<>
geo::PlaneID GeometryCore::GetBeginID< geo::PlaneID, geo::CryostatID > (geo::CryostatID const &id) const
 
template<>
geo::PlaneID GeometryCore::GetEndID< geo::PlaneID, geo::CryostatID > (geo::CryostatID const &id) const
 
static bool sortorderOpDets (const OpDetGeo &t1, const OpDetGeo &t2)
 
static bool sortAuxDetStandard (const AuxDetGeo &ad1, const AuxDetGeo &ad2)
 
static bool sortAuxDetSensitiveStandard (const AuxDetSensitiveGeo &ad1, const AuxDetSensitiveGeo &ad2)
 
static bool sortCryoStandard (const CryostatGeo &c1, const CryostatGeo &c2)
 
static bool sortTPCStandard (const TPCGeo &t1, const TPCGeo &t2)
 
static bool sortPlaneStandard (const PlaneGeo &p1, const PlaneGeo &p2)
 
static bool sortWireStandard (WireGeo const &w1, WireGeo const &w2)
 
template<typename Point , typename Vector >
IntersectionPointAndOffsets< PointLineClosestPointAndOffsets (Point const &startA, Vector const &dirA, Point const &startB, Vector const &dirB)
 Returns the point of a line that is closest to a second line. More...
 
template<typename Point , typename Vector >
Point LineClosestPoint (Point const &startA, Vector const &dirA, Point const &startB, Vector const &dirB)
 Returns the point of a line that is closest to a second line. More...
 
template<typename Point , typename UnitVector >
IntersectionPointAndOffsets< PointLineClosestPointAndOffsetsWithUnitVectors (Point const &startA, UnitVector const &dirA, Point const &startB, UnitVector const &dirB)
 Returns the point of a line that is closest to a second line. More...
 
template<typename Point , typename UnitVector >
Point LineClosestPointWithUnitVectors (Point const &startA, UnitVector const &dirA, Point const &startB, UnitVector const &dirB)
 Returns the point of a line that is closest to a second line. More...
 
template<typename StoredMatrix , typename ITER >
static StoredMatrix transformationFromPath (ITER begin, ITER end)
 Builds a matrix to go from local to world coordinates in one step. More...
 
template<typename StoredMatrix >
static StoredMatrix transformationFromPath (std::vector< TGeoNode const * > const &path, size_t depth)
 Builds a matrix to go from local to world coordinates in one step. More...
 
template<typename Dest , typename Src >
decltype(auto) convertTransformationMatrix (Src &&trans)
 Converts a transformation matrix into Dest format. More...
 
template<typename Trans >
decltype(auto) makeTransformationMatrix (Trans &&trans)
 Converts a transformation matrix into a geo::TransformationMatrix. More...
 
geo::Point_t WiresIntersection (geo::WireGeo const &wireA, geo::WireGeo const &wireB)
 Returns the point of wireA that is closest to wireB. More...
 
geo::IntersectionPointAndOffsets< geo::Point_tWiresIntersectionAndOffsets (geo::WireGeo const &wireA, geo::WireGeo const &wireB)
 Returns the point of wireA that is closest to wireB. More...
 
std::string SignalTypeName (geo::SigType_t sigType)
 Returns the name of the specified signal type. More...
 
DriftPartitions buildDriftVolumes (geo::CryostatGeo const &cryo)
 Creates a DriftPartitions object from the TPCs in a cryostat. More...
 
Geometry element IDs
std::ostream & operator<< (std::ostream &out, CryostatID const &cid)
 Generic output of CryostatID to stream. More...
 
std::ostream & operator<< (std::ostream &out, OpDetID const &oid)
 Generic output of OpDetID to stream. More...
 
std::ostream & operator<< (std::ostream &out, TPCID const &tid)
 Generic output of TPCID to stream. More...
 
std::ostream & operator<< (std::ostream &out, PlaneID const &pid)
 Generic output of PlaneID to stream. More...
 
std::ostream & operator<< (std::ostream &out, WireID const &wid)
 Generic output of WireID to stream. More...
 
ID comparison operators

The result of comparison with invalid IDs is undefined.

constexpr bool operator== (CryostatID const &a, CryostatID const &b)
 Comparison: the IDs point to the same cryostat (validity is ignored) More...
 
constexpr bool operator!= (CryostatID const &a, CryostatID const &b)
 Comparison: the IDs point to different cryostats (validity is ignored) More...
 
constexpr bool operator< (CryostatID const &a, CryostatID const &b)
 Order cryostats with increasing ID. More...
 
constexpr bool operator== (OpDetID const &a, OpDetID const &b)
 Comparison: the IDs point to same optical detector (validity is ignored) More...
 
constexpr bool operator!= (OpDetID const &a, OpDetID const &b)
 Comparison: IDs point to different optical detectors (validity is ignored) More...
 
constexpr bool operator< (OpDetID const &a, OpDetID const &b)
 Order OpDetID in increasing Cryo, then OpDet. More...
 
constexpr bool operator== (TPCID const &a, TPCID const &b)
 Comparison: the IDs point to the same TPC (validity is ignored) More...
 
constexpr bool operator!= (TPCID const &a, TPCID const &b)
 Comparison: the IDs point to different TPCs (validity is ignored) More...
 
constexpr bool operator< (TPCID const &a, TPCID const &b)
 Order TPCID in increasing Cryo, then TPC. More...
 
constexpr bool operator== (PlaneID const &a, PlaneID const &b)
 Comparison: the IDs point to the same plane (validity is ignored) More...
 
constexpr bool operator!= (PlaneID const &a, PlaneID const &b)
 Comparison: the IDs point to different planes (validity is ignored) More...
 
constexpr bool operator< (PlaneID const &a, PlaneID const &b)
 Order PlaneID in increasing TPC, then plane. More...
 
constexpr bool operator== (WireID const &a, WireID const &b)
 Comparison: the IDs point to the same wire (validity is ignored) More...
 
constexpr bool operator!= (WireID const &a, WireID const &b)
 Comparison: the IDs point to different wires (validity is ignored) More...
 
constexpr bool operator< (WireID const &a, WireID const &b)
 

Vector types for the standard LArSoft geometry.

LArSoft geometry provides two main types of vectors in 3D space:

  1. geo::Point_t to describe an absolute position in global coordinates
  2. geo::Vector_t to describe a displacement or direction (or momentum!)

Both vectors are supposed to represent:

  • centimeters in double precision when used on the real geometry space
  • in the global coordinate system, which is represented by the tag geo::GlobalCoords.

These types constitute the basic objects the geometry works with.

All interfaces should support them.

Note
As this requires some transition, please report any interface missing support for these types by opening a "necessary maintenance" request in the LArSoft issue tracker at https://cdcvs.fnal.gov/redmine/projects/larsoft/issues . Even if there are plenty.

The same type of vectors, but in a different coordinate system representation, can be obtained by using geo::Point3DBase_t template:

(geo::Vector3DBase_t is also available). If a single precision vector is desired, the most general geo::GenPoint3DBase_t and geo::GenVector3DBase_t are also available:

using Length_t = double
 Type used for coordinates and distances. They are measured in centimeters. More...
 
using GlobalCoords = ROOT::Math::GlobalCoordinateSystemTag
 Tag for vectors in the global coordinate system. More...
 
using Vector_t = ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag >
 Type for representation of momenta in 3D space. More...
 
using Point_t = ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag >
 Type for representation of position in physical 3D space. More...
 
template<typename CoordSystemTag >
using VectorIn_t = Vector3DBase_t< CoordSystemTag >
 Type for representation of momenta in 3D space. More...
 
template<typename CoordSystemTag >
using PointIn_t = Point3DBase_t< CoordSystemTag >
 Type for representation of positions in 3D space. More...
 
using Rotation_t = ROOT::Math::Rotation3D
 Type for representation of space rotations. More...
 
template<typename Vector = Vector_t>
constexpr Vector Xaxis ()
 Returns a x axis vector of the specified type. More...
 
template<typename Vector = Vector_t>
constexpr Vector Yaxis ()
 Returns a y axis vector of the specified type. More...
 
template<typename Vector = Vector_t>
constexpr Vector Zaxis ()
 Returns a z axis vector of the specified type. More...
 
template<typename Point = Point_t>
constexpr Point origin ()
 Returns a origin position with a point of the specified type. More...
 

Geometry enumerators

enum  coordinates { kXCoord, kYCoord, kZCoord }
 
enum  _plane_proj {
  kU, kV, kW, kZ =kW,
  kY, kX, k3D, kUnknown
}
 Enumerate the possible plane projections. More...
 
enum  _plane_orient { kHorizontal, kVertical }
 
enum  _plane_sigtype { kInduction, kCollection, kMysteryType }
 
enum  driftdir {
  kUnknownDrift, kPos, kNeg, kPosX = kPos,
  kNegX = kNeg
}
 Drift direction: positive or negative. More...
 
typedef enum geo::coordinates Coord_t
 
typedef enum geo::_plane_proj View_t
 Enumerate the possible plane projections. More...
 
typedef enum geo::_plane_orient Orient_t
 
typedef enum geo::_plane_sigtype SigType_t
 
typedef enum geo::driftdir DriftDirection_t
 Drift direction: positive or negative. More...
 

Detailed Description

LArSoft geometry interface.

Detector geometry definition and interface.

ROOT libraries.

Namespace collecting geometry-related classes utilities.

Writes a sumdata::RunData record into the run(s).

Verifies that the geometry check information is available.

See also
geo::GeometryCore

The geo namespace includes all LArSoft data types, classes and functions related to detector geometry.

For more guidance, dee the LArSoft geometry module.

Configuration parameters

A copy of the same data product is put into each of the runs on opening.

Configuration parameters

TrackLineFitAlg class

Bruce Baller, balle.nosp@m.r@fn.nosp@m.al.go.nosp@m.v

Algorithm for fitting a 3D line given a number of points in 3 wire planes

TrackTrajectoryAlg class

Bruce Baller, balle.nosp@m.r@fn.nosp@m.al.go.nosp@m.v

Algorithm fitting a 3D trajectory through a set of hit pairs

Typedef Documentation

Drift direction: positive or negative.

Do not use this type to distinguish different drift axes: e.g., negative x drift and negative z drift are both by kNeg.

template<typename T , typename C = ROOT::Math::GlobalCoordinateSystemTag>
using geo::GenPoint3DBase_t = typedef ROOT::Math::PositionVector3D<ROOT::Math::Cartesian3D<T>, C>

Type of 3D point.

Template Parameters
Tdata type for coordinate representation
Ccoordinate system tag (default: global coordinates)

Definition at line 82 of file geo_vectors.h.

template<typename T , typename C = ROOT::Math::GlobalCoordinateSystemTag>
using geo::GenVector3DBase_t = typedef ROOT::Math::DisplacementVector3D<ROOT::Math::Cartesian3D<T>, C>

Type of 3D displacement vector.

Template Parameters
Tdata type for coordinate representation
Ccoordinate system tag (default: global coordinates)

Definition at line 75 of file geo_vectors.h.

using geo::GeoNodeIterator_t = typedef std::vector<TGeoNode const*>::const_iterator

Definition at line 36 of file LocalTransformation.h.

typedef ROOT::Math::GlobalCoordinateSystemTag geo::GlobalCoords

Tag for vectors in the global coordinate system.

A vector tagged as "global" is expected to be represented in the global (or "world") coordinate system.

That system is the one the detector geometry is described in, and it is defined by the GDML detector description. The linear coordinates are described in centimeters.

Definition at line 150 of file geo_vectors.h.

typedef double geo::Length_t

Type used for coordinates and distances. They are measured in centimeters.

Definition at line 137 of file geo_vectors.h.

Type of optical local 3D point.

Template Parameters
Tdata type for coordinate representation

Definition at line 55 of file geo_optical_vectors.h.

using geo::OpticalPoint_t = typedef OpticalPoint3DBase_t<double>

Type of optical 3D point with representation in double precision.

Definition at line 63 of file geo_optical_vectors.h.

Type of optical local 3D displacement vector.

Template Parameters
Tdata type for coordinate representation

Definition at line 49 of file geo_optical_vectors.h.

Type of optical 3D displacement vector with representation in double precision.

Definition at line 60 of file geo_optical_vectors.h.

template<typename C >
using geo::Point3DBase_t = typedef GenPoint3DBase_t<double, C>

Type of 3D point with representation in double precision.

Template Parameters
Ccoordinate system tag

Definition at line 92 of file geo_vectors.h.

typedef ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > geo::Point_t

Type for representation of position in physical 3D space.

A point represents a position in 3D space. As such, it makes no sense to add points, and the difference between two points is not a point any more (it is, in fact, a geo::Vector_t). Scaling and norm of a point also have no meaning.

A vector can be added to a point, resulting in another point.

Note that middlePoint() function and MiddlePointAccumulator class are provided to facilitate the computation of a middle point using any type of vector and in particular geo::Point_t.

Definition at line 184 of file geo_vectors.h.

template<typename CoordSystemTag >
using geo::PointIn_t = typedef Point3DBase_t<CoordSystemTag>

Type for representation of positions in 3D space.

Template Parameters
CoordSystemTagthe coordinate system tag for this point

This point type is equivalent to geo::Point_t but it's tagged as from a different coordinate system.

Definition at line 205 of file geo_vectors.h.

typedef ROOT::Math::Rotation3D geo::Rotation_t

Type for representation of space rotations.

Definition at line 209 of file geo_vectors.h.

using geo::TransformationMatrix = typedef ROOT::Math::Transform3D

Type of transformation matrix used in geometry.

This type is used for storing the transformation matrices of the various geometry description objects (e.g. geo::WireGeo, geo::OpDetGeo, ...).

Definition at line 30 of file TransformationMatrix.h.

template<typename C >
using geo::Vector3DBase_t = typedef GenVector3DBase_t<double, C>

Type of 3D displacement vector with representation in double precision.

Template Parameters
Ccoordinate system tag

Definition at line 87 of file geo_vectors.h.

typedef ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > geo::Vector_t

Type for representation of momenta in 3D space.

A vector represents a direction and intensity, or a displacement respect to an unspecified starting point. Vectors can be added or subtracted, resulting in still a vector. Their modulus can also be scaled.

Definition at line 164 of file geo_vectors.h.

template<typename CoordSystemTag >
using geo::VectorIn_t = typedef Vector3DBase_t<CoordSystemTag>

Type for representation of momenta in 3D space.

Template Parameters
CoordSystemTagthe coordinate system tag for this vector

This vector type is equivalent to geo::Vector_t but it's tagged as from a different coordinate system.

Definition at line 195 of file geo_vectors.h.

Enumerate the possible plane projections.

using geo::WirePtr = typedef WireGeo const*

Definition at line 48 of file PlaneGeo.h.

Enumeration Type Documentation

Enumerator
kHorizontal 

Planes that are in the horizontal plane.

kVertical 

Planes that are in the vertical plane (e.g. ArgoNeuT).

Definition at line 139 of file geo_types.h.

139  {
140  kHorizontal, ///< Planes that are in the horizontal plane.
141  kVertical ///< Planes that are in the vertical plane (e.g. ArgoNeuT).
142  } Orient_t;
enum geo::_plane_orient Orient_t
Planes that are in the horizontal plane.
Definition: geo_types.h:140
Planes that are in the vertical plane (e.g. ArgoNeuT).
Definition: geo_types.h:141

Enumerate the possible plane projections.

Enumerator
kU 

Planes which measure U.

kV 

Planes which measure V.

kW 

Planes which measure W (third view for Bo, MicroBooNE, etc).

kZ 

Planes which measure Z direction.

kY 

Planes which measure Y direction.

kX 

Planes which measure X direction.

k3D 

3-dimensional objects, potentially hits, clusters, prongs, etc.

kUnknown 

Unknown view.

Definition at line 128 of file geo_types.h.

128  {
129  kU, ///< Planes which measure U.
130  kV, ///< Planes which measure V.
131  kW, ///< Planes which measure W (third view for Bo, MicroBooNE, etc).
132  kZ=kW, ///< Planes which measure Z direction.
133  kY, ///< Planes which measure Y direction.
134  kX, ///< Planes which measure X direction.
135  k3D, ///< 3-dimensional objects, potentially hits, clusters, prongs, etc.
136  kUnknown ///< Unknown view.
137  } View_t;
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
Planes which measure V.
Definition: geo_types.h:130
Unknown view.
Definition: geo_types.h:136
Planes which measure X direction.
Definition: geo_types.h:134
Planes which measure Z direction.
Definition: geo_types.h:132
Planes which measure Y direction.
Definition: geo_types.h:133
3-dimensional objects, potentially hits, clusters, prongs, etc.
Definition: geo_types.h:135
Planes which measure U.
Definition: geo_types.h:129
Planes which measure W (third view for Bo, MicroBooNE, etc).
Definition: geo_types.h:131
Enumerator
kInduction 

Signal from induction planes.

kCollection 

Signal from collection planes.

kMysteryType 

Who knows?

Definition at line 144 of file geo_types.h.

144  {
145  kInduction, ///< Signal from induction planes.
146  kCollection, ///< Signal from collection planes.
147  kMysteryType ///< Who knows?
148  } SigType_t;
Who knows?
Definition: geo_types.h:147
Signal from induction planes.
Definition: geo_types.h:145
enum geo::_plane_sigtype SigType_t
Signal from collection planes.
Definition: geo_types.h:146
Enumerator
kXCoord 

X coordinate.

kYCoord 

Y coordinate.

kZCoord 

Z coordinate.

Definition at line 121 of file geo_types.h.

121  {
122  kXCoord, ///< X coordinate.
123  kYCoord, ///< Y coordinate.
124  kZCoord ///< Z coordinate.
125  } Coord_t;
X coordinate.
Definition: geo_types.h:122
enum geo::coordinates Coord_t
Z coordinate.
Definition: geo_types.h:124
Y coordinate.
Definition: geo_types.h:123

Drift direction: positive or negative.

Do not use this type to distinguish different drift axes: e.g., negative x drift and negative z drift are both by kNeg.

Enumerator
kUnknownDrift 

Drift direction is unknown.

kPos 

Drift towards positive values.

kNeg 

Drift towards negative values.

kPosX 

Drift towards positive X values.

kNegX 

Drift towards negative X values.

Definition at line 157 of file geo_types.h.

157  {
158  kUnknownDrift, ///< Drift direction is unknown.
159  kPos, ///< Drift towards positive values.
160  kNeg, ///< Drift towards negative values.
161  kPosX = kPos, ///< Drift towards positive X values.
162  kNegX = kNeg ///< Drift towards negative X values.
Drift direction is unknown.
Definition: geo_types.h:158
Drift towards positive values.
Definition: geo_types.h:159
Drift towards negative X values.
Definition: geo_types.h:162
enum geo::driftdir DriftDirection_t
Drift direction: positive or negative.
Drift towards positive X values.
Definition: geo_types.h:161
Drift towards negative values.
Definition: geo_types.h:160

Function Documentation

geo::DriftPartitions geo::buildDriftVolumes ( geo::CryostatGeo const &  cryo)

Creates a DriftPartitions object from the TPCs in a cryostat.

Parameters
cryothe cryostat with the TPCs to be partitioned.

The algorithm groups all TPCs with the same drift direction and readout planes with similar drift coordinates. A "global drift direction" is chosen. The drift directions of all TPCs in the cryostat are required to be parallel (at most with different verse). Projections of the TPC wire planes on this direction determine TPC grouping. TPCs with planes within a small range (typically, 10 plane pitches) of this projected coordinate are grouped together. TPCs with opposite drift directions are still kept in different groups.

The information of each drift volume is kept in a DriftVolume_t class which contains a hierarchical structure of type geo::part::Partition (with data geo::TPCGeo const coming directly from the geometry). This structure describes the topology of the TPCs within the drift volume.

Definition at line 1099 of file DriftPartitions.cxx.

1099  {
1100 
1101  //
1102  // group TPCs by drift direction
1103  //
1104  auto TPCsByDriftDir = groupTPCsByDriftDir(cryo);
1105 
1106  //
1107  // determine the cryostat-wide drift direction (arbitrary but consistent)
1108  // and the decomposition base (using the same for all drift partitions);
1109  //
1110 
1111  // In practice we use the coordinate system from the first TPC;
1112  // we still check that all drift directions are compatible,
1113  // but the result of detection is ignored.
1114  /* auto globalDriftDir = */ detectGlobalDriftDir(keys(TPCsByDriftDir));
1115  using Direction_t = geo::DriftPartitions::Direction_t;
1116  geo::TPCGeo const& firstTPC = cryo.TPC(0);
1118  ({ cryo.Center(), firstTPC.RefWidthDir<Direction_t>(), firstTPC.RefDepthDir<Direction_t>() });
1119 
1120  //
1121  // further group TPCs by plane position in drift direction
1122  //
1123  std::vector<TPCgroup_t> TPCgroups;
1124  for (auto const& TPCsOnDriftDir: TPCsByDriftDir) {
1125  auto TPCs = sortTPCsByDriftCoord(TPCsOnDriftDir.second, decomposer);
1126  append(TPCgroups, groupByDriftCoordinate(TPCs));
1127  } // for
1128 
1129  //
1130  // verify coordinate system consistency between TPCs
1131  //
1132  for (auto const& TPCgroup: TPCgroups) {
1133  unsigned int errors = checkTPCcoords(TPCgroup.TPCs);
1134  if (errors > 0) {
1135  throw cet::exception("buildDriftVolumes")
1136  << "TPCs in partition have different drift directions ("
1137  << errors << " errors found in " << TPCgroup.TPCs.size() << " TPCs).\n";
1138  } // if
1139  } // for
1140 
1141  //
1142  // partition each group
1143  //
1144  geo::DriftPartitions partitions(decomposer);
1145  for (auto const& TPCgroup: TPCgroups) {
1146  auto TPCs = addAreaToTPCs(TPCgroup.TPCs, decomposer);
1147  auto part = makePartition(TPCs);
1148  if (!part) {
1149  cet::exception e("buildDriftVolumes");
1150  e << "Failed to construct partition out of " << TPCs.size() << " TPCs:";
1151  for (auto const& TPCinfo: TPCs) {
1152  e << "\n at " << TPCinfo.area() << " TPC ";
1153  TPCinfo.TPC->PrintTPCInfo(e, " ", 5U);
1154  } // for
1155  throw e;
1156  } // if error
1157  partitions.addPartition(std::move(part));
1158  } // for
1159 
1160  return partitions;
1161 } // geo::buildDriftVolumes()
std::unique_ptr< geo::part::Partition< geo::TPCGeo const > > makePartition(BeginIter beginTPCwithArea, EndIter endTPCwithArea)
Geometry information for a single TPC.
Definition: TPCGeo.h:38
Vector RefWidthDir() const
Return the direction of reference plane width.
Definition: TPCGeo.h:372
std::vector< TPCwithArea_t > addAreaToTPCs(std::vector< geo::TPCGeo const * > const &TPCs, geo::DriftPartitions::Decomposer_t const &decomposer)
const double e
Vector RefDepthDir() const
Return the direction of reference plane depth.
Definition: TPCGeo.h:388
geo::DriftPartitions::DriftDir_t detectGlobalDriftDir(Range &&directions)
def move(depos, offset)
Definition: depos.py:107
std::vector< TPCgroup_t > groupByDriftCoordinate(std::vector< TPCandPos_t > const &TPCs)
std::vector< std::pair< geo::DriftPartitions::DriftDir_t, std::vector< geo::TPCGeo const * > > > groupTPCsByDriftDir(geo::CryostatGeo const &cryo)
Set of drift volumes.
unsigned int checkTPCcoords(std::vector< geo::TPCGeo const * > const &TPCs)
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
geo::Vector_t Direction_t
Type representing a direction in 3D space (norm is not constrained).
std::vector< TPCandPos_t > sortTPCsByDriftCoord(std::vector< geo::TPCGeo const * > const &TPCs, geo::DriftPartitions::Decomposer_t const &decomp)
double geo::ClosestApproach ( const double  point[],
const double  intercept[],
const double  slopes[],
double  closest[] 
)
inline

Find the distance of closest approach between point and line

Parameters
point- xyz coordinates of point
intercept- xyz coodinates of point on line
slopes- unit vector direction (need not be normalized)
closest- on output, point on line that is closest
Returns
distance from point to line

Definition at line 96 of file geo.h.

100 {
101  double s =
102  (slopes[0]*(point[0]-intercept[0]) +
103  slopes[1]*(point[1]-intercept[1]) +
104  slopes[2]*(point[2]-intercept[2]));
105  double sd =
106  (slopes[0]*slopes[0] +
107  slopes[1]*slopes[1] +
108  slopes[2]*slopes[2]);
109  if (sd>0.0) {
110  s /= sd;
111  closest[0] = intercept[0] + s*slopes[0];
112  closest[1] = intercept[1] + s*slopes[1];
113  closest[2] = intercept[2] + s*slopes[2];
114  }
115  else {
116  // How to handle this zero gracefully? Assume that the intercept
117  // is a particle vertex and "slopes" are momenta. In that case,
118  // the particle goes nowhere and the closest approach is the
119  // distance from the intercept to point
120  closest[0] = intercept[0];
121  closest[1] = intercept[1];
122  closest[2] = intercept[2];
123  }
124  return std::sqrt(pow((point[0]-closest[0]),2)+
125  pow((point[1]-closest[1]),2)+
126  pow((point[2]-closest[2]),2));
127 }
constexpr T pow(T x)
Definition: pow.h:72
static QCString * s
Definition: config.cpp:1042
template<typename Dest , typename Src >
decltype(auto) geo::convertTransformationMatrix ( Src &&  trans)

Converts a transformation matrix into Dest format.

Definition at line 323 of file LocalTransformation.h.

324  {
325  return details::TransformationMatrixConverter
326  <std::decay_t<Dest>, std::decay_t<Src>>::convert
327  (std::forward<Src>(trans));
328  }
def convert(inputfile, outputfile="wire-cell-garfield-fine-response.json.bz2", average=False, shaped=False)
Definition: garfield.py:262
bool geo::CrossesBoundary ( double  x0[],
double  gradient[],
double  x_lo,
double  x_hi,
double  y_lo,
double  y_hi,
double  z_lo,
double  z_hi,
double  point[] 
)
inline

Determine whether or not track intersects box of volume: ( x_hi - x_lo ) x ( y_hi - y_lo ) x ( z_hi - z_lo )

Parameters
x_hi- x box coordinates in space w.r.t. the origin
x_lo- x box coordinates in space w.r.t. the origin
y_hi- y box coordinates in space w.r.t. the origin
y_lo- y box coordinates in space w.r.t. the origin
z_hi- z box coordinates in space w.r.t. the origin
z_lo- z box coordinates in space w.r.t. the origin
x0[]- initial position of the particle
gradient[]- initial gradient of particle position
point[](output) - position of the particle at intersection
See also
geo::BoxBoundedGeo::GetIntersection()

*** assumes particle's track is linear

Definition at line 148 of file geo.h.

157 {
158 
159  double distance[3]; // distance to plane
160 
161  // puts box coordinates into more useful vectors (for loop later)
162  double lo[3] = { x_lo , y_lo , z_lo };
163  double hi[3] = { x_hi , y_hi , z_hi };
164 
165  // puts box coordinates into more useful vector (for loop later)
166  double facecoord[6] = { lo[0] , hi[0] ,
167  lo[1] , hi[1] ,
168  lo[2] , hi[2] };
169 
170  int intersect[6]={0,0,0,0,0,0}; // initialize intersection tally vector
171  int count=0;
172  // iterates through spatial axes (0,1,2) = (x,y,z)
173  for(int i=0; i<3; i++) {
174  // try both planes with normal parallel to axis
175  for(int p=0; p<2; p++ ) {
176 
177  point[i] = facecoord[count]; // point on face
178  distance[i] = point[i] - x0[i]; // calculate x-coordinate of track distance
179 
180  double C_dg = distance[i] / gradient[i]; // calculate correlation b/w gradient and distance
181 
182  for(int m=0; m<3; m++){ distance[m] = C_dg * gradient[m]; }
183  for(int n=0; n<3; n++){ point[n] = x0[n] + distance[n]; }
184 
185  int j, k;
186  switch (i) {
187  case 0: j=1; k=2; break;
188  case 1: j=2; k=0; break;
189  case 2: j=0; k=1; break;
190  default:
191  throw std::logic_error("Big trouble");
192  } // switch
193 
194  // now want to check to see if the point is in the right plane
195  if ( lo[j] < point[j] && point[j] < hi[j]
196  && lo[k] < point[k] && point[k] < hi[k] ) {
197 
198  // double length = std::sqrt( distance[0]*distance[0]
199  // + distance[1]*distance[1]
200  // + distance[2]*distance[2] );
201 
202  // direction of motion w.r.t. start point
203  int direction = distance[i]*gradient[i]
204  / std::sqrt( (distance[i]*distance[i]) * (gradient[i]*gradient[i]) );
205  bool directed = ( direction + 1 ) / 2;
206 
207  // checks if particle passes through face
208  // and also checks to see whether it passes inward or outward
209  //if ( track_length > length && directed ) {
210  if ( directed ) {
211  int normal = pow( -1 , count + 1 );
212  int thru = normal * gradient[i] / std::sqrt(gradient[i]*gradient[i]) ;
213  intersect[count]=thru;
214  }
215  }
216  count++;
217  }
218  }
219 
220  // count faces it passes through,
221  // ... not necessary now, but maybe useful in the future
222  int passes=0;
223  for ( int face=0; face<6; ++face ) {
224  passes+=(intersect[face]*intersect[face]);
225  }
226 
227  if ( passes==0 ) {
228  return 0;
229  } else {
230  return 1;
231  }
232 }
constexpr T pow(T x)
Definition: pow.h:72
std::void_t< T > n
p
Definition: test.py:223
double distance(double x1, double y1, double z1, double x2, double y2, double z2)

Definition at line 5819 of file GeometryCore.h.

5820  { return GetBeginPlaneID(id); }

Definition at line 5809 of file GeometryCore.h.

5810  { return GetBeginTPCID(id); }

Definition at line 5824 of file GeometryCore.h.

5825  { return GetEndPlaneID(id); }

Definition at line 5814 of file GeometryCore.h.

5815  { return GetEndTPCID(id); }
template<typename Point , typename Vector >
Point geo::LineClosestPoint ( Point const &  startA,
Vector const &  dirA,
Point const &  startB,
Vector const &  dirB 
)

Returns the point of a line that is closest to a second line.

Template Parameters
Pointa type describing a point
Vectora type describing a direction (displacement vector)
Parameters
refAa reference point on the first line
dirAthe direction of the first line
refBa reference point on the second line
dirBthe direction of the second line
Returns
the point of A closest to B
See also
LineClosestPointAndOffsets(), LineClosestPointWithUnitVectors()

The point of line A that is closest to line B is returned.

The two lines are assumed not to be parallel, and when this prerequisite is not met the behaviour is undefined.

Note
This formulation is valid for lines in a Euclidean space of any dimension; the minimized distance is the Euclidean one.

A separate function, LineClosestPointAndOffsets(), also returns the offset of the intersection from the two reference points.

Requirements

The following operations between points, vectors and scalars must be defined:

  • Vector operator- (Point, Point): the difference of two points always exists and it returns a Vector;
  • Point operator+ (Point, Vector): translation of a point by a displacement vector;
  • Vector operator* (Vector, double): vector scaling by a real factor;
  • double dot(Vector, Vector): scalar (inner) product of two vectors.
template<typename Point , typename Vector >
IntersectionPointAndOffsets<Point> geo::LineClosestPointAndOffsets ( Point const &  startA,
Vector const &  dirA,
Point const &  startB,
Vector const &  dirB 
)

Returns the point of a line that is closest to a second line.

Template Parameters
Pointa type describing a point
Vectora type describing a direction (displacement vector)
Parameters
refAa reference point on the first line
dirAthe direction of the first line
refBa reference point on the second line
dirBthe direction of the second line
Returns
a data structure with three fields: point: the point of A closest to B, offset1: its offset on A in units of dirA, offset2: its offset on B in units of dirB
See also
LineClosestPointWithUnitVectors()
LineClosestPointAndOffsets()

The point of line A that is closest to line B is returned.

This function is equivalent to LineClosestPoint(), but it returns in addition the offsets of the intersection point from the reference points of the two lines, in the direction specified by dirA/dirB.

The return value is a data structure of type geo::IntersectionPointAndOffsets, which is most easily unpacked immediately:

auto [ point, offsetA, offsetB ] = geo::LineClosestPointAndOffsets(
geo::Point_t{ 2, 0, 1 }, geo::Vector_t{ 0.0, 0.5, 0.0 },
geo::Point_t{ 0, 1, 0 }, geo::Vector_t{ 0.866, 0.0, 0.0 }
);

will set point to geo::Point{ 2, 1, 1 }, offsetA to 2 and offsetB to 2.309.... To reassign the variables after they have been defined, though, a temporary structure is needed:

auto const xsectAndOfs = geo::LineClosestPointAndOffsets(
geo::Point_t{ 0, 1, 0 }, geo::Vector_t{ 0.866, 0.0, 0.0 },
geo::Point_t{ 2, 0, 1 }, geo::Vector_t{ 0.0, 0.5, 0.0 }
);
point = xsectAndOfs.point;
offsetA = xsectAndOfs.offset1;
offsetB = xsectAndOfs.offset2;

(point to geo::Point{ 2, 1, 0 }, offsetA to 2.039... and offsetB to 2, because the intersection point is always on the first line).

template<typename Point , typename UnitVector >
IntersectionPointAndOffsets<Point> geo::LineClosestPointAndOffsetsWithUnitVectors ( Point const &  startA,
UnitVector const &  dirA,
Point const &  startB,
UnitVector const &  dirB 
)

Returns the point of a line that is closest to a second line.

Template Parameters
Pointa type describing a point
UnitVectora type describing a direction (unit vector)
Parameters
refAa reference point on the first line
dirAthe direction of the first line (unity-normed)
refBa reference point on the second line
dirBthe direction of the second line (unity-normed)
Returns
a data structure with three fields: point: the point of A closest to B, offset1: its offset on A in units of dirA (i.e. unity), offset2: its offset on B in units of dirB (i.e. unity)
See also
LineClosestPointWithUnitVectors()
LineClosestPointAndOffsets()

The point of line A that is closest to line B is returned.

The return value is a data structure of type geo::IntersectionPointAndOffsets, which is most easily unpacked immediately:

auto [ point, offsetA, offsetB ] = geo::LineClosestPointAndOffsetsWithUnitVectors(
geo::Point_t{ 2, 0, 1 }, geo::Vector_t{ 0, 1, 0 },
geo::Point_t{ 0, 1, 0 }, geo::Vector_t{ 1, 0, 0 }
);

will set point to geo::Point{ 2, 1, 1 }, offsetA to 1 and offsetB to 2. To reassign the variables after they have been defined, instead:

geo::Point_t{ 0, 1, 0 }, geo::Vector_t{ 1, 0, 0 },
geo::Point_t{ 2, 0, 1 }, geo::Vector_t{ 0, 1, 0 }
);
point = xsectAndOfs.point;
offsetA = xsectAndOfs.offset1;
offsetB = xsectAndOfs.offset2;

(point to geo::Point{ 2, 1, 0 }, offsetA to 2 and offsetB to 1, because the intersection point is always on the first line).

template<typename Point , typename UnitVector >
Point geo::LineClosestPointWithUnitVectors ( Point const &  startA,
UnitVector const &  dirA,
Point const &  startB,
UnitVector const &  dirB 
)

Returns the point of a line that is closest to a second line.

Template Parameters
Pointa type describing a point
UnitVectora type describing a direction (unit vector)
Parameters
refAa reference point on the first line
dirAthe direction of the first line (unity-normed)
refBa reference point on the second line
dirBthe direction of the second line (unity-normed)
Returns
the point of A closest to B
See also
LineClosestPointAndOffsetsWithUnitVectors(), LineClosestPoint()

The point of line A that is closest to line B is returned.

The two lines are assumed not to be parallel, and when this prerequisite is not met the behaviour is undefined.

The two directions are required to have norm 1. While formally if this prerequisite is not met the result is undefined, the result will be still mostly correct if their norm departs from unity only by a rounding error. The more the vectors deviate from that condition, the larger the error in the result.

Note
This formulation is valid for lines in a Euclidean space of any dimension; the minimized distance is the Euclidean one.

A separate function, LineClosestPointAndOffsetsWithUnitVectors(), also returne the offset of the intersection from the two reference points.

Requirements

The following operations between points, vectors and scalars must be defined:

  • Vector operator* (UnitVector, double): scaling of a unit vector by a real factor to produce a non-unit vector;
  • Vector operator- (Point, Point): the difference of two points always exists and it returns a Vector;
  • Point operator+ (Point, Vector): translation of a point by a displacement vector;
  • double dot(Vector, UnitVector), double dot(UnitVector, UnitVector): scalar (inner) product of one unit vector and a vector, or two unit vectors.
template<typename Trans >
decltype(auto) geo::makeTransformationMatrix ( Trans &&  trans)

Converts a transformation matrix into a geo::TransformationMatrix.

Definition at line 35 of file TransformationMatrix.h.

36  { return convertTransformationMatrix<geo::TransformationMatrix>(trans); }
constexpr bool geo::operator!= ( CryostatID const &  a,
CryostatID const &  b 
)
inline

Comparison: the IDs point to different cryostats (validity is ignored)

Definition at line 702 of file geo_types.h.

703  { return a.Cryostat != b.Cryostat; }
const double a
static bool * b
Definition: config.cpp:1043
constexpr bool geo::operator!= ( OpDetID const &  a,
OpDetID const &  b 
)
inline

Comparison: IDs point to different optical detectors (validity is ignored)

Definition at line 715 of file geo_types.h.

716  { return (a.asCryostatID() != b.asCryostatID()) || (a.OpDet != b.OpDet); }
const double a
static bool * b
Definition: config.cpp:1043
constexpr bool geo::operator!= ( TPCID const &  a,
TPCID const &  b 
)
inline

Comparison: the IDs point to different TPCs (validity is ignored)

Definition at line 736 of file geo_types.h.

736  {
737  return
738  (static_cast<CryostatID const&>(a) != static_cast<CryostatID const&>(b))
739  || (a.TPC != b.TPC);
740  } // operator!= (TPCID, TPCID)
const double a
static bool * b
Definition: config.cpp:1043
constexpr bool geo::operator!= ( PlaneID const &  a,
PlaneID const &  b 
)
inline

Comparison: the IDs point to different planes (validity is ignored)

Definition at line 760 of file geo_types.h.

760  {
761  return
762  (static_cast<TPCID const&>(a) != static_cast<TPCID const&>(b))
763  || (a.Plane != b.Plane);
764  } // operator!= (PlaneID, PlaneID)
const double a
static bool * b
Definition: config.cpp:1043
constexpr bool geo::operator!= ( WireID const &  a,
WireID const &  b 
)
inline

Comparison: the IDs point to different wires (validity is ignored)

Definition at line 784 of file geo_types.h.

784  {
785  return
786  (static_cast<PlaneID const&>(a) != static_cast<PlaneID const&>(b))
787  || (a.Wire != b.Wire);
788  } // operator!= (WireID, WireID)
const double a
static bool * b
Definition: config.cpp:1043
constexpr bool geo::operator< ( CryostatID const &  a,
CryostatID const &  b 
)
inline

Order cryostats with increasing ID.

Definition at line 706 of file geo_types.h.

707  { return a.Cryostat < b.Cryostat; }
const double a
static bool * b
Definition: config.cpp:1043
constexpr bool geo::operator< ( OpDetID const &  a,
OpDetID const &  b 
)
inline

Order OpDetID in increasing Cryo, then OpDet.

Definition at line 719 of file geo_types.h.

719  {
720  int cmp_res = a.asCryostatID().cmp(b);
721  if (cmp_res == 0) // same cryostat: compare optical detectors
722  return a.OpDet < b.OpDet;
723  else // return the order of cryostats
724  return cmp_res < 0;
725  } // operator< (OpDetID, OpDetID)
const double a
static bool * b
Definition: config.cpp:1043
constexpr bool geo::operator< ( TPCID const &  a,
TPCID const &  b 
)
inline

Order TPCID in increasing Cryo, then TPC.

Definition at line 743 of file geo_types.h.

743  {
744  int cmp_res = (static_cast<CryostatID const&>(a)).cmp(b);
745  if (cmp_res == 0) // same cryostat: compare TPC
746  return a.TPC < b.TPC;
747  else // return the order of cryostats
748  return cmp_res < 0;
749  } // operator< (TPCID, TPCID)
IDparameter< geo::CryostatID > CryostatID
Member type of validated geo::CryostatID parameter.
const double a
static bool * b
Definition: config.cpp:1043
constexpr bool geo::operator< ( PlaneID const &  a,
PlaneID const &  b 
)
inline

Order PlaneID in increasing TPC, then plane.

Definition at line 767 of file geo_types.h.

767  {
768  int cmp_res = (static_cast<TPCID const&>(a)).cmp(b);
769  if (cmp_res == 0) // same TPC: compare plane
770  return a.Plane < b.Plane;
771  else // return the order of TPC
772  return cmp_res < 0;
773  } // operator< (PlaneID, PlaneID)
const double a
static bool * b
Definition: config.cpp:1043
IDparameter< geo::TPCID > TPCID
Member type of validated geo::TPCID parameter.
constexpr bool geo::operator< ( WireID const &  a,
WireID const &  b 
)
inline

Definition at line 791 of file geo_types.h.

791  {
792  int cmp_res = (static_cast<PlaneID const&>(a)).cmp(b);
793  if (cmp_res == 0) // same plane: compare wire
794  return a.Wire < b.Wire;
795  else // return the order of planes
796  return cmp_res < 0;
797  } // operator< (WireID, WireID)
const double a
static bool * b
Definition: config.cpp:1043
detail::Node< FrameID, bool > PlaneID
Definition: CRTID.h:125
std::ostream& geo::operator<< ( std::ostream &  out,
CryostatID const &  cid 
)
inline

Generic output of CryostatID to stream.

Definition at line 653 of file geo_types.h.

653  {
654  out << "C:" << cid.Cryostat;
655  return out;
656  } // operator<< (CryostatID)
std::ostream& geo::operator<< ( std::ostream &  out,
OpDetID const &  oid 
)
inline

Generic output of OpDetID to stream.

Definition at line 660 of file geo_types.h.

660  {
661  out << oid.asCryostatID() << " O:" << oid.OpDet;
662  return out;
663  } // operator<< (OpDetID)
std::ostream& geo::operator<< ( std::ostream &  out,
TPCID const &  tid 
)
inline

Generic output of TPCID to stream.

Definition at line 667 of file geo_types.h.

667  {
668  out << ((CryostatID const&) tid) << " T:" << tid.TPC;
669  return out;
670  } // operator<< (TPCID)
IDparameter< geo::CryostatID > CryostatID
Member type of validated geo::CryostatID parameter.
std::ostream& geo::operator<< ( std::ostream &  out,
PlaneID const &  pid 
)
inline

Generic output of PlaneID to stream.

Definition at line 674 of file geo_types.h.

674  {
675  out << ((TPCID const&) pid) << " P:" << pid.Plane;
676  return out;
677  } // operator<< (PlaneID)
IDparameter< geo::TPCID > TPCID
Member type of validated geo::TPCID parameter.
std::ostream& geo::operator<< ( std::ostream &  out,
WireID const &  wid 
)
inline

Generic output of WireID to stream.

Definition at line 681 of file geo_types.h.

681  {
682  out << ((PlaneID const&) wid) << " W:" << wid.Wire;
683  return out;
684  } // operator<< (WireID)
detail::Node< FrameID, bool > PlaneID
Definition: CRTID.h:125
constexpr bool geo::operator== ( CryostatID const &  a,
CryostatID const &  b 
)
inline

Comparison: the IDs point to the same cryostat (validity is ignored)

Definition at line 698 of file geo_types.h.

699  { return a.Cryostat == b.Cryostat; }
const double a
static bool * b
Definition: config.cpp:1043
constexpr bool geo::operator== ( OpDetID const &  a,
OpDetID const &  b 
)
inline

Comparison: the IDs point to same optical detector (validity is ignored)

Definition at line 711 of file geo_types.h.

712  { return (a.asCryostatID() == b.asCryostatID()) && (a.OpDet == b.OpDet); }
const double a
static bool * b
Definition: config.cpp:1043
constexpr bool geo::operator== ( TPCID const &  a,
TPCID const &  b 
)
inline

Comparison: the IDs point to the same TPC (validity is ignored)

Definition at line 729 of file geo_types.h.

729  {
730  return
731  (static_cast<CryostatID const&>(a) == static_cast<CryostatID const&>(b))
732  && (a.TPC == b.TPC);
733  } // operator== (TPCID, TPCID)
const double a
static bool * b
Definition: config.cpp:1043
constexpr bool geo::operator== ( PlaneID const &  a,
PlaneID const &  b 
)
inline

Comparison: the IDs point to the same plane (validity is ignored)

Definition at line 753 of file geo_types.h.

753  {
754  return
755  (static_cast<TPCID const&>(a) == static_cast<TPCID const&>(b))
756  && (a.Plane == b.Plane);
757  } // operator== (PlaneID, PlaneID)
const double a
static bool * b
Definition: config.cpp:1043
constexpr bool geo::operator== ( WireID const &  a,
WireID const &  b 
)
inline

Comparison: the IDs point to the same wire (validity is ignored)

Definition at line 777 of file geo_types.h.

777  {
778  return
779  (static_cast<PlaneID const&>(a) == static_cast<PlaneID const&>(b))
780  && (a.Wire == b.Wire);
781  } // operator== (WireID, WireID)
const double a
static bool * b
Definition: config.cpp:1043
template<typename Point = Point_t>
constexpr Point geo::origin ( )

Returns a origin position with a point of the specified type.

Definition at line 227 of file geo_vectors.h.

227 { return { 0.0, 0.0, 0.0 }; }
void geo::ProjectToBoxEdge ( const double  xyz[],
const double  dxyz[],
double  xlo,
double  xhi,
double  ylo,
double  yhi,
double  zlo,
double  zhi,
double  xyzout[] 
)
inline

Project along a direction from a particular starting point to the edge of a box

Parameters
xyz- The starting x,y,z location. Must be inside box.
dxyz- Direction vector
xlo- Low edge of box in x
xhi- Low edge of box in x
ylo- Low edge of box in y
yhi- Low edge of box in y
zlo- Low edge of box in z
zhi- Low edge of box in z
xyzout- On output, the position at the box edge

Note: It should be safe to use the same array for input and output.

Definition at line 49 of file geo.h.

55 {
56  // Make sure we're inside the box!
57  if( !(xyz[0]>=xlo && xyz[0]<=xhi) ||
58  !(xyz[1]>=ylo && xyz[1]<=yhi) ||
59  !(xyz[2]>=zlo && xyz[2]<=zhi) )
60  throw cet::exception("ProjectToBoxEdge") << "desired point is not"
61  << " in the specififed box\n";
62 
63  // Compute the distances to the x/y/z walls
64  double dx = 99.E99;
65  double dy = 99.E99;
66  double dz = 99.E99;
67  if (dxyz[0]>0.0) { dx = (xhi-xyz[0])/dxyz[0]; }
68  else if (dxyz[0]<0.0) { dx = (xlo-xyz[0])/dxyz[0]; }
69  if (dxyz[1]>0.0) { dy = (yhi-xyz[1])/dxyz[1]; }
70  else if (dxyz[1]<0.0) { dy = (ylo-xyz[1])/dxyz[1]; }
71  if (dxyz[2]>0.0) { dz = (zhi-xyz[2])/dxyz[2]; }
72  else if (dxyz[2]<0.0) { dz = (zlo-xyz[2])/dxyz[2]; }
73 
74  // Choose the shortest distance
75  double d = 0.0;
76  if (dx<dy && dx<dz) d = dx;
77  else if (dy<dz && dy<dx) d = dy;
78  else if (dz<dx && dz<dy) d = dz;
79 
80  // Make the step
81  for (int i=0; i<3; ++i) {
82  xyzout[i] = xyz[i] + dxyz[i]*d;
83  }
84 }
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
std::string geo::SignalTypeName ( geo::SigType_t  sigType)

Returns the name of the specified signal type.

Definition at line 19 of file geo_types.cxx.

19  {
20  switch (sigType) {
21  case geo::kInduction: return "induction";
22  case geo::kCollection: return "collection";
23  case geo::kMysteryType: return "unknown";
24  } // switch
25  throw std::logic_error(
26  "geo::SignalTypeName(): unexpected signal type #"
27  + std::to_string(static_cast<int>(sigType))
28  );
29 } // geo::SignalTypeName()
Who knows?
Definition: geo_types.h:147
Signal from induction planes.
Definition: geo_types.h:145
std::string to_string(ModuleType const mt)
Definition: ModuleType.h:34
Signal from collection planes.
Definition: geo_types.h:146
static bool geo::sortAuxDet35 ( const AuxDetGeo ad1,
const AuxDetGeo ad2 
)
static

Definition at line 25 of file GeoObjectSorter35.cxx.

26  {
27 
28  double xyz1[3] = {0.};
29  double xyz2[3] = {0.};
30  double local[3] = {0.};
31  ad1.LocalToWorld(local, xyz1);
32  ad2.LocalToWorld(local, xyz2);
33 
34  // AuxDet groups in 35t may have a couple-cm difference in vertical pos
35  // Adjusting for this messes up sorting between the top layers of AuxDets
36  float VertEps(0);
37  if ( strncmp( (ad1.TotalVolume())->GetName(), "volAuxDetTrap", 13) == 0 ) VertEps = 13;
38  else if( strncmp( (ad1.TotalVolume())->GetName(), "volAuxDetBox", 12) == 0 ) VertEps = 1;
39 
40  // First sort all AuxDets into same-y groups
41  if( xyz1[1] < xyz2[1] && xyz2[1]-xyz1[1] >= VertEps ) return true;
42 
43  // Within a same-y group, sort AuxDets into same-x groups
44  if( std::abs(xyz2[1]-xyz1[1]) < VertEps && xyz1[0] < xyz2[0]) return true;
45 
46  // Within a same-x, same-y group, sort AuxDets according to z
47  if(xyz1[0] == xyz2[0] && std::abs(xyz2[1]-xyz1[1]) < VertEps && xyz1[2] < xyz2[2]) return true;
48 
49  // none of those are true, so return false
50  return false;
51 
52  }
T abs(T value)
static bool geo::sortAuxDetAPA ( const AuxDetGeo ad1,
const AuxDetGeo ad2 
)
static

Definition at line 20 of file GeoObjectSorterAPA.cxx.

21  {
22 
23  // NOTE: This initial sorting is arbitrary, there
24  // are no APAAlg users using AuxDet yet
25 
26  double xyz1[3] = {0.};
27  double xyz2[3] = {0.};
28  double local[3] = {0.};
29  ad1.LocalToWorld(local, xyz1);
30  ad2.LocalToWorld(local, xyz2);
31 
32  // First sort all AuxDets into same-y groups
33  if(xyz1[1] < xyz2[1]) return true;
34 
35  // Within a same-y group, sort TPCs into same-z groups
36  if(xyz1[1] == xyz2[1] && xyz1[2] < xyz2[2]) return true;
37 
38  // Within a same-z, same-y group, sort TPCs according to x
39  if(xyz1[2] == xyz2[2] && xyz1[1] == xyz2[1] && xyz1[0] < xyz2[0]) return true;
40 
41  // none of those are true, so return false
42  return false;
43 
44  }
static bool geo::sortAuxDetCRM ( const AuxDetGeo ad1,
const AuxDetGeo ad2 
)
static

Definition at line 26 of file GeoObjectSorterCRM.cxx.

27  {
28 
29  // sort based off of GDML name, assuming ordering is encoded
30  std::string ad1name = (ad1.TotalVolume())->GetName();
31  std::string ad2name = (ad2.TotalVolume())->GetName();
32 
33  // assume volume name is "volAuxDet##"
34  int ad1Num = atoi( ad1name.substr( 9, ad1name.size()).c_str() );
35  int ad2Num = atoi( ad2name.substr( 9, ad2name.size()).c_str() );
36 
37  return ad1Num < ad2Num;
38 
39  }
std::string string
Definition: nybbler.cc:12
static bool geo::sortAuxDetSensitive35 ( const AuxDetSensitiveGeo ad1,
const AuxDetSensitiveGeo ad2 
)
static

Definition at line 55 of file GeoObjectSorter35.cxx.

56  {
57 
58  double xyz1[3] = {0.};
59  double xyz2[3] = {0.};
60  double local[3] = {0.};
61  ad1.LocalToWorld(local, xyz1);
62  ad2.LocalToWorld(local, xyz2);
63 
64  // AuxDet groups in 35t may have a couple-cm difference in vertical pos
65  // Adjusting for this messes up sorting between the top layers of AuxDets
66  float VertEps(0);
67  if ( strncmp( (ad1.TotalVolume())->GetName(), "volAuxDetTrapSensitive", 13) == 0 ) VertEps = 13;
68  else if( strncmp( (ad1.TotalVolume())->GetName(), "volAuxDetBoxSensitive", 12) == 0 ) VertEps = 1;
69 
70  // First sort all AuxDets into same-y groups
71  if( xyz1[1] < xyz2[1] && xyz2[1]-xyz1[1] >= VertEps ) return true;
72 
73  // Within a same-y group, sort AuxDets into same-x groups
74  if( std::abs(xyz2[1]-xyz1[1]) < VertEps && xyz1[0] < xyz2[0]) return true;
75 
76  // Within a same-x, same-y group, sort AuxDets according to z
77  if(xyz1[0] == xyz2[0] && std::abs(xyz2[1]-xyz1[1]) < VertEps && xyz1[2] < xyz2[2]) return true;
78 
79  // none of those are true, so return false
80  return false;
81 
82  }
T abs(T value)
static bool geo::sortAuxDetSensitiveAPA ( const AuxDetSensitiveGeo ad1,
const AuxDetSensitiveGeo ad2 
)
static

Definition at line 47 of file GeoObjectSorterAPA.cxx.

48  {
49 
50  // NOTE: This initial sorting is arbitrary, there
51  // are no APAAlg users using AuxDet yet
52 
53  double xyz1[3] = {0.};
54  double xyz2[3] = {0.};
55  double local[3] = {0.};
56  ad1.LocalToWorld(local, xyz1);
57  ad2.LocalToWorld(local, xyz2);
58 
59  // First sort all AuxDets into same-y groups
60  if(xyz1[1] < xyz2[1]) return true;
61 
62  // Within a same-y group, sort TPCs into same-z groups
63  if(xyz1[1] == xyz2[1] && xyz1[2] < xyz2[2]) return true;
64 
65  // Within a same-z, same-y group, sort TPCs according to x
66  if(xyz1[2] == xyz2[2] && xyz1[1] == xyz2[1] && xyz1[0] < xyz2[0]) return true;
67 
68  // none of those are true, so return false
69  return false;
70 
71  }
static bool geo::sortAuxDetSensitiveCRM ( const AuxDetSensitiveGeo ad1,
const AuxDetSensitiveGeo ad2 
)
static

Definition at line 43 of file GeoObjectSorterCRM.cxx.

44  {
45 
46  // sort based off of GDML name, assuming ordering is encoded
47  std::string ad1name = (ad1.TotalVolume())->GetName();
48  std::string ad2name = (ad2.TotalVolume())->GetName();
49 
50  // assume volume name is "volAuxDetSensitive##"
51  int ad1Num = atoi( ad1name.substr( 9, ad1name.size()).c_str() );
52  int ad2Num = atoi( ad2name.substr( 9, ad2name.size()).c_str() );
53 
54  return ad1Num < ad2Num;
55 
56  }
std::string string
Definition: nybbler.cc:12
static bool geo::sortAuxDetSensitiveStandard ( const AuxDetSensitiveGeo ad1,
const AuxDetSensitiveGeo ad2 
)
static

Definition at line 43 of file GeoObjectSorterStandard.cxx.

44  {
45  // sort based off of GDML name, assuming ordering is encoded
46  std::string ad1name = (ad1.TotalVolume())->GetName();
47  std::string ad2name = (ad2.TotalVolume())->GetName();
48 
49  // assume volume name is "volAuxDetSensitive##"
50  int ad1Num = atoi( ad1name.substr( 9, ad1name.size()).c_str() );
51  int ad2Num = atoi( ad2name.substr( 9, ad2name.size()).c_str() );
52 
53  return ad1Num < ad2Num;
54  }
std::string string
Definition: nybbler.cc:12
static bool geo::sortAuxDetStandard ( const AuxDetGeo ad1,
const AuxDetGeo ad2 
)
static

Definition at line 27 of file GeoObjectSorterStandard.cxx.

28  {
29  // sort based off of GDML name, assuming ordering is encoded
30  std::string const& ad1name = ad1.TotalVolume()->GetName();
31  std::string const& ad2name = ad2.TotalVolume()->GetName();
32 
33  // assume volume name is "volAuxDet##"
34  int ad1Num = atoi( ad1name.substr( 9, ad1name.size()).c_str() );
35  int ad2Num = atoi( ad2name.substr( 9, ad2name.size()).c_str() );
36 
37  return ad1Num < ad2Num;
38 
39  }
std::string string
Definition: nybbler.cc:12
static bool geo::sortCryo35 ( const CryostatGeo c1,
const CryostatGeo c2 
)
static

Definition at line 88 of file GeoObjectSorter35.cxx.

89  {
90  double xyz1[3] = {0.}, xyz2[3] = {0.};
91  double local[3] = {0.};
92  c1.LocalToWorld(local, xyz1);
93  c2.LocalToWorld(local, xyz2);
94 
95  return xyz1[0] < xyz2[0];
96  }
static bool geo::sortCryoAPA ( const CryostatGeo c1,
const CryostatGeo c2 
)
static

Definition at line 76 of file GeoObjectSorterAPA.cxx.

77  {
78  double xyz1[3] = {0.}, xyz2[3] = {0.};
79  double local[3] = {0.};
80  c1.LocalToWorld(local, xyz1);
81  c2.LocalToWorld(local, xyz2);
82 
83  return xyz1[0] < xyz2[0];
84  }
static bool geo::sortCryoCRM ( const CryostatGeo c1,
const CryostatGeo c2 
)
static

Definition at line 60 of file GeoObjectSorterCRM.cxx.

61  {
62  double xyz1[3] = {0.}, xyz2[3] = {0.};
63  double local[3] = {0.};
64  c1.LocalToWorld(local, xyz1);
65  c2.LocalToWorld(local, xyz2);
66 
67  return xyz1[0] < xyz2[0];
68  }
static bool geo::sortCryoStandard ( const CryostatGeo c1,
const CryostatGeo c2 
)
static

Definition at line 58 of file GeoObjectSorterStandard.cxx.

59  {
60  double xyz1[3] = {0.}, xyz2[3] = {0.};
61  double local[3] = {0.};
62  c1.LocalToWorld(local, xyz1);
63  c2.LocalToWorld(local, xyz2);
64 
65  return xyz1[0] < xyz2[0];
66  }
bool geo::sortorderOpDet ( const OpDetGeo t1,
const OpDetGeo t2 
)
inline

Definition at line 10 of file OpDetSorter.h.

11  {
12  double xyz1[3] = {0.}, xyz2[3] = {0.};
13  double local[3] = {0.};
14  t1.LocalToWorld(local, xyz1);
15  t2.LocalToWorld(local, xyz2);
16 
17  if(xyz1[0]!=xyz2[0])
18  return xyz1[0]>xyz2[0];
19  else if(xyz1[2]!=xyz2[2])
20  return xyz1[2]>xyz2[2];
21  else
22  return xyz1[1]>xyz2[1];
23  }
static bool geo::sortorderOpDets ( const OpDetGeo t1,
const OpDetGeo t2 
)
static

Definition at line 16 of file GeoObjectSorter.cxx.

17  {
18  double xyz1[3] = {0.}, xyz2[3] = {0.};
19  double local[3] = {0.};
20  t1.LocalToWorld(local, xyz1);
21  t2.LocalToWorld(local, xyz2);
22 
23  if(xyz1[2]!=xyz2[2])
24  return xyz1[2]>xyz2[2];
25  else if(xyz1[1]!=xyz2[1])
26  return xyz1[1]>xyz2[1];
27  else
28  return xyz1[0]>xyz2[0];
29  }
static bool geo::sortPlane35 ( const PlaneGeo p1,
const PlaneGeo p2 
)
static

Definition at line 136 of file GeoObjectSorter35.cxx.

137  {
138  double xyz1[3] = {0.};
139  double xyz2[3] = {0.};
140  double local[3] = {0.};
141  p1.LocalToWorld(local, xyz1);
142  p2.LocalToWorld(local, xyz2);
143 
144  //mf::LogVerbatim("sortPlanes35") << "Sorting planes: ("
145  // << xyz1[0] <<","<< xyz1[1] <<","<< xyz1[2] << ") and ("
146  // << xyz2[0] <<","<< xyz2[1] <<","<< xyz2[2] << ")";
147 
148  return xyz1[0] > xyz2[0];
149  }
static bool geo::sortPlaneAPA ( const PlaneGeo p1,
const PlaneGeo p2 
)
static

Definition at line 118 of file GeoObjectSorterAPA.cxx.

119  {
120  double xyz1[3] = {0.};
121  double xyz2[3] = {0.};
122  double local[3] = {0.};
123  p1.LocalToWorld(local, xyz1);
124  p2.LocalToWorld(local, xyz2);
125 
126  return xyz1[0] > xyz2[0];
127  }
static bool geo::sortPlaneCRM ( const PlaneGeo p1,
const PlaneGeo p2 
)
static

Definition at line 93 of file GeoObjectSorterCRM.cxx.

94  {
95  double xyz1[3] = {0.};
96  double xyz2[3] = {0.};
97  double local[3] = {0.};
98  p1.LocalToWorld(local, xyz1);
99  p2.LocalToWorld(local, xyz2);
100 
101  // drift direction is negative, plane number increases in drift direction
102  return xyz1[0] > xyz2[0];
103  }
static bool geo::sortPlaneStandard ( const PlaneGeo p1,
const PlaneGeo p2 
)
static

Definition at line 86 of file GeoObjectSorterStandard.cxx.

87  {
88  double xyz1[3] = {0.};
89  double xyz2[3] = {0.};
90  double local[3] = {0.};
91  p1.LocalToWorld(local, xyz1);
92  p2.LocalToWorld(local, xyz2);
93 
94  // drift direction is negative, plane number increases in drift direction
95  if(std::abs(xyz1[0]-xyz2[0]) > DistanceTol)
96  return xyz1[0] > xyz2[0];
97 
98  //if same drift, sort by z
99  if(std::abs(xyz1[2]-xyz2[2]) > DistanceTol)
100  return xyz1[2] < xyz2[2];
101 
102  //if same z, sort by y
103  return xyz1[1] < xyz2[1];
104  }
T abs(T value)
static bool geo::sortTPC35 ( const TPCGeo t1,
const TPCGeo t2 
)
static

Definition at line 101 of file GeoObjectSorter35.cxx.

102  {
103  double xyz1[3] = {0.};
104  double xyz2[3] = {0.};
105  double local[3] = {0.};
106  t1.LocalToWorld(local, xyz1);
107  t2.LocalToWorld(local, xyz2);
108 
109  // very useful for aligning volume sorting with GDML bounds
110  // --> looking at this output is one way to find the z-borders between APAs,
111  // which tells soreWire35 to sort depending on z position via "InVertSplitRegion"
112  //mf::LogVerbatim("sortTPC35") << "tpx z range = " << xyz1[2] - t1->Length()/2
113  // << " to " << xyz1[2] + t1->Length()/2;
114 
115  // The goal is to number TPCs first in the x direction so that,
116  // in the case of APA configuration, TPCs 2c and 2c+1 make up APA c.
117  // then numbering will go in y then in z direction.
118 
119  // First sort all TPCs into same-z groups
120  if(xyz1[2] < xyz2[2]) return true;
121 
122  // Within a same-z group, sort TPCs into same-y groups
123  if(xyz1[2] == xyz2[2] && xyz1[1] < xyz2[1]) return true;
124 
125  // Within a same-z, same-y group, sort TPCs according to x
126  if(xyz1[2] == xyz2[2] && xyz1[1] == xyz2[1] && xyz1[0] < xyz2[0]) return true;
127 
128  // none of those are true, so return false
129  return false;
130  }
static bool geo::sortTPCAPA ( const TPCGeo t1,
const TPCGeo t2 
)
static

Definition at line 89 of file GeoObjectSorterAPA.cxx.

90  {
91  double xyz1[3] = {0.};
92  double xyz2[3] = {0.};
93  double local[3] = {0.};
94  t1.LocalToWorld(local, xyz1);
95  t2.LocalToWorld(local, xyz2);
96 
97  // The goal is to number TPCs first in the x direction so that,
98  // in the case of APA configuration, TPCs 2c and 2c+1 make up APA c.
99  // then numbering will go in y then in z direction.
100 
101  // First sort all TPCs into same-z groups
102  if(xyz1[2] < xyz2[2]) return true;
103 
104  // Within a same-z group, sort TPCs into same-y groups
105  if(xyz1[2] == xyz2[2] && xyz1[1] < xyz2[1]) return true;
106 
107  // Within a same-z, same-y group, sort TPCs according to x
108  if(xyz1[2] == xyz2[2] && xyz1[1] == xyz2[1] && xyz1[0] < xyz2[0]) return true;
109 
110  // none of those are true, so return false
111  return false;
112  }
static bool geo::sortTPCCRM ( const TPCGeo t1,
const TPCGeo t2 
)
static

Definition at line 73 of file GeoObjectSorterCRM.cxx.

74  {
75  double xyz1[3] = {0.};
76  double xyz2[3] = {0.};
77  double local[3] = {0.};
78  t1.LocalToWorld(local, xyz1);
79  t2.LocalToWorld(local, xyz2);
80 
81  // First sort all TPCs into same-z groups
82  if(xyz1[2]<xyz2[2]) return true;
83 
84  // Within a same-z group, sort TPCs into same-y groups
85  if(xyz1[2] == xyz2[2] && xyz1[1] < xyz2[1]) return true;
86 
87  return false;
88  }
static bool geo::sortTPCStandard ( const TPCGeo t1,
const TPCGeo t2 
)
static

Definition at line 71 of file GeoObjectSorterStandard.cxx.

72  {
73  double xyz1[3] = {0.};
74  double xyz2[3] = {0.};
75  double local[3] = {0.};
76  t1.LocalToWorld(local, xyz1);
77  t2.LocalToWorld(local, xyz2);
78 
79  // sort TPCs according to x
80  return xyz1[0] < xyz2[0];
81  }
bool geo::sortWireAPA ( WireGeo w1,
WireGeo w2 
)

Definition at line 131 of file GeoObjectSorterAPA.cxx.

131  {
132  double xyz1[3] = {0.};
133  double xyz2[3] = {0.};
134 
135  w1.GetCenter(xyz1); w2.GetCenter(xyz2);
136 
137  // we want the wires to be sorted such that the smallest corner wire
138  // on the readout end of a plane is wire zero, with wire number
139  // increasing away from that wire.
140 
141  // if a top TPC, count from top down
142  if( xyz1[1]>0 && xyz1[1] > xyz2[1] ) return true;
143 
144  // if a bottom TPC, count from bottom up
145  if( xyz1[1]<0 && xyz1[1] < xyz2[1] ) return true;
146 
147  // sort the all vertical wires to increase in +z direction
148  if( xyz1[1] == xyz2[1] && xyz1[2] < xyz2[2] ) return true;
149 
150  return false;
151  }
bool geo::sortWireCRM ( WireGeo const &  w1,
WireGeo const &  w2 
)

Definition at line 107 of file GeoObjectSorterCRM.cxx.

107  {
108 
109  std::array<double, 3> xyz1, xyz2;
110  w1.GetCenter(xyz1.data()); w2.GetCenter(xyz2.data());
111 
112  // for dual-phase we have to planes with wires perpendicular to each other
113  // sort wires in the increasing coordinate order
114 
115  if (std::abs(xyz1[0] - xyz2[0]) < 1.0E-4 && std::abs(xyz1[1] - xyz2[1]) < 1.0E-4 )
116  return xyz1[2] < xyz2[2];
117  else if (std::abs(xyz1[0] - xyz2[0]) < 1.0E-4 && std::abs(xyz1[2] - xyz2[2]) < 1.0E-4 )
118  return xyz1[1] < xyz2[1];
119  else if (std::abs(xyz1[1] - xyz2[1]) < 1.0E-4 && std::abs(xyz1[2] - xyz2[2]) < 1.0E-4 )
120  return xyz1[0] < xyz2[0];
121  else { // don't know what to do
122  throw cet::exception("GeoObjectSorterCRM")
123  << "Uknown sorting situation for the wires in a plane\n";
124  }
125  } // sortWireCRM()
T abs(T value)
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
static bool geo::sortWireStandard ( WireGeo const &  w1,
WireGeo const &  w2 
)
static

Definition at line 108 of file GeoObjectSorterStandard.cxx.

109  {
110  double xyz1[3] = {0.};
111  double xyz2[3] = {0.};
112 
113  w1.GetCenter(xyz1); w2.GetCenter(xyz2);
114 
115  //sort by z first
116  if(std::abs(xyz1[2]-xyz2[2]) > DistanceTol)
117  return xyz1[2] < xyz2[2];
118 
119  //if same z sort by y
120  if(std::abs(xyz1[1]-xyz2[1]) > DistanceTol)
121  return xyz1[1] < xyz2[1];
122 
123  //if same y sort by x
124  return xyz1[0] < xyz2[0];
125  }
T abs(T value)
template<typename StoredMatrix , typename ITER >
static StoredMatrix geo::transformationFromPath ( ITER  begin,
ITER  end 
)
static

Builds a matrix to go from local to world coordinates in one step.

template<typename StoredMatrix >
static StoredMatrix geo::transformationFromPath ( std::vector< TGeoNode const * > const &  path,
size_t  depth 
)
static

Builds a matrix to go from local to world coordinates in one step.

geo::Point_t geo::WiresIntersection ( geo::WireGeo const &  wireA,
geo::WireGeo const &  wireB 
)
inline

Returns the point of wireA that is closest to wireB.

Parameters
wireAthe first wire
wireBthe other wire
Returns
the point of wireA closest to wireB
See also
WiresIntersectionAndOffsets()

The point of wireA that is closest to wireB is returned.

The two wires are assumed not to be parallel, and when this prerequisite is not met the behaviour is undefined.

A separate function, WiresIntersectionAndOffsets(), also returns the offset of the intersection from the two reference points.

Definition at line 654 of file WireGeo.h.

655 {
656 
658  wireA.GetCenter<geo::Point_t>(), wireA.Direction<geo::Vector_t>(),
659  wireB.GetCenter<geo::Point_t>(), wireB.Direction<geo::Vector_t>()
660  );
661 
662 } // geo::WiresIntersection()
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space.
Definition: geo_vectors.h:164
Point LineClosestPointWithUnitVectors(Point const &startA, UnitVector const &dirA, Point const &startB, UnitVector const &dirB)
Returns the point of a line that is closest to a second line.
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
Definition: geo_vectors.h:184
geo::IntersectionPointAndOffsets< geo::Point_t > geo::WiresIntersectionAndOffsets ( geo::WireGeo const &  wireA,
geo::WireGeo const &  wireB 
)
inline

Returns the point of wireA that is closest to wireB.

Parameters
wireAthe first wire
wireBthe other wire
Returns
a data structure with three fields: point: the point of wireA closest to wireB; offset1: its offset on wireA [cm]; offset2: its offset on wireB [cm]
See also
WiresIntersection()

Computes the point of wireA that is closest to wireB.

The returned intersection point is the same as for geo::WiresIntersection(). The return value is actually triplet, though, which is most easily unpacked immediately:

auto [ point, offsetA, offsetB ] = geo::WiresIntersection(wireA, wireB);

The two other elements of the triplets are the distances of the intersection point from the center of this wire (offset in the example) and from the center of the other wire (otherOffset), in centimeters. The sign of the offsets are positive if the intersection points lie on the side pointed by the Direction() of the respective wires.

To reassign the variables after they have been defined, instead:

std::tie(point, offsetB, offsetA) = geo::WiresIntersection(wireB, wireA);

Definition at line 668 of file WireGeo.h.

669 {
670 
672  wireA.GetCenter<geo::Point_t>(), wireA.Direction<geo::Vector_t>(),
673  wireB.GetCenter<geo::Point_t>(), wireB.Direction<geo::Vector_t>()
674  );
675 
676 } // geo::WiresIntersectionAndOffsets()
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space.
Definition: geo_vectors.h:164
IntersectionPointAndOffsets< Point > LineClosestPointAndOffsetsWithUnitVectors(Point const &startA, UnitVector const &dirA, Point const &startB, UnitVector const &dirB)
Returns the point of a line that is closest to a second line.
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
Definition: geo_vectors.h:184
template<typename Vector = Vector_t>
constexpr Vector geo::Xaxis ( )

Returns a x axis vector of the specified type.

Definition at line 215 of file geo_vectors.h.

215 { return { 1.0, 0.0, 0.0 }; }
template<typename Vector = Vector_t>
constexpr Vector geo::Yaxis ( )

Returns a y axis vector of the specified type.

Definition at line 219 of file geo_vectors.h.

219 { return { 0.0, 1.0, 0.0 }; }
template<typename Vector = Vector_t>
constexpr Vector geo::Zaxis ( )

Returns a z axis vector of the specified type.

Definition at line 223 of file geo_vectors.h.

223 { return { 0.0, 0.0, 1.0 }; }