test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
LHEProvenanceHelper.cc
Go to the documentation of this file.
1 #include <string>
2 #include <vector>
5 
10 
12 
16 
17 namespace edm {
18  LHEProvenanceHelper::LHEProvenanceHelper(TypeID const& eventProductType, TypeID const& runProductType, ProductRegistry& productRegistry)
19  : eventProductBranchDescription_(BranchDescription(
20  InEvent
21  , "source"
22  , "LHEFile"
23  // , "LHE"
24  , "LHEEventProduct"
25  , "LHEEventProduct"
26  , ""
27  , "LHESource"
28  , ParameterSetID()
29  , TypeWithDict(eventProductType.typeInfo())
30  , false))
31  , runProductBranchDescription_(BranchDescription(
32  InRun
33  , "source"
34  , "LHEFile"
35  // , "LHE"
36  , "LHERunInfoProduct"
37  , "LHERunInfoProduct"
38  , ""
39  , "LHESource"
40  , ParameterSetID()
41  , TypeWithDict(runProductType.typeInfo())
42  , false))
43  , eventProductProvenance_(eventProductBranchDescription_.branchID())
44  , commonProcessParameterSet_(fillCommonProcessParameterSet())
45  , processParameterSet_() {
46 
47  // Add the products to the product registry
50  }
51 
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 
90  void
93  if(runInfo == nullptr) 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()) {
106  if(!LHERunInfoProduct::isTagComparedInMerge(header.tag())) {
107  continue;
108  }
109  processParameterSet_.addParameter<vstring>(header.tag(), header.lines());
110  }
111  }
112 
115  // Now we register the process parameter set.
117  //std::cerr << processParameterSet_.dump() << std::endl;
118 
119  // Insert an entry for this process in the process history registry
120  ProcessHistory ph;
122  processHistoryRegistry.registerProcessHistory(ph);
123 
124  // Save the process history ID for use every event.
125  return ph.id();
126  }
127 
128 }
std::string getPassID()
Definition: GetPassID.h:8
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:144
static bool isTagComparedInMerge(const std::string &tag)
const std::vector< Header > & getHeaders() const
Definition: LHERunInfo.h:58
std::string const & moduleName() const
std::string getReleaseVersion()
ProcessHistoryID lheInit(ProcessHistoryRegistry &processHistoryRegistry)
const HEPRUP * getHEPRUP() const
Definition: LHERunInfo.h:52
ParameterSet const commonProcessParameterSet_
volatile std::atomic< bool > shutdown_flag false
static std::string const triggerPaths
Definition: EdmProvDump.cc:42
ProcessHistoryID id() const
ParameterSet const & registerIt()
std::vector< std::string > vstring
Definition: Schedule.cc:358
BranchDescription const eventProductBranchDescription_
void lheAugment(lhef::LHERunInfo const *runInfo)
void copyProduct(BranchDescription const &productdesc)