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  explicit DaqProvenanceHelper(TypeID const& rawDataType,
34  std::string const& sourceLabel);
35  ProcessHistoryID daqInit(ProductRegistry& productRegistry, ProcessHistoryRegistry& processHistoryRegistry) const;
36  void saveInfo(BranchDescription const& oldBD, BranchDescription const& newBD) {
37  oldProcessName_ = oldBD.processName();
38  oldBranchID_ = oldBD.branchID();
39  newBranchID_ = newBD.branchID();
40  }
41  bool matchProcesses(ProcessConfiguration const& pc, ProcessHistory const& ph) const;
42  void fixMetaData(ProcessConfigurationVector& pcv, std::vector<ProcessHistory>& phv);
43  void fixMetaData(std::vector<BranchID>& branchIDs) const;
44  void fixMetaData(BranchIDLists const&) const;
45  void fixMetaData(BranchChildren& branchChildren) const;
47  ParentageID const& mapParentageID(ParentageID const& phid) const;
48  BranchID const& mapBranchID(BranchID const& branchID) const;
49 
53 
54  void setOldParentageIDToNew(ParentageID const& iOld, ParentageID const& iNew);
55 
56  private:
60 
67  };
68 } // namespace edm
69 #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
std::string friendlyName(std::string const &iFullName)
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_