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 
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 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
edm::DaqProvenanceHelper::oldBranchID_
BranchID oldBranchID_
Definition: DaqProvenanceHelper.h:58
edm::DaqProvenanceHelper::oldProcessName_
std::string oldProcessName_
Definition: DaqProvenanceHelper.h:57
ProcessHistoryID.h
edm::DaqProvenanceHelper::oldProcessHistoryID
ProcessHistoryID const * oldProcessHistoryID() const
Definition: DaqProvenanceHelper.h:47
edm::DaqProvenanceHelper::saveInfo
void saveInfo(BranchDescription const &oldBD, BranchDescription const &newBD)
Definition: DaqProvenanceHelper.h:32
edm::DaqProvenanceHelper::processParameterSet_
ParameterSet processParameterSet_
Definition: DaqProvenanceHelper.h:55
edm::DaqProvenanceHelper::ProcessHistoryIDMap
std::map< ProcessHistoryID, ProcessHistoryID > ProcessHistoryIDMap
Definition: DaqProvenanceHelper.h:28
edm::DaqProvenanceHelper::mapParentageID
ParentageID const & mapParentageID(ParentageID const &phid) const
Definition: DaqProvenanceHelper.cc:182
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::DaqProvenanceHelper::matchProcesses
bool matchProcesses(ProcessConfiguration const &pc, ProcessHistory const &ph) const
Definition: DaqProvenanceHelper.cc:98
edm::DaqProvenanceHelper::oldProcessHistoryID_
ProcessHistoryID const * oldProcessHistoryID_
Definition: DaqProvenanceHelper.h:60
BranchID.h
edm::DaqProvenanceHelper
Definition: DaqProvenanceHelper.h:27
edm::DaqProvenanceHelper::ParentageIDMap
tbb::concurrent_unordered_map< ParentageID, ParentageID, dqh::parentage_hash > ParentageIDMap
Definition: DaqProvenanceHelper.h:29
edm::DaqProvenanceHelper::newBranchID_
BranchID newBranchID_
Definition: DaqProvenanceHelper.h:59
edm::dqh::parentage_hash::operator()
std::size_t operator()(edm::ParentageID const &iKey) const
Definition: DaqProvenanceHelper.h:23
ParentageID.h
edm::Hash::smallHash
size_t smallHash() const
returns a short hash which can be used with hashing containers
Definition: Hash.h:191
edm::ProductRegistry
Definition: ProductRegistry.h:34
edm::DaqProvenanceHelper::dummyProvenance_
ProductProvenance dummyProvenance_
Definition: DaqProvenanceHelper.h:54
edm::ProductProvenance
Definition: ProductProvenance.h:24
ProcessConfiguration.h
edm::BranchDescription::processName
std::string const & processName() const
Definition: BranchDescription.h:73
ProductProvenance.h
edm::BranchID
Definition: BranchID.h:14
edm::Hash< ParentageType >
edm::BranchIDLists
std::vector< BranchIDList > BranchIDLists
Definition: BranchIDList.h:19
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
BranchDescription.h
edm::DaqProvenanceHelper::mapBranchID
BranchID const & mapBranchID(BranchID const &branchID) const
Definition: DaqProvenanceHelper.cc:191
edm::ParameterSet
Definition: ParameterSet.h:36
edm::DaqProvenanceHelper::daqInit
ProcessHistoryID daqInit(ProductRegistry &productRegistry, ProcessHistoryRegistry &processHistoryRegistry) const
Definition: DaqProvenanceHelper.cc:83
edm::DaqProvenanceHelper::setOldParentageIDToNew
void setOldParentageIDToNew(ParentageID const &iOld, ParentageID const &iNew)
Definition: DaqProvenanceHelper.cc:195
edm::ProcessConfigurationVector
std::vector< ProcessConfiguration > ProcessConfigurationVector
Definition: ProcessConfiguration.h:62
edm::BranchChildren
Definition: BranchChildren.h:18
edm::dqh::parentage_hash
Definition: DaqProvenanceHelper.h:22
edm::DaqProvenanceHelper::parentageIDMap_
ParentageIDMap parentageIDMap_
Definition: DaqProvenanceHelper.h:62
edm::DaqProvenanceHelper::DaqProvenanceHelper
DaqProvenanceHelper(TypeID const &rawDataType)
Definition: DaqProvenanceHelper.cc:37
edm::TypeID
Definition: TypeID.h:22
edm::DaqProvenanceHelper::branchDescription
BranchDescription const & branchDescription() const
Definition: DaqProvenanceHelper.h:46
edm::DaqProvenanceHelper::mapProcessHistoryID
ProcessHistoryID const & mapProcessHistoryID(ProcessHistoryID const &phid)
Definition: DaqProvenanceHelper.cc:174
edm::DaqProvenanceHelper::phidMap_
ProcessHistoryIDMap phidMap_
Definition: DaqProvenanceHelper.h:61
edm::ProcessHistoryRegistry
Definition: ProcessHistoryRegistry.h:18
edm::BranchDescription
Definition: BranchDescription.h:32
edm::DaqProvenanceHelper::fixMetaData
void fixMetaData(ProcessConfigurationVector &pcv, std::vector< ProcessHistory > &phv)
edm::ProcessHistory
Definition: ProcessHistory.h:13
ParameterSet.h
edm::BranchDescription::branchID
BranchID const & branchID() const
Definition: BranchDescription.h:74
edm::ProcessConfiguration
Definition: ProcessConfiguration.h:14
edm::DaqProvenanceHelper::constBranchDescription_
const BranchDescription constBranchDescription_
Definition: DaqProvenanceHelper.h:53
edm::DaqProvenanceHelper::dummyProvenance
ProductProvenance const & dummyProvenance() const
Definition: DaqProvenanceHelper.h:48