CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
getProducerParameterSet.cc
Go to the documentation of this file.
2 
11 
12 #include <string>
13 
14 namespace edm {
15 
16  ParameterSet const* getProducerParameterSet(Provenance const& provenance, ProcessHistory const& processHistory) {
17  const std::shared_ptr<BranchDescription const>& branchDescription = provenance.constBranchDescriptionPtr();
18 
19  if (branchDescription) {
20  std::string const& process = branchDescription->processName();
21  std::string const& label = branchDescription->moduleLabel();
22 
23  for (ProcessConfiguration const& pc : processHistory) {
24  if (pc.processName() == process) {
25  ParameterSetID const& psetID = pc.parameterSetID();
26  pset::Registry const* psetRegistry = pset::Registry::instance();
27  ParameterSet const* processPset = psetRegistry->getMapped(psetID);
28  if (processPset) {
29  return &processPset->getParameterSet(label);
30  }
31  }
32  }
33  }
34  // This should never happen
35  throw cms::Exception("LogicError") << "getProducerParameterSet failed";
36  return nullptr;
37  }
38 } // namespace edm
Definition: Hash.h:43
char const * label
bool getMapped(key_type const &k, value_type &result) const
Definition: Registry.cc:17
ParameterSet const * getProducerParameterSet(Provenance const &provenance, ProcessHistory const &)
std::shared_ptr< BranchDescription const > const & constBranchDescriptionPtr() const
Definition: Provenance.h:46
ParameterSet const & getParameterSet(std::string const &) const
tuple process
Definition: LaserDQM_cfg.py:3
static Registry * instance()
Definition: Registry.cc:12