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 "oneapi/tbb/concurrent_unordered_map.h"
8 
16 
17 namespace edm {
18  class BranchChildren;
19  class ProcessHistoryRegistry;
20 
21  namespace dqh {
22  struct parentage_hash {
23  std::size_t operator()(edm::ParentageID const& iKey) const { return iKey.smallHash(); }
24  };
25  } // namespace dqh
26 
28  typedef std::map<ProcessHistoryID, ProcessHistoryID> ProcessHistoryIDMap;
29  typedef oneapi::tbb::concurrent_unordered_map<ParentageID, ParentageID, dqh::parentage_hash> ParentageIDMap;
30  explicit DaqProvenanceHelper(TypeID const& rawDataType);
31  ProcessHistoryID daqInit(ProductRegistry& productRegistry, ProcessHistoryRegistry& processHistoryRegistry) const;
32  void saveInfo(BranchDescription const& oldBD, BranchDescription const& newBD) {
33  oldProcessName_ = oldBD.processName();
34  oldBranchID_ = oldBD.branchID();
35  newBranchID_ = newBD.branchID();
36  }
37  bool matchProcesses(ProcessConfiguration const& pc, ProcessHistory const& ph) const;
38  void fixMetaData(ProcessConfigurationVector& pcv, std::vector<ProcessHistory>& phv);
39  void fixMetaData(std::vector<BranchID>& branchIDs) const;
40  void fixMetaData(BranchIDLists const&) const;
41  void fixMetaData(BranchChildren& branchChildren) const;
43  ParentageID const& mapParentageID(ParentageID const& phid) const;
44  BranchID const& mapBranchID(BranchID const& branchID) const;
45 
49 
50  void setOldParentageIDToNew(ParentageID const& iOld, ParentageID const& iNew);
51 
52  private:
56 
63  };
64 } // namespace edm
65 #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_
BranchID const & branchID() const
size_t smallHash() const
returns a short hash which can be used with hashing containers
Definition: Hash.h:191
std::map< ProcessHistoryID, ProcessHistoryID > ProcessHistoryIDMap
std::string const & processName() const
ProcessHistoryID daqInit(ProductRegistry &productRegistry, ProcessHistoryRegistry &processHistoryRegistry) const
void fixMetaData(ProcessConfigurationVector &pcv, std::vector< ProcessHistory > &phv)
BranchID const & mapBranchID(BranchID const &branchID) const
bool matchProcesses(ProcessConfiguration const &pc, ProcessHistory const &ph) const
void setOldParentageIDToNew(ParentageID const &iOld, ParentageID const &iNew)
ProcessHistoryIDMap phidMap_
ProductProvenance const & dummyProvenance() const
ParentageID const & mapParentageID(ParentageID const &phid) const
BranchDescription const & branchDescription() const
ProcessHistoryID const & mapProcessHistoryID(ProcessHistoryID const &phid)
std::size_t operator()(edm::ParentageID const &iKey) const
oneapi::tbb::concurrent_unordered_map< ParentageID, ParentageID, dqh::parentage_hash > ParentageIDMap
HLT enums.
BranchDescription const constBranchDescription_
ProcessHistoryID const * oldProcessHistoryID() const
ProcessHistoryID const * oldProcessHistoryID_