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)
 
 LHEProvenanceHelper (TypeID const &eventProductType, TypeID const &runProductType)
 

Public Attributes

ConstBranchDescription eventProductBranchDescription_
 
ProductProvenance eventProductProvenance_
 
ParameterSet processParameterSet_
 
ConstBranchDescription runProductBranchDescription_
 

Detailed Description

Definition at line 16 of file LHEProvenanceHelper.h.

Constructor & Destructor Documentation

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

Definition at line 20 of file LHEProvenanceHelper.cc.

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

21  : eventProductBranchDescription_(BranchDescription(
22  InEvent
23  , "source"
24  , "LHEFile"
25  // , "LHE"
26  , "LHEEventProduct"
27  , "LHEEventProduct"
28  , ""
29  , "LHESource"
30  , ParameterSetID()
31  , TypeWithDict(eventProductType.typeInfo())
32  , false))
33  , runProductBranchDescription_(BranchDescription(
34  InRun
35  , "source"
36  , "LHEFile"
37  // , "LHE"
38  , "LHERunInfoProduct"
39  , "LHERunInfoProduct"
40  , ""
41  , "LHESource"
42  , ParameterSetID()
43  , TypeWithDict(runProductType.typeInfo())
44  , false))
47 
48  // Now we create a process parameter set for the "LHC" process.
49  // We don't currently use the untracked parameters, However, we make them available, just in case.
53  typedef std::vector<std::string> vstring;
54  vstring empty;
55 
56  vstring modlbl;
57  modlbl.reserve(1);
58  modlbl.push_back(moduleLabel);
59  processParameterSet_.addParameter("@all_sources", modlbl);
60 
61  ParameterSet triggerPaths;
62  triggerPaths.addParameter<vstring>("@trigger_paths", empty);
63  processParameterSet_.addParameter<ParameterSet>("@trigger_paths", triggerPaths);
64 
65  ParameterSet pseudoInput;
66  pseudoInput.addParameter<std::string>("@module_edm_type", "Source");
67  pseudoInput.addParameter<std::string>("@module_label", moduleLabel);
68  pseudoInput.addParameter<std::string>("@module_type", moduleName);
69  processParameterSet_.addParameter<ParameterSet>(moduleLabel, pseudoInput);
70 
71  processParameterSet_.addParameter<vstring>("@all_esmodules", empty);
72  processParameterSet_.addParameter<vstring>("@all_esprefers", empty);
73  processParameterSet_.addParameter<vstring>("@all_essources", empty);
74  processParameterSet_.addParameter<vstring>("@all_loopers", empty);
75  processParameterSet_.addParameter<vstring>("@all_modules", empty);
76  processParameterSet_.addParameter<vstring>("@end_paths", empty);
77  processParameterSet_.addParameter<vstring>("@paths", empty);
78  processParameterSet_.addParameter<std::string>("@process_name", processName);
79  }
std::string const & processName() const
std::vector< std::string > vstring
Definition: Schedule.cc:277
std::string const & moduleName() const
void addParameter(std::string const &name, T const &value)
Definition: ParameterSet.h:145
BranchID const & branchID() const
Hash< ParameterSetType > ParameterSetID
ConstBranchDescription eventProductBranchDescription_
ProductProvenance eventProductProvenance_
ConstBranchDescription runProductBranchDescription_
std::string const & moduleLabel() const

Member Function Documentation

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

Definition at line 82 of file LHEProvenanceHelper.cc.

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

Referenced by LHESource::LHESource().

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

Definition at line 104 of file LHEProvenanceHelper.cc.

References edm::ProductRegistry::copyProduct(), edm::ProcessHistory::data(), edm::ProcessHistory::emplace_back(), eventProductBranchDescription_, edm::getPassID(), edm::getReleaseVersion(), edm::ParameterSet::id(), edm::ProcessHistory::id(), edm::detail::ThreadSafeRegistry< KEY, T, E >::insertMapped(), edm::detail::ThreadSafeRegistry< KEY, T, E >::instance(), edm::ConstBranchDescription::me(), edm::ConstBranchDescription::processName(), processParameterSet_, edm::ParameterSet::registerIt(), and runProductBranchDescription_.

Referenced by LHESource::LHESource().

104  {
105  // Now we register the process parameter set.
107  //std::cerr << processParameterSet_.dump() << std::endl;
108  // Now we need to set all the metadata
109  // Add the products to the product registry
110  productRegistry.copyProduct(eventProductBranchDescription_.me());
111  productRegistry.copyProduct(runProductBranchDescription_.me());
112 
113  // Insert an entry for this process in the process history registry
114  ProcessHistory ph;
116  ProcessConfiguration const& pc = ph.data().back();
118 
119  // Insert an entry for this process in the process configuration registry
121 
122  // Save the process history ID for use every event.
123  return ph.id();
124  }
std::string const & processName() const
std::string getPassID()
Definition: GetPassID.h:8
BranchDescription const & me() const
ParameterSetID id() const
static ThreadSafeRegistry * instance()
bool insertMapped(value_type const &v)
std::string getReleaseVersion()
ConstBranchDescription eventProductBranchDescription_
ParameterSet const & registerIt()
ConstBranchDescription runProductBranchDescription_

Member Data Documentation

ConstBranchDescription edm::LHEProvenanceHelper::eventProductBranchDescription_

Definition at line 20 of file LHEProvenanceHelper.h.

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

ProductProvenance edm::LHEProvenanceHelper::eventProductProvenance_

Definition at line 22 of file LHEProvenanceHelper.h.

Referenced by LHESource::readEvent_().

ParameterSet edm::LHEProvenanceHelper::processParameterSet_

Definition at line 23 of file LHEProvenanceHelper.h.

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

ConstBranchDescription edm::LHEProvenanceHelper::runProductBranchDescription_

Definition at line 21 of file LHEProvenanceHelper.h.

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