CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Attributes
edm::BranchIDListHelper Class Reference

#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
 
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 ( )

Definition at line 8 of file BranchIDListHelper.cc.

8  :
BranchListIndexMapper branchListIndexMapper_
BranchIDToIndexMap branchIDToIndexMap_

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().

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

Definition at line 24 of file BranchIDListHelper.h.

References branchIDLists_.

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

Definition at line 25 of file BranchIDListHelper.h.

References branchIDToIndexMap_.

25 {return branchIDToIndexMap_;}
BranchIDToIndexMap branchIDToIndexMap_
void edm::BranchIDListHelper::fixBranchListIndexes ( BranchListIndexes indexes)

Definition at line 61 of file BranchIDListHelper.cc.

References branchListIndexMapper_, and i.

61  {
62  for(BranchListIndex& i : indexes) {
64  }
65  }
int i
Definition: DBlmapReader.cc:9
unsigned short BranchListIndex
BranchListIndexMapper branchListIndexMapper_
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().

14  {
15  bool unchanged = true;
16  branchListIndexMapper_.clear();
17  typedef BranchIDLists::const_iterator Iter;
18  for(Iter it = bidlists.begin(), itEnd = bidlists.end(); it != itEnd; ++it) {
19  BranchListIndex oldBlix = it - bidlists.begin();
20  Iter j = find_in_all(branchIDLists_, *it);
21  BranchListIndex blix = j - branchIDLists_.begin();
22  if(j == branchIDLists_.end()) {
23  branchIDLists_.push_back(*it);
24  for(BranchIDList::const_iterator i = it->begin(), iEnd = it->end(); i != iEnd; ++i) {
25  ProductIndex pix = i - it->begin();
26  branchIDToIndexMap_.insert(std::make_pair(BranchID(*i), std::make_pair(blix, pix)));
27  }
28  }
29  branchListIndexMapper_.insert(std::make_pair(oldBlix, blix));
30  if(oldBlix != blix) {
31  unchanged = false;
32  }
33  }
34  return unchanged;
35  }
int i
Definition: DBlmapReader.cc:9
unsigned short BranchListIndex
int j
Definition: DBlmapReader.cc:9
BranchListIndexMapper branchListIndexMapper_
ForwardSequence::const_iterator find_in_all(ForwardSequence const &s, Datum const &d)
wrappers for std::find
Definition: Algorithms.h:32
BranchIDToIndexMap branchIDToIndexMap_
unsigned short ProductIndex
Definition: ProductID.h:26
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().

38  {
39  BranchIDList bidlist;
40  // Add entries for current process for ProductID to BranchID mapping.
41  for(ProductRegistry::ProductList::const_iterator it = preg.productList().begin(), itEnd = preg.productList().end();
42  it != itEnd; ++it) {
43  if(it->second.produced()) {
44  if(it->second.branchType() == InEvent) {
45  bidlist.push_back(it->second.branchID().id());
46  }
47  }
48  }
49  if(!bidlist.empty()) {
50  BranchListIndex blix = branchIDLists_.size();
51  preg.setProducedBranchListIndex(blix);
52  branchIDLists_.push_back(bidlist);
53  for(BranchIDList::const_iterator i = bidlist.begin(), iEnd = bidlist.end(); i != iEnd; ++i) {
54  ProductIndex pix = i - bidlist.begin();
55  branchIDToIndexMap_.insert(std::make_pair(BranchID(*i), std::make_pair(blix, pix)));
56  }
57  }
58  }
int i
Definition: DBlmapReader.cc:9
unsigned short BranchListIndex
BranchIDToIndexMap branchIDToIndexMap_
std::vector< BranchID::value_type > BranchIDList
Definition: BranchIDList.h:18
unsigned short ProductIndex
Definition: ProductID.h:26

Member Data Documentation

BranchIDLists edm::BranchIDListHelper::branchIDLists_
private

Definition at line 28 of file BranchIDListHelper.h.

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

BranchIDToIndexMap edm::BranchIDListHelper::branchIDToIndexMap_
private

Definition at line 29 of file BranchIDListHelper.h.

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

BranchListIndexMapper edm::BranchIDListHelper::branchListIndexMapper_
private

Definition at line 30 of file BranchIDListHelper.h.

Referenced by fixBranchListIndexes(), and updateFromInput().