CMS 3D CMS Logo

Config.h
Go to the documentation of this file.
1 #ifndef RecoTracker_MkFitCore_interface_Config_h
2 #define RecoTracker_MkFitCore_interface_Config_h
3 
4 namespace mkfit {
5 
6  namespace Const {
7  constexpr float PI = 3.14159265358979323846;
8  constexpr float TwoPI = 6.28318530717958647692;
9  constexpr float PIOver2 = Const::PI / 2.0f;
10  constexpr float PIOver4 = Const::PI / 4.0f;
11  constexpr float PI3Over4 = 3.0f * Const::PI / 4.0f;
12  constexpr float InvPI = 1.0f / Const::PI;
13  constexpr float sol = 0.299792458; // speed of light in m/ns
14 
15  // NAN and silly track parameter tracking options
16  constexpr bool nan_etc_sigs_enable = false;
17 
18  constexpr bool nan_n_silly_check_seeds = true;
19  constexpr bool nan_n_silly_print_bad_seeds = false;
20  constexpr bool nan_n_silly_fixup_bad_seeds = false;
21  constexpr bool nan_n_silly_remove_bad_seeds = true;
22 
23  constexpr bool nan_n_silly_check_cands_every_layer = false;
26 
27  constexpr bool nan_n_silly_check_cands_pre_bkfit = true;
28  constexpr bool nan_n_silly_check_cands_post_bkfit = true;
29  constexpr bool nan_n_silly_print_bad_cands_bkfit = false;
30  } // namespace Const
31 
32  inline float cdist(float a) { return a > Const::PI ? Const::TwoPI - a : a; }
33 
34  //------------------------------------------------------------------------------
35 
36  namespace Config {
37  // config for fitting
38  constexpr int nLayers = 10; // default/toy: 10; cms-like: 18 (barrel), 27 (endcap)
39 
40  // Layer constants for common barrel / endcap.
41  // TrackerInfo more or less has all this information.
42  constexpr int nMaxTrkHits = 64; // Used for array sizes in MkFitter/Finder, max hits in toy MC
43  constexpr int nAvgSimHits = 32; // Used for reserve() calls for sim hits/states
44 
45  // This will become layer dependent (in bits). To be consistent with min_dphi.
46  static constexpr int m_nphi = 256;
47 
48  // Config for propagation - could/should enter into PropagationFlags?!
49  constexpr int Niter = 5;
50  constexpr bool useTrigApprox = true;
51 
52  // Config for Bfield. Note: for now the same for CMS-phase1 and CylCowWLids.
53  constexpr float Bfield = 3.8112;
54  constexpr float mag_c1 = 3.8114;
55  constexpr float mag_b0 = -3.94991e-06;
56  constexpr float mag_b1 = 7.53701e-06;
57  constexpr float mag_a = 2.43878e-11;
58 
59  // Config for SelectHitIndices
60  // Use extra arrays to store phi and q of hits.
61  // MT: This would in principle allow fast selection of good hits, if
62  // we had good error estimates and reasonable *minimal* phi and q windows.
63  // Speed-wise, those arrays (filling AND access, about half each) cost 1.5%
64  // and could help us reduce the number of hits we need to process with bigger
65  // potential gains.
66 #ifdef CONFIG_PhiQArrays
67  extern bool usePhiQArrays;
68 #else
69  constexpr bool usePhiQArrays = true;
70 #endif
71 
72  // sorting config (bonus,penalty)
73  constexpr float validHitBonus_ = 4;
74  constexpr float validHitSlope_ = 0.2;
75  constexpr float overlapHitBonus_ = 0; // set to negative for penalty
76  constexpr float missingHitPenalty_ = 8;
77  constexpr float tailMissingHitPenalty_ = 3;
78 
79  // Threading
80 #if defined(MKFIT_STANDALONE)
81  extern int numThreadsFinder;
82  extern int numThreadsEvents;
83  extern int numSeedsPerTask;
84 #else
85  constexpr int numThreadsFinder = 1;
86  constexpr int numThreadsEvents = 1;
87  constexpr int numSeedsPerTask = 32;
88 #endif
89 
90  // config on seed cleaning
91  constexpr float track1GeVradius = 87.6; // = 1/(c*B)
92  constexpr float c_etamax_brl = 0.9;
93  constexpr float c_dpt_common = 0.25;
94  constexpr float c_dzmax_brl = 0.005;
95  constexpr float c_drmax_brl = 0.010;
96  constexpr float c_ptmin_hpt = 2.0;
97  constexpr float c_dzmax_hpt = 0.010;
98  constexpr float c_drmax_hpt = 0.010;
99  constexpr float c_dzmax_els = 0.015;
100  constexpr float c_drmax_els = 0.015;
101 
102  // config on duplicate removal
103 #if defined(MKFIT_STANDALONE)
104  extern bool useHitsForDuplicates;
105  extern bool removeDuplicates;
106 #else
107  const bool useHitsForDuplicates = true;
108 #endif
109  extern const float maxdPhi;
110  extern const float maxdPt;
111  extern const float maxdEta;
112  extern const float minFracHitsShared;
113  extern const float maxdR;
114 
115  // duplicate removal: tighter version
116  extern const float maxd1pt;
117  extern const float maxdphi;
118  extern const float maxdcth;
119  extern const float maxcth_ob;
120  extern const float maxcth_fw;
121 
122  // ================================================================
123 
124  inline float bFieldFromZR(const float z, const float r) {
125  return (Config::mag_b0 * z * z + Config::mag_b1 * z + Config::mag_c1) * (Config::mag_a * r * r + 1.f);
126  }
127 
128  }; // namespace Config
129 
130  //------------------------------------------------------------------------------
131 
132 } // end namespace mkfit
133 #endif
static constexpr int m_nphi
Definition: Config.h:46
constexpr float c_drmax_els
Definition: Config.h:100
const float maxdPt
Definition: Config.cc:17
const float maxdphi
Definition: Config.cc:24
const float maxd1pt
Definition: Config.cc:23
const float maxdcth
Definition: Config.cc:25
constexpr float validHitSlope_
Definition: Config.h:74
constexpr float c_dpt_common
Definition: Config.h:93
constexpr bool nan_n_silly_check_cands_post_bkfit
Definition: Config.h:28
constexpr bool nan_n_silly_print_bad_seeds
Definition: Config.h:19
constexpr float mag_c1
Definition: Config.h:54
constexpr bool nan_n_silly_print_bad_cands_bkfit
Definition: Config.h:29
constexpr bool nan_n_silly_check_cands_pre_bkfit
Definition: Config.h:27
const float maxdR
Definition: Config.cc:20
constexpr bool nan_n_silly_check_seeds
Definition: Config.h:18
constexpr float PIOver2
Definition: Config.h:9
constexpr float TwoPI
Definition: Config.h:8
constexpr bool nan_n_silly_fixup_bad_cands_every_layer
Definition: Config.h:25
const float maxcth_fw
Definition: Config.cc:27
constexpr bool usePhiQArrays
Definition: Config.h:69
constexpr int nLayers
Definition: Config.h:38
const float maxcth_ob
Definition: Config.cc:26
constexpr float c_dzmax_hpt
Definition: Config.h:97
constexpr float c_etamax_brl
Definition: Config.h:92
constexpr float mag_b1
Definition: Config.h:56
const float maxdEta
Definition: Config.cc:19
constexpr float PI
Definition: Config.h:7
constexpr bool nan_n_silly_remove_bad_seeds
Definition: Config.h:21
constexpr float c_ptmin_hpt
Definition: Config.h:96
const float maxdPhi
Definition: Config.cc:18
constexpr float mag_a
Definition: Config.h:57
constexpr float Bfield
Definition: Config.h:53
constexpr float tailMissingHitPenalty_
Definition: Config.h:77
constexpr int numThreadsFinder
Definition: Config.h:85
constexpr bool useTrigApprox
Definition: Config.h:50
float cdist(float a)
Definition: Config.h:32
constexpr float overlapHitBonus_
Definition: Config.h:75
constexpr bool nan_etc_sigs_enable
Definition: Config.h:16
constexpr int nAvgSimHits
Definition: Config.h:43
constexpr bool nan_n_silly_fixup_bad_seeds
Definition: Config.h:20
constexpr float sol
Definition: Config.h:13
float bFieldFromZR(const float z, const float r)
Definition: Config.h:124
constexpr float track1GeVradius
Definition: Config.h:91
constexpr float c_dzmax_els
Definition: Config.h:99
constexpr float c_dzmax_brl
Definition: Config.h:94
constexpr bool nan_n_silly_check_cands_every_layer
Definition: Config.h:23
constexpr int numSeedsPerTask
Definition: Config.h:87
constexpr float mag_b0
Definition: Config.h:55
constexpr int numThreadsEvents
Definition: Config.h:86
double a
Definition: hdecay.h:121
Definition: Config.py:1
constexpr float c_drmax_hpt
Definition: Config.h:98
const bool useHitsForDuplicates
Definition: Config.h:107
constexpr float c_drmax_brl
Definition: Config.h:95
constexpr float PI3Over4
Definition: Config.h:11
constexpr bool nan_n_silly_print_bad_cands_every_layer
Definition: Config.h:24
constexpr float InvPI
Definition: Config.h:12
constexpr int nMaxTrkHits
Definition: Config.h:42
constexpr float PIOver4
Definition: Config.h:10
constexpr float validHitBonus_
Definition: Config.h:73
constexpr int Niter
Definition: Config.h:49
const float minFracHitsShared
Definition: Config.cc:21
constexpr float missingHitPenalty_
Definition: Config.h:76