CMS 3D CMS Logo

ThinnedAssociation.h
Go to the documentation of this file.
1 #ifndef DataFormats_Common_ThinnedAssociation_h
2 #define DataFormats_Common_ThinnedAssociation_h
3 
9 
10 #include <optional>
11 #include <vector>
12 
13 namespace edm {
14 
16  public:
18 
21  std::vector<unsigned int> const& indexesIntoParent() const { return indexesIntoParent_; }
22 
23  // If this association contains the parent index, return the
24  // corresponding index into the thinned collection. Otherwise
25  // return null std::optional.
26  std::optional<unsigned int> getThinnedIndex(unsigned int parentIndex) const;
27 
30  void push_back(unsigned int index) { indexesIntoParent_.push_back(index); }
31 
32  private:
35 
36  // The size of indexesIntoParent_ is the same as
37  // the size of the thinned collection and each
38  // element of indexesIntoParent corresponds to the
39  // element of the thinned collection at the same position.
40  // The values give the index of the corresponding element
41  // in the parent collection.
42  std::vector<unsigned int> indexesIntoParent_;
43  };
44 } // namespace edm
45 #endif
ProductID const & parentCollectionID() const
void setThinnedCollectionID(ProductID const &v)
std::vector< unsigned int > const & indexesIntoParent() const
ProductID const & thinnedCollectionID() const
std::vector< unsigned int > indexesIntoParent_
std::optional< unsigned int > getThinnedIndex(unsigned int parentIndex) const
void push_back(unsigned int index)
void setParentCollectionID(ProductID const &v)
HLT enums.