10 #define BOOST_TEST_MODULE ( geo_vectors_test )
11 #include <boost/test/unit_test.hpp>
21 #include "TLorentzVector.h"
30 #include <type_traits>
37 template <
typename Po
intA,
typename Po
intB>
42 if (!tag.empty()) BOOST_TEST_CHECKPOINT(tag);
45 BOOST_TEST_CHECKPOINT(
" coordinate #" << ic);
58 std::vector<geo::Point_t> points {
63 TVector3 another(expected.X(), expected.Y(), expected.Z());
69 BOOST_TEST(acc.empty());
70 BOOST_TEST(acc.weight() == 0.0, 0.001%
tolerance());
73 BOOST_TEST(!acc.empty());
74 BOOST_TEST(acc.weight() == 1.0, 0.001%
tolerance());
75 CheckPoint(acc.middlePoint(), expected,
"Single add");
77 acc.add(points.begin(), points.end());
78 BOOST_TEST(!acc.empty());
79 BOOST_TEST(acc.weight() == 1.0 + points.size(), 0.001%
tolerance());
80 CheckPoint(acc.middlePoint(), expected,
"Single add plus sequence");
86 BOOST_TEST(acc.empty());
87 acc.add(
geo::Point_t{ expected.X() + 1.0, expected.Z(), expected.Y() });
90 geo::Point_t{ expected.X() + 1.0, expected.Z(), expected.Y() },
99 acc.add(points.begin(), points.end());
100 BOOST_TEST(!acc.empty());
101 CheckPoint(acc.middlePoint(), expected,
"Sequence add");
104 BOOST_TEST(!acc.empty());
105 CheckPoint(acc.middlePoint(), expected,
"Sequence add plus single point");
114 std::vector<geo::Point_t> points {
119 TVector3 another(expected.X(), expected.Y(), expected.Z());
125 BOOST_TEST(!acc.empty());
126 CheckPoint(acc.middlePoint(), expected,
"Sequence construction");
129 BOOST_TEST(!acc.empty());
130 CheckPoint(acc.middlePoint(), expected,
"Sequence construction plus single");
136 template <
typename Po
int>
139 constexpr
unsigned int Dim = geo::vect::dimension<Point>();
143 constexpr
unsigned int MaxDim = 4U;
145 static_assert(Dim < MaxDim,
"This test supports only up to dimension 4");
146 using GenType = std::array<Scalar_t, MaxDim>;
149 GenType
const genExpected{{ 2., 4., 6., 8. }};
153 std::vector<GenType> genPoints {
154 GenType{{ 1., 2., 3., 4. }},
155 GenType{{ 2., 4., 6., 8. }},
156 GenType{{ 3., 6., 9., 12. }}
159 std::vector<Point> points;
160 for (
auto const& genPoint: genPoints)
161 points.push_back(geo::vect::makeFromCoords<Point>(genPoint.data()));
162 auto const expected = geo::vect::makeFromCoords<Point>(genExpected.data());
163 auto const another = expected;
169 BOOST_TEST(acc.
empty());
173 BOOST_TEST(!acc.
empty());
177 acc.
add(points.begin(), points.end());
178 BOOST_TEST(!acc.
empty());
186 BOOST_TEST(acc.
empty());
187 acc.
add(
geo::Point_t{ expected.X() + 1.0, expected.Z(), expected.Y() });
190 geo::Point_t{ expected.X() + 1.0, expected.Z(), expected.Y() },
199 acc.
add(points.begin(), points.end());
200 BOOST_TEST(!acc.
empty());
204 BOOST_TEST(!acc.
empty());
234 std::array<geo::Point_t, 4>
const points = {{
242 for (
auto const& point: points)
243 if (point.Y() > 0.0) pointsAboveGround.
add(point);
245 if (pointsAboveGround.
empty())
246 throw std::runtime_error(
"No point above ground!");
248 auto middleAboveGround = pointsAboveGround.
middlePoint();
252 "unexpected return type for geo::vect::MiddlePointAccumulator::middlePoint()");
254 (middleAboveGround, expected,
"MiddlePointAccumulator::middlePoint()");
292 std::vector<geo::Point_t> points {
317 auto const mp3 = geo::vect::middlePointAs<TVector3>(points.begin(), points.end());
319 std::is_same<std::decay_t<decltype(mp3)>, TVector3>::
value,
320 "geo::vect::middlePointAs<TVector3> does not return a TVector3!"
322 CheckPoint(mp3, expected,
"geo::vect::middlePointAs(sequence)");
338 std::vector<geo::Point_t> points {
343 auto mp = geo::vect::middlePointAs<geo::Vector_t>(points.begin(), points.end());
346 "geo::vect::middlePointAs<geo::Vector_t> result is not geo::Vector_t");
364 std::vector<geo::Point_t> points {
373 "geo::vect::middlePoint() result is not geo::Point_t");
391 "geo::vect::middlePoint() result is not geo::Point_t");
398 template <
typename Vector>
404 std::array<double, 3U>
const coords = {{ 1.0, 5.0, 9.0 }};
405 Vector v{ coords[0], coords[1], coords[2] };
407 unsigned int iCoord = 0;
408 for(
auto coordMan: geo::vect::coordManagers<Vector>()) {
409 auto const expected = coords[iCoord++];
411 BOOST_TEST(mc() == expected);
412 BOOST_TEST(mc == expected);
414 BOOST_TEST(iCoord == 3U);
420 BOOST_TEST(
x() == 1.0);
421 BOOST_TEST(
x == 1.0);
422 BOOST_TEST(
x() == v.X());
423 BOOST_TEST(c0() == v.X());
424 BOOST_TEST(mx() == 1.0);
425 BOOST_TEST(mx == 1.0);
426 BOOST_TEST(mx() == v.X());
427 BOOST_TEST(mc0() == v.X());
430 BOOST_TEST(
x() == 2.0);
431 BOOST_TEST(x == 2.0);
432 BOOST_TEST(
x() == v.X());
433 BOOST_TEST(c0() == v.X());
434 BOOST_TEST(mx() == 2.0);
435 BOOST_TEST(mx == 2.0);
436 BOOST_TEST(mx() == v.X());
437 BOOST_TEST(mc0() == v.X());
440 BOOST_TEST(
x() == 4.0);
441 BOOST_TEST(x == 4.0);
442 BOOST_TEST(
x() == v.X());
443 BOOST_TEST(c0() == v.X());
444 BOOST_TEST(mx() == 4.0);
445 BOOST_TEST(mx == 4.0);
446 BOOST_TEST(mx() == v.X());
447 BOOST_TEST(mc0() == v.X());
450 BOOST_TEST(
x() == 2.0);
451 BOOST_TEST(x == 2.0);
452 BOOST_TEST(
x() == v.X());
453 BOOST_TEST(c0() == v.X());
454 BOOST_TEST(mx() == 2.0);
455 BOOST_TEST(mx == 2.0);
456 BOOST_TEST(mx() == v.X());
457 BOOST_TEST(mc0() == v.X());
460 BOOST_TEST(
x() == 8.0);
461 BOOST_TEST(x == 8.0);
462 BOOST_TEST(
x() == v.X());
463 BOOST_TEST(c0() == v.X());
464 BOOST_TEST(mx() == 8.0);
465 BOOST_TEST(mx == 8.0);
466 BOOST_TEST(mx() == v.X());
467 BOOST_TEST(mc0() == v.X());
470 BOOST_TEST(
x() == 2.0);
471 BOOST_TEST(x == 2.0);
472 BOOST_TEST(
x() == v.X());
473 BOOST_TEST(c0() == v.X());
474 BOOST_TEST(mx() == 2.0);
475 BOOST_TEST(mx == 2.0);
476 BOOST_TEST(mx() == v.X());
477 BOOST_TEST(mc0() == v.X());
483 BOOST_TEST(
y() == 5.0);
484 BOOST_TEST(y == 5.0);
485 BOOST_TEST(
y() == v.Y());
486 BOOST_TEST(c1() == v.Y());
487 BOOST_TEST(
my() == 5.0);
488 BOOST_TEST(
my == 5.0);
489 BOOST_TEST(
my() == v.Y());
490 BOOST_TEST(mc1() == v.Y());
493 BOOST_TEST(
y() == 2.0);
494 BOOST_TEST(y == 2.0);
495 BOOST_TEST(
y() == v.Y());
496 BOOST_TEST(c1() == v.Y());
497 BOOST_TEST(
my() == 2.0);
498 BOOST_TEST(
my == 2.0);
499 BOOST_TEST(
my() == v.Y());
500 BOOST_TEST(mc1() == v.Y());
503 BOOST_TEST(
y() == 4.0);
504 BOOST_TEST(y == 4.0);
505 BOOST_TEST(
y() == v.Y());
506 BOOST_TEST(c1() == v.Y());
507 BOOST_TEST(
my() == 4.0);
508 BOOST_TEST(
my == 4.0);
509 BOOST_TEST(
my() == v.Y());
510 BOOST_TEST(mc1() == v.Y());
513 BOOST_TEST(
y() == 2.0);
514 BOOST_TEST(y == 2.0);
515 BOOST_TEST(
y() == v.Y());
516 BOOST_TEST(c1() == v.Y());
517 BOOST_TEST(
my() == 2.0);
518 BOOST_TEST(
my == 2.0);
519 BOOST_TEST(
my() == v.Y());
520 BOOST_TEST(mc1() == v.Y());
523 BOOST_TEST(
y() == 8.0);
524 BOOST_TEST(y == 8.0);
525 BOOST_TEST(
y() == v.Y());
526 BOOST_TEST(c1() == v.Y());
527 BOOST_TEST(
my() == 8.0);
528 BOOST_TEST(
my == 8.0);
529 BOOST_TEST(
my() == v.Y());
530 BOOST_TEST(mc1() == v.Y());
533 BOOST_TEST(
y() == 2.0);
534 BOOST_TEST(y == 2.0);
535 BOOST_TEST(
y() == v.Y());
536 BOOST_TEST(c1() == v.Y());
537 BOOST_TEST(
my() == 2.0);
538 BOOST_TEST(
my == 2.0);
539 BOOST_TEST(
my() == v.Y());
540 BOOST_TEST(mc1() == v.Y());
546 BOOST_TEST(
z() == 9.0);
547 BOOST_TEST(z == 9.0);
548 BOOST_TEST(
z() == v.Z());
549 BOOST_TEST(c2() == v.Z());
550 BOOST_TEST(mz() == 9.0);
551 BOOST_TEST(mz == 9.0);
552 BOOST_TEST(mz() == v.Z());
553 BOOST_TEST(mc2() == v.Z());
556 BOOST_TEST(
z() == 2.0);
557 BOOST_TEST(z == 2.0);
558 BOOST_TEST(
z() == v.Z());
559 BOOST_TEST(c2() == v.Z());
560 BOOST_TEST(mz() == 2.0);
561 BOOST_TEST(mz == 2.0);
562 BOOST_TEST(mz() == v.Z());
563 BOOST_TEST(mc2() == v.Z());
566 BOOST_TEST(
z() == 4.0);
567 BOOST_TEST(z == 4.0);
568 BOOST_TEST(
z() == v.Z());
569 BOOST_TEST(c2() == v.Z());
570 BOOST_TEST(mz() == 4.0);
571 BOOST_TEST(mz == 4.0);
572 BOOST_TEST(mz() == v.Z());
573 BOOST_TEST(mc2() == v.Z());
576 BOOST_TEST(
z() == 2.0);
577 BOOST_TEST(z == 2.0);
578 BOOST_TEST(
z() == v.Z());
579 BOOST_TEST(c2() == v.Z());
580 BOOST_TEST(mz() == 2.0);
581 BOOST_TEST(mz == 2.0);
582 BOOST_TEST(mz() == v.Z());
583 BOOST_TEST(mc2() == v.Z());
586 BOOST_TEST(
z() == 8.0);
587 BOOST_TEST(z == 8.0);
588 BOOST_TEST(
z() == v.Z());
589 BOOST_TEST(c2() == v.Z());
590 BOOST_TEST(mz() == 8.0);
591 BOOST_TEST(mz == 8.0);
592 BOOST_TEST(mz() == v.Z());
593 BOOST_TEST(mc2() == v.Z());
596 BOOST_TEST(
z() == 2.0);
597 BOOST_TEST(z == 2.0);
598 BOOST_TEST(
z() == v.Z());
599 BOOST_TEST(c2() == v.Z());
600 BOOST_TEST(mz() == 2.0);
601 BOOST_TEST(mz == 2.0);
602 BOOST_TEST(mz() == v.Z());
603 BOOST_TEST(mc2() == v.Z());
610 template <
typename Vector>
617 std::array<double, 3U>
const coords = {{ 1.0, 5.0, 9.0 }};
618 Vector
const v{ coords[0], coords[1], coords[2] };
620 unsigned int iCoord = 0;
621 for(
auto coordMan: geo::vect::coordReaders<Vector>()) {
622 auto const expected = coords[iCoord++];
624 BOOST_TEST(mc() == expected);
625 BOOST_TEST(mc == expected);
627 BOOST_TEST(iCoord == 3U);
633 BOOST_TEST(
x() == 1.0);
634 BOOST_TEST(
x == 1.0);
635 BOOST_TEST(
x() == v.X());
636 BOOST_TEST(c0() == v.X());
637 BOOST_TEST(mx() == 1.0);
638 BOOST_TEST(mx == 1.0);
639 BOOST_TEST(mx() == v.X());
640 BOOST_TEST(mc0() == v.X());
646 BOOST_TEST(
y() == 5.0);
647 BOOST_TEST(y == 5.0);
648 BOOST_TEST(
y() == v.Y());
649 BOOST_TEST(c1() == v.Y());
650 BOOST_TEST(
my() == 5.0);
651 BOOST_TEST(
my == 5.0);
652 BOOST_TEST(
my() == v.Y());
653 BOOST_TEST(mc1() == v.Y());
660 BOOST_TEST(
z() == 9.0);
661 BOOST_TEST(z == 9.0);
662 BOOST_TEST(
z() == v.Z());
663 BOOST_TEST(c2() == v.Z());
664 BOOST_TEST(mz() == 9.0);
665 BOOST_TEST(mz == 9.0);
666 BOOST_TEST(mz() == v.Z());
667 BOOST_TEST(mc2() == v.Z());
675 template <
typename Vector,
unsigned int Dim = geo::vect::dimension<Vector>()>
678 template <
typename Vector>
705 BOOST_TEST(!
geo::vect::isfinite(Vector{ std::nan(
""), std::nan(
""), std::nan(
""), std::nan(
"") }));
709 template <
typename Vector>
731 template <
typename Vector>
747 template <
typename Vector>
756 template <
typename Source,
typename Dest>
761 std::array<double, 4U> srcData {{ 1.0, 5.0, 9.0, 16.0 }};
766 Source srcForClangBug;
767 if constexpr (util::is_STLarray_v<Source>)
768 srcForClangBug = Source{{ srcData[0], srcData[1] }};
770 srcForClangBug = Source{ srcData[0], srcData[1] };
771 Source
const src { srcForClangBug };
773 auto dest = geo::vect::convertTo<Dest>(src);
776 (std::is_same<decltype(dest), Dest>(),
"Unexpected return type!");
785 template <
typename Source,
typename Dest>
790 std::array<double, 4U> srcData {{ 1.0, 5.0, 9.0, 16.0 }};
795 Source srcForClangBug;
796 if constexpr (util::is_STLarray_v<Source>)
797 srcForClangBug = Source{{ srcData[0], srcData[1], srcData[2] }};
799 srcForClangBug = Source{ srcData[0], srcData[1], srcData[2] };
800 Source
const src { srcForClangBug };
802 auto dest = geo::vect::convertTo<Dest>(src);
805 (std::is_same<decltype(dest), Dest>(),
"Unexpected return type!");
815 template <
typename Source,
typename Dest>
820 std::array<double, 4U> srcData {{ 1.0, 5.0, 9.0, 16.0 }};
825 Source srcForClangBug;
826 if constexpr (util::is_STLarray_v<Source>)
827 srcForClangBug = Source{{ srcData[0], srcData[1], srcData[2], srcData[3] }};
829 srcForClangBug = Source{ srcData[0], srcData[1], srcData[2], srcData[3] };
830 Source
const src { srcForClangBug };
833 auto dest = geo::vect::convertTo<Dest>(src);
836 (std::is_same<decltype(dest), Dest>(),
"Unexpected return type!");
855 constexpr std::array<float, 5U> data {{ 2.0, 5.0, 7.0, 11.0, 15.5 }};
856 auto const p = geo::vect::makeFromCoords<geo::Point_t>(data);
857 auto const v = geo::vect::makeFromCoords<geo::Vector_t>(data.data() + 1);
866 template <
typename Vector>
871 std::array<float, 5U> data {{ 4.0, 5.0, 7.0, 11.0, 15.5 }};
872 auto const v = geo::vect::makeFromCoords<Vector>(data);
876 (std::is_same<decltype(neg_v), decltype(v)>(),
"Unexpected return type");
877 BOOST_TEST(neg_v == -v);
884 std::ostringstream expected, out;
897 std::cout << v <<
" has x=" << vx() << std::endl;
898 out << v <<
" has x=" << vx();
899 expected << v <<
" has x=" << v.X();
901 BOOST_TEST(out.str() == expected.str());
918 out <<
p <<
" has now x=" <<
px();
919 expected <<
p <<
" has now x=" <<
p.X();
921 BOOST_TEST(out.str() == expected.str());
929 template <
typename C>
931 {
static constexpr
unsigned int Dim = 0U;
using Scalar = C; };
932 template <
typename C>
934 {
static constexpr
unsigned int Dim = 1U; C
X()
const; };
935 template <
typename C>
937 {
static constexpr
unsigned int Dim = 2U; C
Y()
const; };
938 template <
typename C>
940 {
static constexpr
unsigned int Dim = 3U; C
Z()
const; };
941 template <
typename C>
943 {
static constexpr
unsigned int Dim = 4U; C
T()
const; };
944 template <
typename C>
946 {
static constexpr
unsigned int Dim = 5
U; C
U()
const; };
988 static_assert( geo::vect::details::HasX<TVector2>(),
"Unexpected TVector2::X()");
989 static_assert( geo::vect::details::HasY<TVector2>(),
"Unexpected TVector2::Y()");
990 static_assert(!geo::vect::details::HasZ<TVector2>(),
"Unexpected TVector2::Z()");
991 static_assert(!geo::vect::details::HasT<TVector2>(),
"Unexpected TVector2::T()");
992 static_assert(geo::vect::dimension<TVector2>() == 2U,
"Unexpected TVector2 dimension");
998 static_assert( geo::vect::details::HasX<TVector3>(),
"Unexpected TVector3::X()");
999 static_assert( geo::vect::details::HasY<TVector3>(),
"Unexpected TVector3::Y()");
1000 static_assert( geo::vect::details::HasZ<TVector3>(),
"Unexpected TVector3::Z()");
1001 static_assert(!geo::vect::details::HasT<TVector3>(),
"Unexpected TVector3::T()");
1002 static_assert(geo::vect::dimension<TVector3>() == 3U,
"Unexpected TVector3 dimension");
1008 static_assert( geo::vect::details::HasX<TLorentzVector>(),
"Unexpected TLorentzVector::X()");
1009 static_assert( geo::vect::details::HasY<TLorentzVector>(),
"Unexpected TLorentzVector::Y()");
1010 static_assert( geo::vect::details::HasZ<TLorentzVector>(),
"Unexpected TLorentzVector::Z()");
1011 static_assert( geo::vect::details::HasT<TLorentzVector>(),
"Unexpected TLorentzVector::T()");
1012 static_assert(geo::vect::dimension<TLorentzVector>() == 4U,
"Unexpected TLorentzVector dimension");
1014 "Unexpected TLorentzVector coordinate type");
1019 static_assert( geo::vect::details::HasX<geo::Vector_t>(),
"Unexpected geo::Vector_t::X()");
1020 static_assert( geo::vect::details::HasY<geo::Vector_t>(),
"Unexpected geo::Vector_t::Y()");
1021 static_assert( geo::vect::details::HasZ<geo::Vector_t>(),
"Unexpected geo::Vector_t::Z()");
1022 static_assert(!geo::vect::details::HasT<geo::Vector_t>(),
"Unexpected geo::Vector_t::T()");
1023 static_assert(geo::vect::dimension<geo::Vector_t>() == 3U,
"Unexpected geo::Vector_t dimension");
1025 "Unexpected vector type");
1030 static_assert( geo::vect::details::HasX<geo::Point_t>(),
"Unexpected geo::Point_t::X()");
1031 static_assert( geo::vect::details::HasY<geo::Point_t>(),
"Unexpected geo::Point_t::Y()");
1032 static_assert( geo::vect::details::HasZ<geo::Point_t>(),
"Unexpected geo::Point_t::Z()");
1033 static_assert(!geo::vect::details::HasT<geo::Point_t>(),
"Unexpected geo::Point_t::T()");
1034 static_assert(geo::vect::dimension<geo::Point_t>() == 3U,
"Unexpected geo::Point_t dimension");
1036 "Unexpected vector type");
1042 template <
typename Vector>
1048 std::array<Coord_t, geo::vect::dimension<Vector_t>()> expected;
1049 std::iota(expected.begin(), expected.end(),
Coord_t(1));
1050 auto const v = geo::vect::makeFromCoords<Vector_t>(expected);
1052 unsigned int index = 0;
1054 BOOST_TEST(c == expected[index]);
1062 BOOST_TEST(c == expected[index]);
1070 template <
typename Vector>
1076 std::array<Coord_t, geo::vect::dimension<Vector_t>()> expected;
1077 std::iota(expected.begin(), expected.end(),
Coord_t(1));
1078 auto const v = geo::vect::makeFromCoords<Vector_t>(expected);
1080 Coord_t coords[geo::vect::dimension<Vector_t>()];
1083 BOOST_TEST(dim == expected.size());
1085 for (
unsigned int index = 0; index < dim; ++index)
1086 BOOST_TEST(coords[index] == expected[index]);
1091 BOOST_AUTO_TEST_SUITE(geo_vectors_utils_test)
1098 test_MiddlePointAccumulator_generic<TVector3>();
1099 test_MiddlePointAccumulator_generic<geo::Vector_t>();
1100 test_MiddlePointAccumulator_generic<geo::Point_t>();
1138 test_vectorProcessing<TVector2>();
1139 test_vectorProcessing<geo::Point_t>();
1140 test_vectorProcessing<geo::Vector_t>();
1141 test_vectorProcessing<TVector3>();
1142 test_vectorProcessing<TLorentzVector>();
1154 test_vector2Dconvert<TVector2 , TVector2 >();
1155 test_vector2Dconvert<std::array<double, 2U>, TVector2 >();
1160 test_vector3Dconvert<std::array<double, 3U>, TVector3 >();
1164 test_vector3Dconvert<TVector3 , TVector3 >();
1165 test_vector3Dconvert<geo::Point_t , TVector3 >();
1166 test_vector3Dconvert<geo::Vector_t , TVector3 >();
1167 test_vector3Dconvert<std::array<double, 3U>,
geo::Point_t >();
1170 test_vector3Dconvert<TVector3 , geo::Point_t >();
1171 test_vector3Dconvert<geo::Point_t , geo::Point_t >();
1172 test_vector3Dconvert<geo::Vector_t , geo::Point_t >();
1173 test_vector3Dconvert<std::array<double, 3U>,
geo::Vector_t>();
1176 test_vector3Dconvert<TVector3 , geo::Vector_t>();
1177 test_vector3Dconvert<geo::Point_t , geo::Vector_t>();
1178 test_vector3Dconvert<geo::Vector_t , geo::Vector_t>();
1180 test_transform<TVector3>();
1183 test_vector4Dconvert<TLorentzVector , TLorentzVector>();
1184 test_vector4Dconvert<std::array<double, 4U>, TLorentzVector>();
1193 test_CoordConstIterator<TVector2 >();
1194 test_CoordConstIterator<TVector3 >();
1195 test_CoordConstIterator<geo::Point_t >();
1196 test_CoordConstIterator<geo::Vector_t >();
1197 test_CoordConstIterator<TLorentzVector>();
1199 test_fillCoords<TVector2 >();
1200 test_fillCoords<TVector3 >();
1201 test_fillCoords<geo::Point_t >();
1202 test_fillCoords<geo::Vector_t >();
1203 test_fillCoords<TLorentzVector>();
1209 BOOST_AUTO_TEST_SUITE_END()
process_name opflash particleana ie ie ie z
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space.
Specializations of geo_vectors_utils.h for ROOT old vector types.
static constexpr unsigned int Dim
void clear()
Resets the status of the object to no accumulated points.
void test_vector4Dconvert()
auto Zcoord(Vector &v)
Returns an object to manage the coordinate Z of the vector v.
Point middlePointAs() const
Returns the middle point, NaN components if no point.
process_name opflash particleana ie x
static constexpr unsigned int Dim
void test_vector3Dconvert()
void test_MiddlePointAccumulator_defaultConstructor()
auto coord(Vector &v, unsigned int n) noexcept
Returns an object to manage the coordinate n of a vector.
Helper class to compute the middle point in a point set.
void CheckPoint(PointA const &test, PointB const &ref, std::string tag="")
double weight() const
Returns the total weight (number of points if all have weight 1).
auto iterateCoords(Vector const &v)
Returns an object for ranged-for iteration on coordinates.
constexpr auto bindCoord(Vector const &v, CoordReader_t< Vector > helper)
Binds the specified constant vector to the coordinate reader.
enum geo::coordinates Coord_t
static constexpr unsigned int Dim
void test_middlePoint_iterators_documentation()
static constexpr unsigned int Dim
void add(Point const &p)
Accumulates a point.
my($xml, $fcl, $workdir, $check, $merge)
constexpr unsigned int dimension()
Returns the dimension of the specified vector type.
static constexpr unsigned int Dim
unsigned int fillCoords(Coords &dest, Vector const &src)
Fills a coordinate array with the coordinates of a vector.
void test_middlePoint_initlist_documentation()
bool isfinite(Vector const &v)
Returns whether all components of the vector are finite.
process_name opflash particleana ie ie y
bool empty() const
Returns whether the total weight is zero (usually means no points).
void test_middlePointAs_documentation()
constexpr std::array< std::size_t, geo::vect::dimension< Vector >)> indices()
Returns a sequence of indices valid for a vector of the specified type.
Utilities to extend the interface of geometry vectors.
void test_MiddlePointAccumulator_documentation_middlePointAs()
void test_vectorProcessing()
auto Ycoord(Vector &v)
Returns an object to manage the coordinate Y of the vector v.
void test_MiddlePointAccumulator_sequenceConstructor()
Vector transformCoords(Vector const &v, Pred &&pred)
Returns a new vector applying a predicate to each component.
void test_vector2Dconvert()
void test_MiddlePointAccumulator_generic()
auto Xcoord(Vector &v)
Returns an object to manage the coordinate X of the vector v.
auto Tcoord(Vector &v)
Returns an object to manage the coordinate T of the vector v.
geo::Point_t middlePoint() const
static constexpr unsigned int Dim
void test_MiddlePointAccumulator_documentation_class()
void test_MiddlePointAccumulator_documentation()
void test_CoordConstIterator()
details::VectorScalar_t< Vector > coordinate_t
Type of coordinate of the specified vector type.
BEGIN_PROLOG hitmakerfive clustermakerfour pfparticlemakerthree showermakertwo END_PROLOG hitmakerfive clustermakerfour pfparticlemakerthree sequence::inline_paths sequence::inline_paths sequence::inline_paths showermakers test
void test_XcoordManager_documentation()
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
void test_makeFromCoords_documentation()
recob::tracking::Vector_t Vector_t
geo::Point_t middlePoint(BeginIter begin, EndIter end)
Returns the middle of the specified points.
BEGIN_PROLOG could also be cout