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
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::ThinnedAssociation
Definition: ThinnedAssociation.h:15
edm::ThinnedAssociation::ThinnedAssociation
ThinnedAssociation()
Definition: ThinnedAssociation.cc:7
edm::ThinnedAssociation::indexesIntoParent
std::vector< unsigned int > const & indexesIntoParent() const
Definition: ThinnedAssociation.h:21
findQualityFiles.v
v
Definition: findQualityFiles.py:179
edm::ThinnedAssociation::setThinnedCollectionID
void setThinnedCollectionID(ProductID const &v)
Definition: ThinnedAssociation.h:29
edm::ThinnedAssociation::getThinnedIndex
std::optional< unsigned int > getThinnedIndex(unsigned int parentIndex) const
Definition: ThinnedAssociation.cc:9
ProductID.h
edm::ThinnedAssociation::thinnedCollectionID
ProductID const & thinnedCollectionID() const
Definition: ThinnedAssociation.h:20
edm::ThinnedAssociation::setParentCollectionID
void setParentCollectionID(ProductID const &v)
Definition: ThinnedAssociation.h:28
edm::ThinnedAssociation::parentCollectionID
ProductID const & parentCollectionID() const
Definition: ThinnedAssociation.h:19
edm::ThinnedAssociation::push_back
void push_back(unsigned int index)
Definition: ThinnedAssociation.h:30
edm::ThinnedAssociation::indexesIntoParent_
std::vector< unsigned int > indexesIntoParent_
Definition: ThinnedAssociation.h:42
edm::ThinnedAssociation::thinnedCollectionID_
ProductID thinnedCollectionID_
Definition: ThinnedAssociation.h:34
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
edm::ThinnedAssociation::parentCollectionID_
ProductID parentCollectionID_
Definition: ThinnedAssociation.h:33
edm::ProductID
Definition: ProductID.h:27