CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
AlgoSettings.cc
Go to the documentation of this file.
2 
3 namespace l1tVertexFinder {
4 
6 
8  : vertex_(iConfig.getParameter<edm::ParameterSet>("VertexReconstruction")),
9  vx_distance_(vertex_.getParameter<double>("VertexDistance")),
10  vx_resolution_(vertex_.getParameter<double>("VertexResolution")),
11  vx_distanceType_(vertex_.getParameter<unsigned int>("DistanceType")),
12  vx_minTracks_(vertex_.getParameter<unsigned int>("MinTracks")),
13  vx_weightedmean_(vertex_.getParameter<unsigned int>("WeightedMean")),
14  vx_chi2cut_(vertex_.getParameter<double>("AVR_chi2cut")),
15  vx_DoPtComp_(vertex_.getParameter<bool>("FH_DoPtComp")),
16  vx_DoTightChi2_(vertex_.getParameter<bool>("FH_DoTightChi2")),
17  vx_histogram_parameters_(vertex_.getParameter<std::vector<double> >("FH_HistogramParameters")),
18  vx_nvtx_(vertex_.getParameter<unsigned int>("FH_NVtx")),
19  vx_width_(vertex_.getParameter<double>("FH_VertexWidth")),
20  vx_windowSize_(vertex_.getParameter<unsigned int>("FH_WindowSize")),
21  vx_TrackMinPt_(vertex_.getParameter<double>("VxMinTrackPt")),
22  vx_TrackMaxPt_(vertex_.getParameter<double>("VxMaxTrackPt")),
23  vx_TrackMaxPtBehavior_(vertex_.getParameter<int>("VxMaxTrackPtBehavior")),
24  vx_TrackMaxChi2_(vertex_.getParameter<double>("VxMaxTrackChi2")),
25  vx_NStubMin_(vertex_.getParameter<unsigned int>("VxMinNStub")),
26  vx_NStubPSMin_(vertex_.getParameter<unsigned int>("VxMinNStubPS")),
27  vx_dbscan_pt_(vertex_.getParameter<double>("DBSCANPtThreshold")),
28  vx_dbscan_mintracks_(vertex_.getParameter<unsigned int>("DBSCANMinDensityTracks")),
29  vx_kmeans_iterations_(vertex_.getParameter<unsigned int>("KmeansIterations")),
30  vx_kmeans_nclusters_(vertex_.getParameter<unsigned int>("KmeansNumClusters")),
31  // Debug printout
32  debug_(iConfig.getParameter<unsigned int>("debug")) {
33  const std::string algoName(vertex_.getParameter<std::string>("Algorithm"));
34  const auto algoMapIt = algoNameMap.find(algoName);
35  if (algoMapIt != algoNameMap.end())
36  vx_algo_ = algoMapIt->second;
37  else {
38  std::ostringstream validAlgoNames;
39  for (auto it = algoNameMap.begin(); it != algoNameMap.end(); it++) {
40  validAlgoNames << '"' << it->first << '"';
41  if (it != (--algoNameMap.end()))
42  validAlgoNames << ", ";
43  }
44  throw cms::Exception("Invalid algo name '" + algoName +
45  "' specified for L1T vertex producer. Valid algo names are: " + validAlgoNames.str());
46  }
47  }
48 
49  const std::map<std::string, Algorithm> AlgoSettings::algoNameMap = {
50  {"FastHisto", Algorithm::FastHisto},
51  {"FastHistoLooseAssociation", Algorithm::FastHistoLooseAssociation},
52  {"GapClustering", Algorithm::GapClustering},
53  {"Agglomerative", Algorithm::AgglomerativeHierarchical},
54  {"DBSCAN", Algorithm::DBSCAN},
55  {"PVR", Algorithm::PVR},
56  {"Adaptive", Algorithm::AdaptiveVertexReconstruction},
57  {"HPV", Algorithm::HPV},
58  {"K-means", Algorithm::Kmeans}};
59 
60 } // end namespace l1tVertexFinder
AlgoSettings(const edm::ParameterSet &iConfig)
=== Get configuration parameters
Definition: AlgoSettings.cc:7
for(Iditer=Id.begin();Iditer!=Id.end();Iditer++)
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::ParameterSet vertex_
Definition: AlgoSettings.h:87
static const std::map< std::string, Algorithm > algoNameMap
Definition: AlgoSettings.h:84