![]() |
LArSoft
v09_93_00
Liquid Argon Software toolkit - https://larsoft.org/
|
Class to transform between world and local coordinates. More...
#include "LocalTransformation.h"
Public Types | |
using | TransformationMatrix_t = StoredMatrix |
Type of transformation matrix. More... | |
Public Member Functions | |
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) | |
Constructor: uses the specified local-to-world transformation. 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<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 | |
TransformationMatrix_t | fGeoMatrix |
local to world transform More... | |
Class to transform between world and local coordinates.
StoredMatrix | type of transformation matrix internally stored |
This class provides two directions of transformations (world to local and the other way around), for points and for vectors. The vector version of the transformation does not apply translation.
Definition at line 59 of file LocalTransformation.h.
using geo::LocalTransformation< StoredMatrix >::TransformationMatrix_t = StoredMatrix |
Type of transformation matrix.
Definition at line 62 of file LocalTransformation.h.
|
inline |
Constructor: uses the specified local-to-world transformation.
matrix | the transformation matrix to be used |
The transformation matrix
is used to transform vectors from the "local" to the "world" frame, while its inverse is used for transformations from the "world" to the "local" frame.
The specified matrix is copied into a local copy unless a R-value reference argument is specified (e.g. with std::move()
).
Definition at line 76 of file LocalTransformation.h.
|
inline |
Constructor: uses the specified local-to-world transformation.
matrix | the transformation matrix to be used |
The transformation matrix
is used to transform vectors from the "local" to the "world" frame, while its inverse is used for transformations from the "world" to the "local" frame.
The specified matrix is copied into a local copy unless a R-value reference argument is specified (e.g. with std::move()
).
Definition at line 77 of file LocalTransformation.h.
|
inline |
Constructor: chains the transformations from the specified nodes.
path | the path of ROOT geometry nodes |
depth | the index in the path of the last node to be considered |
The resulting transformation is the sequence of transformations from depth
nodes from the first on.
Definition at line 88 of file LocalTransformation.h.
|
inline |
Constructor: chains the transformations from all specified nodes.
path | the path of ROOT geometry nodes |
The resulting transformation is the sequence of transformations from the first to the last node of the path.
Definition at line 99 of file LocalTransformation.h.
|
inline |
Constructor: sequence of transformations from a node path.
ITER | type of iterator to node pointers |
begin | the begin iterator of the path of ROOT geometry nodes |
end | the end iterator of the path of ROOT geometry nodes |
The resulting transformation is the sequence of transformations from the one pointed by begin
to the one before end
.
Definition at line 113 of file LocalTransformation.h.
void geo::LocalTransformation< ROOT::Math::Transform3D >::LocalToWorld | ( | double const * | local, |
double * | world | ||
) | const |
Definition at line 23 of file GeoVectorLocalTransformation.cxx.
References geo::vect::fillCoords().
void geo::LocalTransformation< ROOT::Math::Transform3D >::LocalToWorld | ( | double const * | local, |
double * | world | ||
) | const |
void geo::LocalTransformation< StoredMatrix >::LocalToWorld | ( | double const * | local, |
double * | world | ||
) | const |
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::GeometryCore::DetectorEnclosureBox().
|
inline |
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 160 of file LocalTransformation.h.
|
inline |
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 165 of file LocalTransformation.h.
|
protected |
|
protected |
void geo::LocalTransformation< ROOT::Math::Transform3D >::LocalToWorldVect | ( | double const * | local, |
double * | world | ||
) | const |
Definition at line 37 of file GeoVectorLocalTransformation.cxx.
References geo::vect::fillCoords().
void geo::LocalTransformation< ROOT::Math::Transform3D >::LocalToWorldVect | ( | double const * | local, |
double * | world | ||
) | const |
void geo::LocalTransformation< StoredMatrix >::LocalToWorldVect | ( | double const * | local, |
double * | world | ||
) | const |
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.
|
inline |
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 198 of file LocalTransformation.h.
|
inline |
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 203 of file LocalTransformation.h.
|
protected |
|
protected |
|
inline |
Direct access to the transformation matrix.
Definition at line 298 of file LocalTransformation.h.
Referenced by geo::AuxDetGeo::AuxDetGeo(), and geo::TPCGeo::TPCGeo().
void geo::LocalTransformation< ROOT::Math::Transform3D >::WorldToLocal | ( | double const * | world, |
double * | local | ||
) | const |
void geo::LocalTransformation< ROOT::Math::Transform3D >::WorldToLocal | ( | double const * | world, |
double * | local | ||
) | const |
Definition at line 51 of file GeoVectorLocalTransformation.cxx.
References geo::vect::fillCoords().
void geo::LocalTransformation< StoredMatrix >::WorldToLocal | ( | double const * | world, |
double * | local | ||
) | const |
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.
|
inline |
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 248 of file LocalTransformation.h.
|
inline |
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 253 of file LocalTransformation.h.
|
protected |
|
protected |
void geo::LocalTransformation< ROOT::Math::Transform3D >::WorldToLocalVect | ( | const double * | world, |
double * | local | ||
) | const |
void geo::LocalTransformation< ROOT::Math::Transform3D >::WorldToLocalVect | ( | const double * | world, |
double * | local | ||
) | const |
Definition at line 65 of file GeoVectorLocalTransformation.cxx.
References geo::vect::fillCoords(), and scale.
void geo::LocalTransformation< StoredMatrix >::WorldToLocalVect | ( | const double * | world, |
double * | local | ||
) | const |
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.
|
inline |
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 286 of file LocalTransformation.h.
|
inline |
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 291 of file LocalTransformation.h.
|
protected |
|
protected |
|
protected |
local to world transform
Definition at line 301 of file LocalTransformation.h.