4 #include <HepMC/GenEvent.h>
5 #include <HepMC/IO_BaseClass.h>
7 #include <ThePEG/Repository/Repository.h>
8 #include <ThePEG/EventRecord/Event.h>
9 #include <ThePEG/Config/ThePEG.h>
10 #include <ThePEG/LesHouches/LesHouchesReader.h>
27 class HepRandomEngine;
49 const char *
classname()
const {
return "ThePEGHadronizer"; }
59 boost::shared_ptr<lhef::LHEProxy>
proxy_;
66 eventsToPrint(pset.getUntrackedParameter<unsigned int>(
"eventsToPrint", 0)),
67 handlerDirectory_(pset.getParameter<std::
string>(
"eventHandlers"))
87 std::ostringstream
ss;
90 std::ostringstream logstream;
92 "/LHEReader:ProxyID " + ss.str(), logstream);
93 edm::LogInfo(
"Generator|LHEInterface") << logstream.str();
109 eg_->integratedXSec() / ThePEG::picobarn,
110 eg_->integratedXSecErr() / ThePEG::picobarn));
115 edm::LogInfo(
"Generator|ThePEGHadronizer") <<
"Start production";
122 edm::LogWarning(
"Generator|ThePEGHadronizer") <<
"EGPtr::shoot() thrown an exception, event skipped: " << exc.what();
125 edm::LogWarning(
"Generator|ThePEGHadronizer") <<
"EGPtr::shoot() thrown an unknown exception, event skipped";
130 edm::LogWarning(
"Generator|ThePEGHadronizer") <<
"thepegEvent not initialized";
135 if (!
event().
get()) {
136 edm::LogWarning(
"Generator|ThePEGHadronizer") <<
"genEvent not initialized";
145 edm::LogInfo(
"Generator|ThePEGHadronizer") <<
"Start production";
153 double mergeweight = 1.0;
158 edm::LogWarning(
"Generator|ThePEGHadronizer") <<
"EGPtr::shoot() thrown an exception, event skipped: " << exc.what();
162 edm::LogWarning(
"Generator|ThePEGHadronizer") <<
"EGPtr::shoot() thrown an unknown exception, event skipped";
168 edm::LogWarning(
"Generator|ThePEGHadronizer") <<
"thepegEvent not initialized";
174 if (!
event().
get()) {
175 edm::LogWarning(
"Generator|ThePEGHadronizer") <<
"genEvent not initialized";
187 event()->set_pdf_info(pdf);
202 event()->set_pdf_info(pdf);
216 edm::LogInfo(
"Generator|ThePEGHadronizer") <<
"Event produced";
unsigned int eventsToPrint
void initRepository(const edm::ParameterSet ¶ms) const
edm::HadronizerFilter< ThePEGHadronizer, gen::ExternalDecayDriver > ThePEGHadronizerFilter
#define DEFINE_FWK_MODULE(type)
void count(LHERunInfo::CountMode count, double weight=1.0, double matchWeight=1.0)
const std::string handlerDirectory_
static double pthat(const ThePEG::EventPtr &event)
void setInternalXSec(const XSec &xsec)
const HEPEUP * getHEPEUP() const
std::auto_ptr< HepMC::GenEvent > & event()
bool declareStableParticles(const std::vector< int > &pdgIds)
GenRunInfoProduct & runInfo()
bool initializeForInternalPartons()
lhef::LHEEvent * lheEvent()
edm::GeneratorFilter< ThePEGHadronizer, gen::ExternalDecayDriver > ThePEGGeneratorFilter
void fillPdfInfo(HepMC::PdfInfo *info) const
void flushRandomNumberGenerator()
ThePEG::EventPtr thepegEvent
std::auto_ptr< HepMC::IO_BaseClass > iobc_
static std::auto_ptr< HepMC::GenEvent > convert(const ThePEG::EventPtr &event)
bool generatePartonsAndHadronize()
std::auto_ptr< GenEventInfoProduct > & eventInfo()
ThePEGHadronizer(const edm::ParameterSet ¶ms)
virtual ~ThePEGHadronizer()
bool initializeForExternalPartons()
virtual void doSetRandomEngine(CLHEP::HepRandomEngine *v) override
boost::shared_ptr< lhef::LHEProxy > proxy_
const char * classname() const
bool declareSpecialSettings(const std::vector< std::string >)
void setPEGRandomEngine(CLHEP::HepRandomEngine *)
const boost::shared_ptr< lhef::LHERunInfo > & getLHERunInfo() const
static void clearAuxiliary(HepMC::GenEvent *hepmc, HepMC::PdfInfo *pdf)
static boost::shared_ptr< LHEProxy > create()
static void fillAuxiliary(HepMC::GenEvent *hepmc, HepMC::PdfInfo *pdf, const ThePEG::EventPtr &event)