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  vx_trkw_graph_(vertex_.getParameter<edm::FileInPath>("TrackWeightGraph")),
33  vx_pattrec_graph_(vertex_.getParameter<edm::FileInPath>("PatternRecGraph")),
34  // Debug printout
35  debug_(iConfig.getParameter<unsigned int>("debug")) {
37  const auto algoMapIt = algoNameMap.find(algoName);
38  if (algoMapIt != algoNameMap.end())
39  vx_algo_ = algoMapIt->second;
40  else {
41  std::ostringstream validAlgoNames;
42  for (auto it = algoNameMap.begin(); it != algoNameMap.end(); it++) {
43  validAlgoNames << '"' << it->first << '"';
44  if (it != (--algoNameMap.end()))
45  validAlgoNames << ", ";
46  }
47  throw cms::Exception("Invalid algo name '" + algoName +
48  "' specified for L1T vertex producer. Valid algo names are: " + validAlgoNames.str());
49  }
50 
51  const auto algoPrecisionMapIt = algoPrecisionMap.find(vx_algo_);
52  if (algoPrecisionMapIt != algoPrecisionMap.end()) {
53  vx_precision_ = algoPrecisionMapIt->second;
54  } else {
55  throw cms::Exception("Unknown precision {Simulation, Emulation} for algo name " + algoName);
56  }
57  }
58 
59  const std::map<std::string, Algorithm> AlgoSettings::algoNameMap = {
60  {"fastHisto", Algorithm::fastHisto},
61  {"fastHistoEmulation", Algorithm::fastHistoEmulation},
62  {"fastHistoLooseAssociation", Algorithm::fastHistoLooseAssociation},
63  {"GapClustering", Algorithm::GapClustering},
64  {"agglomerative", Algorithm::agglomerativeHierarchical},
65  {"DBSCAN", Algorithm::DBSCAN},
66  {"PVR", Algorithm::PVR},
67  {"adaptive", Algorithm::adaptiveVertexReconstruction},
68  {"HPV", Algorithm::HPV},
69  {"K-means", Algorithm::Kmeans},
70  {"NNEmulation", Algorithm::NNEmulation}};
71 
72  const std::map<Algorithm, Precision> AlgoSettings::algoPrecisionMap = {
73  {Algorithm::fastHisto, Precision::Simulation},
74  {Algorithm::fastHistoEmulation, Precision::Emulation},
75  {Algorithm::fastHistoLooseAssociation, Precision::Simulation},
76  {Algorithm::GapClustering, Precision::Simulation},
77  {Algorithm::agglomerativeHierarchical, Precision::Simulation},
78  {Algorithm::DBSCAN, Precision::Simulation},
79  {Algorithm::PVR, Precision::Simulation},
80  {Algorithm::adaptiveVertexReconstruction, Precision::Simulation},
81  {Algorithm::HPV, Precision::Simulation},
82  {Algorithm::Kmeans, Precision::Simulation},
83  {Algorithm::NNEmulation, Precision::Emulation}};
84 
85 } // 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.
static const std::map< std::string, Algorithm > algoNameMap
Definition: AlgoSettings.h:99