CMS 3D CMS Logo

Static Public Member Functions

ParticleReplacerFactory Class Reference

#include <TauAnalysis/MCEmbeddingTools/src/ParticleReplacerFactory.cc>

List of all members.

Static Public Member Functions

static boost::shared_ptr
< ParticleReplacerBase
create (const std::string &algo, const edm::ParameterSet &iConfig)

Detailed Description

Description: Factory class for creating particle replacer algorithm objects

Implementation: <Notes on="" implementation>="">

Definition at line 28 of file ParticleReplacerFactory.h.


Member Function Documentation

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;
}