CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Static Public Member Functions
ParticleReplacerFactory Class Reference

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

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 edm::hlt::Exception, and edm::ParameterSet::getParameter().

5  {
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
LimitAlgo * algo
Definition: Combine.cc:60