LArSoft
v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
|
Class to transform between world and local coordinates. More...
#include "LocalTransformationGeo.h"
Public Types | |
using | GlobalPoint_t = geo::Point_t |
Type for global 3D point. More... | |
using | GlobalVector_t = geo::Vector_t |
Type for global 3D displacement. More... | |
using | LocalPoint_t = LocalPoint |
Type for local 3D point. More... | |
using | LocalVector_t = LocalVector |
Type for local 3D displacement. More... | |
using | TransformationMatrix_t = StoredMatrix |
Type of transformation matrix. More... | |
Public Member Functions | |
LocalTransformationGeo (std::vector< TGeoNode const * > const &path, size_t depth) | |
Constructor: uses the specified transformation matrix. More... | |
GlobalPoint_t | toWorldCoords (LocalPoint_t const &local) const |
Transforms a point from local frame to world frame. More... | |
GlobalVector_t | toWorldCoords (LocalVector_t const &local) const |
Transforms a vector from local frame to world frame. More... | |
LocalPoint_t | toLocalCoords (GlobalPoint_t const &world) const |
Transforms a point from world frame to local frame. More... | |
LocalVector_t | toLocalCoords (GlobalVector_t const &world) const |
Transforms a vector from world frame to local frame. More... | |
void | LocalToWorld (double const *local, double *world) const |
Transforms a point from local frame to world frame. More... | |
void | LocalToWorldVect (double const *local, double *world) const |
Transforms a vector from local frame to world frame. More... | |
void | WorldToLocal (double const *world, double *local) const |
Transforms a point from world frame to local frame. More... | |
void | WorldToLocalVect (const double *world, double *local) const |
Transforms a vector from world frame to local frame. More... | |
TransformationMatrix_t const & | Matrix () const |
Direct access to the transformation matrix. More... | |
template<> | |
TGeoHMatrix | transformationFromPath (std::vector< TGeoNode const * > const &path, size_t depth) |
template<> | |
HepGeom::Transform3D | transformationFromPath (std::vector< TGeoNode const * > const &path, size_t depth) |
LocalTransformationGeo (TransformationMatrix_t const &matrix) | |
Constructor: uses the specified transformation matrix. More... | |
LocalTransformationGeo (TransformationMatrix_t &&matrix) | |
Constructor: uses the specified transformation matrix. More... | |
template<typename DestPoint , typename SrcPoint , typename = std::enable_if_t<!std::is_same<SrcPoint, DestPoint>::value>> | |
DestPoint | LocalToWorld (SrcPoint const &local) const |
Transforms a point from local frame to world frame. More... | |
template<typename Point > | |
Point | LocalToWorld (Point const &local) const |
Transforms a point from local frame to world frame. More... | |
template<typename DestVector , typename SrcVector , typename = std::enable_if_t<!std::is_same<SrcVector, DestVector>::value>> | |
DestVector | LocalToWorldVect (SrcVector const &local) const |
Transforms a vector from local frame to world frame. More... | |
template<typename Vector > | |
Vector | LocalToWorldVect (Vector const &local) const |
Transforms a vector from local frame to world frame. More... | |
template<typename DestPoint , typename SrcPoint , typename = std::enable_if_t<!std::is_same<SrcPoint, DestPoint>::value>> | |
DestPoint | WorldToLocal (SrcPoint const &world) const |
Transforms a point from world frame to local frame. More... | |
template<typename Point > | |
Point | WorldToLocal (Point const &world) const |
Transforms a point from world frame to local frame. More... | |
template<typename DestVector , typename SrcVector , typename = std::enable_if_t<!std::is_same<SrcVector, DestVector>::value>> | |
DestVector | WorldToLocalVect (SrcVector const &world) const |
Transforms a vector from world frame to local frame. More... | |
template<typename Vector > | |
Vector | WorldToLocalVect (Vector const &world) const |
Transforms a vector from world frame to local frame. More... | |
Static Public Member Functions | |
static TransformationMatrix_t | transformationFromPath (std::vector< TGeoNode const * > const &path, size_t depth) |
Builds a matrix to go from local to world coordinates in one step. More... | |
Protected Member Functions | |
template<typename DestPoint , typename SrcPoint > | |
DestPoint | LocalToWorldImpl (SrcPoint const &local) const |
template<typename DestVector , typename SrcVector > | |
DestVector | LocalToWorldVectImpl (SrcVector const &local) const |
template<typename DestPoint , typename SrcPoint > | |
DestPoint | WorldToLocalImpl (SrcPoint const &world) const |
template<typename DestVector , typename SrcVector > | |
DestVector | WorldToLocalVectImpl (SrcVector const &world) const |
Protected Attributes | |
TransformationMatrix_t | fGeoMatrix |
local to world transform More... | |
Private Types | |
using | Base_t = geo::LocalTransformation< StoredMatrix > |
Class to transform between world and local coordinates.
StoredMatrix | type of transformation matrix internally stored |
LocalPoint | type representing a local point |
LocalVector | type representing a local displacement vector |
geo::LocalTransformation
This class provides two directions of transformations (world to local and the other way around), for points and for vectors.
Compared to geo::LocalTransformation
, this class offers a simplified interface for the supported vectors: toWorldCoords()
and toLocalCoords()
apply the correct transformation depending on whether the argument is a point or a displacement vector.
geo::Point_t
and geo::Vector_t
are explicitly tagged to be in the global coordinate frame, but mechanically it will work just the same. Definition at line 52 of file LocalTransformationGeo.h.
|
private |
Definition at line 53 of file LocalTransformationGeo.h.
using geo::LocalTransformationGeo< StoredMatrix, LocalPoint, LocalVector >::GlobalPoint_t = geo::Point_t |
Type for global 3D point.
Definition at line 56 of file LocalTransformationGeo.h.
using geo::LocalTransformationGeo< StoredMatrix, LocalPoint, LocalVector >::GlobalVector_t = geo::Vector_t |
Type for global 3D displacement.
Definition at line 57 of file LocalTransformationGeo.h.
using geo::LocalTransformationGeo< StoredMatrix, LocalPoint, LocalVector >::LocalPoint_t = LocalPoint |
Type for local 3D point.
Definition at line 58 of file LocalTransformationGeo.h.
using geo::LocalTransformationGeo< StoredMatrix, LocalPoint, LocalVector >::LocalVector_t = LocalVector |
Type for local 3D displacement.
Definition at line 59 of file LocalTransformationGeo.h.
using geo::LocalTransformation< StoredMatrix >::TransformationMatrix_t = StoredMatrix |
Type of transformation matrix.
Definition at line 49 of file LocalTransformation.h.
|
inline |
Constructor: uses the specified transformation matrix.
matrix | the transformation matrix to be used |
The specified matrix is copied into a local copy.
Definition at line 70 of file LocalTransformationGeo.h.
Referenced by geo::LocalTransformationGeo< TGeoHMatrix, LocalPoint_t, LocalVector_t >::LocalTransformationGeo().
|
inline |
Constructor: uses the specified transformation matrix.
matrix | the transformation matrix to be used |
The specified matrix is copied into a local copy.
Definition at line 72 of file LocalTransformationGeo.h.
|
inline |
Constructor: uses the specified transformation matrix.
path | the path of ROOT geometry nodes |
depth | the index in the path of the last node to be considered |
The specified matrix is copied into a local copy.
Definition at line 84 of file LocalTransformationGeo.h.
|
inherited |
Transforms a point from local frame to world frame.
local | local coordinates: [0] x, [1] y, [2] z [cm] |
world | (output) corresponding world coordinates [cm] |
The full transformation is applied. Fox example:
center
will contain the world coordinates of the center of the volume, which is usually represented by the origin in the local coordinates.
In-place replacement is not supported: world
and local
buffers are assumed not to, and must not, overlap.
Referenced by geo::OpDetGeo::Length(), geo::AuxDetGeo::LocalToWorld(), geo::AuxDetSensitiveGeo::LocalToWorld(), geo::CryostatGeo::LocalToWorld(), geo::TPCGeo::LocalToWorld(), and geo::LocalTransformation< TGeoHMatrix >::LocalTransformation().
|
inlineinherited |
Transforms a point from local frame to world frame.
SrcPoint | type of the input (local) vector |
DestPoint | type of the output (world) vector (default: as Point ) |
local | local coordinates [cm] |
The full transformation is applied. Fox example:
center
will be a TVector3
containing the world coordinates of the center of the volume, which is usually represented by the origin in the local coordinates (a TVector3 is by default constructed to point to the origin).
Definition at line 119 of file LocalTransformation.h.
|
inlineinherited |
Transforms a point from local frame to world frame.
SrcPoint | type of the input (local) vector |
DestPoint | type of the output (world) vector (default: as Point ) |
local | local coordinates [cm] |
The full transformation is applied. Fox example:
center
will be a TVector3
containing the world coordinates of the center of the volume, which is usually represented by the origin in the local coordinates (a TVector3 is by default constructed to point to the origin).
Definition at line 122 of file LocalTransformation.h.
|
protectedinherited |
|
inherited |
Transforms a vector from local frame to world frame.
local | local coordinates: [0] x, [1] y, [2] z [cm] |
world | (output) corresponding world coordinates [cm] |
The translation is not applied, since the argument is supposed to be a vector, relative difference between two points.
In-place replacement is not supported: world
and local
buffers are assumed not to, and must not, overlap.
Referenced by geo::LocalTransformation< TGeoHMatrix >::LocalToWorld(), geo::OpDetGeo::LocalToWorldVect(), geo::AuxDetGeo::LocalToWorldVect(), geo::AuxDetSensitiveGeo::LocalToWorldVect(), geo::WireGeo::LocalToWorldVect(), geo::CryostatGeo::LocalToWorldVect(), and geo::TPCGeo::LocalToWorldVect().
|
inlineinherited |
Transforms a vector from local frame to world frame.
SrcVector | type of the input (local) vector |
DestVector | type of output (world) vector (default: as Vector ) |
local | local coordinates [cm] |
The translation is not applied, since the argument is supposed to be a vector, relative difference between two points.
Definition at line 154 of file LocalTransformation.h.
|
inlineinherited |
Transforms a vector from local frame to world frame.
SrcVector | type of the input (local) vector |
DestVector | type of output (world) vector (default: as Vector ) |
local | local coordinates [cm] |
The translation is not applied, since the argument is supposed to be a vector, relative difference between two points.
Definition at line 157 of file LocalTransformation.h.
|
protectedinherited |
|
inlineinherited |
Direct access to the transformation matrix.
Definition at line 247 of file LocalTransformation.h.
Referenced by geo::AuxDetGeo::AuxDetGeo(), and geo::TPCGeo::TPCGeo().
|
inline |
Transforms a point from world frame to local frame.
world | world coordinates [cm] |
The full transformation is applied. Fox example:
local
will be a LocalPoint_t
containing the local coordinates of the specified point.
Definition at line 133 of file LocalTransformationGeo.h.
Referenced by geo::OpDetGeo::toLocalCoords(), geo::AuxDetGeo::toLocalCoords(), geo::AuxDetSensitiveGeo::toLocalCoords(), geo::WireGeo::toLocalCoords(), geo::CryostatGeo::toLocalCoords(), and geo::TPCGeo::toLocalCoords().
|
inline |
Transforms a vector from world frame to local frame.
world | world coordinates: [0] x, [1] y, [2] z [cm] |
The translation is not applied, since the argument is supposed to be a vector, relative difference between two points.
Definition at line 144 of file LocalTransformationGeo.h.
|
inline |
Transforms a point from local frame to world frame.
local | local coordinates [cm] |
The full transformation is applied. Fox example:
center
will be a geo::Point_t
containing the world coordinates of the center of the volume, which is usually represented by the origin in the local coordinates.
Definition at line 103 of file LocalTransformationGeo.h.
Referenced by geo::OpDetGeo::toWorldCoords(), geo::AuxDetGeo::toWorldCoords(), geo::AuxDetSensitiveGeo::toWorldCoords(), geo::WireGeo::toWorldCoords(), geo::CryostatGeo::toWorldCoords(), and geo::TPCGeo::toWorldCoords().
|
inline |
Transforms a vector from local frame to world frame.
local | local coordinates [cm] |
The translation is not applied, since the argument is supposed to be a vector, relative difference between two points.
Definition at line 115 of file LocalTransformationGeo.h.
|
inherited |
Definition at line 30 of file LocalTransformation.cxx.
References geo::LocalTransformation< StoredMatrix >::transformationFromPath().
|
inherited |
Definition at line 45 of file LocalTransformation.cxx.
References mat, and geo::LocalTransformation< StoredMatrix >::transformationFromPath().
|
staticinherited |
Builds a matrix to go from local to world coordinates in one step.
Referenced by geo::LocalTransformation< TGeoHMatrix >::Matrix(), and geo::LocalTransformation< StoredMatrix >::transformationFromPath().
|
inherited |
Transforms a point from world frame to local frame.
world | world coordinates: [0] x, [1] y, [2] z [cm] |
local | (output) corresponding local coordinates [cm] |
The full transformation is applied. Fox example:
local
will contain the local coordinates of the specified point.
In-place replacement is not supported: world
and local
buffers are assumed not to, and must not, overlap.
Referenced by geo::LocalTransformation< TGeoHMatrix >::LocalToWorldVect(), geo::OpDetGeo::WorldToLocal(), geo::AuxDetGeo::WorldToLocal(), geo::AuxDetSensitiveGeo::WorldToLocal(), geo::WireGeo::WorldToLocal(), geo::CryostatGeo::WorldToLocal(), and geo::TPCGeo::WorldToLocal().
|
inlineinherited |
Transforms a point from world frame to local frame.
SrcPoint | type of the input (local) vector |
DestPoint | type of the output (world) vector (default: as Point ) |
world | world coordinates [cm] |
The full transformation is applied. Fox example:
local
will be a TVector3
containing the local coordinates of the specified point.
Definition at line 202 of file LocalTransformation.h.
|
inlineinherited |
Transforms a point from world frame to local frame.
SrcPoint | type of the input (local) vector |
DestPoint | type of the output (world) vector (default: as Point ) |
world | world coordinates [cm] |
The full transformation is applied. Fox example:
local
will be a TVector3
containing the local coordinates of the specified point.
Definition at line 205 of file LocalTransformation.h.
|
protectedinherited |
|
inherited |
Transforms a vector from world frame to local frame.
world | world coordinates: [0] x, [1] y, [2] z [cm] |
local | (output) corresponding local coordinates [cm] |
The translation is not applied, since the argument is supposed to be a vector, relative difference between two points.
In-place replacement is not supported: world
and local
buffers are assumed not to, and must not, overlap.
Referenced by geo::LocalTransformation< TGeoHMatrix >::WorldToLocal(), geo::OpDetGeo::WorldToLocalVect(), geo::AuxDetGeo::WorldToLocalVect(), geo::AuxDetSensitiveGeo::WorldToLocalVect(), geo::WireGeo::WorldToLocalVect(), geo::CryostatGeo::WorldToLocalVect(), and geo::TPCGeo::WorldToLocalVect().
|
inlineinherited |
Transforms a vector from world frame to local frame.
SrcVector | type of the input (local) vector |
DestVector | type of output (world) vector (default: as Vector ) |
world | coordinates [cm] |
The translation is not applied, since the argument is supposed to be a vector, relative difference between two points.
Definition at line 238 of file LocalTransformation.h.
|
inlineinherited |
Transforms a vector from world frame to local frame.
SrcVector | type of the input (local) vector |
DestVector | type of output (world) vector (default: as Vector ) |
world | coordinates [cm] |
The translation is not applied, since the argument is supposed to be a vector, relative difference between two points.
Definition at line 241 of file LocalTransformation.h.
|
protectedinherited |
|
protectedinherited |
local to world transform
Definition at line 257 of file LocalTransformation.h.
Referenced by geo::LocalTransformation< TGeoHMatrix >::Matrix().