CMS 3D CMS Logo

lhef::Hadronisation Class Reference

#include <GeneratorInterface/LHEInterface/interface/Hadronisation.h>

Inheritance diagram for lhef::Hadronisation:

lhef::Herwig6Hadronisation lhef::Pythia6Hadronisation lhef::Pythia8Hadronisation lhef::ThePEGHadronisation

List of all members.

Public Types

typedef
edmplugin::PluginFactory
< Hadronisation *(const
edm::ParameterSet &)> 
Factory

Public Member Functions

virtual std::set< std::string > capabilities () const
void clear ()
 Hadronisation (const edm::ParameterSet &params)
std::auto_ptr< HepMC::GenEvent > hadronize ()
void init ()
virtual void matchingCapabilities (const std::set< std::string > &capabilities)
sigc::signal< void > & onBeforeHadronisation ()
sigc::signal< void > & onInit ()
sigc::signal< bool, const
boost::shared_ptr
< HepMC::GenEvent > & > & 
onShoweredEvent ()
bool setEvent (const boost::shared_ptr< LHEEvent > &event)
virtual void statistics ()
virtual double totalBranchingRatio (int pdgId) const
virtual ~Hadronisation ()

Static Public Member Functions

static std::auto_ptr
< Hadronisation
create (const edm::ParameterSet &params)

Protected Member Functions

virtual std::auto_ptr
< HepMC::GenEvent > 
doHadronisation ()=0
virtual void doInit ()=0
const boost::shared_ptr
< LHEEvent > & 
getRawEvent () const
virtual void newRunInfo (const boost::shared_ptr< LHERunInfo > &runInfo)
bool showeredEvent (const boost::shared_ptr< HepMC::GenEvent > &event)
bool wantsShoweredEvent () const
bool wantsShoweredEventAsHepMC () const

Private Attributes

bool psAsHepMC
bool psRequested
boost::shared_ptr< LHEEventrawEvent
sigc::signal< voidsigBeforeHadronisation
sigc::signal< voidsigInit
sigc::signal< bool, const
boost::shared_ptr
< HepMC::GenEvent > & > 
sigShower


Detailed Description

Definition at line 21 of file Hadronisation.h.


Member Typedef Documentation

typedef edmplugin::PluginFactory<Hadronisation*( const edm::ParameterSet &)> lhef::Hadronisation::Factory

Definition at line 49 of file Hadronisation.h.


Constructor & Destructor Documentation

lhef::Hadronisation::Hadronisation ( const edm::ParameterSet params  ) 

Definition at line 37 of file Hadronisation.cc.

00037                                                           :
00038         psRequested(false),
00039         psAsHepMC(true)
00040 {
00041 }

lhef::Hadronisation::~Hadronisation (  )  [virtual]

Definition at line 43 of file Hadronisation.cc.

00044 {
00045 }


Member Function Documentation

std::set< std::string > lhef::Hadronisation::capabilities (  )  const [virtual]

Reimplemented in lhef::Herwig6Hadronisation, and lhef::Pythia6Hadronisation.

Definition at line 69 of file Hadronisation.cc.

00070 {
00071         return std::set<std::string>();
00072 }

void lhef::Hadronisation::clear ( void   ) 

Reimplemented in lhef::Herwig6Hadronisation.

Definition at line 65 of file Hadronisation.cc.

00066 {
00067 }

std::auto_ptr< Hadronisation > lhef::Hadronisation::create ( const edm::ParameterSet params  )  [static]

Definition at line 95 of file Hadronisation.cc.

References lat::endl(), DBSPlugin::get(), edm::ParameterSet::getParameter(), name, and plugin.

00097 {
00098         std::string name = params.getParameter<std::string>("generator");
00099 
00100         if (name == "None")
00101                 return std::auto_ptr<Hadronisation>(
00102                                         new NoHadronisation(params));
00103 
00104         std::auto_ptr<Hadronisation> plugin(
00105                 Factory::get()->create(name + "Hadronisation", params));
00106 
00107         if (!plugin.get())
00108                 throw cms::Exception("InvalidGenerator")
00109                         << "Unknown MC generator \"" << name << "\""
00110                            " specified for hadronisation in LHEProducer."
00111                         << std::endl;
00112 
00113         edm::LogInfo("Generator|LHEInterface")
00114                 << "Using " << name << " to hadronize LHE input." << std::endl;
00115 
00116         return plugin;
00117 }

virtual std::auto_ptr<HepMC::GenEvent> lhef::Hadronisation::doHadronisation (  )  [protected, pure virtual]

Implemented in lhef::Herwig6Hadronisation, lhef::Pythia6Hadronisation, lhef::Pythia8Hadronisation, and lhef::ThePEGHadronisation.

Referenced by hadronize().

virtual void lhef::Hadronisation::doInit (  )  [protected, pure virtual]

Implemented in lhef::Herwig6Hadronisation, lhef::Pythia6Hadronisation, lhef::Pythia8Hadronisation, and lhef::ThePEGHadronisation.

Referenced by init().

const boost::shared_ptr<LHEEvent>& lhef::Hadronisation::getRawEvent (  )  const [inline, protected]

Definition at line 59 of file Hadronisation.h.

References rawEvent.

Referenced by lhef::Pythia8Hadronisation::doHadronisation(), lhef::Pythia6Hadronisation::doHadronisation(), lhef::ThePEGHadronisation::doHadronisation(), lhef::Herwig6Hadronisation::doHadronisation(), lhef::Herwig6Hadronisation::fillEvent(), lhef::Pythia6Hadronisation::fillEvent(), lhef::Herwig6Hadronisation::fillHeader(), and lhef::Pythia6Hadronisation::fillHeader().

00060         { return rawEvent; }

std::auto_ptr< HepMC::GenEvent > lhef::Hadronisation::hadronize (  ) 

Definition at line 119 of file Hadronisation.cc.

References doHadronisation(), event(), and lhef::LHEEvent::findSignalVertex().

00120 {
00121         std::auto_ptr<HepMC::GenEvent> event = this->doHadronisation();
00122         if (!event.get())
00123                 return event;
00124 
00125         const HepMC::GenVertex *signalVertex = event->signal_process_vertex();
00126         if (!signalVertex) {
00127                 signalVertex = LHEEvent::findSignalVertex(event.get());
00128                 event->set_signal_process_vertex(
00129                         const_cast<HepMC::GenVertex*>(signalVertex));
00130         }
00131 
00132         return event;
00133 }

void lhef::Hadronisation::init ( void   ) 

Definition at line 47 of file Hadronisation.cc.

References doInit().

00048 {
00049         doInit();
00050 }

void lhef::Hadronisation::matchingCapabilities ( const std::set< std::string > &  capabilities  )  [virtual]

Definition at line 74 of file Hadronisation.cc.

References lat::endl(), iter, psAsHepMC, and psRequested.

00076 {
00077         psRequested = false;
00078         psAsHepMC = false;
00079         for(std::set<std::string>::const_iterator iter = capabilities.begin();
00080             iter != capabilities.end(); ++iter) {
00081                 if (*iter == "hepmc")
00082                         psAsHepMC = true;
00083                 else if (*iter == "psFinalState")
00084                         psRequested = true;
00085                 else if (*iter == "matchSummary")
00086                         /* nothing */;
00087                 else if (!this->capabilities().count(*iter))
00088                         throw cms::Exception("Generator|LHEInterface")
00089                                 << "JetMatching expected capability \""
00090                                 << *iter << "\", but hadronizer does not "
00091                                    "support it." << std::endl;
00092         }
00093 }

void lhef::Hadronisation::newRunInfo ( const boost::shared_ptr< LHERunInfo > &  runInfo  )  [protected, virtual]

Reimplemented in lhef::Herwig6Hadronisation, lhef::Pythia6Hadronisation, lhef::Pythia8Hadronisation, and lhef::ThePEGHadronisation.

Definition at line 135 of file Hadronisation.cc.

Referenced by setEvent().

00136 {
00137 }

sigc::signal<void>& lhef::Hadronisation::onBeforeHadronisation (  )  [inline]

Definition at line 42 of file Hadronisation.h.

References sigBeforeHadronisation.

Referenced by lhef::Herwig6Hadronisation::fillEvent(), lhef::Pythia6Hadronisation::fillEvent(), and lhef::Pythia8Hadronisation::LHAupLesHouches::setEvent().

00043         { return sigBeforeHadronisation; }

sigc::signal<void>& lhef::Hadronisation::onInit (  )  [inline]

Definition at line 41 of file Hadronisation.h.

References sigInit.

Referenced by lhef::Herwig6Hadronisation::fillHeader(), lhef::Pythia6Hadronisation::fillHeader(), and lhef::Pythia8Hadronisation::LHAupLesHouches::setInit().

00041 { return sigInit; }

sigc::signal<bool, const boost::shared_ptr<HepMC::GenEvent>&>& lhef::Hadronisation::onShoweredEvent (  )  [inline]

Definition at line 40 of file Hadronisation.h.

References sigShower.

00040 { return sigShower; }

bool lhef::Hadronisation::setEvent ( const boost::shared_ptr< LHEEvent > &  event  ) 

Definition at line 52 of file Hadronisation.cc.

References newRunInfo(), and rawEvent.

00053 {
00054         bool newRunInfo = !rawEvent ||
00055                           (rawEvent->getRunInfo() != event->getRunInfo() &&
00056                            *rawEvent->getRunInfo() != *event->getRunInfo());
00057         rawEvent = event;
00058         if (newRunInfo) {
00059                 this->newRunInfo(event->getRunInfo());
00060                 return true;
00061         } else
00062                 return false;
00063 }

bool lhef::Hadronisation::showeredEvent ( const boost::shared_ptr< HepMC::GenEvent > &  event  )  [protected]

Definition at line 139 of file Hadronisation.cc.

References lhef::LHEEvent::findSignalVertex(), and sigShower.

Referenced by lhef::Herwig6Hadronisation::doHadronisation(), and lhef::Pythia6Hadronisation::veto().

00141 {
00142         if (event.get()) {
00143                 const HepMC::GenVertex *signalVertex =
00144                                         event->signal_process_vertex();
00145                 if (!signalVertex) {
00146                         signalVertex = LHEEvent::findSignalVertex(event.get(), false);
00147                         event->set_signal_process_vertex(
00148                                 const_cast<HepMC::GenVertex*>(signalVertex));
00149                 }
00150         }
00151 
00152         return sigShower.emit(event);
00153 }

virtual void lhef::Hadronisation::statistics (  )  [inline, virtual]

Reimplemented in lhef::Pythia6Hadronisation.

Definition at line 30 of file Hadronisation.h.

00030 {}

virtual double lhef::Hadronisation::totalBranchingRatio ( int  pdgId  )  const [inline, virtual]

Reimplemented in lhef::Pythia6Hadronisation.

Definition at line 31 of file Hadronisation.h.

Referenced by lhef::BranchingRatios::get().

00031 { return 1.0; }

bool lhef::Hadronisation::wantsShoweredEvent (  )  const [inline, protected]

Definition at line 52 of file Hadronisation.h.

References psRequested, and sigShower.

Referenced by lhef::Herwig6Hadronisation::doHadronisation(), lhef::Herwig6Hadronisation::doInit(), and lhef::Pythia6Hadronisation::doInit().

00053         { return psRequested && !sigShower.empty(); }

bool lhef::Hadronisation::wantsShoweredEventAsHepMC (  )  const [inline, protected]

Definition at line 54 of file Hadronisation.h.

References psAsHepMC.

Referenced by lhef::Herwig6Hadronisation::doHadronisation(), and lhef::Pythia6Hadronisation::veto().

00055         { return psAsHepMC; }


Member Data Documentation

bool lhef::Hadronisation::psAsHepMC [private]

Definition at line 71 of file Hadronisation.h.

Referenced by matchingCapabilities(), and wantsShoweredEventAsHepMC().

bool lhef::Hadronisation::psRequested [private]

Definition at line 70 of file Hadronisation.h.

Referenced by matchingCapabilities(), and wantsShoweredEvent().

boost::shared_ptr<LHEEvent> lhef::Hadronisation::rawEvent [private]

Definition at line 72 of file Hadronisation.h.

Referenced by getRawEvent(), and setEvent().

sigc::signal<void> lhef::Hadronisation::sigBeforeHadronisation [private]

Definition at line 69 of file Hadronisation.h.

Referenced by onBeforeHadronisation().

sigc::signal<void> lhef::Hadronisation::sigInit [private]

Definition at line 68 of file Hadronisation.h.

Referenced by onInit().

sigc::signal<bool, const boost::shared_ptr<HepMC::GenEvent>&> lhef::Hadronisation::sigShower [private]

Definition at line 67 of file Hadronisation.h.

Referenced by onShoweredEvent(), showeredEvent(), and wantsShoweredEvent().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:48:46 2009 for CMSSW by  doxygen 1.5.4