In this tutorial we demonstrate RVec helpers for index manipulation.
{
for (
size_t i = 0; i <
muon_pt.size(); i++) {
std::cout <<
"Muon " << i + 1 <<
" (pt, eta): " <<
muon_pt[i] <<
", "
}
for (size_t i = 0; i < idx.size(); i++) {
std::cout <<
"Selected muon " << i + 1 <<
" (pt, eta): " <<
good_muon_pt[i]
}
}
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
RVec< T > Reverse(const RVec< T > &v)
Return copy of reversed vector.
RVec< T > Intersect(const RVec< T > &v1, const RVec< T > &v2, bool v2_is_sorted=false)
Return the intersection of elements of two RVecs.
RVec< typename RVec< T >::size_type > Nonzero(const RVec< T > &v)
Return the indices of the elements which are not zero.
RVec< PromoteType< T > > abs(const RVec< T > &v)
RVec< T > Take(const RVec< T > &v, const RVec< typename RVec< T >::size_type > &i)
Return elements of a vector at given indices.
RVec< typename RVec< T >::size_type > Argsort(const RVec< T > &v)
Return an RVec of indices that sort the input RVec.
Muon 1 (pt, eta): 20, 1
Muon 2 (pt, eta): 30, -2
Muon 3 (pt, eta): 10, 0.5
Muon 4 (pt, eta): 25, 2.5
Selected muon 1 (pt, eta): 30, -2
Selected muon 2 (pt, eta): 20, 1
- Date
- September 2018
- Author
- Stefan Wunsch
Definition in file vo006_IndexManipulation.C.