test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DaqProvenanceHelper.h
Go to the documentation of this file.
1 #ifndef FWCore_Sources_DaqProvenanceHelper_h
2 #define FWCore_Sources_DaqProvenanceHelper_h
3 
4 #include <map>
5 #include <string>
6 #include <vector>
7 #include "tbb/concurrent_unordered_map.h"
8 
9 
17 
18 namespace edm {
19  class BranchChildren;
20  class ProcessHistoryRegistry;
21 
22  namespace dqh {
23  struct parentage_hash {
24  std::size_t operator()(edm::ParentageID const& iKey) const{
25  return iKey.smallHash();
26  }
27  };
28  }
29 
31  typedef std::map<ProcessHistoryID, ProcessHistoryID> ProcessHistoryIDMap;
32  typedef tbb::concurrent_unordered_map<ParentageID, ParentageID, dqh::parentage_hash> ParentageIDMap;
33  explicit DaqProvenanceHelper(TypeID const& rawDataType);
34  ProcessHistoryID daqInit(ProductRegistry& productRegistry, ProcessHistoryRegistry& processHistoryRegistry) const;
35  void saveInfo(BranchDescription const& oldBD, BranchDescription const& newBD) {
36  oldProcessName_ = oldBD.processName();
37  oldBranchID_ = oldBD.branchID();
38  newBranchID_ = newBD.branchID();
39  }
40  bool matchProcesses(ProcessConfiguration const& pc, ProcessHistory const& ph) const;
41  void fixMetaData(ProcessConfigurationVector& pcv, std::vector<ProcessHistory>& phv);
42  void fixMetaData(std::vector<BranchID>& branchIDs) const;
43  void fixMetaData(BranchIDLists const&) const;
44  void fixMetaData(BranchChildren& branchChildren) const;
46  ParentageID const& mapParentageID(ParentageID const& phid) const;
47  BranchID const& mapBranchID(BranchID const& branchID) const;
48 
52 
53  void setOldParentageIDToNew(ParentageID const& iOld, ParentageID const& iNew);
54 
55  private:
59 
66  };
67 }
68 #endif
std::vector< ProcessConfiguration > ProcessConfigurationVector
DaqProvenanceHelper(TypeID const &rawDataType)
void saveInfo(BranchDescription const &oldBD, BranchDescription const &newBD)
std::vector< BranchIDList > BranchIDLists
Definition: BranchIDList.h:19
ProductProvenance dummyProvenance_
std::map< ProcessHistoryID, ProcessHistoryID > ProcessHistoryIDMap
BranchID const & mapBranchID(BranchID const &branchID) const
std::string const & processName() const
ProductProvenance const & dummyProvenance() const
std::size_t operator()(edm::ParentageID const &iKey) const
ProcessHistoryID const & mapProcessHistoryID(ProcessHistoryID const &phid)
void fixMetaData(ProcessConfigurationVector &pcv, std::vector< ProcessHistory > &phv)
void setOldParentageIDToNew(ParentageID const &iOld, ParentageID const &iNew)
ProcessHistoryIDMap phidMap_
BranchDescription const & branchDescription() const
BranchID const & branchID() const
ProcessHistoryID daqInit(ProductRegistry &productRegistry, ProcessHistoryRegistry &processHistoryRegistry) const
size_t smallHash() const
returns a short hash which can be used with hashing containers
Definition: Hash.h:220
ProcessHistoryID const * oldProcessHistoryID() const
BranchDescription const constBranchDescription_
ParentageID const & mapParentageID(ParentageID const &phid) const
tbb::concurrent_unordered_map< ParentageID, ParentageID, dqh::parentage_hash > ParentageIDMap
ProcessHistoryID const * oldProcessHistoryID_
bool matchProcesses(ProcessConfiguration const &pc, ProcessHistory const &ph) const