CMS 3D CMS Logo

ThinnedAssociationsHelper.h
Go to the documentation of this file.
1 #ifndef DataFormats_Provenance_ThinnedAssociationsHelper_h
2 #define DataFormats_Provenance_ThinnedAssociationsHelper_h
3 
9 
10 #include <map>
11 #include <set>
12 #include <vector>
13 
14 namespace edm {
15 
16  class BranchDescription;
17 
19  public:
21  ThinnedAssociationBranches(BranchID const&, BranchID const&, BranchID const&, bool slimmed);
22 
23  BranchID const& parent() const { return parent_; }
24  BranchID const& association() const { return association_; }
25  BranchID const& thinned() const { return thinned_; }
26  bool isSlimmed() const { return slimmed_; }
27 
28  bool operator<(ThinnedAssociationBranches const& rhs) const { return parent_ < rhs.parent_; }
29 
30  private:
34  bool slimmed_ = false;
35  };
36 
38  public:
40 
41  std::vector<ThinnedAssociationBranches>::const_iterator begin() const;
42  std::vector<ThinnedAssociationBranches>::const_iterator end() const;
43 
44  std::vector<ThinnedAssociationBranches>::const_iterator parentBegin(BranchID const&) const;
45  std::vector<ThinnedAssociationBranches>::const_iterator parentEnd(BranchID const&) const;
46 
47  void addAssociation(BranchID const&, BranchID const&, BranchID const&, bool slimmed);
49 
50  std::vector<std::pair<BranchID, ThinnedAssociationBranches const*> > associationToBranches() const;
51 
52  void clear() { vThinnedAssociationBranches_.clear(); }
53 
54  void selectAssociationProducts(std::vector<BranchDescription const*> const& associationDescriptions,
55  std::set<BranchID> const& keptProductsInEvent,
56  std::map<BranchID, bool>& keepAssociation) const;
57 
58  std::vector<ThinnedAssociationBranches> const& data() const { return vThinnedAssociationBranches_; }
59 
61 
63 
65  std::vector<BranchID> const& associationsFromSecondary);
66 
68  ThinnedAssociationsHelper const& parentThinnedAssociationsHelper,
69  std::map<BranchID, bool> const& keepAssociation,
70  std::map<BranchID::value_type, BranchID::value_type> const& droppedBranchIDToKeptBranchID);
71 
72  void initAssociationsFromSecondary(std::vector<BranchID> const&, ThinnedAssociationsHelper const&);
73 
74  private:
76  BranchID const& association,
77  std::vector<std::pair<BranchID, ThinnedAssociationBranches const*> > const& associationToBranches,
78  std::set<BranchID>& branchesInRecursion,
79  std::set<BranchID> const& keptProductsInEvent,
80  std::map<BranchID, bool>& keepAssociation) const;
81  std::vector<ThinnedAssociationBranches>::const_iterator lower_bound(
82  ThinnedAssociationBranches const& branches) const;
83 
84  void ensureSlimmingConstraints() const;
85 
86  std::vector<ThinnedAssociationBranches> vThinnedAssociationBranches_;
87  };
88 } // namespace edm
89 #endif
void initAssociationsFromSecondary(std::vector< BranchID > const &, ThinnedAssociationsHelper const &)
std::vector< ThinnedAssociationBranches >::const_iterator parentEnd(BranchID const &) const
std::vector< ThinnedAssociationBranches >::const_iterator lower_bound(ThinnedAssociationBranches const &branches) const
std::vector< std::pair< BranchID, ThinnedAssociationBranches const * > > associationToBranches() const
void updateFromPrimaryInput(ThinnedAssociationsHelper const &)
static std::string const input
Definition: EdmProvDump.cc:50
bool operator<(ThinnedAssociationBranches const &rhs) const
std::tuple< layerClusterToCaloParticle, caloParticleToLayerCluster > association
std::vector< ThinnedAssociationBranches > const & data() const
std::vector< ThinnedAssociationBranches >::const_iterator begin() const
std::vector< ThinnedAssociationBranches >::const_iterator end() const
void addAssociation(BranchID const &, BranchID const &, BranchID const &, bool slimmed)
void updateFromSecondaryInput(ThinnedAssociationsHelper const &, std::vector< BranchID > const &associationsFromSecondary)
std::vector< ThinnedAssociationBranches > vThinnedAssociationBranches_
void requireMatch(ThinnedAssociationBranches const &input) const
bool shouldKeepAssociation(BranchID const &association, std::vector< std::pair< BranchID, ThinnedAssociationBranches const *> > const &associationToBranches, std::set< BranchID > &branchesInRecursion, std::set< BranchID > const &keptProductsInEvent, std::map< BranchID, bool > &keepAssociation) const
std::vector< ThinnedAssociationBranches >::const_iterator parentBegin(BranchID const &) const
void updateFromParentProcess(ThinnedAssociationsHelper const &parentThinnedAssociationsHelper, std::map< BranchID, bool > const &keepAssociation, std::map< BranchID::value_type, BranchID::value_type > const &droppedBranchIDToKeptBranchID)
HLT enums.
void selectAssociationProducts(std::vector< BranchDescription const *> const &associationDescriptions, std::set< BranchID > const &keptProductsInEvent, std::map< BranchID, bool > &keepAssociation) const