Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ROOT::VecOps Namespace Reference

Classes

class  RVec
 A "std::vector"-like collection of values implementing handy operation to analyse them. More...
 
class  RVecN
 

Functions

template<typename T >
auto All (const RVec< T > &v) -> decltype(v[0]==false)
 Return true if all of the elements equate to true, return false otherwise.
 
template<typename T >
auto Any (const RVec< T > &v) -> decltype(v[0]==true)
 Return true if any of the elements equates to true, return false otherwise.
 
template<typename T >
std::size_t ArgMax (const RVec< T > &v)
 Get the index of the greatest element of an RVec In case of multiple occurrences of the maximum values, the index corresponding to the first occurrence is returned.
 
template<typename T >
std::size_t ArgMin (const RVec< T > &v)
 Get the index of the smallest element of an RVec In case of multiple occurrences of the minimum values, the index corresponding to the first occurrence is returned.
 
template<typename T >
RVec< typename RVec< T >::size_type > Argsort (const RVec< T > &v)
 Return an RVec of indices that sort the input RVec.
 
template<typename T , typename Compare >
RVec< typename RVec< T >::size_type > Argsort (const RVec< T > &v, Compare &&c)
 Return an RVec of indices that sort the input RVec based on a comparison function.
 
template<typename T , unsigned N>
size_t CapacityInBytes (const RVecN< T, N > &X)
 
template<typename T >
RVec< RVec< typename RVec< T >::size_type > > Combinations (const RVec< T > &v, const typename RVec< T >::size_type n)
 Return the indices that represent all unique combinations of the elements of a given RVec.
 
template<typename T1 , typename T2 >
RVec< RVec< typename RVec< T1 >::size_type > > Combinations (const RVec< T1 > &v1, const RVec< T2 > &v2)
 Return the indices that represent all combinations of the elements of two RVecs.
 
RVec< RVec< std::size_t > > Combinations (const std::size_t size1, const std::size_t size2)
 Return the indices that represent all combinations of the elements of two RVecs.
 
template<typename T0 , typename T1 , typename Common_t = typename std::common_type<T0, T1>::type>
RVec< Common_t > Concatenate (const RVec< T0 > &v0, const RVec< T1 > &v1)
 Return the concatenation of two RVecs.
 
template<typename T , typename... Args_t>
RVec< T > Construct (const RVec< Args_t > &... args)
 Build an RVec of objects starting from RVecs of input to their constructors.
 
template<typename T >
RVec< T > DeltaPhi (const RVec< T > &v1, const RVec< T > &v2, const T c=M_PI)
 Return the angle difference \(\Delta \phi\) in radians of two vectors.
 
template<typename T >
RVec< T > DeltaPhi (const RVec< T > &v1, T v2, const T c=M_PI)
 Return the angle difference \(\Delta \phi\) in radians of a vector and a scalar.
 
template<typename T >
RVec< T > DeltaPhi (T v1, const RVec< T > &v2, const T c=M_PI)
 Return the angle difference \(\Delta \phi\) in radians of a scalar and a vector.
 
template<typename T >
DeltaPhi (T v1, T v2, const T c=M_PI)
 Return the angle difference \(\Delta \phi\) of two scalars.
 
template<typename T >
RVec< T > DeltaR (const RVec< T > &eta1, const RVec< T > &eta2, const RVec< T > &phi1, const RVec< T > &phi2, const T c=M_PI)
 Return the distance on the \(\eta\)- \(\phi\) plane ( \(\Delta R\)) from the collections eta1, eta2, phi1 and phi2.
 
template<typename T >
DeltaR (T eta1, T eta2, T phi1, T phi2, const T c=M_PI)
 Return the distance on the \(\eta\)- \(\phi\) plane ( \(\Delta R\)) from the scalars eta1, eta2, phi1 and phi2.
 
template<typename T >
RVec< T > DeltaR2 (const RVec< T > &eta1, const RVec< T > &eta2, const RVec< T > &phi1, const RVec< T > &phi2, const T c=M_PI)
 Return the square of the distance on the \(\eta\)- \(\phi\) plane ( \(\Delta R\)) from the collections eta1, eta2, phi1 and phi2.
 
template<typename T , typename V >
auto Dot (const RVec< T > &v0, const RVec< V > &v1) -> decltype(v0[0] *v1[0])
 Inner product.
 
template<typename T >
RVec< T > Drop (const RVec< T > &v, RVec< typename RVec< T >::size_type > idxs)
 Return a copy of the container without the elements at the specified indices.
 
template<typename T , typename F >
RVec< T > Filter (const RVec< T > &v, F &&f)
 Create a new collection with the elements passing the filter expressed by the predicate.
 
template<typename T >
RVec< T > Intersect (const RVec< T > &v1, const RVec< T > &v2, bool v2_is_sorted=false)
 Return the intersection of elements of two RVecs.
 
template<typename T >
InvariantMass (const RVec< T > &pt, const RVec< T > &eta, const RVec< T > &phi, const RVec< T > &mass)
 Return the invariant mass of multiple particles given the collections of the quantities transverse momentum (pt), rapidity (eta), azimuth (phi) and mass.
 
template<typename T >
RVec< T > InvariantMasses (const RVec< T > &pt1, const RVec< T > &eta1, const RVec< T > &phi1, const RVec< T > &mass1, const RVec< T > &pt2, const RVec< T > &eta2, const RVec< T > &phi2, const RVec< T > &mass2)
 Return the invariant mass of two particles given the collections of the quantities transverse momentum (pt), rapidity (eta), azimuth (phi) and mass.
 
template<typename... Args>
auto Map (Args &&... args)
 Create new collection applying a callable to the elements of the input collection.
 
template<typename T >
Max (const RVec< T > &v)
 Get the greatest element of an RVec.
 
template<typename T >
double Mean (const RVec< T > &v)
 Get the mean of the elements of an RVec.
 
template<typename T , typename R = T>
R Mean (const RVec< T > &v, const R zero)
 Get the mean of the elements of an RVec with custom initial value.
 
template<typename T >
Min (const RVec< T > &v)
 Get the smallest element of an RVec.
 
template<typename T >
RVec< typename RVec< T >::size_type > Nonzero (const RVec< T > &v)
 Return the indices of the elements which are not zero.
 
template<class T >
std::ostream & operator<< (std::ostream &os, const RVec< T > &v)
 Print a RVec at the prompt:
 
template<typename T >
RVec< T > Reverse (const RVec< T > &v)
 Return copy of reversed vector.
 
template<typename T >
RVec< T > Sort (const RVec< T > &v)
 Return copy of RVec with elements sorted in ascending order.
 
template<typename T , typename Compare >
RVec< T > Sort (const RVec< T > &v, Compare &&c)
 Return copy of RVec with elements sorted based on a comparison operator.
 
template<typename T >
RVec< typename RVec< T >::size_type > StableArgsort (const RVec< T > &v)
 Return an RVec of indices that sort the input RVec while keeping the order of equal elements.
 
template<typename T , typename Compare >
RVec< typename RVec< T >::size_type > StableArgsort (const RVec< T > &v, Compare &&c)
 Return an RVec of indices that sort the input RVec based on a comparison function while keeping the order of equal elements.
 
template<typename T >
RVec< T > StableSort (const RVec< T > &v)
 Return copy of RVec with elements sorted in ascending order while keeping the order of equal elements.
 
template<typename T , typename Compare >
RVec< T > StableSort (const RVec< T > &v, Compare &&c)
 Return copy of RVec with elements sorted based on a comparison operator while keeping the order of equal elements.
 
template<typename T >
double StdDev (const RVec< T > &v)
 Get the standard deviation of the elements of an RVec.
 
template<typename T , typename R = T>
R Sum (const RVec< T > &v, const R zero=R(0))
 Sum elements of an RVec.
 
template<typename T >
void swap (RVec< T > &lhs, RVec< T > &rhs)
 
template<typename T >
RVec< T > Take (const RVec< T > &v, const int n)
 Return first or last n elements of an RVec.
 
template<typename T >
RVec< T > Take (const RVec< T > &v, const RVec< typename RVec< T >::size_type > &i)
 Return elements of a vector at given indices.
 
template<typename T >
double Var (const RVec< T > &v)
 Get the variance of the elements of an RVec.
 
template<typename T >
RVec< T > Where (const RVec< int > &c, const RVec< T > &v1, const RVec< T > &v2)
 Return the elements of v1 if the condition c is true and v2 if the condition c is false.
 
template<typename T >
RVec< T > Where (const RVec< int > &c, const RVec< T > &v1, typename RVec< T >::value_type v2)
 Return the elements of v1 if the condition c is true and sets the value v2 if the condition c is false.
 
template<typename T >
RVec< T > Where (const RVec< int > &c, T v1, T v2)
 Return a vector with the value v2 if the condition c is false and sets the value v1 if the condition c is true.
 
template<typename T >
RVec< T > Where (const RVec< int > &c, typename RVec< T >::value_type v1, const RVec< T > &v2)
 Return the elements of v2 if the condition c is false and sets the value v1 if the condition c is true.