#include <TauAnalysis/MCEmbeddingTools/src/ParticleReplacerFactory.cc>
Static Public Member Functions | |
static boost::shared_ptr < ParticleReplacerBase > | create (const std::string &algo, const edm::ParameterSet &iConfig) |
Description: Factory class for creating particle replacer algorithm objects
Implementation: <Notes on="" implementation>="">
Definition at line 28 of file ParticleReplacerFactory.h.
boost::shared_ptr< ParticleReplacerBase > ParticleReplacerFactory::create | ( | const std::string & | algo, |
const edm::ParameterSet & | iConfig | ||
) | [static] |
Definition at line 5 of file ParticleReplacerFactory.cc.
References Exception, and edm::ParameterSet::getParameter().
{ bool verbose = iConfig.getParameter<bool>("verbose"); if(algo == "ZTauTau") return boost::shared_ptr<ParticleReplacerBase>(new ParticleReplacerClass(iConfig.getParameter<edm::ParameterSet>("ZTauTau"), verbose)); else if(algo == "ParticleGun") return boost::shared_ptr<ParticleReplacerBase>(new ParticleReplacerParticleGun(iConfig.getParameter<edm::ParameterSet>("ParticleGun"), verbose)); else throw cms::Exception("Configuration") << "Unknown particle replacer algorithm " << algo << ". Supported algorithms: 'ZTauTau', 'ParticleGun'." << std::endl; }