CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
edm::LHEProvenanceHelper Struct Reference

#include <LHEProvenanceHelper.h>

Public Member Functions

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

Public Attributes

ParameterSet const commonProcessParameterSet_
 
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,
ProductRegistry productRegistry 
)
explicit

Definition at line 18 of file LHEProvenanceHelper.cc.

References edm::ProductRegistry::copyProduct(), eventProductBranchDescription_, and runProductBranchDescription_.

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))
46 
47  // Add the products to the product registry
48  productRegistry.copyProduct(eventProductBranchDescription_);
49  productRegistry.copyProduct(runProductBranchDescription_);
50  }
BranchDescription const runProductBranchDescription_
ParameterSet fillCommonProcessParameterSet()
BranchID const & branchID() const
Hash< ParameterSetType > ParameterSetID
ParameterSet const commonProcessParameterSet_
ProductProvenance eventProductProvenance_
BranchDescription const eventProductBranchDescription_

Member Function Documentation

ParameterSet edm::LHEProvenanceHelper::fillCommonProcessParameterSet ( )

Definition at line 53 of file LHEProvenanceHelper.cc.

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

53  {
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  }
std::string const & processName() const
std::string moduleName(Provenance const &provenance)
Definition: Provenance.cc:27
std::string const & moduleLabel() const
std::string const & moduleName() const
static std::string const triggerPaths
Definition: EdmProvDump.cc:42
std::vector< std::string > vstring
Definition: Schedule.cc:430
BranchDescription const eventProductBranchDescription_
void edm::LHEProvenanceHelper::lheAugment ( lhef::LHERunInfo const *  runInfo)

Definition at line 91 of file LHEProvenanceHelper.cc.

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

Referenced by LHESource::LHESource(), and LHESource::nextEvent().

91  {
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()) {
107  continue;
108  }
109  processParameterSet_.addParameter<vstring>(header.tag(), header.lines());
110  }
111  }
void addParameter(std::string const &name, T const &value)
Definition: ParameterSet.h:144
static bool isTagComparedInMerge(const std::string &tag)
ParameterSet const commonProcessParameterSet_
std::vector< std::string > vstring
Definition: Schedule.cc:430
ProcessHistoryID edm::LHEProvenanceHelper::lheInit ( ProcessHistoryRegistry processHistoryRegistry)

Definition at line 114 of file LHEProvenanceHelper.cc.

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

Referenced by LHESource::LHESource(), and LHESource::nextEvent().

114  {
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  }
std::string getPassID()
Definition: GetPassID.h:8
ParameterSetID id() const
std::string const & processName() const
std::string getReleaseVersion()
ParameterSet const & registerIt()
BranchDescription const eventProductBranchDescription_

Member Data Documentation

ParameterSet const edm::LHEProvenanceHelper::commonProcessParameterSet_

Definition at line 27 of file LHEProvenanceHelper.h.

Referenced by lheAugment().

BranchDescription const edm::LHEProvenanceHelper::eventProductBranchDescription_
ProductProvenance edm::LHEProvenanceHelper::eventProductProvenance_

Definition at line 26 of file LHEProvenanceHelper.h.

Referenced by LHESource::readEvent_().

ParameterSet edm::LHEProvenanceHelper::processParameterSet_

Definition at line 28 of file LHEProvenanceHelper.h.

Referenced by lheAugment(), and lheInit().

BranchDescription const edm::LHEProvenanceHelper::runProductBranchDescription_