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 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
 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 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 22 of file ThePEGHadronizer.cc.

Constructor & Destructor Documentation

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

Definition at line 49 of file ThePEGHadronizer.cc.

References ThePEGInterface::initRepository().

49  :
50  ThePEGInterface(pset),
51  BaseHadronizer(pset),
52  eventsToPrint(pset.getUntrackedParameter<unsigned int>("eventsToPrint", 0))
53 {
54  initRepository(pset);
55 
56 }
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 58 of file ThePEGHadronizer.cc.

59 {
60 }

Member Function Documentation

const char* ThePEGHadronizer::classname ( ) const
inline

Definition at line 41 of file ThePEGHadronizer.cc.

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

Definition at line 123 of file ThePEGHadronizer.cc.

124 {
125  return true;
126 }
bool ThePEGHadronizer::declareSpecialSettings ( const std::vector< std::string >  )
inline

Definition at line 31 of file ThePEGHadronizer.cc.

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

Definition at line 68 of file ThePEGHadronizer.cc.

69 {
70  return false;
71 }
void ThePEGHadronizer::finalizeEvent ( )

Definition at line 101 of file ThePEGHadronizer.cc.

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

102 {
103  HepMC::PdfInfo pdf;
104  clearAuxiliary(event().get(), &pdf);
105  fillAuxiliary(event().get(), &pdf, thepegEvent);
106  event()->set_pdf_info(pdf);
107 
108  eventInfo().reset(new GenEventInfoProduct(event().get()));
109  eventInfo()->setBinningValues(
110  std::vector<double>(1, pthat(thepegEvent)));
111 
112  if (eventsToPrint) {
113  eventsToPrint--;
114  event()->print();
115  }
116 
117  if (iobc_.get())
118  iobc_->write_event(event().get());
119 
120  edm::LogInfo("Generator|ThePEGHadronizer") << "Event produced";
121 }
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 80 of file ThePEGHadronizer.cc.

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

81 {
82  edm::LogInfo("Generator|ThePEGHadronizer") << "Start production";
83 
85 
86  thepegEvent = eg_->shoot();
87  if (!thepegEvent) {
88  edm::LogWarning("Generator|ThePEGHadronizer") << "thepegEvent not initialized";
89  return false;
90  }
91 
93  if (!event().get()) {
94  edm::LogWarning("Generator|ThePEGHadronizer") << "genEvent not initialized";
95  return false;
96  }
97 
98  return true;
99 }
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 62 of file ThePEGHadronizer.cc.

References ThePEGInterface::initGenerator().

63 {
64  initGenerator();
65  return true;
66 }
bool ThePEGHadronizer::readSettings ( int  )
inline

Definition at line 27 of file ThePEGHadronizer.cc.

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

Definition at line 128 of file ThePEGHadronizer.cc.

129 {
130  return true;
131 }
void ThePEGHadronizer::statistics ( )

Definition at line 73 of file ThePEGHadronizer.cc.

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

74 {
76  eg_->integratedXSec() / ThePEG::picobarn,
77  eg_->integratedXSecErr() / ThePEG::picobarn));
78 }
void setInternalXSec(const XSec &xsec)
GenRunInfoProduct & runInfo()
ThePEG::EGPtr eg_

Member Data Documentation

unsigned int ThePEGHadronizer::eventsToPrint
private

Definition at line 44 of file ThePEGHadronizer.cc.

Referenced by finalizeEvent().

ThePEG::EventPtr ThePEGHadronizer::thepegEvent
private

Definition at line 46 of file ThePEGHadronizer.cc.

Referenced by finalizeEvent(), and generatePartonsAndHadronize().