All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Macros | Functions
LineClosestPoint_test.cc File Reference

Test of LineClosestPoint.h utilities. More...

#include <boost/test/unit_test.hpp>
#include "larcorealg/Geometry/LineClosestPoint.h"
#include "larcoreobj/SimpleTypesAndConstants/geo_vectors.h"
#include <utility>
#include <type_traits>
#include <cmath>

Go to the source code of this file.

Macros

#define BOOST_TEST_MODULE   LineClosestPoint_test
 

Functions

void LineClosestPointSimple_test ()
 
void LineClosestPointSimple45_test ()
 
void LineClosestPointAndOffsets_test ()
 
void LineClosestPointWithScaledDirs_test ()
 
void LineClosestPointWithNonHomogeneousDirs_test ()
 
void LineClosestPointAndOffsetsDocumentation_test ()
 
void LineClosestPointWithUnitVectorsSimple_test ()
 
void LineClosestPointWithUnitVectorsSimple45_test ()
 
void LineClosestPointWithUnitVectorsAndOffsets_test ()
 
void LineClosestPointAndOffsetsWithUnitVectorsDocumentation_test ()
 
 BOOST_AUTO_TEST_CASE (LineClosestPointTestCase)
 
 BOOST_AUTO_TEST_CASE (LineClosestPointWithUnitVectorsTestCase)
 

Detailed Description

Test of LineClosestPoint.h utilities.

Author
Gianluca Petrillo (petri.nosp@m.llo@.nosp@m.slac..nosp@m.stan.nosp@m.ford..nosp@m.edu)
Date
June 29, 2021
See Also
larcorealg/Geometry/LineClosestPoint.h

Definition in file LineClosestPoint_test.cc.

Macro Definition Documentation

#define BOOST_TEST_MODULE   LineClosestPoint_test

Definition at line 11 of file LineClosestPoint_test.cc.

Function Documentation

BOOST_AUTO_TEST_CASE ( LineClosestPointTestCase  )

Definition at line 331 of file LineClosestPoint_test.cc.

331  {
332 
339 
340 } // BOOST_AUTO_TEST_CASE(LineClosestPointTestCase)
void LineClosestPointWithScaledDirs_test()
void LineClosestPointAndOffsetsDocumentation_test()
void LineClosestPointSimple45_test()
void LineClosestPointWithNonHomogeneousDirs_test()
void LineClosestPointSimple_test()
void LineClosestPointAndOffsets_test()
BOOST_AUTO_TEST_CASE ( LineClosestPointWithUnitVectorsTestCase  )

Definition at line 344 of file LineClosestPoint_test.cc.

344  {
345 
350 
351 } // BOOST_AUTO_TEST_CASE(LineClosestPointWithUnitVectorsTestCase)
void LineClosestPointWithUnitVectorsAndOffsets_test()
void LineClosestPointAndOffsetsWithUnitVectorsDocumentation_test()
void LineClosestPointWithUnitVectorsSimple45_test()
void LineClosestPointWithUnitVectorsSimple_test()
void LineClosestPointAndOffsets_test ( )

Definition at line 59 of file LineClosestPoint_test.cc.

59  {
60 
61  auto const tol = boost::test_tools::tolerance(0.001);
62 
63  auto const [ p, ofsA, ofsB ] = geo::LineClosestPointAndOffsets(
64  geo::origin() - 3.0 * geo::Xaxis(), geo::Xaxis(),
65  geo::origin() + geo::Zaxis() + 2.0 * geo::Yaxis(), geo::Yaxis()
66  );
67 
68  BOOST_TEST(p.X() == 0.0, tol);
69  BOOST_TEST(p.Y() == 0.0, tol);
70  BOOST_TEST(p.Z() == 0.0, tol);
71  BOOST_TEST(ofsA == +3.0, tol);
72  BOOST_TEST(ofsB == -2.0, tol);
73 
74 } // LineClosestPointAndOffsets_test()
auto const tol
Definition: SurfXYZTest.cc:16
auto const tolerance
pdgs p
Definition: selectors.fcl:22
constexpr Vector Yaxis()
Returns a y axis vector of the specified type.
Definition: geo_vectors.h:219
IntersectionPointAndOffsets< Point > LineClosestPointAndOffsets(Point const &startA, Vector const &dirA, Point const &startB, Vector const &dirB)
Returns the point of a line that is closest to a second line.
constexpr Vector Xaxis()
Returns a x axis vector of the specified type.
Definition: geo_vectors.h:215
constexpr Vector Zaxis()
Returns a z axis vector of the specified type.
Definition: geo_vectors.h:223
constexpr Point origin()
Returns a origin position with a point of the specified type.
Definition: geo_vectors.h:227
void LineClosestPointAndOffsetsDocumentation_test ( )

Definition at line 116 of file LineClosestPoint_test.cc.

116  {
117 
118  auto const tol = boost::test_tools::tolerance(0.001);
119 
120  /*
121  * The promise:
122  *
123  * --- 8< --------------------------------------------------------------------
124  * The return value is a triplet, which is most easily unpacked immediately:
125  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
126  * auto [ point, offsetA, offsetB ] = geo::LineClosestPointAndOffsets(
127  * geo::Point_t{ 2, 0, 1 }, geo::Vector_t{ 0.0, 0.5, 0.0 },
128  * geo::Point_t{ 0, 1, 0 }, geo::Vector_t{ 0.866, 0.0, 0.0 }
129  * );
130  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
131  * will set `point` to `geo::Point{ 2, 1, 1 }`, `offsetA` to `2` and `offsetB`
132  * to `2.309...`.
133  * To reassign the variables after they have been defined, instead:
134  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
135  * auto const xsectAndOfs = geo::LineClosestPointAndOffsets(
136  * geo::Point_t{ 0, 1, 0 }, geo::Vector_t{ 0.866, 0.0, 0.0 },
137  * geo::Point_t{ 2, 0, 1 }, geo::Vector_t{ 0.0, 0.5, 0.0 }
138  * );
139  * point = xsectAndOfs.point;
140  * offsetA = xsectAndOfs.offset1;
141  * offsetB = xsectAndOfs.offset2;
142  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
143  * (`point` to `geo::Point{ 2, 1, 0 }`, `offsetA` to `2.039...` and `offsetB`
144  * to `2`, because the intersection point is always on the first line).
145  * --- 8< --------------------------------------------------------------------
146  */
147 
148  auto [ point, offsetA, offsetB ] = geo::LineClosestPointAndOffsets(
149  geo::Point_t{ 2, 0, 1 }, geo::Vector_t{ 0.0, 0.5, 0.0 },
150  geo::Point_t{ 0, 1, 0 }, geo::Vector_t{ 0.866, 0.0, 0.0 }
151  );
152 
153  // a way to check we did not mess with the assignment above too much
154  static_assert
155  (std::is_same_v<decltype(point), geo::Point_t>, "Unexpected point type");
156  static_assert
157  (std::is_same_v<decltype(offsetA), double>, "Unexpected first offset type");
158  static_assert
159  (std::is_same_v<decltype(offsetB), double>, "Unexpected second offset type");
160 
161  BOOST_TEST(point.X() == 2.0, tol);
162  BOOST_TEST(point.Y() == 1.0, tol);
163  BOOST_TEST(point.Z() == 1.0, tol);
164  BOOST_TEST(offsetA == 2.0, tol);
165  BOOST_TEST(offsetB == (2.0/0.866), tol);
166 
167  auto const xsectAndOfs = geo::LineClosestPointAndOffsets(
168  geo::Point_t{ 0, 1, 0 }, geo::Vector_t{ 0.866, 0.0, 0.0 },
169  geo::Point_t{ 2, 0, 1 }, geo::Vector_t{ 0.0, 0.5, 0.0 }
170  );
171  point = xsectAndOfs.point;
172  offsetA = xsectAndOfs.offset1;
173  offsetB = xsectAndOfs.offset2;
174 
175  BOOST_TEST(point.X() == 2.0, tol);
176  BOOST_TEST(point.Y() == 1.0, tol);
177  BOOST_TEST(point.Z() == 0.0, tol);
178  BOOST_TEST(offsetA == 2.0/0.866, tol);
179  BOOST_TEST(offsetB == 2.0, tol);
180 
181  // actually we _can_ assign with `std::tie()`:
182  std::tie(point, offsetA, offsetB) = geo::LineClosestPointAndOffsets(
183  geo::Point_t{ 2, 0, 1 }, geo::Vector_t{ 0.0, 0.5, 0.0 },
184  geo::Point_t{ 0, 1, 0 }, geo::Vector_t{ 0.866, 0.0, 0.0 }
185  );
186 
187  BOOST_TEST(point.X() == 2.0, tol);
188  BOOST_TEST(point.Y() == 1.0, tol);
189  BOOST_TEST(point.Z() == 1.0, tol);
190  BOOST_TEST(offsetA == 2.0, tol);
191  BOOST_TEST(offsetB == (2.0/0.866), tol);
192 
193 } // LineClosestPointAndOffsetsDocumentation_test()
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space.
Definition: geo_vectors.h:164
auto const tol
Definition: SurfXYZTest.cc:16
auto const tolerance
IntersectionPointAndOffsets< Point > LineClosestPointAndOffsets(Point const &startA, Vector const &dirA, Point const &startB, Vector const &dirB)
Returns the point of a line that is closest to a second line.
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:184
void LineClosestPointAndOffsetsWithUnitVectorsDocumentation_test ( )

Definition at line 250 of file LineClosestPoint_test.cc.

250  {
251 
252  auto const tol = boost::test_tools::tolerance(0.001);
253 
254  /*
255  * The promise:
256  *
257  * --- 8< --------------------------------------------------------------------
258  * The return value is a triplet, which is most easily unpacked immediately:
259  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
260  * auto [ point, offsetA, offsetB ] = geo::LineClosestPointAndOffsetsWithUnitVectors(
261  * geo::Point_t{ 2, 0, 1 }, geo::Vector_t{ 0, 1, 0 },
262  * geo::Point_t{ 0, 1, 0 }, geo::Vector_t{ 1, 0, 0 }
263  * );
264  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
265  * will set `point` to `geo::Point{ 2, 1, 1 }`, `offsetA` to `1` and `offsetB`
266  * to `2`.
267  * To reassign the variables after they have been defined, instead:
268  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
269  * auto const xsectAndOfs = geo::LineClosestPointAndOffsetsWithUnitVectors(
270  * geo::Point_t{ 0, 1, 0 }, geo::Vector_t{ 1, 0, 0 },
271  * geo::Point_t{ 2, 0, 1 }, geo::Vector_t{ 0, 1, 0 }
272  * );
273  * point = xsectAndOfs.point;
274  * offsetA = xsectAndOfs.offset1;
275  * offsetB = xsectAndOfs.offset2;
276  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
277  * (`point` to `geo::Point{ 2, 1, 0 }`, `offsetA` to `2` and `offsetB` to `1`,
278  * because the intersection point is always on the first line).
279  * --- 8< --------------------------------------------------------------------
280  */
281 
282  auto [ point, offsetA, offsetB ] = geo::LineClosestPointAndOffsetsWithUnitVectors(
283  geo::Point_t{ 2, 0, 1 }, geo::Vector_t{ 0, 1, 0 },
284  geo::Point_t{ 0, 1, 0 }, geo::Vector_t{ 1, 0, 0 }
285  );
286 
287  // a way to check we did not mess with the assignment above too much
288  static_assert
289  (std::is_same_v<decltype(point), geo::Point_t>, "Unexpected point type");
290  static_assert
291  (std::is_same_v<decltype(offsetA), double>, "Unexpected first offset type");
292  static_assert
293  (std::is_same_v<decltype(offsetB), double>, "Unexpected second offset type");
294 
295  BOOST_TEST(point.X() == 2.0, tol);
296  BOOST_TEST(point.Y() == 1.0, tol);
297  BOOST_TEST(point.Z() == 1.0, tol);
298  BOOST_TEST(offsetA == 1.0, tol);
299  BOOST_TEST(offsetB == 2.0, tol);
300 
301  auto const xsectAndOfs = geo::LineClosestPointAndOffsetsWithUnitVectors(
302  geo::Point_t{ 0, 1, 0 }, geo::Vector_t{ 1, 0, 0 },
303  geo::Point_t{ 2, 0, 1 }, geo::Vector_t{ 0, 1, 0 }
304  );
305  point = xsectAndOfs.point;
306  offsetA = xsectAndOfs.offset1;
307  offsetB = xsectAndOfs.offset2;
308 
309  BOOST_TEST(point.X() == 2.0, tol);
310  BOOST_TEST(point.Y() == 1.0, tol);
311  BOOST_TEST(point.Z() == 0.0, tol);
312  BOOST_TEST(offsetA == 2.0, tol);
313  BOOST_TEST(offsetB == 1.0, tol);
314 
315  // actually we _can_ assign with `std::tie()`:
316  std::tie(point, offsetA, offsetB) = geo::LineClosestPointAndOffsetsWithUnitVectors(
317  geo::Point_t{ 2, 0, 1 }, geo::Vector_t{ 0, 1, 0 },
318  geo::Point_t{ 0, 1, 0 }, geo::Vector_t{ 1, 0, 0 }
319  );
320 
321  BOOST_TEST(point.X() == 2.0, tol);
322  BOOST_TEST(point.Y() == 1.0, tol);
323  BOOST_TEST(point.Z() == 1.0, tol);
324  BOOST_TEST(offsetA == 1.0, tol);
325  BOOST_TEST(offsetB == 2.0, tol);
326 
327 } // LineClosestPointAndOffsetsWithUnitVectorsDocumentation_test()
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space.
Definition: geo_vectors.h:164
auto const tol
Definition: SurfXYZTest.cc:16
auto const tolerance
IntersectionPointAndOffsets< Point > LineClosestPointAndOffsetsWithUnitVectors(Point const &startA, UnitVector const &dirA, Point const &startB, UnitVector const &dirB)
Returns the point of a line that is closest to a second line.
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:184
void LineClosestPointSimple45_test ( )

Definition at line 42 of file LineClosestPoint_test.cc.

42  {
43 
44  auto const tol = boost::test_tools::tolerance(0.001);
45 
48  geo::origin() + geo::Yaxis(), (geo::Xaxis() + geo::Zaxis()) / std::sqrt(2.0)
49  );
50 
51  BOOST_TEST(p.X() == 0.0, tol);
52  BOOST_TEST(p.Y() == 0.0, tol);
53  BOOST_TEST(p.Z() == 0.0, tol);
54 
55 } // LineClosestPointSimple45_test()
auto const tol
Definition: SurfXYZTest.cc:16
auto const tolerance
pdgs p
Definition: selectors.fcl:22
constexpr Vector Yaxis()
Returns a y axis vector of the specified type.
Definition: geo_vectors.h:219
constexpr Vector Xaxis()
Returns a x axis vector of the specified type.
Definition: geo_vectors.h:215
constexpr Vector Zaxis()
Returns a z axis vector of the specified type.
Definition: geo_vectors.h:223
Point LineClosestPoint(Point const &startA, Vector const &dirA, Point const &startB, Vector const &dirB)
Returns the point of a line that is closest to a second line.
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:184
constexpr Point origin()
Returns a origin position with a point of the specified type.
Definition: geo_vectors.h:227
void LineClosestPointSimple_test ( )

Definition at line 25 of file LineClosestPoint_test.cc.

25  {
26 
27  auto const tol = boost::test_tools::tolerance(0.001);
28 
30  geo::origin() - geo::Zaxis() - 3.0 * geo::Xaxis(), geo::Xaxis(),
31  geo::origin() + geo::Zaxis() + 2.0 * geo::Yaxis(), geo::Yaxis()
32  );
33 
34  BOOST_TEST(p.X() == 0.0, tol);
35  BOOST_TEST(p.Y() == 0.0, tol);
36  BOOST_TEST(p.Z() == -1.0, tol);
37 
38 } // LineClosestPointSimple_test()
auto const tol
Definition: SurfXYZTest.cc:16
auto const tolerance
pdgs p
Definition: selectors.fcl:22
constexpr Vector Yaxis()
Returns a y axis vector of the specified type.
Definition: geo_vectors.h:219
constexpr Vector Xaxis()
Returns a x axis vector of the specified type.
Definition: geo_vectors.h:215
constexpr Vector Zaxis()
Returns a z axis vector of the specified type.
Definition: geo_vectors.h:223
Point LineClosestPoint(Point const &startA, Vector const &dirA, Point const &startB, Vector const &dirB)
Returns the point of a line that is closest to a second line.
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:184
constexpr Point origin()
Returns a origin position with a point of the specified type.
Definition: geo_vectors.h:227
void LineClosestPointWithNonHomogeneousDirs_test ( )

Definition at line 97 of file LineClosestPoint_test.cc.

97  {
98 
99  auto const tol = boost::test_tools::tolerance(0.001);
100 
101  auto const [ p, ofsA, ofsB ] = geo::LineClosestPointAndOffsets(
102  geo::origin() - 3.0 * geo::Xaxis(), 1.5 * geo::Xaxis(),
103  geo::origin() + geo::Zaxis() + 2.0 * geo::Yaxis(), -2.0 * geo::Yaxis()
104  );
105 
106  BOOST_TEST(p.X() == 0.0, tol);
107  BOOST_TEST(p.Y() == 0.0, tol);
108  BOOST_TEST(p.Z() == 0.0, tol);
109  BOOST_TEST(ofsA == (+3.0 / 1.5), tol);
110  BOOST_TEST(ofsB == (-2.0 / -2.0), tol);
111 
112 } // LineClosestPointWithNonHomogeneousDirs_test()
auto const tol
Definition: SurfXYZTest.cc:16
auto const tolerance
pdgs p
Definition: selectors.fcl:22
constexpr Vector Yaxis()
Returns a y axis vector of the specified type.
Definition: geo_vectors.h:219
IntersectionPointAndOffsets< Point > LineClosestPointAndOffsets(Point const &startA, Vector const &dirA, Point const &startB, Vector const &dirB)
Returns the point of a line that is closest to a second line.
constexpr Vector Xaxis()
Returns a x axis vector of the specified type.
Definition: geo_vectors.h:215
constexpr Vector Zaxis()
Returns a z axis vector of the specified type.
Definition: geo_vectors.h:223
constexpr Point origin()
Returns a origin position with a point of the specified type.
Definition: geo_vectors.h:227
void LineClosestPointWithScaledDirs_test ( )

Definition at line 78 of file LineClosestPoint_test.cc.

78  {
79 
80  auto const tol = boost::test_tools::tolerance(0.001);
81 
82  auto const [ p, ofsA, ofsB ] = geo::LineClosestPointAndOffsets(
83  geo::origin() - 3.0 * geo::Xaxis(), 2.0 * geo::Xaxis(),
84  geo::origin() + geo::Zaxis() + 2.0 * geo::Yaxis(), -2.0 * geo::Yaxis()
85  );
86 
87  BOOST_TEST(p.X() == 0.0, tol);
88  BOOST_TEST(p.Y() == 0.0, tol);
89  BOOST_TEST(p.Z() == 0.0, tol);
90  BOOST_TEST(ofsA == (+3.0 / 2.0), tol);
91  BOOST_TEST(ofsB == (-2.0 / -2.0), tol);
92 
93 } // LineClosestPointWithScaledDirs_test()
auto const tol
Definition: SurfXYZTest.cc:16
auto const tolerance
pdgs p
Definition: selectors.fcl:22
constexpr Vector Yaxis()
Returns a y axis vector of the specified type.
Definition: geo_vectors.h:219
IntersectionPointAndOffsets< Point > LineClosestPointAndOffsets(Point const &startA, Vector const &dirA, Point const &startB, Vector const &dirB)
Returns the point of a line that is closest to a second line.
constexpr Vector Xaxis()
Returns a x axis vector of the specified type.
Definition: geo_vectors.h:215
constexpr Vector Zaxis()
Returns a z axis vector of the specified type.
Definition: geo_vectors.h:223
constexpr Point origin()
Returns a origin position with a point of the specified type.
Definition: geo_vectors.h:227
void LineClosestPointWithUnitVectorsAndOffsets_test ( )

Definition at line 231 of file LineClosestPoint_test.cc.

231  {
232 
233  auto const tol = boost::test_tools::tolerance(0.001);
234 
235  auto const [ p, ofsA, ofsB ] = geo::LineClosestPointAndOffsetsWithUnitVectors(
236  geo::origin() - 3.0 * geo::Xaxis(), geo::Xaxis(),
237  geo::origin() + geo::Zaxis() + 2.0 * geo::Yaxis(), geo::Yaxis()
238  );
239 
240  BOOST_TEST(p.X() == 0.0, tol);
241  BOOST_TEST(p.Y() == 0.0, tol);
242  BOOST_TEST(p.Z() == 0.0, tol);
243  BOOST_TEST(ofsA == +3.0, tol);
244  BOOST_TEST(ofsB == -2.0, tol);
245 
246 } // LineClosestPointWithUnitVectorsAndOffsets_test()
auto const tol
Definition: SurfXYZTest.cc:16
auto const tolerance
pdgs p
Definition: selectors.fcl:22
constexpr Vector Yaxis()
Returns a y axis vector of the specified type.
Definition: geo_vectors.h:219
IntersectionPointAndOffsets< Point > LineClosestPointAndOffsetsWithUnitVectors(Point const &startA, UnitVector const &dirA, Point const &startB, UnitVector const &dirB)
Returns the point of a line that is closest to a second line.
constexpr Vector Xaxis()
Returns a x axis vector of the specified type.
Definition: geo_vectors.h:215
constexpr Vector Zaxis()
Returns a z axis vector of the specified type.
Definition: geo_vectors.h:223
constexpr Point origin()
Returns a origin position with a point of the specified type.
Definition: geo_vectors.h:227
void LineClosestPointWithUnitVectorsSimple45_test ( )

Definition at line 214 of file LineClosestPoint_test.cc.

214  {
215 
216  auto const tol = boost::test_tools::tolerance(0.001);
217 
219  geo::origin(), geo::Xaxis(),
220  geo::origin() + geo::Yaxis(), (geo::Xaxis() + geo::Zaxis()) / std::sqrt(2.0)
221  );
222 
223  BOOST_TEST(p.X() == 0.0, tol);
224  BOOST_TEST(p.Y() == 0.0, tol);
225  BOOST_TEST(p.Z() == 0.0, tol);
226 
227 } // LineClosestPointWithUnitVectorsSimple45_test()
auto const tol
Definition: SurfXYZTest.cc:16
auto const tolerance
pdgs p
Definition: selectors.fcl:22
constexpr Vector Yaxis()
Returns a y axis vector of the specified type.
Definition: geo_vectors.h:219
constexpr Vector Xaxis()
Returns a x axis vector of the specified type.
Definition: geo_vectors.h:215
Point LineClosestPointWithUnitVectors(Point const &startA, UnitVector const &dirA, Point const &startB, UnitVector const &dirB)
Returns the point of a line that is closest to a second line.
constexpr Vector Zaxis()
Returns a z axis vector of the specified type.
Definition: geo_vectors.h:223
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:184
constexpr Point origin()
Returns a origin position with a point of the specified type.
Definition: geo_vectors.h:227
void LineClosestPointWithUnitVectorsSimple_test ( )

Definition at line 197 of file LineClosestPoint_test.cc.

197  {
198 
199  auto const tol = boost::test_tools::tolerance(0.001);
200 
202  geo::origin() - geo::Zaxis() - 3.0 * geo::Xaxis(), geo::Xaxis(),
203  geo::origin() + geo::Zaxis() + 2.0 * geo::Yaxis(), geo::Yaxis()
204  );
205 
206  BOOST_TEST(p.X() == 0.0, tol);
207  BOOST_TEST(p.Y() == 0.0, tol);
208  BOOST_TEST(p.Z() == -1.0, tol);
209 
210 } // LineClosestPointWithUnitVectorsSimple_test()
auto const tol
Definition: SurfXYZTest.cc:16
auto const tolerance
pdgs p
Definition: selectors.fcl:22
constexpr Vector Yaxis()
Returns a y axis vector of the specified type.
Definition: geo_vectors.h:219
constexpr Vector Xaxis()
Returns a x axis vector of the specified type.
Definition: geo_vectors.h:215
Point LineClosestPointWithUnitVectors(Point const &startA, UnitVector const &dirA, Point const &startB, UnitVector const &dirB)
Returns the point of a line that is closest to a second line.
constexpr Vector Zaxis()
Returns a z axis vector of the specified type.
Definition: geo_vectors.h:223
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:184
constexpr Point origin()
Returns a origin position with a point of the specified type.
Definition: geo_vectors.h:227