All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Private Types | List of all members
geo::LocalTransformationGeo< StoredMatrix, LocalPoint, LocalVector > Class Template Reference

Class to transform between world and local coordinates. More...

#include <LocalTransformationGeo.h>

Inheritance diagram for geo::LocalTransformationGeo< StoredMatrix, LocalPoint, LocalVector >:
geo::LocalTransformation< StoredMatrix >

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 Types inherited from geo::LocalTransformation< StoredMatrix >
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...
 
 LocalTransformationGeo (TransformationMatrix_t const &matrix)
 Constructor: uses the specified transformation matrix. More...
 
 LocalTransformationGeo (TransformationMatrix_t &&matrix)
 
- Public Member Functions inherited from geo::LocalTransformation< StoredMatrix >
 LocalTransformation (std::vector< TGeoNode const * > const &path, size_t depth)
 Constructor: chains the transformations from the specified nodes. More...
 
 LocalTransformation (std::vector< TGeoNode const * > const &path)
 Constructor: chains the transformations from all specified nodes. More...
 
template<typename ITER >
 LocalTransformation (ITER begin, ITER end)
 Constructor: sequence of transformations from a node path. 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<>
void LocalToWorld (double const *local, double *world) const
 
template<>
void LocalToWorldVect (double const *local, double *world) const
 
template<>
void WorldToLocal (double const *world, double *local) const
 
template<>
void WorldToLocalVect (const double *world, double *local) const
 
template<>
void LocalToWorld (double const *local, double *world) const
 
template<>
void LocalToWorldVect (double const *local, double *world) const
 
template<>
void WorldToLocal (double const *world, double *local) const
 
template<>
void WorldToLocalVect (const double *world, double *local) const
 
 LocalTransformation (TransformationMatrix_t const &matrix)
 Constructor: uses the specified local-to-world transformation. More...
 
 LocalTransformation (TransformationMatrix_t &&matrix)
 
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
 
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
 
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
 
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
 

Private Types

using Base_t = geo::LocalTransformation< StoredMatrix >
 

Additional Inherited Members

- Protected Member Functions inherited from geo::LocalTransformation< StoredMatrix >
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
 
template<>
DestPoint WorldToLocalImpl (SrcPoint const &world) const
 
template<>
DestVector WorldToLocalVectImpl (SrcVector const &world) const
 
template<>
DestPoint LocalToWorldImpl (SrcPoint const &local) const
 
template<>
DestVector LocalToWorldVectImpl (SrcVector const &local) const
 
- Protected Attributes inherited from geo::LocalTransformation< StoredMatrix >
TransformationMatrix_t fGeoMatrix
 local to world transform More...
 

Detailed Description

template<typename StoredMatrix, typename LocalPoint = geo::Point_t, typename LocalVector = geo::Vector_t>
class geo::LocalTransformationGeo< StoredMatrix, LocalPoint, LocalVector >

Class to transform between world and local coordinates.

Template Parameters
StoredMatrixtype of transformation matrix internally stored
LocalPointtype representing a local point
LocalVectortype representing a local displacement vector
See Also
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.

Note
In the class method examples, the following definition is assumed:
using LocalTransformationGeo_t = geo::LocalTransformationGeo
<TGeoHMatrix, geo::Point_t, geo::Vector_t>;
This is conceptually wrong since 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 53 of file LocalTransformationGeo.h.

Member Typedef Documentation

template<typename StoredMatrix, typename LocalPoint = geo::Point_t, typename LocalVector = geo::Vector_t>
using geo::LocalTransformationGeo< StoredMatrix, LocalPoint, LocalVector >::Base_t = geo::LocalTransformation<StoredMatrix>
private

Definition at line 54 of file LocalTransformationGeo.h.

template<typename StoredMatrix, typename LocalPoint = geo::Point_t, typename LocalVector = geo::Vector_t>
using geo::LocalTransformationGeo< StoredMatrix, LocalPoint, LocalVector >::GlobalPoint_t = geo::Point_t

Type for global 3D point.

Definition at line 57 of file LocalTransformationGeo.h.

template<typename StoredMatrix, typename LocalPoint = geo::Point_t, typename LocalVector = geo::Vector_t>
using geo::LocalTransformationGeo< StoredMatrix, LocalPoint, LocalVector >::GlobalVector_t = geo::Vector_t

Type for global 3D displacement.

Definition at line 58 of file LocalTransformationGeo.h.

template<typename StoredMatrix, typename LocalPoint = geo::Point_t, typename LocalVector = geo::Vector_t>
using geo::LocalTransformationGeo< StoredMatrix, LocalPoint, LocalVector >::LocalPoint_t = LocalPoint

Type for local 3D point.

Definition at line 59 of file LocalTransformationGeo.h.

template<typename StoredMatrix, typename LocalPoint = geo::Point_t, typename LocalVector = geo::Vector_t>
using geo::LocalTransformationGeo< StoredMatrix, LocalPoint, LocalVector >::LocalVector_t = LocalVector

Type for local 3D displacement.

Definition at line 60 of file LocalTransformationGeo.h.

template<typename StoredMatrix, typename LocalPoint = geo::Point_t, typename LocalVector = geo::Vector_t>
using geo::LocalTransformation< StoredMatrix >::TransformationMatrix_t = StoredMatrix

Type of transformation matrix.

Definition at line 68 of file LocalTransformation.h.

Constructor & Destructor Documentation

template<typename StoredMatrix, typename LocalPoint = geo::Point_t, typename LocalVector = geo::Vector_t>
geo::LocalTransformationGeo< StoredMatrix, LocalPoint, LocalVector >::LocalTransformationGeo ( TransformationMatrix_t const &  matrix)
inline

Constructor: uses the specified transformation matrix.

Parameters
matrixthe transformation matrix to be used

The specified matrix is copied into a local copy.

Definition at line 71 of file LocalTransformationGeo.h.

72  : Base_t(matrix) {}
geo::LocalTransformation< StoredMatrix > Base_t
template<typename StoredMatrix, typename LocalPoint = geo::Point_t, typename LocalVector = geo::Vector_t>
geo::LocalTransformationGeo< StoredMatrix, LocalPoint, LocalVector >::LocalTransformationGeo ( TransformationMatrix_t &&  matrix)
inline

Definition at line 73 of file LocalTransformationGeo.h.

74  : Base_t(std::move(matrix)) {}
geo::LocalTransformation< StoredMatrix > Base_t
template<typename StoredMatrix, typename LocalPoint = geo::Point_t, typename LocalVector = geo::Vector_t>
geo::LocalTransformationGeo< StoredMatrix, LocalPoint, LocalVector >::LocalTransformationGeo ( std::vector< TGeoNode const * > const &  path,
size_t  depth 
)
inline

Constructor: uses the specified transformation matrix.

Parameters
paththe path of ROOT geometry nodes
depththe index in the path of the last node to be considered

The specified matrix is copied into a local copy.

Definition at line 85 of file LocalTransformationGeo.h.

86  : Base_t(path, depth) {}
geo::LocalTransformation< StoredMatrix > Base_t

Member Function Documentation

template<typename StoredMatrix, typename LocalPoint = geo::Point_t, typename LocalVector = geo::Vector_t>
LocalPoint_t geo::LocalTransformationGeo< StoredMatrix, LocalPoint, LocalVector >::toLocalCoords ( GlobalPoint_t const &  world) const
inline

Transforms a point from world frame to local frame.

Parameters
worldworld coordinates [cm]
Returns
corresponding local coordinates [cm]

The full transformation is applied. Fox example:

geo::LocalTransformation trans( ... ); // with proper initialisation
geo::Point_t p = { 4.0, 5.0, -2.5 };
auto local = trans.toLocalCoords(p);

local will be a LocalPoint_t containing the local coordinates of the specified point.

Definition at line 134 of file LocalTransformationGeo.h.

135  { return Base_t::template WorldToLocal<LocalPoint_t>(world); }
template<typename StoredMatrix, typename LocalPoint = geo::Point_t, typename LocalVector = geo::Vector_t>
LocalVector_t geo::LocalTransformationGeo< StoredMatrix, LocalPoint, LocalVector >::toLocalCoords ( GlobalVector_t const &  world) const
inline

Transforms a vector from world frame to local frame.

Parameters
worldworld coordinates: [0] x, [1] y, [2] z [cm]
Returns
a local vector with corresponding 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 145 of file LocalTransformationGeo.h.

146  { return Base_t::template WorldToLocalVect<LocalVector_t>(world); }
template<typename StoredMatrix, typename LocalPoint = geo::Point_t, typename LocalVector = geo::Vector_t>
GlobalPoint_t geo::LocalTransformationGeo< StoredMatrix, LocalPoint, LocalVector >::toWorldCoords ( LocalPoint_t const &  local) const
inline

Transforms a point from local frame to world frame.

Parameters
locallocal coordinates [cm]
Returns
corresponding world coordinates [cm]

The full transformation is applied. Fox example:

geo::LocalTransformationGeo_t trans( ... ); // with proper initialisation
auto center = trans.toWorldCoords(geo::origin());

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 104 of file LocalTransformationGeo.h.

105  { return Base_t::template LocalToWorld<GlobalPoint_t>(local); }
then local
template<typename StoredMatrix, typename LocalPoint = geo::Point_t, typename LocalVector = geo::Vector_t>
GlobalVector_t geo::LocalTransformationGeo< StoredMatrix, LocalPoint, LocalVector >::toWorldCoords ( LocalVector_t const &  local) const
inline

Transforms a vector from local frame to world frame.

Parameters
locallocal coordinates [cm]
Returns
corresponding 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 116 of file LocalTransformationGeo.h.

117  { return Base_t::template LocalToWorldVect<GlobalVector_t>(local); }
then local

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