CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
BranchMapperWithReader.cc
Go to the documentation of this file.
1 /*----------------------------------------------------------------------
2 
3 BranchMapperWithReader:
4 
5 ----------------------------------------------------------------------*/
8 #include "RootTree.h"
9 
10 namespace edm {
13  rootTree_(0),
14  infoVector_(),
15  pInfoVector_(&infoVector_),
16  oldProductIDToBranchIDMap_()
17  { }
18 
21  rootTree_(rootTree),
22  infoVector_(),
23  pInfoVector_(&infoVector_),
24  oldProductIDToBranchIDMap_()
25  { }
26 
27  void
29  setRefCoreStreamer(0, false, false);
31  setRefCoreStreamer(true);
32  BranchMapperWithReader* me = const_cast<BranchMapperWithReader*>(this);
33  for (ProductProvenanceVector::const_iterator it = infoVector_.begin(), itEnd = infoVector_.end();
34  it != itEnd; ++it) {
35  me->insert(*it);
36  }
37  }
38 
39  void
40  BranchMapperWithReader::insertIntoMap(ProductID const& oldProductID, BranchID const& branchID) {
41  oldProductIDToBranchIDMap_.insert(std::make_pair(oldProductID.oldID(), branchID));
42  }
43 
44  BranchID
46  std::map<unsigned int, BranchID>::const_iterator it = oldProductIDToBranchIDMap_.find(oldProductID.oldID());
47  if(it == oldProductIDToBranchIDMap_.end()) {
48  return BranchID();
49  }
50  return it->second;
51  }
52 }
TBranch *const branchEntryInfoBranch() const
Definition: RootTree.h:125
ProductProvenanceVector * pInfoVector_
void setRefCoreStreamer(bool resetAll=false)
void fillBranchEntryMeta(TBranch *branch, T *&pbuf)
Definition: RootTree.h:97
void insert(ProductProvenance const &provenanceProduct)
Definition: BranchMapper.cc:35
virtual BranchID oldProductIDToBranchID_(ProductID const &oldProductID) const
std::map< unsigned int, BranchID > oldProductIDToBranchIDMap_
virtual void readProvenance_() const
void insertIntoMap(ProductID const &oldProductID, BranchID const &branchID)
ProductProvenanceVector infoVector_
unsigned int oldID() const
Definition: ProductID.h:42