LArSoft  v09_90_00
Liquid Argon Software toolkit - https://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
15 #include "larcoreobj/SimpleTypesAndConstants/geo_vectors.h" // geo::Point_t...
16 
17 // C/C++ standard libraries
18 #include <type_traits> // std::is_same
19 #include <utility> // std::move()
20 
21 namespace geo {
22 
47  template <typename StoredMatrix,
48  typename LocalPoint = geo::Point_t,
49  typename LocalVector = geo::Vector_t>
50  class LocalTransformationGeo : public geo::LocalTransformation<StoredMatrix> {
52 
53  public:
56  using LocalPoint_t = LocalPoint;
57  using LocalVector_t = LocalVector;
58 
59  using typename Base_t::TransformationMatrix_t;
60 
62 
71 
79  LocalTransformationGeo(std::vector<TGeoNode const*> const& path, size_t depth)
80  : Base_t(path, depth)
81  {}
82 
99  {
100  return Base_t::template LocalToWorld<GlobalPoint_t>(local);
101  }
102 
112  {
113  return Base_t::template LocalToWorldVect<GlobalVector_t>(local);
114  }
115 
131  {
132  return Base_t::template WorldToLocal<LocalPoint_t>(world);
133  }
134 
144  {
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 } // namespace geo
154 
155 #endif // LARCOREALG_GEOMETRY_LOCALTRANSFORMATIONGEO_H
StoredMatrix TransformationMatrix_t
Type of transformation matrix.
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space.
Definition: geo_vectors.h:160
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.
Class to transform between world and local coordinates.
Definitions of geometry vector data types.
LocalTransformationGeo(std::vector< TGeoNode const * > const &path, size_t depth)
Constructor: uses the specified transformation matrix.
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:180
GlobalPoint_t toWorldCoords(LocalPoint_t const &local) const
Transforms a point from local frame to world frame.
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.
Specialization of local-to-world transformations for ROOT GenVector.