FWCore
Framework
src
getProducerParameterSet.cc
Go to the documentation of this file.
1
#include "
FWCore/Framework/interface/getProducerParameterSet.h
"
2
3
#include "
DataFormats/Provenance/interface/BranchDescription.h
"
4
#include "
DataFormats/Provenance/interface/ParameterSetID.h
"
5
#include "
DataFormats/Provenance/interface/ProcessConfiguration.h
"
6
#include "
DataFormats/Provenance/interface/ProcessHistory.h
"
7
#include "
DataFormats/Provenance/interface/Provenance.h
"
8
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
9
#include "
FWCore/ParameterSet/interface/Registry.h
"
10
#include "
FWCore/Utilities/interface/Exception.h
"
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
edm::pset::Registry::instance
static Registry * instance()
Definition:
Registry.cc:12
getProducerParameterSet.h
edm
HLT enums.
Definition:
AlignableModifier.h:19
edm::getProducerParameterSet
ParameterSet const * getProducerParameterSet(Provenance const &provenance, ProcessHistory const &)
Definition:
getProducerParameterSet.cc:16
ProcessHistory.h
ProcessConfiguration.h
Provenance.h
edm::Hash
Definition:
Hash.h:43
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
BranchDescription.h
edm::ParameterSet
Definition:
ParameterSet.h:36
LaserDQM_cfg.process
process
Definition:
LaserDQM_cfg.py:3
Registry.h
Exception
Definition:
hltDiff.cc:246
Exception.h
ParameterSetID.h
edm::ProcessHistory
Definition:
ProcessHistory.h:13
ParameterSet.h
edm::Provenance
Definition:
Provenance.h:34
edm::Provenance::constBranchDescriptionPtr
std::shared_ptr< BranchDescription const > const & constBranchDescriptionPtr() const
Definition:
Provenance.h:46
edm::pset::Registry::getMapped
bool getMapped(key_type const &k, value_type &result) const
Definition:
Registry.cc:17
label
const char * label
Definition:
PFTauDecayModeTools.cc:11
edm::ProcessConfiguration
Definition:
ProcessConfiguration.h:14
edm::ParameterSet::getParameterSet
ParameterSet const & getParameterSet(std::string const &) const
Definition:
ParameterSet.cc:2121
edm::pset::Registry
Definition:
Registry.h:26
Generated for CMSSW Reference Manual by
1.8.16