LArSoft  v10_04_05
Liquid Argon Software toolkit - https://larsoft.org/
LocalTransformationGeo.h
Go to the documentation of this file.
1 
7 #ifndef LARCOREALG_GEOMETRY_LOCALTRANSFORMATIONGEO_H
8 #define LARCOREALG_GEOMETRY_LOCALTRANSFORMATIONGEO_H
9 
10 // LArSoft libraries
13 #include "larcoreobj/SimpleTypesAndConstants/geo_vectors.h" // geo::Point_t...
14 
15 // C/C++ standard libraries
16 #include <type_traits> // std::is_same
17 #include <utility> // std::move()
18 
19 namespace geo {
20 
45  template <typename StoredMatrix, typename LocalPoint = Point_t, typename LocalVector = Vector_t>
46  class LocalTransformationGeo : public LocalTransformation<StoredMatrix> {
48 
49  public:
52  using LocalPoint_t = LocalPoint;
53  using LocalVector_t = LocalVector;
54 
55  using typename Base_t::TransformationMatrix_t;
56 
58 
67 
75  LocalTransformationGeo(std::vector<TGeoNode const*> const& path, size_t depth)
76  : Base_t(path, depth)
77  {}
78 
95  {
96  return Base_t::template LocalToWorld<GlobalPoint_t>(local);
97  }
98 
108  {
109  return Base_t::template LocalToWorldVect<GlobalVector_t>(local);
110  }
111 
127  {
128  return Base_t::template WorldToLocal<LocalPoint_t>(world);
129  }
130 
140  {
141  return Base_t::template WorldToLocalVect<LocalVector_t>(world);
142  }
143 
144  static_assert(!std::is_same<LocalPoint_t, LocalVector_t>(),
145  "Vector and point types must be distinct");
146 
147  }; // class LocalTransformationGeo<>
148 
149 } // namespace geo
150 
151 #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.
ROOT libraries.
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.This is a header-only library...