File indexing completed on 2024-04-06 12:03:54
0001 #ifndef DataFormats_Common_ThinnedAssociation_h
0002 #define DataFormats_Common_ThinnedAssociation_h
0003
0004
0005
0006
0007
0008 #include "DataFormats/Provenance/interface/ProductID.h"
0009
0010 #include <optional>
0011 #include <vector>
0012
0013 namespace edm {
0014
0015 class ThinnedAssociation {
0016 public:
0017 ThinnedAssociation();
0018
0019 ProductID const& parentCollectionID() const { return parentCollectionID_; }
0020 ProductID const& thinnedCollectionID() const { return thinnedCollectionID_; }
0021 std::vector<unsigned int> const& indexesIntoParent() const { return indexesIntoParent_; }
0022
0023
0024
0025
0026 std::optional<unsigned int> getThinnedIndex(unsigned int parentIndex) const;
0027
0028 void setParentCollectionID(ProductID const& v) { parentCollectionID_ = v; }
0029 void setThinnedCollectionID(ProductID const& v) { thinnedCollectionID_ = v; }
0030 void push_back(unsigned int index) { indexesIntoParent_.push_back(index); }
0031
0032 private:
0033 ProductID parentCollectionID_;
0034 ProductID thinnedCollectionID_;
0035
0036
0037
0038
0039
0040
0041
0042 std::vector<unsigned int> indexesIntoParent_;
0043 };
0044 }
0045 #endif