17 #ifndef LARCOREOBJ_SIMPLETYPESANDCONSTANTS_GEO_VECTORS_UTILS_H
18 #define LARCOREOBJ_SIMPLETYPESANDCONSTANTS_GEO_VECTORS_UTILS_H
25 #include "Math/GenVector/PositionVector2D.h"
26 #include "Math/GenVector/DisplacementVector2D.h"
27 #include "Math/GenVector/PositionVector3D.h"
28 #include "Math/GenVector/DisplacementVector3D.h"
29 #include "Math/GenVector/LorentzVector.h"
35 #include <type_traits>
54 template <
typename Op,
typename... T>
58 <
typename Op,
typename First,
typename Second,
typename... Others>
60 static auto compute(Op op, First&&
a, Second&& b, Others&&... others)
66 (op, std::forward<Second>(b), std::forward<Others>(others)...)
71 template <
typename Op,
typename T>
73 static auto compute(Op, T&& v) -> decltype(
auto)
74 {
return std::forward<T>(v); }
77 template <
typename Op,
typename... T>
82 template <
typename... T>
85 auto and_op = [](
auto&&
a,
auto&& b) {
return a && b; };
102 template <
typename Vector>
105 template <
typename Vector>
110 template <
typename Vector>
114 template<
typename Class>
115 static constexpr
bool TestX(decltype(std::declval<Class>().
X())*) {
return true; }
116 template<
typename Class>
117 static constexpr
bool TestX(...) {
return false; }
118 template<
typename Class>
119 static constexpr
bool TestY(decltype(std::declval<Class>().
Y())*) {
return true; }
120 template<
typename Class>
121 static constexpr
bool TestY(...) {
return false; }
122 template<
typename Class>
123 static constexpr
bool TestZ(decltype(std::declval<Class>().
Z())*) {
return true; }
124 template<
typename Class>
125 static constexpr
bool TestZ(...) {
return false; }
126 template<
typename Class>
127 static constexpr
bool TestT(decltype(std::declval<Class>().
T())*) {
return true; }
128 template<
typename Class>
129 static constexpr
bool TestT(...) {
return false; }
132 static constexpr
bool X = TestX<Vector>(
nullptr);
133 static constexpr
bool Y = TestY<Vector>(
nullptr);
134 static constexpr
bool Z = TestZ<Vector>(
nullptr);
135 static constexpr
bool T = TestT<Vector>(
nullptr);
138 template <
typename Vector>
140 template <
typename Vector>
142 template <
typename Vector>
144 template <
typename Vector>
147 template <
typename Vector,
typename =
void>
150 template <
typename Vector>
156 template <
typename Vector>
158 = std::array<VectorScalar_t<Vector>, dimension<Vector>()>;
161 template <
typename T>
166 =
typename decltype(std::mem_fn(std::declval<T>()))::result_type;
169 template <
typename T>
172 template <
typename T>
175 template <
typename Class,
typename Func>
178 template <
typename T>
182 template <
typename Vector,
typename SetterType =
void>
185 template <
typename Vector>
192 template <
typename Vector,
typename SetterType>
205 "Invalid setter type"
210 template <
typename Vector>
222 template <
typename Vector>
245 template <
typename Getter>
248 using Vector_t = std::remove_reference_t<MemberFuncClass_t<Getter>>;
253 template <
typename Vector,
typename SetterType>
266 template <
typename Vector,
typename SetterType>
304 template <
typename Getter,
typename Setter>
307 using Vector_t = std::remove_reference_t<MemberFuncClass_t<Getter>>;
313 template <
typename CoordHelper,
typename StoredVector>
351 template <
typename CoordHelper,
typename StoredVector>
368 :
Base_t(v, coordManager) {}
409 template <
typename T>
415 template <
typename T>
417 if (
std::abs(value) < tol)
return 0.;
581 template <
typename Vector>
582 constexpr
unsigned int dimension() {
return details::dimension<Vector>(); }
583 template <
typename Vector>
584 constexpr
unsigned int dimension(Vector&&) {
return dimension<Vector>(); }
589 template <
typename Vector>
590 constexpr std::array<std::size_t, geo::vect::dimension<Vector>()>
indices();
591 template <
typename Vector>
592 constexpr
auto indices(Vector
const&) -> decltype(indices<Vector>());
596 template <
typename Vector>
620 template <
typename Vector,
typename Coords>
636 template <
typename Vector,
typename Coords>
641 template <
typename Vector>
646 template <
typename Vector>
671 template <
typename Vector>
696 template <
typename Vector>
702 template <
typename Vector>
708 template <
typename Vector>
714 template <
typename Vector>
720 template <
typename Vector>
726 template <
typename Vector>
732 template <
typename Vector>
777 template <
typename Vector>
791 template <
typename Vector>
797 template <
typename Vector>
799 template <
typename Vector>
805 template <
typename Vector>
807 template <
typename Vector>
812 template <
typename Vector>
821 template <
typename Vector>
824 {
return { v, helper }; }
838 template <
typename Vector>
840 {
return bindCoord(v, XcoordManager<Vector>); }
852 template <
typename Vector>
854 {
return bindCoord<Vector>(v, YcoordManager<Vector>); }
866 template <
typename Vector>
868 {
return bindCoord<Vector>(v, ZcoordManager<Vector>); }
880 template <
typename Vector>
882 {
return bindCoord<Vector>(v, TcoordManager<Vector>); }
895 template <
typename Vector>
896 auto coord(Vector& v,
unsigned int n) noexcept;
901 template <
typename Vector>
906 template <
typename Vector>
917 template <
typename Vector>
929 unsigned int index = std::numeric_limits<unsigned int>::max();
931 decltype(
auto)
access(
unsigned int c)
const
1015 {
return (v == other.
v) && (
index == other.
index); }
1018 {
return (v != other.
v) || (
index != other.
index); }
1021 {
return (v == other.
v) && (
index <= other.
index); }
1024 {
return (v == other.
v) && (
index >= other.
index); }
1027 {
return (v == other.
v) && (
index < other.
index); }
1030 {
return (v == other.
v) && (
index > other.
index); }
1037 template <
typename Vector>
1045 template <
typename Vector>
1050 template <
typename Vector>
1067 template <
typename Vector>
1082 template <
typename Dest,
typename Source>
1101 template <
typename Dest,
typename Source>
1102 std::vector<Dest>
convertCollTo(std::vector<Source>
const& coll);
1116 template <
typename Vector,
typename Pred>
1156 template <
typename Vector,
typename Scalar>
1164 template <
typename Vector,
typename Scalar>
1168 template <
typename Vector,
typename Scalar>
1176 template <
typename Vector,
typename Scalar>
1181 template <
typename Vector>
1185 template <
typename Vector>
1189 template <
typename Vector>
1190 Vector
cross(Vector
const&
a, Vector
const& b) {
return a.Cross(b); }
1193 template <
typename Vector>
1194 constexpr
auto dot(Vector
const&
a, Vector
const& b) {
return a.Dot(b); }
1197 template <
typename Vector>
1198 auto mag2(Vector
const& v) {
return v.Mag2(); }
1201 template <
typename Vector>
1202 auto norm(Vector
const& v) {
return v.Mag(); }
1206 template <
typename Vector>
1245 template <
unsigned int N = 3U>
1247 static constexpr
unsigned int Dim =
N;
1263 template <
typename BeginIter,
typename EndIter>
1266 {
add(begin, end); }
1290 template <
typename Po
int>
1293 {
return makeWeightedPoint<Point>(1.0 /
fW); }
1298 {
return middlePointAs<geo::Point_t>(); }
1315 template <
typename Po
int>
1318 std::size_t ic = 0U;
1329 template <
typename Po
int>
1332 std::size_t ic = 0U;
1334 fSums[ic++] += weight * c();
1347 template <
typename BeginIter,
typename EndIter>
1349 { std::for_each(begin, end, [
this](
auto const&
p){ this->
add(
p); }); }
1360 template <
typename Point, std::size_t...
I>
1362 {
return {
fSums.operator[](
I)... }; }
1364 template <
typename Point, std::size_t...
I>
1366 {
return { (
fSums.operator[](
I) * w)... }; }
1369 template <
typename Po
int>
1371 {
return geo::vect::makeFromCoords<Point>(
fSums); }
1375 template <
typename Po
int>
1414 template <
typename Po
int,
typename BeginIter,
typename EndIter>
1417 constexpr
auto Dim = geo::vect::dimension<Point>();
1419 .
template middlePointAs<Point>();
1443 template <
typename BeginIter,
typename EndIter>
1445 {
return middlePointAs<geo::Point_t>(
begin,
end); }
1463 template <
typename Po
int>
1466 constexpr
auto Dim = geo::vect::dimension<Point>();
1468 .
template middlePointAs<Point>();
1484 template <
typename Po
int>
1486 {
return geo::vect::convertTo<::geo::Point_t>(
p); }
1489 template <
typename Vector>
1491 {
return geo::vect::convertTo<::geo::Vector_t>(v); }
1496 template <
typename Po
int>
1498 (std::vector<Point>
const& coll)
1499 {
return convertCollTo<geo::Point_t>(coll); }
1503 template <
typename Vector>
1505 (std::vector<Vector>
const& coll)
1506 {
return convertCollTo<geo::Vector_t>(coll); }
1510 template <
typename Coords>
1512 {
return makeFromCoords<::geo::Point_t>(std::forward<Coords>(coords)); }
1515 template <
typename Coords>
1517 {
return makeFromCoords<::geo::Vector_t>(std::forward<Coords>(coords)); }
1534 namespace ROOT::Math {
1540 template<
class CoordSystem,
class Tag>
1544 template<
class CoordSystem,
class Tag>
1548 template<
class CoordSystem,
class Tag>
1549 decltype(
auto)
end(
ROOT::Math::PositionVector2D<CoordSystem, Tag>
const& v)
1552 template<
class CoordSystem,
class Tag>
1556 template<
class CoordSystem,
class Tag>
1561 template<
class CoordSystem,
class Tag>
1565 template<
class CoordSystem,
class Tag>
1566 decltype(
auto)
end(
ROOT::Math::DisplacementVector2D<CoordSystem, Tag>
const& v)
1569 template<
class CoordSystem,
class Tag>
1570 decltype(
auto)
cend(
ROOT::Math::DisplacementVector2D<CoordSystem, Tag>
const& v)
1577 template<
class CoordSystem,
class Tag>
1581 template<
class CoordSystem,
class Tag>
1585 template<
class CoordSystem,
class Tag>
1586 decltype(
auto)
end(
ROOT::Math::PositionVector3D<CoordSystem, Tag>
const& v)
1589 template<
class CoordSystem,
class Tag>
1593 template<
class CoordSystem,
class Tag>
1598 template<
class CoordSystem,
class Tag>
1602 template<
class CoordSystem,
class Tag>
1603 decltype(
auto)
end(
ROOT::Math::DisplacementVector3D<CoordSystem, Tag>
const& v)
1606 template<
class CoordSystem,
class Tag>
1607 decltype(
auto)
cend(
ROOT::Math::DisplacementVector3D<CoordSystem, Tag>
const& v)
1614 template<
class CoordSystem>
1618 template<
class CoordSystem>
1622 template<
class CoordSystem>
1626 template<
class CoordSystem>
1642 namespace geo::vect {
1656 namespace geo::vect::details {
1663 template <
typename T>
1665 {
return static_cast<T&&
>(t); }
1667 template<
typename T>
1670 static_assert(!std::is_lvalue_reference<T>(),
1671 "template argument substituting T is an lvalue reference type");
1672 return static_cast<T&&
>(t);
1676 template <
typename Vector,
typename >
1677 struct DimensionImpl
1678 :
public std::integral_constant<
1681 : HasZ<Vector>()? 3U
1682 : HasY<Vector>()? 2U
1683 : HasX<Vector>()? 1U
1688 template <
typename Array>
1690 :
public std::integral_constant<unsigned int, std::extent_v<Array>>
1693 template <
typename T, std::
size_t Dim>
1695 :
public std::integral_constant<unsigned int, Dim>
1701 template <
typename Vector>
1704 template <
typename Vector>
1707 template <
typename Vector>
1709 {
return makeVectorIndices<Vector>(); }
1712 template <
typename T, T... Indices>
1716 {
return std::array<T,
sizeof...(Indices)>{{ Indices... }}; }
1719 template <
typename T, T N>
1721 {
return makeIndexSeqImpl<T>(std::make_integer_sequence<T, N>{}); }
1725 template <std::
size_t I,
typename Data>
1728 template <
typename Vector,
typename Coords, std::size_t... Indices>
1730 (
Coords&& coords, std::index_sequence<Indices...>)
1733 { accessElement<Indices>(constexpr_forward<Coords>(coords))... };
1738 template <
typename Vector>
1741 template <
typename Vector,
unsigned int Dim = dimension<Vector>()>
1744 template <
typename Vector>
1746 static auto get(
unsigned int n) noexcept
1747 {
return (
n == 0)? XcoordManager<Vector>: NoCoordManager<Vector>; }
1750 template <
typename Vector>
1752 static auto get(
unsigned int n) noexcept
1759 template <
typename Vector>
1761 static auto get(
unsigned int n) noexcept
1768 template <
typename Vector>
1770 static auto get(
unsigned int n) noexcept
1780 template <
typename Vector,
unsigned int N>
1782 static constexpr
unsigned int Dim =
N;
1787 static_assert(dimension<Vector>() == Dim,
"Inconsistent vector size.");
1790 template <
typename Vector,
unsigned int N>
1793 template <
typename Vector>
1804 XcoordManager<Vector>
1805 , YcoordManager<Vector>
1810 template <
typename Vector>
1821 XcoordManager<Vector>
1822 , YcoordManager<Vector>
1823 , ZcoordManager<Vector>
1828 template <
typename Vector>
1839 XcoordManager<Vector>
1840 , YcoordManager<Vector>
1841 , ZcoordManager<Vector>
1842 , TcoordManager<Vector>
1849 template <
typename Vector,
unsigned int N>
1851 static constexpr
unsigned int Dim =
N;
1856 static_assert(dimension<Vector>() == Dim,
"Inconsistent vector size.");
1859 template <
typename Vector,
unsigned int N>
1862 template <
typename Vector>
1879 template <
typename Vector>
1897 template <
typename Vector>
1918 template<
typename Dest,
typename Source>
1920 static_assert(dimension<Source>() == dimension<Dest>(),
1921 "Source and destination vectors must have the same dimension.");
1925 template <
typename Dest,
typename Source,
unsigned int Dim>
1929 (std::is_arithmetic_v<std::decay_t<decltype(std::declval<Source>()[0])>>);
1931 {
return geo::vect::makeFromCoords<Dest>(v); }
1936 template <
typename Dest,
typename Source,
unsigned int Dim>
1940 template <
typename Dest,
typename Source>
1946 template <
typename Dest,
typename T, std::
size_t Dim>
1951 template <
typename Dest,
typename T, std::
size_t Dim>
1957 template <
typename Dest,
typename T>
1959 static_assert(std::is_arithmetic_v<T>);
1960 static Dest
convert(T* v) {
return geo::vect::makeFromCoords<Dest>(v); }
1965 template <
typename Dest,
typename Source,
unsigned int Dim>
1966 struct ConvertToImplDim {
1969 AlwaysFalse<Dest>(),
1970 "This vector dimensionality is not implemented yet."
1974 template <
typename Dest,
typename Source>
1982 template <
typename Dest,
typename Source>
1990 template <
typename Dest,
typename Source>
1999 template <
typename Dest,
typename Source>
2003 template <
typename Vector>
2010 template <
typename Point, std::size_t...
I>
2020 template <
typename Vector>
2021 constexpr std::array<std::size_t, geo::vect::dimension<Vector>()>
2024 return details::makeIndexSeq<std::size_t, dimension<Vector>()>();
2027 template <
typename Vector>
2029 {
return indices<Vector>(); }
2033 template <
typename Vector,
typename Coords>
2035 using namespace geo::vect::details;
2036 return makeFromCoordsImpl<Vector>
2037 (constexpr_forward<Coords>(coords), makeVectorIndices<Vector>());
2042 template <
typename Vector>
2048 template <
typename Vector>
2050 return vect::bindCoord<Vector>(v, coordManager<Vector>(
n));
2055 template <
typename Vector,
typename Coords>
2065 template <
typename Vector>
2067 using PlainVector = std::remove_reference_t<Vector>;
2072 template <
typename Vector>
2074 {
return coordManagers<Vector>(); }
2077 template <
typename Vector>
2079 using ConstVector = std::add_const_t<std::remove_reference_t<Vector>>;
2084 template <
typename Vector>
2086 {
return coordReaders<Vector>(); }
2090 template <
typename Vector>
2096 template <
typename Vector>
2098 using ConstVector = std::add_const_t<std::remove_reference_t<Vector>>;
2105 template <
typename Dest,
typename Source>
2111 template <
typename Dest,
typename Source>
2114 std::vector<Dest> dest;
2115 dest.reserve(coll.size());
2116 std::transform(coll.begin(), coll.end(), std::back_inserter(dest),
2117 geo::vect::convertTo<Dest, Source>);
2124 template <
typename Vector,
typename Pred>
2129 return makeFromCoords<Vector>(
values);
2134 template <
typename Vector>
2141 #endif // LARCOREOBJ_SIMPLETYPESANDCONSTANTS_GEO_VECTORS_UTILS_H
void operator()(Vector_t &v, Scalar_t c) const
Setter: assigns a value to the bound coordinate of specified vector.
constexpr auto coordManager(unsigned int n)
Returns an object that can be bound to a vector to manage one of its coordinates. ...
static constexpr bool TestZ(...)
void round01(Vector &v, Scalar tol)
Returns a vector with all components rounded if close to 0, -1 or +1.
see a below echo or echo I(indirect symbol).'echo" If the symbol is local (non-external)
static constexpr auto XcoordManager< Vector const >
Object that can be bound to a vector to access its X coordinate.
constexpr T && constexpr_forward(std::remove_reference_t< T > &t)
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space.
Constant iterator to vector coordinates.
double std(const std::vector< short > &wf, const double ped_mean, size_t start, size_t nsample)
typename BaseTypes_t::Scalar_t Scalar_t
BoundCoordManager(Stored_t &v, CoordHelper_t coordManager)
Constructor: manage the specified coordinate of specified vector.
typename Traits_t::Getter_t Getter_t
void clear()
Resets the status of the object to no accumulated points.
typename CoordHelper_t::Getter_t Getter_t
constexpr auto dot(Vector const &a, Vector const &b)
Return cross product of two vectors.
Point makePoint() const
Converts the internal sums into a Point.
constexpr auto accessElement(Data &&data)
CoordConstIterator(Vector &v, unsigned int index=0)
Constructor: points to index coordinate of vector v.
decltype(auto) access(unsigned int c) const
std::array< Manager_t, Dim > Return_t
Point middlePointAs() const
Returns the middle point, NaN components if no point.
auto Zcoord(Vector &v)
Returns an object to manage the coordinate Z of the vector v.
static constexpr bool TestX(...)
constexpr auto makeIndexSeq()
static auto compute(Op, T &&v) -> decltype(auto)
constexpr auto makeVectorIndices()
An object with a begin and end iterator.
static constexpr auto XcoordManager
Object that can be bound to a vector to manage its X coordinate.
std::vector< Dest > convertCollTo(std::vector< Source > const &coll)
Returns a vector of type Dest with the same content as a Src.
static Dest convert(Source const &v)
void mult(Vector_t &v, Scalar_t f) const
Multiplies the coordinate by the specified amount.
std::array< Manager_t, Dim > Return_t
decltype(XcoordManager< Vector >) Manager_t
static constexpr auto YcoordManager< Vector const >
static constexpr auto const YcoordManager
typename BaseTypes_t::Vector_t Vector_t
auto mixedProduct(Vector const &a, Vector const &b, Vector const &c)
static constexpr unsigned int Dim
Dimension of the points.
auto coord(Vector &v, unsigned int n) noexcept
Returns an object to manage the coordinate n of a vector.
constexpr auto bindCoordReaders(Vector const &v)
typename Vector::Scalar type
Helper class to compute the middle point in a point set.
bool operator<=(iterator_t const &other) const
geo::vect::coordinate_t< Vector_t > Coord_t
Type of vector coordinate.
constexpr auto makeCoordReader(Getter getter)
typename Traits_t::Setter_t Setter_t
std::decay_t< Vector > Vector_t
CoordConstIterator< Vector > operator+(typename CoordConstIterator< Vector >::difference_type n, CoordConstIterator< Vector > const &v)
typename MemberFuncReturnType< T >::type MemberFuncReturn_t
double weight() const
Returns the total weight (number of points if all have weight 1).
::geo::Point_t toPoint(Point const &p)
Convert the specified point into a geo::Point_t.
iterator_t operator-(iterator_t const &other) const
Returns the distance from another iterator.
auto iterateCoords(Vector const &v)
Returns an object for ranged-for iteration on coordinates.
::geo::Vector_t toVector(Vector const &v)
Convert the specified vector into a geo::Vector_t.
static constexpr auto TcoordManager
std::remove_cv_t< Coord_t > value_type
BoundCoordManager & operator+=(Scalar_t c)
Increments by the specified amount.
constexpr auto bindCoord(Vector const &v, CoordReader_t< Vector > helper)
Binds the specified constant vector to the coordinate reader.
auto cbegin(FixedBins< T, C > const &) noexcept
BoundCoordManager(Stored_t &v, Getter_t getter, Setter_t setter)
Constructor: manage the specified vector with specified methods.
static constexpr auto ZcoordManager
decltype(Xcoord(std::declval< Vector >())) Manager_t
static Return_t bind(Vector &v)
iterator_t operator-(difference_type d) const
Returns an iterator decremented by d positions (unchecked).
typename BaseTypes_t::Getter_t Getter_t
typename BaseTypes_t::Setter_t Setter_t
constexpr auto coordManagers()
Returns an array with all coordinate managers for a type of vector.
Simple class with a begin and an end.
void round0(Vector &v, Scalar tol)
Returns a vector with all components rounded if close to 0.
static Return_t bind(Vector &v)
Helper class for read/write of a single vector coordinate.
then echo echo For and will not be changed by echo further linking echo echo B echo The symbol is in the uninitialized data multiple common symbols may appear with the echo same name If the symbol is defined the common echo symbols are treated as undefined references For more echo details on common see the discussion of warn common echo in *Note Linker see the discussion of warn common echo in *Note Linker such as a global int variable echo as opposed to a large global array echo echo I echo The symbol is an indirect reference to another symbol This echo is a GNU extension to the a out object file format which is echo rarely used echo echo N echo The symbol is a debugging symbol echo echo R echo The symbol is in a read only data section echo echo S echo The symbol is in an uninitialized data section for small echo objects echo echo T echo The symbol is in the the normal defined echo symbol is used with no error When a weak undefined symbol echo is linked and the symbol is not the value of the echo weak symbol becomes zero with no error echo echo W echo The symbol is a weak symbol that has not been specifically echo tagged as a weak object symbol When a weak defined symbol echo is linked with a normal defined the normal defined echo symbol is used with no error When a weak undefined symbol echo is linked and the symbol is not the value of the echo weak symbol becomes zero with no error echo echo echo The symbol is a stabs symbol in an a out object file In echo this the next values printed are the stabs other echo the stabs desc and the stab type Stabs symbols are echo used to hold debugging information For more echo see *Note or object file format specific echo echo For Mac OS X
typename CoordHelper_t::Vector_t Vector_t
bool operator>(iterator_t const &other) const
typename MemberFuncClassType< T >::type MemberFuncClass_t
BoundCoordGetter(Stored_t &v, Getter_t getter)
Constructor: manage the specified vector with specified methods.
std::array< Length_t, Dim > fSums
Sum of each of the point components.
void add(Point const &p)
Accumulates a point.
constexpr unsigned int dimension()
Returns the dimension of the specified vector type.
auto cend(FixedBins< T, C > const &) noexcept
static constexpr auto ZcoordManager< Vector const >
recob::tracking::Point_t Point_t
unsigned int fillCoords(Coords &dest, Vector const &src)
Fills a coordinate array with the coordinates of a vector.
typename BaseTypes_t::Scalar_t Scalar_t
void add(Point const &p, double weight)
Accumulates a point.
iterator_t operator+(difference_type d) const
Returns an iterator incremented by d positions (unchecked).
static constexpr bool TestX(decltype(std::declval< Class >().X())*)
typename VectorScalar< Vector >::type VectorScalar_t
typename Traits_t::Vector_t Vector_t
constexpr unsigned int dimension()
iterator_t operator--(int)
Points to previous coordinate (unchecked), returns the previous iterator.
std::array< Manager_t, Dim > Return_t
std::random_access_iterator_tag iterator_category
constexpr auto coordReaders()
Returns an array with all coordinate readers for a type of vector.
BoundCoordManager & operator/=(Scalar_t f)
Divides by the specified amount.
void decr(Vector_t &v, Scalar_t c) const
Decrements the coordinate by the specified amount.
CoordHelper CoordHelper_t
bool isfinite(Vector const &v)
Returns whether all components of the vector are finite.
typename BaseTypes_t::Vector_t Vector_t
then echo ***************************************echo array
typename Traits_t::Scalar_t Scalar_t
Getter_t fGetter
Member function returning the coordinate value.
constexpr CoordManager_t< Vector > NoCoordManager
void add(BeginIter begin, EndIter end)
Adds a sequence of points.
bool empty() const
Returns whether the total weight is zero (usually means no points).
typename BaseTypes_t::Vector_t Vector_t
void incr(Vector_t &v, Scalar_t c) const
Increments the coordinate by the specified amount.
iterator_t & operator--()
Points to the previous coordinate (unchecked).
Definitions of geometry vector data types.
std::vector< geo::Point_t > convertCollToPoint(std::vector< Point > const &coll)
auto vector_cend(Vector const &v)
Returns a const-iterator pointing after the last coordinate of v.
constexpr CoordGetter(Getter_t getter)
Constructor: sets getter and setter functions.
typename BaseTypes_t::Scalar_t Scalar_t
std::tuple< double, double, const reco::ClusterHit3D * > Point
Definitions used by the VoronoiDiagram algorithm.
Point makeWeightedPointImpl(double w, std::index_sequence< I...>) const
Point makePointImpl(std::index_sequence< I...>) const
MiddlePointAccumulatorDim(BeginIter begin, EndIter end)
Constructor: starts with accumulating a sequence of points.
typename CoordHelper_t::Setter_t Setter_t
typename CoordHelper_t::Scalar_t Scalar_t
auto extended_and(T...args) -> decltype(auto)
constexpr std::array< std::size_t, geo::vect::dimension< Vector >)> indices()
Returns a sequence of indices valid for a vector of the specified type.
bool operator>=(iterator_t const &other) const
MemberFuncReturn_t< Setter_t > SetterReturn_t
constexpr auto makeCoordManager(Getter getter, Setter setter)
static Return_t bind(Vector &v)
Point makeWeightedPoint(double w) const
auto end(FixedBins< T, C > const &) noexcept
typename std::enable_if< B, T >::type enable_if_t
void LorentzVector(Stream &&out, TLorentzVector const &v)
Print a TLorentzVector to an output stream.
iterator_t & operator++()
Points to the next coordinate (unchecked).
BoundCoordManager & operator*=(Scalar_t f)
Multiplies by the specified amount.
std::array< Manager_t, Dim > Return_t
auto Ycoord(Vector &v)
Returns an object to manage the coordinate Y of the vector v.
Scalar_t get(Vector_t const &v) const
Returns the value of the bound coordinate.
typename decltype(std::mem_fn(std::declval< T >()))::result_type type
static constexpr bool TestY(...)
Stored_t & vector() const
Vector transformCoords(Vector const &v, Pred &&pred)
Returns a new vector applying a predicate to each component.
constexpr Vector makeFromCoordsImpl(Coords &&coords, std::index_sequence< Indices...>)
CoordHelper_t fCoord
Helper to manage a specific coordinate.
auto norm(Vector const &v)
Return norm of the specified vector.
Vector rounded01(Vector const &v, Scalar tol)
Returns a vector with all components rounded if close to 0, -1 or +1.
auto mag2(Vector const &v)
Return norm of the specified vector.
std::array< Manager_t, Dim > Return_t
static Dest convert(T *v)
auto Xcoord(Vector &v)
Returns an object to manage the coordinate X of the vector v.
BoundCoordManager & operator-=(Scalar_t c)
Decrements by the specified amount.
auto begin(FixedBins< T, C > const &) noexcept
typename BaseTypes_t::Getter_t Getter_t
BoundCoordGetter(Stored_t &v, CoordHelper_t coordManager)
Constructor: manage the specified coordinate of specified vector.
Scalar_t operator()(Vector_t const &v) const
Returns the value of the bound coordinate.
std::array< Manager_t, Dim > Return_t
auto Tcoord(Vector &v)
Returns an object to manage the coordinate T of the vector v.
geo::Point_t middlePoint() const
CoordHelper_t const & manager() const
auto extended_accumulate(Op op, T &&...args)
BoundCoordManager & operator=(Scalar_t c)
Setter: assigns a value to the bound coordinate of specified vector.
static Dest convert(Source const &v)
typename BaseTypes_t::Getter_t Getter_t
static auto compute(Op op, First &&a, Second &&b, Others &&...others) -> decltype(auto)
bool isfiniteImpl(Point const &point, std::index_sequence< I...>)
std::make_index_sequence< Dim > IndexSequence_t
static constexpr auto TcoordManager< Vector const >
auto vector_cbegin(Vector const &v)
Returns a const-iterator pointing to the first coordinate of v.
static Dest convert(Source const &v)
std::array< VectorScalar_t< Vector >, dimension< Vector >()> CoordinateArray_t
A STL array suitable to contain all coordinate values of a Vector.
CoordConstIterator()=default
Default constructor: invalid iterator.
decltype(details::makeCoordReader(&Vector::X)) CoordReader_t
Type of a coordinate reader for a vector type.
std::vector< geo::Vector_t > convertCollToVector(std::vector< Vector > const &coll)
process_name largeant stream1 can override from command line with o or output physics producers generator N
Scalar_t operator()() const
Returns the value of the bound coordinate.
constexpr auto bindCoordManagers(Vector &v)
constexpr CoordManager(Getter_t getter, Setter_t setter)
Constructor: sets getter and setter functions.
std::array< Manager_t, Dim > Return_t
std::array< Manager_t, Dim > Return_t
Setter_t fSetter
Member function setting the coordinate value.
reference operator[](difference_type n) const
Access the current coordinate.
bool operator==(iterator_t const &other) const
Stored_t & fVector
The vector to manage the coordinate of.
void set(Vector_t &v, Scalar_t c) const
Setter: assigns a value to the bound coordinate of specified vector.
MiddlePointAccumulatorDim()
Default constructor: starts with no accumulated point.
std::ptrdiff_t difference_type
Helper class for read of a single vector coordinate.
bool operator!=(iterator_t const &other) const
details::VectorScalar_t< Vector > coordinate_t
Type of coordinate of the specified vector type.
VectorScalar_t< Vector > Scalar_t
constexpr Vector makeFromCoords(Coords &&coords)
Creates a Vector object with coordinates from coords.
static constexpr bool TestT(...)
constexpr auto makeIndexSeqImpl(std::integer_sequence< T, Indices...>)
std::make_index_sequence< dimension< Vector >()> VectorIndices_t
Type of sequence of indices up to Vector size.
Vector cross(Vector const &a, Vector const &b)
Return cross product of two vectors.
Vector normalize(Vector const &v)
Returns a vector parallel to v and with norm 1.
Dest convertTo(Source const &v)
Returns a vector of type Dest with the same content as a Src.
void div(Vector_t &v, Scalar_t f) const
Divides the coordinate by the specified amount.
Vector rounded0(Vector const &v, Scalar tol)
Returns a vector with all components rounded if close to 0.
reference operator*() const
Access the current coordinate.
iterator_t & operator+=(difference_type d)
Increments the iterator by d positions (unchecked).
decltype(details::makeCoordManager(&Vector::X,&Vector::SetX)) CoordManager_t
Type of a coordinate manager for a vector type.
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
GENVECTOR_CONSTEXPR::geo::Point_t makePointFromCoords(Coords &&coords)
Creates a geo::Point_t from its coordinates (see makeFromCoords()).
GENVECTOR_CONSTEXPR::geo::Vector_t makeVectorFromCoords(Coords &&coords)
Creates a geo::Vector_t from its coordinates (see makeFromCoords()).
recob::tracking::Vector_t Vector_t
static Dest convert(Source const &v)
Scalar_t(Vector_t::*)() const Getter_t
iterator_t & operator-=(difference_type d)
Decrements the iterator by d positions (unchecked).
iterator_t operator++(int)
Points to the next coordinate (unchecked), returns the previous iterator.
TimeTrackTreeStorage::TriggerInputSpec_t convert(TimeTrackTreeStorage::Config::TriggerSpecConfig const &config)
bool operator<(iterator_t const &other) const
static constexpr bool TestY(decltype(std::declval< Class >().Y())*)
static constexpr bool TestZ(decltype(std::declval< Class >().Z())*)
static constexpr bool TestT(decltype(std::declval< Class >().T())*)