CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/src/TauAnalysis/MCEmbeddingTools/src/ParticleReplacerFactory.cc

Go to the documentation of this file.
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 }