Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 11:14:06

0001 #ifndef __L1Trigger_VertexFinder_AlgoSettings_h__
0002 #define __L1Trigger_VertexFinder_AlgoSettings_h__
0003 
0004 #include <vector>
0005 #include <string>
0006 
0007 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0008 #include "FWCore/Utilities/interface/Exception.h"
0009 
0010 namespace l1tVertexFinder {
0011 
0012   enum class Algorithm {
0013     fastHisto,
0014     fastHistoEmulation,
0015     fastHistoLooseAssociation,
0016     GapClustering,
0017     agglomerativeHierarchical,
0018     DBSCAN,
0019     PVR,
0020     adaptiveVertexReconstruction,
0021     HPV,
0022     Kmeans
0023   };
0024 
0025   enum class Precision { Simulation, Emulation };
0026 
0027   class AlgoSettings {
0028   public:
0029     AlgoSettings(const edm::ParameterSet& iConfig);
0030     ~AlgoSettings() {}
0031 
0032     //=== Vertex Reconstruction configuration
0033     // Vertex Reconstruction algo
0034     Algorithm vx_algo() const { return vx_algo_; }
0035     Precision vx_precision() const { return vx_precision_; }
0036     // For agglomerative cluster algorithm, select a definition of distance between clusters
0037     unsigned int vx_distanceType() const { return vx_distanceType_; }
0038     // Assumed Vertex Distance
0039     float vx_distance() const { return vx_distance_; }
0040     // Assumed Vertex Resolution
0041     float vx_resolution() const { return vx_resolution_; }
0042     // Minimum number of tracks to accept vertex
0043     unsigned int vx_minTracks() const { return vx_minTracks_; }
0044     // Compute the z0 position of the vertex with a mean weighted with track momenta
0045     unsigned int vx_weightedmean() const { return vx_weightedmean_; }
0046     // Chi2 cut for the adaptive Vertex Recostruction Algorithm
0047     float vx_chi2cut() const { return vx_chi2cut_; }
0048     // Do track quality cuts in emulation algorithms
0049     bool vx_DoQualityCuts() const { return vx_DoQualityCuts_; }
0050     // Window size of the sliding window
0051     unsigned int vx_windowSize() const { return vx_windowSize_; }
0052     // fastHisto histogram parameters (min, max, width)
0053     std::vector<double> vx_histogram_parameters() const { return vx_histogram_parameters_; }
0054     double vx_histogram_min() const { return vx_histogram_parameters_.at(0); }
0055     double vx_histogram_max() const { return vx_histogram_parameters_.at(1); }
0056     double vx_histogram_binwidth() const { return vx_histogram_parameters_.at(2); }
0057     // fastHisto assumed vertex width
0058     float vx_width() const { return vx_width_; }
0059     // fastHisto track selection control
0060     bool vx_DoPtComp() const { return vx_DoPtComp_; }
0061     bool vx_DoTightChi2() const { return vx_DoTightChi2_; }
0062     // Number of vertices to return for fastHisto
0063     unsigned int vx_nvtx() const { return vx_nvtx_; }
0064     float vx_dbscan_pt() const { return vx_dbscan_pt_; }
0065     unsigned int vx_dbscan_mintracks() const { return vx_dbscan_mintracks_; }
0066 
0067     unsigned int vx_kmeans_iterations() const { return vx_kmeans_iterations_; }
0068     unsigned int vx_kmeans_nclusters() const { return vx_kmeans_nclusters_; }
0069     float vx_TrackMinPt() const { return vx_TrackMinPt_; }
0070     float vx_TrackMaxPt() const { return vx_TrackMaxPt_; }
0071     float vx_TrackMaxPtBehavior() const { return vx_TrackMaxPtBehavior_; }
0072     float vx_TrackMaxChi2() const { return vx_TrackMaxChi2_; }
0073     unsigned int vx_NStubMin() const { return vx_NStubMin_; }
0074     unsigned int vx_NStubPSMin() const { return vx_NStubPSMin_; }
0075 
0076     //=== Debug printout
0077     unsigned int debug() const { return debug_; }
0078 
0079     //=== Hard-wired constants
0080     // EJC Check this.  Found stub at r = 109.504 with flat geometry in 81X, so increased tracker radius for now.
0081     double trackerOuterRadius() const { return 120.2; }  // max. occuring stub radius.
0082     // EJC Check this.  Found stub at r = 20.664 with flat geometry in 81X, so decreased tracker radius for now.
0083     double trackerInnerRadius() const { return 20; }   // min. occuring stub radius.
0084     double trackerHalfLength() const { return 270.; }  // half-length  of tracker.
0085     double layerIDfromRadiusBin() const {
0086       return 6.;
0087     }  // When counting stubs in layers, actually histogram stubs in distance from beam-line with this bin size.
0088 
0089   private:
0090     static const std::map<std::string, Algorithm> algoNameMap;
0091     static const std::map<Algorithm, Precision> algoPrecisionMap;
0092 
0093     // Parameter sets for differents types of configuration parameter.
0094     edm::ParameterSet vertex_;
0095 
0096     // Vertex Reconstruction configuration
0097     Algorithm vx_algo_;
0098     Precision vx_precision_;
0099     float vx_distance_;
0100     float vx_resolution_;
0101     unsigned int vx_distanceType_;
0102     unsigned int vx_minTracks_;
0103     unsigned int vx_weightedmean_;
0104     float vx_chi2cut_;
0105     bool vx_DoQualityCuts_;
0106     bool vx_DoPtComp_;
0107     bool vx_DoTightChi2_;
0108     std::vector<double> vx_histogram_parameters_;
0109     unsigned int vx_nvtx_;
0110     float vx_width_;
0111     unsigned int vx_windowSize_;
0112     float vx_TrackMinPt_;
0113     float vx_TrackMaxPt_;
0114     int vx_TrackMaxPtBehavior_;
0115     float vx_TrackMaxChi2_;
0116     unsigned int vx_NStubMin_;
0117     unsigned int vx_NStubPSMin_;
0118     float vx_dbscan_pt_;
0119     float vx_dbscan_mintracks_;
0120     unsigned int vx_kmeans_iterations_;
0121     unsigned int vx_kmeans_nclusters_;
0122 
0123     // Debug printout
0124     unsigned int debug_;
0125   };
0126 
0127 }  // end namespace l1tVertexFinder
0128 
0129 #endif