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
51  }
52 
54  // We create a process parameter set for the "LHC" process.
55  // This function only fills parameters whose values are independent of the LHE input files.
56  // We don't currently use the untracked parameters, However, we make them available, just in case.
61  typedef std::vector<std::string> vstring;
62  vstring empty;
63 
64  vstring modlbl;
65  modlbl.reserve(1);
66  modlbl.push_back(moduleLabel);
67  pset.addParameter("@all_sources", modlbl);
68 
70  triggerPaths.addParameter<vstring>("@trigger_paths", empty);
71  pset.addParameter<ParameterSet>("@trigger_paths", triggerPaths);
72 
73  ParameterSet pseudoInput;
74  pseudoInput.addParameter<std::string>("@module_edm_type", "Source");
75  pseudoInput.addParameter<std::string>("@module_label", moduleLabel);
76  pseudoInput.addParameter<std::string>("@module_type", moduleName);
77  pset.addParameter<ParameterSet>(moduleLabel, pseudoInput);
78 
79  pset.addParameter<vstring>("@all_esmodules", empty);
80  pset.addParameter<vstring>("@all_esprefers", empty);
81  pset.addParameter<vstring>("@all_essources", empty);
82  pset.addParameter<vstring>("@all_loopers", empty);
83  pset.addParameter<vstring>("@all_modules", empty);
84  pset.addParameter<vstring>("@end_paths", empty);
85  pset.addParameter<vstring>("@paths", empty);
86  pset.addParameter<std::string>("@process_name", processName);
87  return pset;
88  }
89 
92  if (runInfo == nullptr)
93  return;
94  typedef std::vector<std::string> vstring;
95  auto const& heprup = *runInfo->getHEPRUP();
96  processParameterSet_.addParameter<int>("IDBMUP1", heprup.IDBMUP.first);
97  processParameterSet_.addParameter<int>("IDBMUP2", heprup.IDBMUP.second);
98  processParameterSet_.addParameter<int>("EBMUP1", heprup.EBMUP.first);
99  processParameterSet_.addParameter<int>("EBMUP2", heprup.EBMUP.second);
100  processParameterSet_.addParameter<int>("PDFGUP1", heprup.PDFGUP.first);
101  processParameterSet_.addParameter<int>("PDFGUP2", heprup.PDFGUP.second);
102  processParameterSet_.addParameter<int>("PDFSUP1", heprup.PDFSUP.first);
103  processParameterSet_.addParameter<int>("PDFSUP2", heprup.PDFSUP.second);
104  processParameterSet_.addParameter<int>("IDWTUP", heprup.IDWTUP);
105  for (auto const& header : runInfo->getHeaders()) {
107  continue;
108  }
109  processParameterSet_.addParameter<vstring>(header.tag(), header.lines());
110  }
111  }
112 
114  // Now we register the process parameter set.
116  //std::cerr << processParameterSet_.dump() << std::endl;
117 
118  // Insert an entry for this process in the process history registry
119  ProcessHistory ph;
120  ph.emplace_back(
122  processHistoryRegistry.registerProcessHistory(ph);
123 
124  // Save the process history ID for use every event.
125  return ph.id();
126  }
127 
128 } // namespace edm
std::string getPassID()
Definition: GetPassID.h:7
ParameterSetID id() const
bool registerProcessHistory(ProcessHistory const &processHistory)
std::string const & processName() const
LHEProvenanceHelper(TypeID const &eventProductType, TypeID const &runProductType, ProductRegistry &productRegistry)
void emplace_back(Args &&...args)
BranchDescription const runProductBranchDescription_
std::string moduleName(Provenance const &provenance)
Definition: Provenance.cc:27
std::string const & moduleLabel() const
ParameterSet fillCommonProcessParameterSet()
void addParameter(std::string const &name, T const &value)
Definition: ParameterSet.h:124
static bool isTagComparedInMerge(const std::string &tag)
const std::vector< Header > & getHeaders() const
Definition: LHERunInfo.h:56
std::string const & moduleName() const
std::string getReleaseVersion()
ProcessHistoryID lheInit(ProcessHistoryRegistry &processHistoryRegistry)
const HEPRUP * getHEPRUP() const
Definition: LHERunInfo.h:51
ParameterSet const commonProcessParameterSet_
HLT enums.
static std::string const triggerPaths
Definition: EdmProvDump.cc:46
ProcessHistoryID id() const
ParameterSet const & registerIt()
std::vector< std::string > vstring
Definition: Schedule.cc:567
BranchDescription const eventProductBranchDescription_
void lheAugment(lhef::LHERunInfo const *runInfo)
void copyProduct(BranchDescription const &productdesc)