File indexing completed on 2024-04-06 12:03:55
0001 #include "DataFormats/Common/interface/ThinnedAssociation.h"
0002
0003 #include <algorithm>
0004
0005 namespace edm {
0006
0007 ThinnedAssociation::ThinnedAssociation() {}
0008
0009 std::optional<unsigned int> ThinnedAssociation::getThinnedIndex(unsigned int parentIndex) const {
0010 auto iter = std::lower_bound(indexesIntoParent_.begin(), indexesIntoParent_.end(), parentIndex);
0011 if (iter != indexesIntoParent_.end() && *iter == parentIndex) {
0012 return iter - indexesIntoParent_.begin();
0013 }
0014 return std::nullopt;
0015 }
0016 }