CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes
edm::BranchChildren Class Reference

#include <BranchChildren.h>

Public Member Functions

void appendToDescendants (BranchDescription const &parent, BranchIDSet &descendants, std::map< BranchID, BranchID > const &droppedToKeptAlias) const
 
map_t const & childLookup () const
 
void clear ()
 
void insertChild (BranchID parent, BranchID child)
 
void insertEmpty (BranchID parent)
 

Private Types

typedef std::set< BranchIDBranchIDSet
 
typedef std::map< BranchID, BranchIDSetmap_t
 

Private Member Functions

void append_ (map_t const &lookup, BranchID item, BranchIDSet &itemSet, std::map< BranchID, BranchID > const &droppedToKeptAlias) const
 

Private Attributes

map_t childLookup_
 

Detailed Description

Definition at line 18 of file BranchChildren.h.

Member Typedef Documentation

◆ BranchIDSet

typedef std::set<BranchID> edm::BranchChildren::BranchIDSet
private

Definition at line 20 of file BranchChildren.h.

◆ map_t

typedef std::map<BranchID, BranchIDSet> edm::BranchChildren::map_t
private

Definition at line 21 of file BranchChildren.h.

Member Function Documentation

◆ append_()

void edm::BranchChildren::append_ ( map_t const &  lookup,
BranchID  item,
BranchIDSet itemSet,
std::map< BranchID, BranchID > const &  droppedToKeptAlias 
) const
private

Definition at line 6 of file BranchChildren.cc.

References B2GTnPMonitor_cfi::item.

Referenced by appendToDescendants().

9  {
10  auto const iter = lookup.find(item);
11  if (iter != lookup.end()) {
12  BranchIDSet const& branchIDs = iter->second;
13  for (BranchID const& branchID : branchIDs) {
14  auto it = droppedToKeptAlias.find(branchID);
15  // Insert the BranchID of the children into the set of descendants.
16  // If the insert succeeds, append recursively.
17  if (it == droppedToKeptAlias.end()) {
18  // Normal case. Not an EDAlias.
19  if (itemSet.insert(branchID).second) {
20  append_(lookup, branchID, itemSet, droppedToKeptAlias);
21  }
22  } else {
23  // In this case, we want to put the EDAlias in the
24  // set of things to drop because that is what really
25  // needs to be dropped, but the recursive search in
26  // the lookup map must continue with the original BranchID
27  // because that is what the lookup map contains.
28  if (itemSet.insert(it->second).second) {
29  append_(lookup, branchID, itemSet, droppedToKeptAlias);
30  }
31  }
32  }
33  }
34  }
void append_(map_t const &lookup, BranchID item, BranchIDSet &itemSet, std::map< BranchID, BranchID > const &droppedToKeptAlias) const
std::set< BranchID > BranchIDSet

◆ appendToDescendants()

void edm::BranchChildren::appendToDescendants ( BranchDescription const &  parent,
BranchIDSet descendants,
std::map< BranchID, BranchID > const &  droppedToKeptAlias 
) const

Definition at line 42 of file BranchChildren.cc.

References append_(), childLookup_, and class-composition::parent.

44  {
45  descendants.insert(parent.branchID());
46  // A little tricky here. The child lookup map is filled with the
47  // BranchID of the original product even if there was an EDAlias
48  // and the EDAlias was saved and the original branch dropped.
49  append_(childLookup_, parent.originalBranchID(), descendants, droppedToKeptAlias);
50  }
void append_(map_t const &lookup, BranchID item, BranchIDSet &itemSet, std::map< BranchID, BranchID > const &droppedToKeptAlias) const

◆ childLookup()

map_t const& edm::BranchChildren::childLookup ( ) const
inline

◆ clear()

void edm::BranchChildren::clear ( void  )

Definition at line 36 of file BranchChildren.cc.

References childLookup_.

Referenced by edm::PoolOutputModule::reallyCloseFile(), and BeautifulSoup.Tag::setString().

36 { childLookup_.clear(); }

◆ insertChild()

void edm::BranchChildren::insertChild ( BranchID  parent,
BranchID  child 
)

◆ insertEmpty()

void edm::BranchChildren::insertEmpty ( BranchID  parent)

Definition at line 38 of file BranchChildren.cc.

References childLookup_, and class-composition::parent.

38 { childLookup_.insert(std::make_pair(parent, BranchIDSet())); }
std::set< BranchID > BranchIDSet

Member Data Documentation

◆ childLookup_

map_t edm::BranchChildren::childLookup_
private

Definition at line 44 of file BranchChildren.h.

Referenced by appendToDescendants(), childLookup(), clear(), insertChild(), and insertEmpty().