LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
LocalTransformationGeo.h
Go to the documentation of this file.
1 
9 #ifndef LARCOREALG_GEOMETRY_LOCALTRANSFORMATIONGEO_H
10 #define LARCOREALG_GEOMETRY_LOCALTRANSFORMATIONGEO_H
11 
12 // LArSoft libraries
14 #include "larcoreobj/SimpleTypesAndConstants/geo_vectors.h" // geo::Point_t...
15 
16 
17 // C/C++ standard libraries
18 #include <utility> // std::move()
19 #include <type_traits> // std::is_same
20 
21 
22 namespace geo {
23 
48  template <typename StoredMatrix
49  , typename LocalPoint = geo::Point_t
50  , typename LocalVector = geo::Vector_t
51  >
52  class LocalTransformationGeo: public geo::LocalTransformation<StoredMatrix> {
54 
55  public:
58  using LocalPoint_t = LocalPoint;
59  using LocalVector_t = LocalVector;
60 
61  using typename Base_t::TransformationMatrix_t;
62 
64 
71  : Base_t(matrix) {}
73  : Base_t(std::move(matrix)) {}
75 
84  (std::vector<TGeoNode const*> const& path, size_t depth)
85  : Base_t(path, depth) {}
86 
87 
104  { return Base_t::template LocalToWorld<GlobalPoint_t>(local); }
105 
106 
116  { return Base_t::template LocalToWorldVect<GlobalVector_t>(local); }
117 
118 
134  { return Base_t::template WorldToLocal<LocalPoint_t>(world); }
135 
145  { return Base_t::template WorldToLocalVect<LocalVector_t>(world); }
146 
147 
148  static_assert(!std::is_same<LocalPoint_t, LocalVector_t>(),
149  "Vector and point types must be distinct");
150 
151  }; // class LocalTransformationGeo<>
152 
153 
154 } // namespace geo
155 
156 
157 #endif // LARCOREALG_GEOMETRY_LOCALTRANSFORMATIONGEO_H
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space.
Definition: geo_vectors.h:167
StoredMatrix TransformationMatrix_t
Type of transformation matrix.
LocalTransformationGeo(TransformationMatrix_t &&matrix)
Constructor: uses the specified transformation matrix.
LocalPoint_t toLocalCoords(GlobalPoint_t const &world) const
Transforms a point from world frame to local frame.
Class to transform between world and local coordinates.
STL namespace.
Class containing local-to-world transformations.
LocalTransformationGeo(TransformationMatrix_t const &matrix)
Constructor: uses the specified transformation matrix.
geo::LocalTransformation< StoredMatrix > Base_t
Class to transform between world and local coordinates.
Definitions of geometry vector data types.
GlobalPoint_t toWorldCoords(LocalPoint_t const &local) const
Transforms a point from local frame to world frame.
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:187
Namespace collecting geometry-related classes utilities.
GlobalVector_t toWorldCoords(LocalVector_t const &local) const
Transforms a vector from local frame to world frame.
LocalVector_t toLocalCoords(GlobalVector_t const &world) const
Transforms a vector from world frame to local frame.