11 #include <CepGen/Core/Exception.h> 12 #include <CepGen/Core/RunParameters.h> 13 #include <CepGen/Event/Event.h> 14 #include <CepGen/EventFilter/EventExporter.h> 15 #include <CepGen/EventFilter/EventModifier.h> 16 #include <CepGen/Generator.h> 17 #include <CepGen/Modules/EventExporterFactory.h> 18 #include <CepGen/Modules/EventModifierFactory.h> 19 #include <CepGen/Modules/ProcessFactory.h> 20 #include <CepGen/Process/Process.h> 21 #include <CepGenAddOns/HepMC2Wrapper/HepMC2EventInterface.h> 37 edm::LogInfo(
"CepGenEventGenerator") <<
"Event modifier modules: " << modif_mods <<
".";
38 for (
const auto&
mod : modif_mods.keys())
41 const auto output_mods =
43 edm::LogInfo(
"CepGenEventGenerator") <<
"Output modules: " << output_mods <<
".";
44 for (
const auto&
mod : output_mods.keys())
55 pproc +=
proc_params_.get<cepgen::ParametersList>(
"processParameters");
56 pproc.erase(
"processParameters");
57 auto& pkin = pproc.operator[]<cepgen::ParametersList>(
"kinematics");
58 pkin += pproc.get<cepgen::ParametersList>(
"inKinematics");
59 pproc.erase(
"inKinematics");
60 pkin += pproc.get<cepgen::ParametersList>(
"outKinematics");
61 pproc.erase(
"outKinematics");
62 if (pproc.has<
unsigned long long>(
"mode"))
63 pkin.set<
int>(
"mode", pproc.get<
unsigned long long>(
"mode"));
67 if (!
gen_->runParameters().hasProcess())
68 throw cms::Exception(
"CepGenEventGenerator") <<
"Failed to retrieve a process from the configuration";
71 for (
const auto&
cfg :
mod.second.get<std::vector<std::string> >(
"preConfiguration"))
72 modifier->readString(
cfg);
73 for (
const auto&
cfg :
mod.second.get<std::vector<std::string> >(
"processConfiguration"))
74 modifier->readString(
cfg);
80 edm::LogInfo(
"CepGenEventGenerator") <<
"Run parameters:\n" <<
gen_->runParameters();
81 const auto xsec =
gen_->computeXsection();
82 xsec_.set_cross_section(xsec, xsec.uncertainty());
88 event().reset(
new HepMC::CepGenEvent(
gen_->next()));
90 event()->weights().push_back(1.);
void setInternalXSec(const XSec &xsec)
T getUntrackedParameter(std::string const &, T const &) const
GenRunInfoProduct & runInfo()
bool initializeForInternalPartons()
virtual ~CepGenEventGenerator()
HepMC::GenCrossSection xsec_
bool generatePartonsAndHadronize()
std::vector< std::pair< std::string, cepgen::ParametersList > > modif_modules_
std::unique_ptr< HepMC::GenEvent > & event()
std::vector< std::pair< std::string, cepgen::ParametersList > > output_modules_
Log< level::Info, false > LogInfo
const cepgen::ParametersList proc_params_
ParametersList fromParameterSet(const edm::ParameterSet &iConfig)
CepGenEventGenerator(const edm::ParameterSet &, edm::ConsumesCollector &&)
T mod(const T &a, const T &b)