LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
TrackingTypes.h
Go to the documentation of this file.
1 #ifndef TRACKINGTYPE_H
2 #define TRACKINGTYPE_H
3 
4 // LArSoft libraries
6 
7 // ROOT libraries
8 #include "Math/GenVector/AxisAngle.h"
9 #include "Math/GenVector/Rotation3D.h"
10 #include "Math/SMatrix.h"
11 #include "TVector3.h"
12 
13 namespace recob {
14 
15  namespace tracking {
16 
23  using Coord_t = Double32_t;
24 
26  using Point_t = ROOT::Math::PositionVector3D<ROOT::Math::Cartesian3D<Coord_t>,
27  ROOT::Math::GlobalCoordinateSystemTag>;
28 
30  using Vector_t = ROOT::Math::DisplacementVector3D<ROOT::Math::Cartesian3D<Coord_t>,
31  ROOT::Math::GlobalCoordinateSystemTag>;
32 
34  using Positions_t = std::vector<Point_t>;
35 
37  using Momenta_t = std::vector<Vector_t>;
38 
40  using Rotation_t = ROOT::Math::Rotation3D;
41 
44  template <typename To, typename From>
45  std::vector<To> convertVec(std::vector<From> const& in)
46  {
47  std::vector<To> out;
48  out.reserve(in.size());
49  for (auto& i : in)
50  out.push_back(To(i));
51  return out;
52  }
53  template <typename From>
54  std::vector<TVector3> convertVecPointToTVec3(std::vector<From> const& in)
55  {
56  std::vector<TVector3> out;
57  out.reserve(in.size());
58  for (auto& i : in)
59  out.push_back(TVector3(i.X(), i.Y(), i.Z()));
60  return out;
61  }
62  template <typename Point>
63  Point_t toPoint(Point const& p)
64  {
65  return geo::vect::convertTo<Point_t>(p);
66  }
67  template <typename Point>
68  std::vector<Point_t> convertCollToPoint(std::vector<Point> const& coll)
69  {
70  return geo::vect::convertCollTo<Point_t>(coll);
71  }
72  template <typename Vector>
73  Vector_t toVector(Vector const& p)
74  {
75  return geo::vect::convertTo<Vector_t>(p);
76  }
77  template <typename Vector>
78  std::vector<Vector_t> convertCollToVector(std::vector<Vector> const& coll)
79  {
80  return geo::vect::convertCollTo<Vector_t>(coll);
81  }
83 
86 
89 
91  TrajectoryPoint_t() = default;
92 
94  TrajectoryPoint_t(Point_t pos, Vector_t mom) : position(pos), momentum(mom) {}
95 
97  Vector_t direction() const { return momentum.Unit(); }
98 
99  }; // TrajectoryPoint_t
100 
103  using SMatrixSym22 =
104  ROOT::Math::SMatrix<Double32_t, 2, 2, ROOT::Math::MatRepSym<Double32_t, 2>>;
105  using SMatrixSym33 =
106  ROOT::Math::SMatrix<Double32_t, 3, 3, ROOT::Math::MatRepSym<Double32_t, 3>>;
107  using SMatrixSym55 =
108  ROOT::Math::SMatrix<Double32_t, 5, 5, ROOT::Math::MatRepSym<Double32_t, 5>>;
109  using SMatrixSym66 =
110  ROOT::Math::SMatrix<Double32_t, 6, 6, ROOT::Math::MatRepSym<Double32_t, 6>>;
111  using SMatrix65 = ROOT::Math::SMatrix<Double32_t, 6, 5>;
112  using SMatrix56 = ROOT::Math::SMatrix<Double32_t, 5, 6>;
113  using SMatrix55 = ROOT::Math::SMatrix<Double32_t, 5, 5>;
114  using SMatrix66 = ROOT::Math::SMatrix<Double32_t, 6, 6>;
115  using SVector6 = ROOT::Math::SVector<Double32_t, 6>;
116  using SVector5 = ROOT::Math::SVector<Double32_t, 5>;
117  using SVector3 = ROOT::Math::SVector<Double32_t, 3>;
118  using SVector2 = ROOT::Math::SVector<Double32_t, 2>;
120 
121  }
122 
123 }
124 
125 #endif
Double32_t Coord_t
Definition: TrackingTypes.h:23
A point in the trajectory, with position and momentum.
Definition: TrackingTypes.h:85
Reconstruction base classes.
std::vector< Vector_t > convertCollToVector(std::vector< Vector > const &coll)
Definition: TrackingTypes.h:78
TrajectoryPoint_t(Point_t pos, Vector_t mom)
Constructor: assigns position and momentum.
Definition: TrackingTypes.h:94
Point_t toPoint(Point const &p)
Definition: TrackingTypes.h:63
ROOT::Math::SMatrix< Double32_t, 6, 5 > SMatrix65
ROOT::Math::SMatrix< Double32_t, 5, 5, ROOT::Math::MatRepSym< Double32_t, 5 >> SMatrixSym55
ROOT::Math::SMatrix< Double32_t, 6, 6, ROOT::Math::MatRepSym< Double32_t, 6 >> SMatrixSym66
ROOT::Math::SVector< Double32_t, 2 > SVector2
ROOT::Math::SMatrix< Double32_t, 3, 3, ROOT::Math::MatRepSym< Double32_t, 3 >> SMatrixSym33
ROOT::Math::SVector< Double32_t, 6 > SVector6
ROOT::Math::SMatrix< Double32_t, 5, 5 > SMatrix55
ROOT::Math::SMatrix< Double32_t, 2, 2, ROOT::Math::MatRepSym< Double32_t, 2 >> SMatrixSym22
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< Coord_t >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space. See recob::tracking::Coord_t for more details on the ...
Definition: TrackingTypes.h:31
Utilities to extend the interface of geometry vectors.
Vector_t momentum
momentum at the trajectory [GeV/c].
Definition: TrackingTypes.h:88
ROOT::Math::SVector< Double32_t, 3 > SVector3
std::vector< Vector_t > Momenta_t
Type of momentum list.
Definition: TrackingTypes.h:37
std::vector< Point_t > convertCollToPoint(std::vector< Point > const &coll)
Definition: TrackingTypes.h:68
std::vector< To > convertVec(std::vector< From > const &in)
Definition: TrackingTypes.h:45
std::vector< TVector3 > convertVecPointToTVec3(std::vector< From > const &in)
Definition: TrackingTypes.h:54
TrajectoryPoint_t()=default
Default constructor: sets at origin with no momentum.
ROOT::Math::Rotation3D Rotation_t
Type for representation of space rotations.
Definition: TrackingTypes.h:40
Vector_t direction() const
Returns the direction of the trajectory (unit vector of the momentum).
Definition: TrackingTypes.h:97
ifstream in
Definition: comparison.C:7
std::vector< Point_t > Positions_t
Type of trajectory point list.
Definition: TrackingTypes.h:34
std::tuple< double, double, const reco::ClusterHit3D * > Point
Definitions used by the VoronoiDiagram algorithm.
Definition: DCEL.h:42
ROOT::Math::SVector< Double32_t, 5 > SVector5
ROOT::Math::SMatrix< Double32_t, 5, 6 > SMatrix56
ROOT::Math::SMatrix< Double32_t, 6, 6 > SMatrix66
Vector_t toVector(Vector const &p)
Definition: TrackingTypes.h:73
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< Coord_t >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space. See recob::tracking::Coord_t for more detai...
Definition: TrackingTypes.h:27
Point_t position
position in the trajectory [cm].
Definition: TrackingTypes.h:87