CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ParticleReplacerFactory.cc
Go to the documentation of this file.
4 
5 boost::shared_ptr<ParticleReplacerBase> ParticleReplacerFactory::create(const std::string& algo, const edm::ParameterSet& iConfig) {
6  bool verbose = iConfig.getParameter<bool>("verbose");
7  if(algo == "ZTauTau")
8  return boost::shared_ptr<ParticleReplacerBase>(new ParticleReplacerClass(iConfig.getParameter<edm::ParameterSet>("ZTauTau"), verbose));
9  else if(algo == "ParticleGun")
10  return boost::shared_ptr<ParticleReplacerBase>(new ParticleReplacerParticleGun(iConfig.getParameter<edm::ParameterSet>("ParticleGun"), verbose));
11  else
12  throw cms::Exception("Configuration") << "Unknown particle replacer algorithm " << algo
13  << ". Supported algorithms: 'ZTauTau', 'ParticleGun'." << std::endl;
14 }
T getParameter(std::string const &) const
static boost::shared_ptr< ParticleReplacerBase > create(const std::string &algo, const edm::ParameterSet &iConfig)
LimitAlgo * algo
Definition: Combine.cc:60