src
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
Registry.h
edm::pset::Registry::getMapped
bool getMapped(key_type const &k, value_type &result) const
Definition:
Registry.cc:17
Exception
Definition:
hltDiff.cc:245
edm::Hash
Definition:
Hash.h:43
ProcessHistory.h
getProducerParameterSet.h
edm::ParameterSet::getParameterSet
ParameterSet const & getParameterSet(std::string const &) const
Definition:
ParameterSet.cc:2128
edm::pset::Registry
Definition:
Registry.h:26
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
ParameterSet.h
label
char const * label
Definition:
PFTauDecayModeTools.cc:11
LaserDQM_cfg.process
process
Definition:
LaserDQM_cfg.py:3
BranchDescription.h
edm::Provenance
Definition:
Provenance.h:34
Exception.h
ParameterSetID.h
ProcessConfiguration.h
edm::getProducerParameterSet
ParameterSet const * getProducerParameterSet(Provenance const &provenance, ProcessHistory const &)
Definition:
getProducerParameterSet.cc:16
edm
HLT enums.
Definition:
AlignableModifier.h:19
edm::ProcessHistory
Definition:
ProcessHistory.h:13
edm::ParameterSet
Definition:
ParameterSet.h:47
Provenance.h
edm::ProcessConfiguration
Definition:
ProcessConfiguration.h:14
crab_script.provenance
provenance
Definition:
crab_script.py:13
edm::pset::Registry::instance
static Registry * instance()
Definition:
Registry.cc:12
Generated for CMSSW Reference Manual by
1.8.14