CMS 3D CMS Logo

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;
45  ProcessHistoryID const& mapProcessHistoryID(ProcessHistoryID const& phid);
46  ParentageID const& mapParentageID(ParentageID const& phid) const;
47  BranchID const& mapBranchID(BranchID const& branchID) const;
48 
49  BranchDescription const& branchDescription() const {return constBranchDescription_;}
50  ProcessHistoryID const* oldProcessHistoryID() const { return oldProcessHistoryID_; }
51  ProductProvenance const& dummyProvenance() const { return dummyProvenance_; }
52 
53  void setOldParentageIDToNew(ParentageID const& iOld, ParentageID const& iNew);
54 
55  private:
59 
64  ProcessHistoryIDMap phidMap_;
65  ParentageIDMap parentageIDMap_;
66  };
67 }
68 #endif
std::vector< ProcessConfiguration > ProcessConfigurationVector
void saveInfo(BranchDescription const &oldBD, BranchDescription const &newBD)
std::vector< BranchIDList > BranchIDLists
Definition: BranchIDList.h:19
ProductProvenance dummyProvenance_
std::map< ProcessHistoryID, ProcessHistoryID > ProcessHistoryIDMap
std::string const & processName() const
ProductProvenance const & dummyProvenance() const
std::size_t operator()(edm::ParentageID const &iKey) const
ProcessHistoryIDMap phidMap_
BranchDescription const & branchDescription() const
BranchID const & branchID() const
size_t smallHash() const
returns a short hash which can be used with hashing containers
Definition: Hash.h:224
HLT enums.
ProcessHistoryID const * oldProcessHistoryID() const
BranchDescription const constBranchDescription_
tbb::concurrent_unordered_map< ParentageID, ParentageID, dqh::parentage_hash > ParentageIDMap
ProcessHistoryID const * oldProcessHistoryID_