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>
279 :
Base_t(getter), fSetter(setter) {}
304 template <
typename Getter,
typename Setter>
307 using Vector_t = std::remove_reference_t<MemberFuncClass_t<Getter>>;
313 template <
typename CoordHelper,
typename StoredVector>
326 : fCoord(coordManager), fVector(v) {}
330 : fCoord(getter), fVector(v) {}
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>
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>
901 template <
typename Vector>
906 template <
typename Vector>
917 template <
typename Vector>
954 : v(&v), index(index)
1002 {
return index - other.
index; }
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>
1193 template <
typename Vector>
1197 template <
typename Vector>
1201 template <
typename Vector>
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); }
1274 bool empty()
const {
return fW == 0.0; }
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); }); }
1352 void clear() { fSums.fill(0.); fW = 0.0; }
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)); }
1540 template<
class CoordSystem,
class Tag>
1544 template<
class CoordSystem,
class Tag>
1548 template<
class CoordSystem,
class Tag>
1552 template<
class CoordSystem,
class Tag>
1556 template<
class CoordSystem,
class Tag>
1561 template<
class CoordSystem,
class Tag>
1565 template<
class CoordSystem,
class Tag>
1569 template<
class CoordSystem,
class Tag>
1577 template<
class CoordSystem,
class Tag>
1581 template<
class CoordSystem,
class Tag>
1585 template<
class CoordSystem,
class Tag>
1589 template<
class CoordSystem,
class Tag>
1593 template<
class CoordSystem,
class Tag>
1598 template<
class CoordSystem,
class Tag>
1602 template<
class CoordSystem,
class Tag>
1606 template<
class CoordSystem,
class Tag>
1614 template<
class CoordSystem>
1618 template<
class CoordSystem>
1622 template<
class CoordSystem>
1626 template<
class CoordSystem>
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 >
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>
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>
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.
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.
span(IterB &&b, IterE &&e, Adaptor &&adaptor) -> span< decltype(adaptor(std::forward< IterB >(b))), decltype(adaptor(std::forward< IterE >(e))) >
decltype(auto) cbegin(ROOT::Math::LorentzVector< CoordSystem > const &v)
Constant iterator to vector coordinates.
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.
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()
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.
Point makePointImpl(std::index_sequence< I... >) const
bool operator>(ScheduleID const left, ScheduleID const right) noexcept
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.
DoubleProduct & operator+=(DoubleProduct &left, DoubleProduct const &right)
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
std::vector< float > Vector
auto mixedProduct(Vector const &a, Vector const &b, Vector const &c)
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)
constexpr bool operator<(CryostatID const &a, CryostatID const &b)
Order cryostats with increasing ID.
typename Vector::Scalar type
Helper class to compute the middle point in a point set.
geo::vect::coordinate_t< Vector_t > Coord_t
Type of vector coordinate.
constexpr auto makeCoordReader(Getter getter)
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >> Point_t
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)
constexpr auto makeIndexSeqImpl(std::integer_sequence< T, Indices... >)
typename MemberFuncReturnType< T >::type MemberFuncReturn_t
Coord add(Coord c1, Coord c2)
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.
constexpr bool operator==(CryostatID const &a, CryostatID const &b)
Comparison: the IDs point to the same cryostat (validity is ignored)
::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
constexpr auto bindCoord(Vector const &v, CoordReader_t< Vector > helper)
Binds the specified constant vector to the coordinate reader.
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
enum geo::coordinates Coord_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.
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.
typename CoordHelper_t::Vector_t Vector_t
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.
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > LorentzVector
static constexpr auto ZcoordManager< Vector const >
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
Point middlePointAs(BeginIter begin, EndIter end)
Returns the middle of the specified points.
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
bool operator<=(ScheduleID const left, ScheduleID const right) noexcept
std::random_access_iterator_tag iterator_category
constexpr auto coordReaders()
Returns an array with all coordinate readers for a type of vector.
void decr(Vector_t &v, Scalar_t c) const
Decrements the coordinate by the specified amount.
CoordHelper CoordHelper_t
Utilities to manipulate geometry vectors.The utilities include generic vector interface facilities al...
bool isfinite(Vector const &v)
Returns whether all components of the vector are finite.
typename BaseTypes_t::Vector_t Vector_t
auto array(Array const &a)
Returns a manipulator which will print the specified 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)
constexpr bool operator!=(CryostatID const &a, CryostatID const &b)
Comparison: the IDs point to different cryostats (validity is ignored)
auto vector_cend(Vector const &v)
Returns a const-iterator pointing after the last coordinate of v.
constexpr Vector makeFromCoordsImpl(Coords &&coords, std::index_sequence< Indices... >)
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.
MiddlePointAccumulatorDim(BeginIter begin, EndIter end)
Constructor: starts with accumulating a sequence of points.
def convert(inputfile, outputfile="wire-cell-garfield-fine-response.json.bz2", average=False, shaped=False)
typename CoordHelper_t::Setter_t Setter_t
decltype(auto) begin(ROOT::Math::LorentzVector< CoordSystem > const &v)
typename CoordHelper_t::Scalar_t Scalar_t
constexpr std::array< std::size_t, geo::vect::dimension< Vector >)> indices()
Returns a sequence of indices valid for a vector of the specified type.
MemberFuncReturn_t< Setter_t > SetterReturn_t
constexpr auto makeCoordManager(Getter getter, Setter setter)
static Return_t bind(Vector &v)
Point makeWeightedPoint(double w) const
iterator_t & operator++()
Points to the next coordinate (unchecked).
std::array< Manager_t, Dim > Return_t
auto Ycoord(Vector &v)
Returns an object to manage the coordinate Y of the vector v.
typename decltype(std::mem_fn(std::declval< T >()))::result_type type
static constexpr bool TestY(...)
static int max(int a, int b)
bool isfiniteImpl(Point const &point, std::index_sequence< I... >)
Stored_t & vector() const
Vector transformCoords(Vector const &v, Pred &&pred)
Returns a new vector applying a predicate to each component.
static auto compute(Op, T &&v) -> decltype(auto)
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.
typename BaseTypes_t::Getter_t Getter_t
Point makeWeightedPointImpl(double w, std::index_sequence< I... >) const
BoundCoordGetter(Stored_t &v, CoordHelper_t coordManager)
Constructor: manage the specified coordinate of specified vector.
std::array< Manager_t, Dim > Return_t
static auto compute(Op op, First &&a, Second &&b, Others &&...others) -> decltype(auto)
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)
static Dest convert(Source const &v)
typename BaseTypes_t::Getter_t Getter_t
auto extended_and(T...args) -> decltype(auto)
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.
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)
decltype(auto) end(ROOT::Math::LorentzVector< CoordSystem > const &v)
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.
Stored_t & fVector
The vector to manage the coordinate of.
MiddlePointAccumulatorDim()
Default constructor: starts with no accumulated point.
std::ptrdiff_t difference_type
Helper class for read of a single vector coordinate.
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.
bool operator>=(ScheduleID const left, ScheduleID const right) noexcept
static constexpr bool TestT(...)
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.
auto const & get(AssnsNode< L, R, D > const &r)
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.
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.
QuadExpr operator*(double v, const QuadExpr &e)
GENVECTOR_CONSTEXPR::geo::Point_t makePointFromCoords(Coords &&coords)
Creates a geo::Point_t from its coordinates (see makeFromCoords()).
Verifies that the geometry check information is available.
GENVECTOR_CONSTEXPR::geo::Vector_t makeVectorFromCoords(Coords &&coords)
Creates a geo::Vector_t from its coordinates (see makeFromCoords()).
recob::tracking::Vector_t Vector_t
geo::Point_t middlePoint(BeginIter begin, EndIter end)
Returns the middle of the specified points.
static Dest convert(Source const &v)
Scalar_t(Vector_t::*)() const Getter_t
decltype(auto) cend(ROOT::Math::LorentzVector< CoordSystem > const &v)
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.
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())*)