Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:28:16

0001 #ifndef RecoTracker_MkFitCore_interface_Config_h
0002 #define RecoTracker_MkFitCore_interface_Config_h
0003 
0004 namespace mkfit {
0005 
0006   namespace Const {
0007     constexpr float PI = 3.14159265358979323846;
0008     constexpr float TwoPI = 6.28318530717958647692;
0009     constexpr float PIOver2 = Const::PI / 2.0f;
0010     constexpr float PIOver4 = Const::PI / 4.0f;
0011     constexpr float PI3Over4 = 3.0f * Const::PI / 4.0f;
0012     constexpr float InvPI = 1.0f / Const::PI;
0013     constexpr float sol = 0.299792458;  // speed of light in m/ns
0014 
0015     // NAN and silly track parameter tracking options
0016     constexpr bool nan_etc_sigs_enable = false;
0017 
0018     constexpr bool nan_n_silly_check_seeds = true;
0019     constexpr bool nan_n_silly_print_bad_seeds = false;
0020     constexpr bool nan_n_silly_fixup_bad_seeds = false;
0021     constexpr bool nan_n_silly_remove_bad_seeds = true;
0022 
0023     constexpr bool nan_n_silly_check_cands_every_layer = false;
0024     constexpr bool nan_n_silly_print_bad_cands_every_layer = false;
0025     constexpr bool nan_n_silly_fixup_bad_cands_every_layer = false;
0026 
0027     constexpr bool nan_n_silly_check_cands_pre_bkfit = true;
0028     constexpr bool nan_n_silly_check_cands_post_bkfit = true;
0029     constexpr bool nan_n_silly_print_bad_cands_bkfit = false;
0030   }  // namespace Const
0031 
0032   inline float cdist(float a) { return a > Const::PI ? Const::TwoPI - a : a; }
0033 
0034   //------------------------------------------------------------------------------
0035 
0036   namespace Config {
0037     // config for fitting
0038     constexpr int nLayers = 10;  // default/toy: 10; cms-like: 18 (barrel), 27 (endcap)
0039 
0040     // Layer constants for common barrel / endcap.
0041     // TrackerInfo more or less has all this information.
0042     constexpr int nMaxTrkHits = 64;  // Used for array sizes in MkFitter/Finder, max hits in toy MC
0043     constexpr int nAvgSimHits = 32;  // Used for reserve() calls for sim hits/states
0044 
0045     // This will become layer dependent (in bits). To be consistent with min_dphi.
0046     static constexpr int m_nphi = 256;
0047 
0048     // Config for propagation - could/should enter into PropagationFlags?!
0049     constexpr int Niter = 5;
0050     constexpr bool useTrigApprox = true;
0051     constexpr bool usePropToPlane = false;
0052     constexpr bool usePtMultScat = false;
0053 
0054     // Config for Bfield. Note: for now the same for CMS-phase1 and CylCowWLids.
0055     constexpr float Bfield = 3.8112;
0056     constexpr float mag_c1 = 3.8114;
0057     constexpr float mag_b0 = -3.94991e-06;
0058     constexpr float mag_b1 = 7.53701e-06;
0059     constexpr float mag_a = 2.43878e-11;
0060 
0061     // Config for SelectHitIndices
0062     // Use extra arrays to store phi and q of hits.
0063     // MT: This would in principle allow fast selection of good hits, if
0064     // we had good error estimates and reasonable *minimal* phi and q windows.
0065     // Speed-wise, those arrays (filling AND access, about half each) cost 1.5%
0066     // and could help us reduce the number of hits we need to process with bigger
0067     // potential gains.
0068 #ifdef CONFIG_PhiQArrays
0069     extern bool usePhiQArrays;
0070 #else
0071     constexpr bool usePhiQArrays = true;
0072 #endif
0073 
0074     // sorting config (bonus,penalty)
0075     constexpr float validHitBonus_ = 4;
0076     constexpr float validHitSlope_ = 0.2;
0077     constexpr float overlapHitBonus_ = 0;  // set to negative for penalty
0078     constexpr float missingHitPenalty_ = 8;
0079     constexpr float tailMissingHitPenalty_ = 3;
0080 
0081     // Threading
0082 #if defined(MKFIT_STANDALONE)
0083     extern int numThreadsFinder;
0084     extern int numThreadsEvents;
0085     extern int numSeedsPerTask;
0086 #else
0087     constexpr int numThreadsFinder = 1;
0088     constexpr int numThreadsEvents = 1;
0089     constexpr int numSeedsPerTask = 32;
0090 #endif
0091 
0092     // config on seed cleaning
0093     constexpr float track1GeVradius = 87.6;  // = 1/(c*B)
0094     constexpr float c_etamax_brl = 0.9;
0095     constexpr float c_dpt_common = 0.25;
0096     constexpr float c_dzmax_brl = 0.005;
0097     constexpr float c_drmax_brl = 0.010;
0098     constexpr float c_ptmin_hpt = 2.0;
0099     constexpr float c_dzmax_hpt = 0.010;
0100     constexpr float c_drmax_hpt = 0.010;
0101     constexpr float c_dzmax_els = 0.015;
0102     constexpr float c_drmax_els = 0.015;
0103 
0104     // config on duplicate removal
0105 #if defined(MKFIT_STANDALONE)
0106     extern bool useHitsForDuplicates;
0107     extern bool removeDuplicates;
0108 #else
0109     const bool useHitsForDuplicates = true;
0110 #endif
0111     extern const float maxdPhi;
0112     extern const float maxdPt;
0113     extern const float maxdEta;
0114     extern const float minFracHitsShared;
0115     extern const float maxdR;
0116 
0117     // duplicate removal: tighter version
0118     extern const float maxd1pt;
0119     extern const float maxdphi;
0120     extern const float maxdcth;
0121     extern const float maxcth_ob;
0122     extern const float maxcth_fw;
0123 
0124     // ================================================================
0125 
0126     inline float bFieldFromZR(const float z, const float r) {
0127       return (Config::mag_b0 * z * z + Config::mag_b1 * z + Config::mag_c1) * (Config::mag_a * r * r + 1.f);
0128     }
0129 
0130   };  // namespace Config
0131 
0132   //------------------------------------------------------------------------------
0133 
0134 }  // end namespace mkfit
0135 #endif