CMS 3D CMS Logo

Static Public Member Functions

StripClusterizerAlgorithmFactory Class Reference

#include <StripClusterizerAlgorithmFactory.h>

List of all members.

Static Public Member Functions

static std::auto_ptr
< StripClusterizerAlgorithm
create (const edm::ParameterSet &)

Detailed Description

Definition at line 8 of file StripClusterizerAlgorithmFactory.h.


Member Function Documentation

std::auto_ptr< StripClusterizerAlgorithm > StripClusterizerAlgorithmFactory::create ( const edm::ParameterSet conf) [static]

Definition at line 9 of file StripClusterizerAlgorithmFactory.cc.

References algorithm(), Exception, edm::ParameterSet::exists(), and edm::ParameterSet::getParameter().

                                    {
  std::string algorithm = conf.getParameter<std::string>("Algorithm");

  bool setDetId=false;
  if (conf.exists("setDetId"))
    setDetId = conf.getParameter<bool>("setDetId");
  if(algorithm == "ThreeThresholdAlgorithm") {
    return std::auto_ptr<StripClusterizerAlgorithm>(
           new ThreeThresholdAlgorithm(
               conf.getParameter<double>("ChannelThreshold"),
               conf.getParameter<double>("SeedThreshold"),
               conf.getParameter<double>("ClusterThreshold"),
               conf.getParameter<unsigned>("MaxSequentialHoles"),
               conf.getParameter<unsigned>("MaxSequentialBad"),
               conf.getParameter<unsigned>("MaxAdjacentBad"),
               conf.getParameter<std::string>("QualityLabel"),
               setDetId,
               conf.getParameter<bool>("RemoveApvShots")));
  }

  if(algorithm == "OldThreeThresholdAlgorithm") {
    return std::auto_ptr<StripClusterizerAlgorithm>(
           new OldThreeThresholdAlgorithm(
               conf.getParameter<double>("ChannelThreshold"),
               conf.getParameter<double>("SeedThreshold"),
               conf.getParameter<double>("ClusterThreshold"),
               conf.getParameter<unsigned>("MaxSequentialHoles"),
               conf.getParameter<std::string>("QualityLabel"),
               setDetId));
  }

  throw cms::Exception("[StripClusterizerAlgorithmFactory] Unregistered Algorithm")
    << algorithm << " is not a registered StripClusterizerAlgorithm";
}