File indexing completed on 2024-04-06 12:11:55
0001 #include "FWCore/Common/interface/Provenance.h"
0002 #include "DataFormats/Provenance/interface/ProcessConfiguration.h"
0003 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0004 #include "FWCore/ParameterSet/interface/Registry.h"
0005
0006 namespace edm {
0007 static std::string const triggerResults("TriggerResults");
0008 static std::string const source("source");
0009 static std::string const triggerResultsInserter("TriggerResultsInserter");
0010
0011 ParameterSet const& parameterSet(StableProvenance const& provenance, ProcessHistory const& history) {
0012 ProcessConfiguration pc;
0013 history.getConfigurationForProcess(provenance.processName(), pc);
0014 ParameterSet const& processParameterSet = *pset::Registry::instance()->getMapped(pc.parameterSetID());
0015 std::string const& label = provenance.moduleLabel();
0016 if (!processParameterSet.existsAs<ParameterSet>(label)) {
0017
0018 if (label == triggerResults) {
0019 return processParameterSet.getParameterSet("@trigger_paths");
0020 } else if (label == source) {
0021 return processParameterSet.getParameterSet("@main_input");
0022 }
0023 }
0024 return processParameterSet.getParameterSet(label);
0025 }
0026
0027 std::string moduleName(StableProvenance const& provenance, ProcessHistory const& history) {
0028
0029 if (provenance.moduleLabel() == triggerResults) {
0030 return triggerResultsInserter;
0031 }
0032 return parameterSet(provenance, history).getParameter<std::string>("@module_type");
0033 }
0034 }