CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes
edm::LHEProvenanceHelper Struct Reference

#include <LHEProvenanceHelper.h>

Public Member Functions

void lheAugment (lhef::LHERunInfo const *runInfo)
 
ProcessHistoryID lheInit (ProductRegistry &productRegistry, ProcessHistoryRegistry &processHistoryRegistry)
 
 LHEProvenanceHelper (TypeID const &eventProductType, TypeID const &runProductType)
 

Public Attributes

BranchDescription const eventProductBranchDescription_
 
ProductProvenance eventProductProvenance_
 
ParameterSet processParameterSet_
 
BranchDescription const runProductBranchDescription_
 

Detailed Description

Definition at line 17 of file LHEProvenanceHelper.h.

Constructor & Destructor Documentation

edm::LHEProvenanceHelper::LHEProvenanceHelper ( TypeID const &  eventProductType,
TypeID const &  runProductType 
)
explicit

Definition at line 18 of file LHEProvenanceHelper.cc.

References edm::ParameterSet::addParameter(), relativeConstraints::empty, eventProductBranchDescription_, edm::BranchDescription::moduleLabel(), edm::moduleName(), edm::BranchDescription::moduleName(), edm::BranchDescription::processName(), processParameterSet_, AlCaHLTBitMon_QueryRunRegistry::string, and triggerPaths.

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))
45 
46  // Now we create a process parameter set for the "LHC" process.
47  // We don't currently use the untracked parameters, However, we make them available, just in case.
51  typedef std::vector<std::string> vstring;
52  vstring empty;
53 
54  vstring modlbl;
55  modlbl.reserve(1);
56  modlbl.push_back(moduleLabel);
57  processParameterSet_.addParameter("@all_sources", modlbl);
58 
60  triggerPaths.addParameter<vstring>("@trigger_paths", empty);
62 
63  ParameterSet pseudoInput;
64  pseudoInput.addParameter<std::string>("@module_edm_type", "Source");
65  pseudoInput.addParameter<std::string>("@module_label", moduleLabel);
66  pseudoInput.addParameter<std::string>("@module_type", moduleName);
67  processParameterSet_.addParameter<ParameterSet>(moduleLabel, pseudoInput);
68 
69  processParameterSet_.addParameter<vstring>("@all_esmodules", empty);
70  processParameterSet_.addParameter<vstring>("@all_esprefers", empty);
71  processParameterSet_.addParameter<vstring>("@all_essources", empty);
72  processParameterSet_.addParameter<vstring>("@all_loopers", empty);
73  processParameterSet_.addParameter<vstring>("@all_modules", empty);
74  processParameterSet_.addParameter<vstring>("@end_paths", empty);
75  processParameterSet_.addParameter<vstring>("@paths", empty);
76  processParameterSet_.addParameter<std::string>("@process_name", processName);
77  }
std::string const & processName() const
BranchDescription const runProductBranchDescription_
std::string moduleName(Provenance const &provenance)
Definition: Provenance.cc:27
std::string const & moduleLabel() const
void addParameter(std::string const &name, T const &value)
Definition: ParameterSet.h:142
BranchID const & branchID() const
Hash< ParameterSetType > ParameterSetID
std::string const & moduleName() const
ProductProvenance eventProductProvenance_
static std::string const triggerPaths
Definition: EdmProvDump.cc:42
std::vector< std::string > vstring
Definition: Schedule.cc:347
BranchDescription const eventProductBranchDescription_

Member Function Documentation

void edm::LHEProvenanceHelper::lheAugment ( lhef::LHERunInfo const *  runInfo)

Definition at line 80 of file LHEProvenanceHelper.cc.

References edm::ParameterSet::addParameter(), lhef::LHERunInfo::getHeaders(), lhef::LHERunInfo::getHEPRUP(), LHERunInfoProduct::isTagComparedInMerge(), and processParameterSet_.

Referenced by LHESource::LHESource().

80  {
81  if(runInfo == nullptr) return;
82  typedef std::vector<std::string> vstring;
83  auto const& heprup = *runInfo->getHEPRUP();
84  processParameterSet_.addParameter<int>("IDBMUP1", heprup.IDBMUP.first);
85  processParameterSet_.addParameter<int>("IDBMUP2", heprup.IDBMUP.second);
86  processParameterSet_.addParameter<int>("EBMUP1", heprup.EBMUP.first);
87  processParameterSet_.addParameter<int>("EBMUP2", heprup.EBMUP.second);
88  processParameterSet_.addParameter<int>("PDFGUP1", heprup.PDFGUP.first);
89  processParameterSet_.addParameter<int>("PDFGUP2", heprup.PDFGUP.second);
90  processParameterSet_.addParameter<int>("PDFSUP1", heprup.PDFSUP.first);
91  processParameterSet_.addParameter<int>("PDFSUP2", heprup.PDFSUP.second);
92  processParameterSet_.addParameter<int>("IDWTUP", heprup.IDWTUP);
93  for(auto const& header : runInfo->getHeaders()) {
94  if(!LHERunInfoProduct::isTagComparedInMerge(header.tag())) {
95  continue;
96  }
97  processParameterSet_.addParameter<vstring>(header.tag(), header.lines());
98  }
99  }
void addParameter(std::string const &name, T const &value)
Definition: ParameterSet.h:142
static bool isTagComparedInMerge(const std::string &tag)
std::vector< std::string > vstring
Definition: Schedule.cc:347
ProcessHistoryID edm::LHEProvenanceHelper::lheInit ( ProductRegistry productRegistry,
ProcessHistoryRegistry processHistoryRegistry 
)

Definition at line 102 of file LHEProvenanceHelper.cc.

References edm::ProductRegistry::copyProduct(), edm::ProcessHistory::emplace_back(), eventProductBranchDescription_, edm::getPassID(), edm::getReleaseVersion(), edm::ParameterSet::id(), edm::ProcessHistory::id(), edm::BranchDescription::processName(), processParameterSet_, edm::ParameterSet::registerIt(), edm::ProcessHistoryRegistry::registerProcessHistory(), and runProductBranchDescription_.

Referenced by LHESource::LHESource().

102  {
103  // Now we register the process parameter set.
105  //std::cerr << processParameterSet_.dump() << std::endl;
106  // Now we need to set all the metadata
107  // Add the products to the product registry
108  productRegistry.copyProduct(eventProductBranchDescription_);
109  productRegistry.copyProduct(runProductBranchDescription_);
110 
111  // Insert an entry for this process in the process history registry
112  ProcessHistory ph;
114  processHistoryRegistry.registerProcessHistory(ph);
115 
116  // Save the process history ID for use every event.
117  return ph.id();
118  }
std::string getPassID()
Definition: GetPassID.h:8
ParameterSetID id() const
std::string const & processName() const
BranchDescription const runProductBranchDescription_
std::string getReleaseVersion()
ParameterSet const & registerIt()
BranchDescription const eventProductBranchDescription_

Member Data Documentation

BranchDescription const edm::LHEProvenanceHelper::eventProductBranchDescription_

Definition at line 21 of file LHEProvenanceHelper.h.

Referenced by lheInit(), LHEProvenanceHelper(), and LHESource::readEvent_().

ProductProvenance edm::LHEProvenanceHelper::eventProductProvenance_

Definition at line 23 of file LHEProvenanceHelper.h.

Referenced by LHESource::readEvent_().

ParameterSet edm::LHEProvenanceHelper::processParameterSet_

Definition at line 24 of file LHEProvenanceHelper.h.

Referenced by lheAugment(), lheInit(), and LHEProvenanceHelper().

BranchDescription const edm::LHEProvenanceHelper::runProductBranchDescription_

Definition at line 22 of file LHEProvenanceHelper.h.

Referenced by LHESource::beginRun(), LHESource::endRun(), and lheInit().