CMS 3D CMS Logo

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_DoQualityCuts_(vertex_.getParameter<bool>("EM_DoQualityCuts")),
16  vx_DoPtComp_(vertex_.getParameter<bool>("FH_DoPtComp")),
17  vx_DoTightChi2_(vertex_.getParameter<bool>("FH_DoTightChi2")),
18  vx_histogram_parameters_(vertex_.getParameter<std::vector<double> >("FH_HistogramParameters")),
19  vx_nvtx_(vertex_.getParameter<unsigned int>("FH_NVtx")),
20  vx_width_(vertex_.getParameter<double>("FH_VertexWidth")),
21  vx_windowSize_(vertex_.getParameter<unsigned int>("FH_WindowSize")),
22  vx_TrackMinPt_(vertex_.getParameter<double>("VxMinTrackPt")),
23  vx_TrackMaxPt_(vertex_.getParameter<double>("VxMaxTrackPt")),
24  vx_TrackMaxPtBehavior_(vertex_.getParameter<int>("VxMaxTrackPtBehavior")),
25  vx_TrackMaxChi2_(vertex_.getParameter<double>("VxMaxTrackChi2")),
26  vx_NStubMin_(vertex_.getParameter<unsigned int>("VxMinNStub")),
27  vx_NStubPSMin_(vertex_.getParameter<unsigned int>("VxMinNStubPS")),
28  vx_dbscan_pt_(vertex_.getParameter<double>("DBSCANPtThreshold")),
29  vx_dbscan_mintracks_(vertex_.getParameter<unsigned int>("DBSCANMinDensityTracks")),
30  vx_kmeans_iterations_(vertex_.getParameter<unsigned int>("KmeansIterations")),
31  vx_kmeans_nclusters_(vertex_.getParameter<unsigned int>("KmeansNumClusters")),
32  // Debug printout
33  debug_(iConfig.getParameter<unsigned int>("debug")) {
35  const auto algoMapIt = algoNameMap.find(algoName);
36  if (algoMapIt != algoNameMap.end())
37  vx_algo_ = algoMapIt->second;
38  else {
39  std::ostringstream validAlgoNames;
40  for (auto it = algoNameMap.begin(); it != algoNameMap.end(); it++) {
41  validAlgoNames << '"' << it->first << '"';
42  if (it != (--algoNameMap.end()))
43  validAlgoNames << ", ";
44  }
45  throw cms::Exception("Invalid algo name '" + algoName +
46  "' specified for L1T vertex producer. Valid algo names are: " + validAlgoNames.str());
47  }
48 
49  const auto algoPrecisionMapIt = algoPrecisionMap.find(vx_algo_);
50  if (algoPrecisionMapIt != algoPrecisionMap.end()) {
51  vx_precision_ = algoPrecisionMapIt->second;
52  } else {
53  throw cms::Exception("Unknown precision {Simulation, Emulation} for algo name " + algoName);
54  }
55  }
56 
57  const std::map<std::string, Algorithm> AlgoSettings::algoNameMap = {
58  {"fastHisto", Algorithm::fastHisto},
59  {"fastHistoEmulation", Algorithm::fastHistoEmulation},
60  {"fastHistoLooseAssociation", Algorithm::fastHistoLooseAssociation},
61  {"GapClustering", Algorithm::GapClustering},
62  {"agglomerative", Algorithm::agglomerativeHierarchical},
63  {"DBSCAN", Algorithm::DBSCAN},
64  {"PVR", Algorithm::PVR},
65  {"adaptive", Algorithm::adaptiveVertexReconstruction},
66  {"HPV", Algorithm::HPV},
67  {"K-means", Algorithm::Kmeans}};
68 
69  const std::map<Algorithm, Precision> AlgoSettings::algoPrecisionMap = {
70  {Algorithm::fastHisto, Precision::Simulation},
71  {Algorithm::fastHistoEmulation, Precision::Emulation},
72  {Algorithm::fastHistoLooseAssociation, Precision::Simulation},
73  {Algorithm::GapClustering, Precision::Simulation},
74  {Algorithm::agglomerativeHierarchical, Precision::Simulation},
75  {Algorithm::DBSCAN, Precision::Simulation},
76  {Algorithm::PVR, Precision::Simulation},
77  {Algorithm::adaptiveVertexReconstruction, Precision::Simulation},
78  {Algorithm::HPV, Precision::Simulation},
79  {Algorithm::Kmeans, Precision::Simulation}};
80 
81 } // end namespace l1tVertexFinder
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
for(int i=first, nt=offsets[nh];i< nt;i+=gridDim.x *blockDim.x)
AlgoSettings(const edm::ParameterSet &iConfig)
=== Get configuration parameters
Definition: AlgoSettings.cc:7
HLT enums.
edm::ParameterSet vertex_
Definition: AlgoSettings.h:94
static const std::map< std::string, Algorithm > algoNameMap
Definition: AlgoSettings.h:90