LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
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 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...
 
template<>
void LocalToWorld (double const *local, double *world) const
 
template<>
void LocalToWorld (double const *local, double *world) const
 
void LocalToWorldVect (double const *local, double *world) const
 Transforms a vector from local frame to world frame. More...
 
template<>
void LocalToWorldVect (double const *local, double *world) const
 
template<>
void LocalToWorldVect (double const *local, double *world) const
 
void WorldToLocal (double const *world, double *local) const
 Transforms a point from world frame to local frame. More...
 
template<>
void WorldToLocal (double const *world, double *local) const
 
template<>
void WorldToLocal (double const *world, double *local) const
 
void WorldToLocalVect (const double *world, double *local) const
 Transforms a vector from world frame to local frame. More...
 
template<>
void WorldToLocalVect (const double *world, double *local) const
 
template<>
void WorldToLocalVect (const double *world, double *local) const
 
TransformationMatrix_t const & Matrix () const
 Direct access to the transformation matrix. More...
 
 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...
 

Protected Member Functions

template<typename DestPoint , typename SrcPoint >
DestPoint LocalToWorldImpl (SrcPoint const &local) const
 
template<>
DestPoint LocalToWorldImpl (SrcPoint const &local) const
 
template<typename DestVector , typename SrcVector >
DestVector LocalToWorldVectImpl (SrcVector const &local) const
 
template<>
DestVector LocalToWorldVectImpl (SrcVector const &local) const
 
template<typename DestPoint , typename SrcPoint >
DestPoint WorldToLocalImpl (SrcPoint const &world) const
 
template<>
DestPoint WorldToLocalImpl (SrcPoint const &world) const
 
template<typename DestVector , typename SrcVector >
DestVector WorldToLocalVectImpl (SrcVector const &world) const
 
template<>
DestVector WorldToLocalVectImpl (SrcVector const &world) const
 

Protected Attributes

TransformationMatrix_t fGeoMatrix
 local to world transform More...
 

Private Types

using Base_t = geo::LocalTransformation< StoredMatrix >
 

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 50 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 51 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 54 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 55 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 56 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 57 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 62 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 68 of file LocalTransformationGeo.h.

68 : 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

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

69 : 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 79 of file LocalTransformationGeo.h.

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

Member Function Documentation

template<>
void geo::LocalTransformation< ROOT::Math::Transform3D >::LocalToWorld ( double const *  local,
double *  world 
) const
inherited

Definition at line 23 of file GeoVectorLocalTransformation.cxx.

References geo::vect::fillCoords().

25 {
26  details::checkVectorBufferOverlap(local, world);
27 
28  // need direct transformation
29  auto const local_v = geo::vect::makeFromCoords<typename TransformationMatrix_t::Point>(local);
30  auto const world_v = fGeoMatrix(local_v);
31  geo::vect::fillCoords(world, world_v);
32 
33 } // geo::LocalTransformation::LocalToWorld()
unsigned int fillCoords(Coords &dest, Vector const &src)
Fills a coordinate array with the coordinates of a vector.
TransformationMatrix_t fGeoMatrix
local to world transform
template<>
void geo::LocalTransformation< ROOT::Math::Transform3D >::LocalToWorld ( double const *  local,
double *  world 
) const
inherited
template<typename StoredMatrix>
void geo::LocalTransformation< StoredMatrix >::LocalToWorld ( double const *  local,
double *  world 
) const
inherited

Transforms a point from local frame to world frame.

Parameters
locallocal coordinates: [0] x, [1] y, [2] z [cm]
world(output) corresponding world coordinates [cm]

The full transformation is applied. Fox example:

LocalTransformation_t trans( ... ); // with proper initialisation
std::array<double, 3U> origin, center;
origin.fill(0.);
trans.LocalToWorld(origin.data(), center.data());

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::GeometryCore::DetectorEnclosureBox().

template<typename StoredMatrix>
template<typename DestPoint , typename SrcPoint , typename = std::enable_if_t<!std::is_same<SrcPoint, DestPoint>::value>>
DestPoint geo::LocalTransformation< StoredMatrix >::LocalToWorld ( SrcPoint const &  local) const
inlineinherited

Transforms a point from local frame to world frame.

Template Parameters
SrcPointtype of the input (local) vector
DestPointtype of the output (world) vector (default: as Point)
Parameters
locallocal coordinates [cm]
Returns
corresponding world coordinates [cm]

The full transformation is applied. Fox example:

LocalTransformation_t trans( ... ); // with proper initialisation
auto center = trans.LocalToWorld(TVector3());

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 160 of file LocalTransformation.h.

161  {
162  return LocalToWorldImpl<DestPoint>(local);
163  }
template<typename StoredMatrix>
template<typename Point >
Point geo::LocalTransformation< StoredMatrix >::LocalToWorld ( Point const &  local) const
inlineinherited

Transforms a point from local frame to world frame.

Template Parameters
SrcPointtype of the input (local) vector
DestPointtype of the output (world) vector (default: as Point)
Parameters
locallocal coordinates [cm]
Returns
corresponding world coordinates [cm]

The full transformation is applied. Fox example:

LocalTransformation_t trans( ... ); // with proper initialisation
auto center = trans.LocalToWorld(TVector3());

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 165 of file LocalTransformation.h.

166  {
167  return LocalToWorldImpl<Point>(local);
168  }
template<>
DestPoint geo::LocalTransformation< ROOT::Math::Transform3D >::LocalToWorldImpl ( SrcPoint const &  local) const
protectedinherited
template<typename StoredMatrix>
template<typename DestPoint , typename SrcPoint >
DestPoint geo::LocalTransformation< StoredMatrix >::LocalToWorldImpl ( SrcPoint const &  local) const
protectedinherited
template<>
void geo::LocalTransformation< ROOT::Math::Transform3D >::LocalToWorldVect ( double const *  local,
double *  world 
) const
inherited

Definition at line 37 of file GeoVectorLocalTransformation.cxx.

References geo::vect::fillCoords().

39 {
40  details::checkVectorBufferOverlap(local, world);
41 
42  // need direct transformation
43  auto const local_v = geo::vect::makeFromCoords<typename TransformationMatrix_t::Vector>(local);
44  auto const world_v = fGeoMatrix(local_v);
45  geo::vect::fillCoords(world, world_v);
46 
47 } // geo::LocalTransformation::LocalToWorldVect()
unsigned int fillCoords(Coords &dest, Vector const &src)
Fills a coordinate array with the coordinates of a vector.
TransformationMatrix_t fGeoMatrix
local to world transform
template<>
void geo::LocalTransformation< ROOT::Math::Transform3D >::LocalToWorldVect ( double const *  local,
double *  world 
) const
inherited
template<typename StoredMatrix>
void geo::LocalTransformation< StoredMatrix >::LocalToWorldVect ( double const *  local,
double *  world 
) const
inherited

Transforms a vector from local frame to world frame.

Parameters
locallocal 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.

template<typename StoredMatrix>
template<typename DestVector , typename SrcVector , typename = std::enable_if_t<!std::is_same<SrcVector, DestVector>::value>>
DestVector geo::LocalTransformation< StoredMatrix >::LocalToWorldVect ( SrcVector const &  local) const
inlineinherited

Transforms a vector from local frame to world frame.

Template Parameters
SrcVectortype of the input (local) vector
DestVectortype of output (world) vector (default: as Vector)
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 198 of file LocalTransformation.h.

199  {
200  return LocalToWorldVectImpl<DestVector>(local);
201  }
template<typename StoredMatrix>
template<typename Vector >
Vector geo::LocalTransformation< StoredMatrix >::LocalToWorldVect ( Vector const &  local) const
inlineinherited

Transforms a vector from local frame to world frame.

Template Parameters
SrcVectortype of the input (local) vector
DestVectortype of output (world) vector (default: as Vector)
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 203 of file LocalTransformation.h.

204  {
205  return LocalToWorldVectImpl<Vector>(local);
206  }
template<>
DestVector geo::LocalTransformation< ROOT::Math::Transform3D >::LocalToWorldVectImpl ( SrcVector const &  local) const
protectedinherited
template<typename StoredMatrix>
template<typename DestVector , typename SrcVector >
DestVector geo::LocalTransformation< StoredMatrix >::LocalToWorldVectImpl ( SrcVector const &  local) const
protectedinherited
template<typename StoredMatrix>
TransformationMatrix_t const& geo::LocalTransformation< StoredMatrix >::Matrix ( ) const
inlineinherited

Direct access to the transformation matrix.

Definition at line 298 of file LocalTransformation.h.

Referenced by geo::AuxDetGeo::AuxDetGeo(), and geo::TPCGeo::TPCGeo().

298 { return fGeoMatrix; }
TransformationMatrix_t fGeoMatrix
local to world transform
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 130 of file LocalTransformationGeo.h.

Referenced by geo::AuxDetSensitiveGeo::toLocalCoords(), geo::AuxDetGeo::toLocalCoords(), geo::OpDetGeo::toLocalCoords(), geo::WireGeo::toLocalCoords(), geo::CryostatGeo::toLocalCoords(), and geo::TPCGeo::toLocalCoords().

131  {
132  return Base_t::template WorldToLocal<LocalPoint_t>(world);
133  }
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 143 of file LocalTransformationGeo.h.

144  {
145  return Base_t::template WorldToLocalVect<LocalVector_t>(world);
146  }
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 98 of file LocalTransformationGeo.h.

Referenced by geo::OpDetGeo::Height(), geo::AuxDetSensitiveGeo::toWorldCoords(), geo::AuxDetGeo::toWorldCoords(), geo::OpDetGeo::toWorldCoords(), geo::CryostatGeo::toWorldCoords(), geo::WireGeo::toWorldCoords(), and geo::TPCGeo::toWorldCoords().

99  {
100  return Base_t::template LocalToWorld<GlobalPoint_t>(local);
101  }
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 111 of file LocalTransformationGeo.h.

112  {
113  return Base_t::template LocalToWorldVect<GlobalVector_t>(local);
114  }
template<>
void geo::LocalTransformation< ROOT::Math::Transform3D >::WorldToLocal ( double const *  world,
double *  local 
) const
inherited
template<>
void geo::LocalTransformation< ROOT::Math::Transform3D >::WorldToLocal ( double const *  world,
double *  local 
) const
inherited

Definition at line 51 of file GeoVectorLocalTransformation.cxx.

References geo::vect::fillCoords().

53 {
54  details::checkVectorBufferOverlap(local, world);
55 
56  // need inverse transformation
57  auto const world_v = geo::vect::makeFromCoords<typename TransformationMatrix_t::Point>(world);
58  auto const local_v = fGeoMatrix.ApplyInverse(world_v);
59  geo::vect::fillCoords(local, local_v);
60 
61 } // geo::LocalTransformation::WorldToLocal()
unsigned int fillCoords(Coords &dest, Vector const &src)
Fills a coordinate array with the coordinates of a vector.
TransformationMatrix_t fGeoMatrix
local to world transform
template<typename StoredMatrix>
void geo::LocalTransformation< StoredMatrix >::WorldToLocal ( double const *  world,
double *  local 
) const
inherited

Transforms a point from world frame to local frame.

Parameters
worldworld coordinates: [0] x, [1] y, [2] z [cm]
local(output) corresponding local coordinates [cm]

The full transformation is applied. Fox example:

LocalTransformation_t trans( ... ); // with proper initialisation
std::array<double, 3U> world{ 4.0, 5.0, -2.5 }, local;
trans.WorldToLocal(world.data(), local.data());

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.

template<typename StoredMatrix>
template<typename DestPoint , typename SrcPoint , typename = std::enable_if_t<!std::is_same<SrcPoint, DestPoint>::value>>
DestPoint geo::LocalTransformation< StoredMatrix >::WorldToLocal ( SrcPoint const &  world) const
inlineinherited

Transforms a point from world frame to local frame.

Template Parameters
SrcPointtype of the input (local) vector
DestPointtype of the output (world) vector (default: as Point)
Parameters
worldworld coordinates [cm]
Returns
corresponding local coordinates [cm]

The full transformation is applied. Fox example:

LocalTransformation_t trans( ... ); // with proper initialisation
auto local = trans.WorldToLocal(TVector3(4.0, 5.0, -2.5));

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

Definition at line 248 of file LocalTransformation.h.

249  {
250  return WorldToLocalImpl<DestPoint>(world);
251  }
template<typename StoredMatrix>
template<typename Point >
Point geo::LocalTransformation< StoredMatrix >::WorldToLocal ( Point const &  world) const
inlineinherited

Transforms a point from world frame to local frame.

Template Parameters
SrcPointtype of the input (local) vector
DestPointtype of the output (world) vector (default: as Point)
Parameters
worldworld coordinates [cm]
Returns
corresponding local coordinates [cm]

The full transformation is applied. Fox example:

LocalTransformation_t trans( ... ); // with proper initialisation
auto local = trans.WorldToLocal(TVector3(4.0, 5.0, -2.5));

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

Definition at line 253 of file LocalTransformation.h.

254  {
255  return WorldToLocalImpl<Point>(world);
256  }
template<>
DestPoint geo::LocalTransformation< ROOT::Math::Transform3D >::WorldToLocalImpl ( SrcPoint const &  world) const
protectedinherited
template<typename StoredMatrix>
template<typename DestPoint , typename SrcPoint >
DestPoint geo::LocalTransformation< StoredMatrix >::WorldToLocalImpl ( SrcPoint const &  world) const
protectedinherited
template<>
void geo::LocalTransformation< ROOT::Math::Transform3D >::WorldToLocalVect ( const double *  world,
double *  local 
) const
inherited
template<>
void geo::LocalTransformation< ROOT::Math::Transform3D >::WorldToLocalVect ( const double *  world,
double *  local 
) const
inherited

Definition at line 65 of file GeoVectorLocalTransformation.cxx.

References geo::vect::fillCoords(), and scale.

67 {
68  details::checkVectorBufferOverlap(local, world);
69 
70  // need inverse transformation
71  auto const world_v = geo::vect::makeFromCoords<typename TransformationMatrix_t::Vector>(world);
72  auto const local_v = fGeoMatrix.ApplyInverse(world_v);
73  geo::vect::fillCoords(local, local_v);
74 
75 } // geo::LocalTransformation::WorldToLocalVect()
unsigned int fillCoords(Coords &dest, Vector const &src)
Fills a coordinate array with the coordinates of a vector.
TransformationMatrix_t fGeoMatrix
local to world transform
template<typename StoredMatrix>
void geo::LocalTransformation< StoredMatrix >::WorldToLocalVect ( const double *  world,
double *  local 
) const
inherited

Transforms a vector from world frame to local frame.

Parameters
worldworld 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.

template<typename StoredMatrix>
template<typename DestVector , typename SrcVector , typename = std::enable_if_t<!std::is_same<SrcVector, DestVector>::value>>
DestVector geo::LocalTransformation< StoredMatrix >::WorldToLocalVect ( SrcVector const &  world) const
inlineinherited

Transforms a vector from world frame to local frame.

Template Parameters
SrcVectortype of the input (local) vector
DestVectortype of output (world) vector (default: as Vector)
Parameters
worldcoordinates [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 286 of file LocalTransformation.h.

287  {
288  return WorldToLocalVectImpl<DestVector>(world);
289  }
template<typename StoredMatrix>
template<typename Vector >
Vector geo::LocalTransformation< StoredMatrix >::WorldToLocalVect ( Vector const &  world) const
inlineinherited

Transforms a vector from world frame to local frame.

Template Parameters
SrcVectortype of the input (local) vector
DestVectortype of output (world) vector (default: as Vector)
Parameters
worldcoordinates [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 291 of file LocalTransformation.h.

292  {
293  return WorldToLocalVectImpl<Vector>(world);
294  }
template<>
DestVector geo::LocalTransformation< ROOT::Math::Transform3D >::WorldToLocalVectImpl ( SrcVector const &  world) const
protectedinherited
template<typename StoredMatrix>
template<typename DestVector , typename SrcVector >
DestVector geo::LocalTransformation< StoredMatrix >::WorldToLocalVectImpl ( SrcVector const &  world) const
protectedinherited

Member Data Documentation

template<typename StoredMatrix>
TransformationMatrix_t geo::LocalTransformation< StoredMatrix >::fGeoMatrix
protectedinherited

local to world transform

Definition at line 301 of file LocalTransformation.h.


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