CMS 3D CMS Logo

StripClusterizerAlgorithmFactory.cc
Go to the documentation of this file.
2 
8 
9 std::unique_ptr<StripClusterizerAlgorithm> StripClusterizerAlgorithmFactory::create(edm::ConsumesCollector&& iC,
10  const edm::ParameterSet& conf) {
11  std::string algorithm = conf.getParameter<std::string>("Algorithm");
12 
13  if (algorithm == "ThreeThresholdAlgorithm") {
14  return std::unique_ptr<StripClusterizerAlgorithm>(new ThreeThresholdAlgorithm(
16  edm::ESInputTag{"", conf.getParameter<std::string>("ConditionsLabel")}),
17  conf.getParameter<double>("ChannelThreshold"),
18  conf.getParameter<double>("SeedThreshold"),
19  conf.getParameter<double>("ClusterThreshold"),
20  conf.getParameter<unsigned>("MaxSequentialHoles"),
21  conf.getParameter<unsigned>("MaxSequentialBad"),
22  conf.getParameter<unsigned>("MaxAdjacentBad"),
23  // existsAs test should be removed once MaxClusterSize is in the HLT config
24  conf.existsAs<unsigned>("MaxClusterSize") ? conf.getParameter<unsigned>("MaxClusterSize") : 3U * 256U,
25  conf.getParameter<bool>("RemoveApvShots"),
26  clusterChargeCut(conf)));
27  }
28 
29  if (algorithm == "OldThreeThresholdAlgorithm") {
30  throw cms::Exception("[StripClusterizerAlgorithmFactory] obsolete") << algorithm << " Obsolete since 7_3_0";
31  }
32 
33  throw cms::Exception("[StripClusterizerAlgorithmFactory] Unregistered Algorithm")
34  << algorithm << " is not a registered StripClusterizerAlgorithm";
35 }
36 
38  clusterizer.add<std::string>("Algorithm", "ThreeThresholdAlgorithm");
39  clusterizer.add<std::string>("ConditionsLabel", "");
40  clusterizer.add("ChannelThreshold", 2.0);
41  clusterizer.add("SeedThreshold", 3.0);
42  clusterizer.add("ClusterThreshold", 5.0);
43  clusterizer.add("MaxSequentialHoles", 0U);
44  clusterizer.add("MaxSequentialBad", 1U);
45  clusterizer.add("MaxAdjacentBad", 0U);
46  clusterizer.addOptional("MaxClusterSize", 3U * 256U); // eventually should be add()
47  clusterizer.add("RemoveApvShots", true);
48  clusterizer.add("setDetId", true);
49  clusterizer.add("clusterChargeCut", getConfigurationDescription4CCC(CCC::kNone));
50 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::ParameterSetDescription getConfigurationDescription4CCC(const CCC::OP &op)
float clusterChargeCut(const edm::ParameterSet &conf, const char *name="clusterChargeCut")
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:171
static std::unique_ptr< StripClusterizerAlgorithm > create(edm::ConsumesCollector &&, const edm::ParameterSet &)
static void fillDescriptions(edm::ParameterSetDescription &clusterizer)