CMS 3D CMS Logo

Public Types | Public Member Functions | Private Attributes

edm::BranchIDListHelper Class Reference

#include <BranchIDListHelper.h>

List of all members.

Public Types

typedef std::multimap
< BranchID, IndexPair
BranchIDToIndexMap
typedef std::map
< BranchListIndex,
BranchListIndex
BranchListIndexMapper
typedef std::pair
< BranchListIndex,
ProductIndex
IndexPair

Public Member Functions

 BranchIDListHelper ()
BranchIDLists const & branchIDLists () const
BranchIDListsbranchIDLists ()
BranchIDToIndexMap const & branchIDToIndexMap () const
void fixBranchListIndexes (BranchListIndexes &indexes)
bool updateFromInput (BranchIDLists const &bidlists)
void updateRegistries (ProductRegistry const &reg)

Private Attributes

BranchIDLists branchIDLists_
BranchIDToIndexMap branchIDToIndexMap_
BranchListIndexMapper branchListIndexMapper_

Detailed Description

Definition at line 13 of file BranchIDListHelper.h.


Member Typedef Documentation

Definition at line 16 of file BranchIDListHelper.h.

Definition at line 17 of file BranchIDListHelper.h.

Definition at line 15 of file BranchIDListHelper.h.


Constructor & Destructor Documentation

edm::BranchIDListHelper::BranchIDListHelper ( )

Member Function Documentation

BranchIDLists const& edm::BranchIDListHelper::branchIDLists ( ) const [inline]

Definition at line 23 of file BranchIDListHelper.h.

References branchIDLists_.

Referenced by edm::Schedule::Schedule().

{return branchIDLists_;}
BranchIDLists& edm::BranchIDListHelper::branchIDLists ( ) [inline]

Definition at line 24 of file BranchIDListHelper.h.

References branchIDLists_.

{return branchIDLists_;}
BranchIDToIndexMap const& edm::BranchIDListHelper::branchIDToIndexMap ( ) const [inline]

Definition at line 25 of file BranchIDListHelper.h.

References branchIDToIndexMap_.

void edm::BranchIDListHelper::fixBranchListIndexes ( BranchListIndexes indexes)

Definition at line 61 of file BranchIDListHelper.cc.

References branchListIndexMapper_, and i.

                                                                     {
    for(BranchListIndex& i : indexes) {
      i = branchListIndexMapper_[i];
    }
  }
bool edm::BranchIDListHelper::updateFromInput ( BranchIDLists const &  bidlists)

Definition at line 14 of file BranchIDListHelper.cc.

References branchIDLists_, branchIDToIndexMap_, branchListIndexMapper_, edm::find_in_all(), i, and j.

Referenced by edm::StreamerInputSource::mergeIntoRegistry().

                                                                    {
    bool unchanged = true;
    branchListIndexMapper_.clear();
    typedef BranchIDLists::const_iterator Iter;
    for(Iter it = bidlists.begin(), itEnd = bidlists.end(); it != itEnd; ++it) {
      BranchListIndex oldBlix = it - bidlists.begin();
      Iter j = find_in_all(branchIDLists_, *it);
      BranchListIndex blix = j - branchIDLists_.begin();
      if(j == branchIDLists_.end()) {
        branchIDLists_.push_back(*it);
        for(BranchIDList::const_iterator i = it->begin(), iEnd = it->end(); i != iEnd; ++i) {
          ProductIndex pix = i - it->begin();
          branchIDToIndexMap_.insert(std::make_pair(BranchID(*i), std::make_pair(blix, pix)));
        }
      }
      branchListIndexMapper_.insert(std::make_pair(oldBlix, blix));
      if(oldBlix != blix) {
        unchanged = false;
      }
    }
    return unchanged;
  }
void edm::BranchIDListHelper::updateRegistries ( ProductRegistry const &  reg)

Definition at line 38 of file BranchIDListHelper.cc.

References branchIDLists_, branchIDToIndexMap_, i, edm::InEvent, edm::ProductRegistry::productList(), and edm::ProductRegistry::setProducedBranchListIndex().

Referenced by edm::Schedule::Schedule().

                                                                  {
    BranchIDList bidlist;
    // Add entries for current process for ProductID to BranchID mapping.
    for(ProductRegistry::ProductList::const_iterator it = preg.productList().begin(), itEnd = preg.productList().end();
        it != itEnd; ++it) {
      if(it->second.produced()) {
        if(it->second.branchType() == InEvent) {
          bidlist.push_back(it->second.branchID().id());
        }
      }
    }
    if(!bidlist.empty()) {
      BranchListIndex blix = branchIDLists_.size();
      preg.setProducedBranchListIndex(blix);
      branchIDLists_.push_back(bidlist);
      for(BranchIDList::const_iterator i = bidlist.begin(), iEnd = bidlist.end(); i != iEnd; ++i) {
        ProductIndex pix = i - bidlist.begin();
        branchIDToIndexMap_.insert(std::make_pair(BranchID(*i), std::make_pair(blix, pix)));
      }
    }
  }

Member Data Documentation

Definition at line 28 of file BranchIDListHelper.h.

Referenced by branchIDLists(), updateFromInput(), and updateRegistries().

Definition at line 29 of file BranchIDListHelper.h.

Referenced by branchIDToIndexMap(), updateFromInput(), and updateRegistries().

Definition at line 30 of file BranchIDListHelper.h.

Referenced by fixBranchListIndexes(), and updateFromInput().