CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
ThePEGHadronizer Class Reference
Inheritance diagram for ThePEGHadronizer:
ThePEGInterface gen::BaseHadronizer

Public Member Functions

const char * classname () const
 
bool decay ()
 
bool declareSpecialSettings (const std::vector< std::string >)
 
bool declareStableParticles (const std::vector< int > &pdgIds)
 
void finalizeEvent ()
 
bool generatePartonsAndHadronize ()
 
bool initializeForInternalPartons ()
 
bool readSettings (int)
 
bool residualDecay ()
 
void statistics ()
 
 ThePEGHadronizer (const edm::ParameterSet &params)
 
virtual ~ThePEGHadronizer ()
 
- Public Member Functions inherited from ThePEGInterface
void setPEGRandomEngine (CLHEP::HepRandomEngine *)
 
 ThePEGInterface (const edm::ParameterSet &params)
 
virtual ~ThePEGInterface ()
 
- Public Member Functions inherited from gen::BaseHadronizer
 BaseHadronizer (edm::ParameterSet const &ps)
 
edm::EventgetEDMEvent () const
 
HepMC::GenEvent * getGenEvent ()
 
GenEventInfoProductgetGenEventInfo ()
 
GenRunInfoProductgetGenRunInfo ()
 
const boost::shared_ptr
< lhef::LHERunInfo > & 
getLHERunInfo () const
 
void resetEvent (HepMC::GenEvent *event)
 
void resetEventInfo (GenEventInfoProduct *eventInfo)
 
virtual bool select (HepMC::GenEvent *) const
 
void setEDMEvent (edm::Event &event)
 
void setLHEEvent (lhef::LHEEvent *event)
 
void setLHERunInfo (lhef::LHERunInfo *runInfo)
 
void setRandomEngine (CLHEP::HepRandomEngine *v)
 
std::vector< std::string > const & sharedResources () const
 
 ~BaseHadronizer ()
 

Private Member Functions

virtual void doSetRandomEngine (CLHEP::HepRandomEngine *v) override
 

Private Attributes

unsigned int eventsToPrint
 
ThePEG::EventPtr thepegEvent
 

Additional Inherited Members

- Protected Member Functions inherited from ThePEGInterface
std::string dataFile (const std::string &fileName) const
 
std::string dataFile (const edm::ParameterSet &pset, const std::string &paramName) const
 
void flushRandomNumberGenerator ()
 
void initGenerator ()
 
void initRepository (const edm::ParameterSet &params) const
 
- Protected Member Functions inherited from gen::BaseHadronizer
std::auto_ptr< HepMC::GenEvent > & event ()
 
std::auto_ptr
< GenEventInfoProduct > & 
eventInfo ()
 
lhef::LHEEventlheEvent ()
 
lhef::LHERunInfolheRunInfo ()
 
GenRunInfoProductrunInfo ()
 
- Static Protected Member Functions inherited from ThePEGInterface
static void clearAuxiliary (HepMC::GenEvent *hepmc, HepMC::PdfInfo *pdf)
 
static std::auto_ptr
< HepMC::GenEvent > 
convert (const ThePEG::EventPtr &event)
 
static void fillAuxiliary (HepMC::GenEvent *hepmc, HepMC::PdfInfo *pdf, const ThePEG::EventPtr &event)
 
static double pthat (const ThePEG::EventPtr &event)
 
- Protected Attributes inherited from ThePEGInterface
ThePEG::EGPtr eg_
 
std::auto_ptr
< HepMC::IO_BaseClass > 
iobc_
 

Detailed Description

Definition at line 26 of file ThePEGHadronizer.cc.

Constructor & Destructor Documentation

ThePEGHadronizer::ThePEGHadronizer ( const edm::ParameterSet params)

Definition at line 56 of file ThePEGHadronizer.cc.

References ThePEGInterface::initRepository().

56  :
57  ThePEGInterface(pset),
58  BaseHadronizer(pset),
59  eventsToPrint(pset.getUntrackedParameter<unsigned int>("eventsToPrint", 0))
60 {
61  initRepository(pset);
62 
63 }
unsigned int eventsToPrint
void initRepository(const edm::ParameterSet &params) const
ThePEGInterface(const edm::ParameterSet &params)
BaseHadronizer(edm::ParameterSet const &ps)
ThePEGHadronizer::~ThePEGHadronizer ( )
virtual

Definition at line 65 of file ThePEGHadronizer.cc.

66 {
67 }

Member Function Documentation

const char* ThePEGHadronizer::classname ( ) const
inline

Definition at line 45 of file ThePEGHadronizer.cc.

45 { return "ThePEGHadronizer"; }
bool ThePEGHadronizer::decay ( )

Definition at line 130 of file ThePEGHadronizer.cc.

131 {
132  return true;
133 }
bool ThePEGHadronizer::declareSpecialSettings ( const std::vector< std::string >  )
inline

Definition at line 35 of file ThePEGHadronizer.cc.

35 { return true; }
bool ThePEGHadronizer::declareStableParticles ( const std::vector< int > &  pdgIds)

Definition at line 75 of file ThePEGHadronizer.cc.

76 {
77  return false;
78 }
virtual void ThePEGHadronizer::doSetRandomEngine ( CLHEP::HepRandomEngine *  v)
inlineoverrideprivatevirtual

Reimplemented from gen::BaseHadronizer.

Definition at line 49 of file ThePEGHadronizer.cc.

References ThePEGInterface::setPEGRandomEngine().

void setPEGRandomEngine(CLHEP::HepRandomEngine *)
void ThePEGHadronizer::finalizeEvent ( )

Definition at line 108 of file ThePEGHadronizer.cc.

References ThePEGInterface::clearAuxiliary(), gen::BaseHadronizer::event(), gen::BaseHadronizer::eventInfo(), eventsToPrint, ThePEGInterface::fillAuxiliary(), ThePEGInterface::iobc_, ThePEGInterface::pthat(), and thepegEvent.

109 {
110  HepMC::PdfInfo pdf;
111  clearAuxiliary(event().get(), &pdf);
112  fillAuxiliary(event().get(), &pdf, thepegEvent);
113  event()->set_pdf_info(pdf);
114 
115  eventInfo().reset(new GenEventInfoProduct(event().get()));
116  eventInfo()->setBinningValues(
117  std::vector<double>(1, pthat(thepegEvent)));
118 
119  if (eventsToPrint) {
120  eventsToPrint--;
121  event()->print();
122  }
123 
124  if (iobc_.get())
125  iobc_->write_event(event().get());
126 
127  edm::LogInfo("Generator|ThePEGHadronizer") << "Event produced";
128 }
unsigned int eventsToPrint
static double pthat(const ThePEG::EventPtr &event)
std::auto_ptr< HepMC::GenEvent > & event()
ThePEG::EventPtr thepegEvent
std::auto_ptr< HepMC::IO_BaseClass > iobc_
std::auto_ptr< GenEventInfoProduct > & eventInfo()
static void clearAuxiliary(HepMC::GenEvent *hepmc, HepMC::PdfInfo *pdf)
static void fillAuxiliary(HepMC::GenEvent *hepmc, HepMC::PdfInfo *pdf, const ThePEG::EventPtr &event)
bool ThePEGHadronizer::generatePartonsAndHadronize ( )

Definition at line 87 of file ThePEGHadronizer.cc.

References ThePEGInterface::convert(), ThePEGInterface::eg_, gen::BaseHadronizer::event(), ThePEGInterface::flushRandomNumberGenerator(), and thepegEvent.

88 {
89  edm::LogInfo("Generator|ThePEGHadronizer") << "Start production";
90 
92 
93  thepegEvent = eg_->shoot();
94  if (!thepegEvent) {
95  edm::LogWarning("Generator|ThePEGHadronizer") << "thepegEvent not initialized";
96  return false;
97  }
98 
100  if (!event().get()) {
101  edm::LogWarning("Generator|ThePEGHadronizer") << "genEvent not initialized";
102  return false;
103  }
104 
105  return true;
106 }
std::auto_ptr< HepMC::GenEvent > & event()
void flushRandomNumberGenerator()
ThePEG::EventPtr thepegEvent
ThePEG::EGPtr eg_
static std::auto_ptr< HepMC::GenEvent > convert(const ThePEG::EventPtr &event)
bool ThePEGHadronizer::initializeForInternalPartons ( )

Definition at line 69 of file ThePEGHadronizer.cc.

References ThePEGInterface::initGenerator().

70 {
71  initGenerator();
72  return true;
73 }
bool ThePEGHadronizer::readSettings ( int  )
inline

Definition at line 31 of file ThePEGHadronizer.cc.

31 { return true; }
bool ThePEGHadronizer::residualDecay ( )

Definition at line 135 of file ThePEGHadronizer.cc.

136 {
137  return true;
138 }
void ThePEGHadronizer::statistics ( )

Definition at line 80 of file ThePEGHadronizer.cc.

References ThePEGInterface::eg_, gen::BaseHadronizer::runInfo(), and GenRunInfoProduct::setInternalXSec().

81 {
83  eg_->integratedXSec() / ThePEG::picobarn,
84  eg_->integratedXSecErr() / ThePEG::picobarn));
85 }
void setInternalXSec(const XSec &xsec)
GenRunInfoProduct & runInfo()
ThePEG::EGPtr eg_

Member Data Documentation

unsigned int ThePEGHadronizer::eventsToPrint
private

Definition at line 51 of file ThePEGHadronizer.cc.

Referenced by finalizeEvent().

ThePEG::EventPtr ThePEGHadronizer::thepegEvent
private

Definition at line 53 of file ThePEGHadronizer.cc.

Referenced by finalizeEvent(), and generatePartonsAndHadronize().