#include <Hadronisation.h>
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 ¶ms) | |
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 ¶ms) |
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< LHEEvent > | rawEvent |
sigc::signal< void > | sigBeforeHadronisation |
sigc::signal< void > | sigInit |
sigc::signal< bool, const boost::shared_ptr < HepMC::GenEvent > & > | sigShower |
Definition at line 21 of file Hadronisation.h.
typedef edmplugin::PluginFactory<Hadronisation*( const edm::ParameterSet &)> lhef::Hadronisation::Factory |
Definition at line 49 of file Hadronisation.h.
lhef::Hadronisation::Hadronisation | ( | const edm::ParameterSet & | params | ) |
Definition at line 37 of file Hadronisation.cc.
: psRequested(false), psAsHepMC(true) { }
lhef::Hadronisation::~Hadronisation | ( | ) | [virtual] |
Definition at line 43 of file Hadronisation.cc.
{ }
std::set< std::string > lhef::Hadronisation::capabilities | ( | ) | const [virtual] |
Definition at line 69 of file Hadronisation.cc.
Referenced by matchingCapabilities().
{
return std::set<std::string>();
}
void lhef::Hadronisation::clear | ( | void | ) |
Definition at line 65 of file Hadronisation.cc.
{ }
std::auto_ptr< Hadronisation > lhef::Hadronisation::create | ( | const edm::ParameterSet & | params | ) | [static] |
Definition at line 95 of file Hadronisation.cc.
References reco::get(), edm::ParameterSet::getParameter(), AlCaRecoCosmics_cfg::name, and python::pfTaus_cff::plugin.
Referenced by lhef::ThePEGHadronisation::ThePEGHadronisation().
{ std::string name = params.getParameter<std::string>("generator"); if (name == "None") return std::auto_ptr<Hadronisation>( new NoHadronisation(params)); std::auto_ptr<Hadronisation> plugin( Factory::get()->create(name + "Hadronisation", params)); if (!plugin.get()) throw cms::Exception("InvalidGenerator") << "Unknown MC generator \"" << name << "\"" " specified for hadronisation in LHEProducer." << std::endl; edm::LogInfo("Generator|LHEInterface") << "Using " << name << " to hadronize LHE input." << std::endl; return plugin; }
virtual std::auto_ptr<HepMC::GenEvent> lhef::Hadronisation::doHadronisation | ( | ) | [protected, pure virtual] |
Implemented in lhef::Pythia8Hadronisation, and lhef::ThePEGHadronisation.
Referenced by hadronize().
virtual void lhef::Hadronisation::doInit | ( | ) | [protected, pure virtual] |
Implemented in 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(), and lhef::ThePEGHadronisation::doHadronisation().
{ 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().
{ std::auto_ptr<HepMC::GenEvent> event = this->doHadronisation(); if (!event.get()) return event; const HepMC::GenVertex *signalVertex = event->signal_process_vertex(); if (!signalVertex) { signalVertex = LHEEvent::findSignalVertex(event.get()); event->set_signal_process_vertex( const_cast<HepMC::GenVertex*>(signalVertex)); } return event; }
void lhef::Hadronisation::init | ( | void | ) |
void lhef::Hadronisation::matchingCapabilities | ( | const std::set< std::string > & | capabilities | ) | [virtual] |
Definition at line 74 of file Hadronisation.cc.
References capabilities(), psAsHepMC, and psRequested.
{ psRequested = false; psAsHepMC = false; for(std::set<std::string>::const_iterator iter = capabilities.begin(); iter != capabilities.end(); ++iter) { if (*iter == "hepmc") psAsHepMC = true; else if (*iter == "psFinalState") psRequested = true; else if (*iter == "matchSummary") /* nothing */; else if (!this->capabilities().count(*iter)) throw cms::Exception("Generator|LHEInterface") << "JetMatching expected capability \"" << *iter << "\", but hadronizer does not " "support it." << std::endl; } }
void lhef::Hadronisation::newRunInfo | ( | const boost::shared_ptr< LHERunInfo > & | runInfo | ) | [protected, virtual] |
Reimplemented in lhef::Pythia8Hadronisation, and lhef::ThePEGHadronisation.
Definition at line 135 of file Hadronisation.cc.
Referenced by setEvent().
{ }
sigc::signal<void>& lhef::Hadronisation::onBeforeHadronisation | ( | ) | [inline] |
Definition at line 42 of file Hadronisation.h.
References sigBeforeHadronisation.
{ return sigBeforeHadronisation; }
sigc::signal<void>& lhef::Hadronisation::onInit | ( | ) | [inline] |
sigc::signal<bool, const boost::shared_ptr<HepMC::GenEvent>&>& lhef::Hadronisation::onShoweredEvent | ( | ) | [inline] |
bool lhef::Hadronisation::setEvent | ( | const boost::shared_ptr< LHEEvent > & | event | ) |
Definition at line 52 of file Hadronisation.cc.
References event(), newRunInfo(), and rawEvent.
{ bool newRunInfo = !rawEvent || (rawEvent->getRunInfo() != event->getRunInfo() && *rawEvent->getRunInfo() != *event->getRunInfo()); rawEvent = event; if (newRunInfo) { this->newRunInfo(event->getRunInfo()); return true; } else return false; }
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.
{ if (event.get()) { const HepMC::GenVertex *signalVertex = event->signal_process_vertex(); if (!signalVertex) { signalVertex = LHEEvent::findSignalVertex(event.get(), false); event->set_signal_process_vertex( const_cast<HepMC::GenVertex*>(signalVertex)); } } return sigShower.emit(event); }
virtual void lhef::Hadronisation::statistics | ( | ) | [inline, virtual] |
Definition at line 30 of file Hadronisation.h.
{}
virtual double lhef::Hadronisation::totalBranchingRatio | ( | int | pdgId | ) | const [inline, virtual] |
Definition at line 31 of file Hadronisation.h.
Referenced by lhef::BranchingRatios::get().
{ return 1.0; }
bool lhef::Hadronisation::wantsShoweredEvent | ( | ) | const [inline, protected] |
Definition at line 52 of file Hadronisation.h.
References psRequested, and sigShower.
{ return psRequested && !sigShower.empty(); }
bool lhef::Hadronisation::wantsShoweredEventAsHepMC | ( | ) | const [inline, protected] |
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().