00001 #include "TauAnalysis/MCEmbeddingTools/interface/ParticleReplacerFactory.h" 00002 #include "TauAnalysis/MCEmbeddingTools/interface/ParticleReplacerClass.h" 00003 #include "TauAnalysis/MCEmbeddingTools/interface/ParticleReplacerParticleGun.h" 00004 00005 boost::shared_ptr<ParticleReplacerBase> ParticleReplacerFactory::create(const std::string& algo, const edm::ParameterSet& iConfig) { 00006 bool verbose = iConfig.getParameter<bool>("verbose"); 00007 if(algo == "ZTauTau") 00008 return boost::shared_ptr<ParticleReplacerBase>(new ParticleReplacerClass(iConfig.getParameter<edm::ParameterSet>("ZTauTau"), verbose)); 00009 else if(algo == "ParticleGun") 00010 return boost::shared_ptr<ParticleReplacerBase>(new ParticleReplacerParticleGun(iConfig.getParameter<edm::ParameterSet>("ParticleGun"), verbose)); 00011 else 00012 throw cms::Exception("Configuration") << "Unknown particle replacer algorithm " << algo 00013 << ". Supported algorithms: 'ZTauTau', 'ParticleGun'." << std::endl; 00014 }