Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-10-17 22:59:02

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