CMS 3D CMS Logo

LHEProvenanceHelper.cc
Go to the documentation of this file.
1 #include <string>
2 #include <vector>
5 
10 
12 
16 
17 namespace edm {
19  TypeID const& runProductType,
20  ProductRegistry& productRegistry)
21  : eventProductBranchDescription_(BranchDescription(InEvent,
22  "source",
23  "LHEFile"
24  // , "LHE"
25  ,
26  "LHEEventProduct",
27  "LHEEventProduct",
28  "",
29  "LHESource",
31  TypeWithDict(eventProductType.typeInfo()),
32  false)),
33  runProductBranchDescription_(BranchDescription(InRun,
34  "source",
35  "LHEFile"
36  // , "LHE"
37  ,
38  "LHERunInfoProduct",
39  "LHERunInfoProduct",
40  "",
41  "LHESource",
43  TypeWithDict(runProductType.typeInfo()),
44  false)),
45  eventProductProvenance_(eventProductBranchDescription_.branchID()),
46  commonProcessParameterSet_(fillCommonProcessParameterSet()),
47  processParameterSet_() {
48  // Add the products to the product registry
50  ep.setIsProvenanceSetOnRead();
51  productRegistry.copyProduct(ep);
54  productRegistry.copyProduct(rp);
55  }
56 
58  // We create a process parameter set for the "LHC" process.
59  // This function only fills parameters whose values are independent of the LHE input files.
60  // We don't currently use the untracked parameters, However, we make them available, just in case.
65  typedef std::vector<std::string> vstring;
66  vstring empty;
67 
68  vstring modlbl;
69  modlbl.reserve(1);
70  modlbl.push_back(moduleLabel);
71  pset.addParameter("@all_sources", modlbl);
72 
74  triggerPaths.addParameter<vstring>("@trigger_paths", empty);
75  pset.addParameter<ParameterSet>("@trigger_paths", triggerPaths);
76 
77  ParameterSet pseudoInput;
78  pseudoInput.addParameter<std::string>("@module_edm_type", "Source");
79  pseudoInput.addParameter<std::string>("@module_label", moduleLabel);
80  pseudoInput.addParameter<std::string>("@module_type", moduleName);
81  pset.addParameter<ParameterSet>(moduleLabel, pseudoInput);
82 
83  pset.addParameter<vstring>("@all_esmodules", empty);
84  pset.addParameter<vstring>("@all_esprefers", empty);
85  pset.addParameter<vstring>("@all_essources", empty);
86  pset.addParameter<vstring>("@all_loopers", empty);
87  pset.addParameter<vstring>("@all_modules", empty);
88  pset.addParameter<vstring>("@end_paths", empty);
89  pset.addParameter<vstring>("@paths", empty);
90  pset.addParameter<std::string>("@process_name", processName);
91  return pset;
92  }
93 
96  if (runInfo == nullptr)
97  return;
98  typedef std::vector<std::string> vstring;
99  auto const& heprup = *runInfo->getHEPRUP();
100  processParameterSet_.addParameter<int>("IDBMUP1", heprup.IDBMUP.first);
101  processParameterSet_.addParameter<int>("IDBMUP2", heprup.IDBMUP.second);
102  processParameterSet_.addParameter<int>("EBMUP1", heprup.EBMUP.first);
103  processParameterSet_.addParameter<int>("EBMUP2", heprup.EBMUP.second);
104  processParameterSet_.addParameter<int>("PDFGUP1", heprup.PDFGUP.first);
105  processParameterSet_.addParameter<int>("PDFGUP2", heprup.PDFGUP.second);
106  processParameterSet_.addParameter<int>("PDFSUP1", heprup.PDFSUP.first);
107  processParameterSet_.addParameter<int>("PDFSUP2", heprup.PDFSUP.second);
108  processParameterSet_.addParameter<int>("IDWTUP", heprup.IDWTUP);
109  for (auto const& header : runInfo->getHeaders()) {
111  continue;
112  }
114  }
115  }
116 
118  // Now we register the process parameter set.
120  //std::cerr << processParameterSet_.dump() << std::endl;
121 
122  // Insert an entry for this process in the process history registry
124  ph.emplace_back(
126  processHistoryRegistry.registerProcessHistory(ph);
127 
128  // Save the process history ID for use every event.
129  return ph.id();
130  }
131 
132 } // namespace edm
std::string getPassID()
Definition: GetPassID.h:7
void setIsProvenanceSetOnRead(bool value=true) noexcept
bool registerProcessHistory(ProcessHistory const &processHistory)
std::string const & moduleName() const
std::string const & processName() const
LHEProvenanceHelper(TypeID const &eventProductType, TypeID const &runProductType, ProductRegistry &productRegistry)
BranchDescription const runProductBranchDescription_
ParameterSetID id() const
ParameterSet const & registerIt()
ParameterSet fillCommonProcessParameterSet()
void addParameter(std::string const &name, T const &value)
Definition: ParameterSet.h:136
static bool isTagComparedInMerge(const std::string &tag)
std::string getReleaseVersion()
ProcessHistoryID lheInit(ProcessHistoryRegistry &processHistoryRegistry)
ParameterSet const commonProcessParameterSet_
std::string moduleName(StableProvenance const &provenance, ProcessHistory const &history)
Definition: Provenance.cc:27
HLT enums.
static std::string const triggerPaths
Definition: EdmProvDump.cc:48
std::string const & moduleLabel() const
std::vector< std::string > vstring
Definition: Schedule.cc:482
BranchDescription const eventProductBranchDescription_
void lheAugment(lhef::LHERunInfo const *runInfo)
void copyProduct(BranchDescription const &productdesc)