Go to the documentation of this file.00001 #include "RecoLocalTracker/SiStripClusterizer/interface/StripClusterizerAlgorithmFactory.h"
00002
00003 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00004 #include "RecoLocalTracker/SiStripClusterizer/interface/StripClusterizerAlgorithm.h"
00005 #include "RecoLocalTracker/SiStripClusterizer/interface/ThreeThresholdAlgorithm.h"
00006 #include "RecoLocalTracker/SiStripClusterizer/interface/OldThreeThresholdAlgorithm.h"
00007
00008 std::auto_ptr<StripClusterizerAlgorithm> StripClusterizerAlgorithmFactory::
00009 create(const edm::ParameterSet& conf) {
00010 std::string algorithm = conf.getParameter<std::string>("Algorithm");
00011
00012 if(algorithm == "ThreeThresholdAlgorithm") {
00013 return std::auto_ptr<StripClusterizerAlgorithm>(
00014 new ThreeThresholdAlgorithm(
00015 conf.getParameter<double>("ChannelThreshold"),
00016 conf.getParameter<double>("SeedThreshold"),
00017 conf.getParameter<double>("ClusterThreshold"),
00018 conf.getParameter<unsigned>("MaxSequentialHoles"),
00019 conf.getParameter<unsigned>("MaxSequentialBad"),
00020 conf.getParameter<unsigned>("MaxAdjacentBad"),
00021 conf.getParameter<std::string>("QualityLabel") ));
00022 }
00023
00024 if(algorithm == "OldThreeThresholdAlgorithm") {
00025 return std::auto_ptr<StripClusterizerAlgorithm>(
00026 new OldThreeThresholdAlgorithm(
00027 conf.getParameter<double>("ChannelThreshold"),
00028 conf.getParameter<double>("SeedThreshold"),
00029 conf.getParameter<double>("ClusterThreshold"),
00030 conf.getParameter<unsigned>("MaxSequentialHoles"),
00031 conf.getParameter<std::string>("QualityLabel") ));
00032 }
00033
00034 throw cms::Exception("[StripClusterizerAlgorithmFactory] Unregistered Algorithm")
00035 << algorithm << " is not a registered StripClusterizerAlgorithm";
00036 }