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&);
22 
23  BranchID const& parent() const { return parent_; }
24  BranchID const& association() const { return association_; }
25  BranchID const& thinned() const { return thinned_; }
26 
27  bool operator<(ThinnedAssociationBranches const& rhs) const { return parent_ < rhs.parent_; }
28 
29  private:
33  };
34 
36  public:
38 
39  std::vector<ThinnedAssociationBranches>::const_iterator begin() const;
40  std::vector<ThinnedAssociationBranches>::const_iterator end() const;
41 
42  std::vector<ThinnedAssociationBranches>::const_iterator parentBegin(BranchID const&) const;
43  std::vector<ThinnedAssociationBranches>::const_iterator parentEnd(BranchID const&) const;
44 
45  void addAssociation(BranchID const&, BranchID const&, BranchID const&);
47 
48  std::vector<std::pair<BranchID, ThinnedAssociationBranches const*> > associationToBranches() const;
49 
50  void sort();
51  void clear() { vThinnedAssociationBranches_.clear(); }
52 
53  void selectAssociationProducts(std::vector<BranchDescription const*> const& associationDescriptions,
54  std::set<BranchID> const& keptProductsInEvent,
55  std::map<BranchID, bool>& keepAssociation) const;
56 
57  std::vector<ThinnedAssociationBranches> const& data() const { return vThinnedAssociationBranches_; }
58 
60 
62 
64  std::vector<BranchID> const& associationsFromSecondary);
65 
67  ThinnedAssociationsHelper const& parentThinnedAssociationsHelper,
68  std::map<BranchID, bool> const& keepAssociation,
69  std::map<BranchID::value_type, BranchID::value_type> const& droppedBranchIDToKeptBranchID);
70 
71  void initAssociationsFromSecondary(std::vector<BranchID> const&, ThinnedAssociationsHelper const&);
72 
73  private:
75  BranchID const& association,
76  std::vector<std::pair<BranchID, ThinnedAssociationBranches const*> > const& associationToBranches,
77  std::set<BranchID>& branchesInRecursion,
78  std::set<BranchID> const& keptProductsInEvent,
79  std::map<BranchID, bool>& keepAssociation) const;
80 
81  std::vector<ThinnedAssociationBranches> vThinnedAssociationBranches_;
82  };
83 } // namespace edm
84 #endif
edm::ThinnedAssociationBranches::thinned_
BranchID thinned_
Definition: ThinnedAssociationsHelper.h:32
edm::ThinnedAssociationBranches::parent
BranchID const & parent() const
Definition: ThinnedAssociationsHelper.h:23
input
static const std::string input
Definition: EdmProvDump.cc:48
edm::ThinnedAssociationBranches::thinned
BranchID const & thinned() const
Definition: ThinnedAssociationsHelper.h:25
edm::ThinnedAssociationBranches::association
BranchID const & association() const
Definition: ThinnedAssociationsHelper.h:24
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::ThinnedAssociationsHelper::clear
void clear()
Definition: ThinnedAssociationsHelper.h:51
BranchID.h
edm::ThinnedAssociationsHelper::shouldKeepAssociation
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
Definition: ThinnedAssociationsHelper.cc:100
edm::ThinnedAssociationsHelper::parentEnd
std::vector< ThinnedAssociationBranches >::const_iterator parentEnd(BranchID const &) const
Definition: ThinnedAssociationsHelper.cc:36
edm::ThinnedAssociationsHelper::data
std::vector< ThinnedAssociationBranches > const & data() const
Definition: ThinnedAssociationsHelper.h:57
edm::BranchID
Definition: BranchID.h:14
edm::ThinnedAssociationsHelper::updateFromPrimaryInput
void updateFromPrimaryInput(ThinnedAssociationsHelper const &)
Definition: ThinnedAssociationsHelper.cc:168
edm::ThinnedAssociationsHelper::selectAssociationProducts
void selectAssociationProducts(std::vector< BranchDescription const * > const &associationDescriptions, std::set< BranchID > const &keptProductsInEvent, std::map< BranchID, bool > &keepAssociation) const
Definition: ThinnedAssociationsHelper.cc:79
edm::ThinnedAssociationBranches
Definition: ThinnedAssociationsHelper.h:18
edm::ThinnedAssociationBranches::parent_
BranchID parent_
Definition: ThinnedAssociationsHelper.h:30
edm::ThinnedAssociationsHelper::requireMatch
void requireMatch(ThinnedAssociationBranches const &input) const
Definition: ThinnedAssociationsHelper.cc:153
edm::ThinnedAssociationsHelper::vThinnedAssociationBranches_
std::vector< ThinnedAssociationBranches > vThinnedAssociationBranches_
Definition: ThinnedAssociationsHelper.h:81
edm::ThinnedAssociationsHelper
Definition: ThinnedAssociationsHelper.h:35
edm::ThinnedAssociationsHelper::updateFromSecondaryInput
void updateFromSecondaryInput(ThinnedAssociationsHelper const &, std::vector< BranchID > const &associationsFromSecondary)
Definition: ThinnedAssociationsHelper.cc:179
edm::ThinnedAssociationsHelper::end
std::vector< ThinnedAssociationBranches >::const_iterator end() const
Definition: ThinnedAssociationsHelper.cc:21
edm::ThinnedAssociationBranches::association_
BranchID association_
Definition: ThinnedAssociationsHelper.h:31
edm::ThinnedAssociationsHelper::ThinnedAssociationsHelper
ThinnedAssociationsHelper()
Definition: ThinnedAssociationsHelper.cc:15
edm::ThinnedAssociationsHelper::updateFromParentProcess
void updateFromParentProcess(ThinnedAssociationsHelper const &parentThinnedAssociationsHelper, std::map< BranchID, bool > const &keepAssociation, std::map< BranchID::value_type, BranchID::value_type > const &droppedBranchIDToKeptBranchID)
Definition: ThinnedAssociationsHelper.cc:204
TrackValidation_cff.association
association
Definition: TrackValidation_cff.py:286
edm::ThinnedAssociationsHelper::parentBegin
std::vector< ThinnedAssociationBranches >::const_iterator parentBegin(BranchID const &) const
Definition: ThinnedAssociationsHelper.cc:25
edm::ThinnedAssociationsHelper::sort
void sort()
Definition: ThinnedAssociationsHelper.cc:47
edm::ThinnedAssociationsHelper::initAssociationsFromSecondary
void initAssociationsFromSecondary(std::vector< BranchID > const &, ThinnedAssociationsHelper const &)
Definition: ThinnedAssociationsHelper.cc:228
edm::ThinnedAssociationBranches::operator<
bool operator<(ThinnedAssociationBranches const &rhs) const
Definition: ThinnedAssociationsHelper.h:27
edm::ThinnedAssociationsHelper::associationToBranches
std::vector< std::pair< BranchID, ThinnedAssociationBranches const * > > associationToBranches() const
Definition: ThinnedAssociationsHelper.cc:67
edm::ThinnedAssociationBranches::ThinnedAssociationBranches
ThinnedAssociationBranches()
Definition: ThinnedAssociationsHelper.cc:8
edm::ThinnedAssociationsHelper::begin
std::vector< ThinnedAssociationBranches >::const_iterator begin() const
Definition: ThinnedAssociationsHelper.cc:17
edm::ThinnedAssociationsHelper::addAssociation
void addAssociation(BranchID const &, BranchID const &, BranchID const &)
Definition: ThinnedAssociationsHelper.cc:56