CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ThinnedAssociation.cc
Go to the documentation of this file.
2 
3 #include <algorithm>
4 
5 namespace edm {
6 
8 
9  std::optional<unsigned int> ThinnedAssociation::getThinnedIndex(unsigned int parentIndex) const {
10  auto iter = std::lower_bound(indexesIntoParent_.begin(), indexesIntoParent_.end(), parentIndex);
11  if (iter != indexesIntoParent_.end() && *iter == parentIndex) {
12  return iter - indexesIntoParent_.begin();
13  }
14  return std::nullopt;
15  }
16 } // namespace edm
std::vector< unsigned int > indexesIntoParent_
std::optional< unsigned int > getThinnedIndex(unsigned int parentIndex) const
__host__ __device__ constexpr RandomIt lower_bound(RandomIt first, RandomIt last, const T &value, Compare comp={})