Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:22:11

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