#include <BranchIDListHelper.h>
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 |
BranchIDLists & | branchIDLists () |
BranchIDToIndexMap const & | branchIDToIndexMap () const |
void | fixBranchListIndexes (BranchListIndexes &indexes) |
bool | updateFromInput (BranchIDLists const &bidlists) |
void | updateRegistries (ProductRegistry const ®) |
Private Attributes | |
BranchIDLists | branchIDLists_ |
BranchIDToIndexMap | branchIDToIndexMap_ |
BranchListIndexMapper | branchListIndexMapper_ |
Definition at line 13 of file BranchIDListHelper.h.
typedef std::multimap<BranchID, IndexPair> edm::BranchIDListHelper::BranchIDToIndexMap |
Definition at line 16 of file BranchIDListHelper.h.
typedef std::map<BranchListIndex, BranchListIndex> edm::BranchIDListHelper::BranchListIndexMapper |
Definition at line 17 of file BranchIDListHelper.h.
typedef std::pair<BranchListIndex, ProductIndex> edm::BranchIDListHelper::IndexPair |
Definition at line 15 of file BranchIDListHelper.h.
edm::BranchIDListHelper::BranchIDListHelper | ( | ) |
Definition at line 8 of file BranchIDListHelper.cc.
: branchIDLists_(), branchIDToIndexMap_(), branchListIndexMapper_() {}
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_.
{return 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))); } } }
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().