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
17 
22 
26 
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  constexpr bool usePropToPlane = false;
52  constexpr bool usePtMultScat = false;
53 
54  // Config for Bfield. Note: for now the same for CMS-phase1 and CylCowWLids.
55  constexpr float Bfield = 3.8112;
56  constexpr float mag_c1 = 3.8114;
57  constexpr float mag_b0 = -3.94991e-06;
58  constexpr float mag_b1 = 7.53701e-06;
59  constexpr float mag_a = 2.43878e-11;
60 
61  // Config for SelectHitIndices
62  // Use extra arrays to store phi and q of hits.
63  // MT: This would in principle allow fast selection of good hits, if
64  // we had good error estimates and reasonable *minimal* phi and q windows.
65  // Speed-wise, those arrays (filling AND access, about half each) cost 1.5%
66  // and could help us reduce the number of hits we need to process with bigger
67  // potential gains.
68 #ifdef CONFIG_PhiQArrays
69  extern bool usePhiQArrays;
70 #else
71  constexpr bool usePhiQArrays = true;
72 #endif
73 
74  // sorting config (bonus,penalty)
77  constexpr float overlapHitBonus_ = 0; // set to negative for penalty
80 
81  // Threading
82 #if defined(MKFIT_STANDALONE)
83  extern int numThreadsFinder;
84  extern int numThreadsEvents;
85  extern int numSeedsPerTask;
86 #else
90 #endif
91 
92  // config on seed cleaning
93  constexpr float track1GeVradius = 87.6; // = 1/(c*B)
94  constexpr float c_etamax_brl = 0.9;
95  constexpr float c_dpt_common = 0.25;
96  constexpr float c_dzmax_brl = 0.005;
97  constexpr float c_drmax_brl = 0.010;
98  constexpr float c_ptmin_hpt = 2.0;
99  constexpr float c_dzmax_hpt = 0.010;
100  constexpr float c_drmax_hpt = 0.010;
101  constexpr float c_dzmax_els = 0.015;
102  constexpr float c_drmax_els = 0.015;
103 
104  // config on duplicate removal
105 #if defined(MKFIT_STANDALONE)
106  extern bool useHitsForDuplicates;
107  extern bool removeDuplicates;
108 #else
109  const bool useHitsForDuplicates = true;
110 #endif
111  extern const float maxdPhi;
112  extern const float maxdPt;
113  extern const float maxdEta;
114  extern const float minFracHitsShared;
115  extern const float maxdR;
116 
117  // duplicate removal: tighter version
118  extern const float maxd1pt;
119  extern const float maxdphi;
120  extern const float maxdcth;
121  extern const float maxcth_ob;
122  extern const float maxcth_fw;
123 
124  // ================================================================
125 
126  inline float bFieldFromZR(const float z, const float r) {
127  return (Config::mag_b0 * z * z + Config::mag_b1 * z + Config::mag_c1) * (Config::mag_a * r * r + 1.f);
128  }
129 
130  }; // namespace Config
131 
132  //------------------------------------------------------------------------------
133 
134 } // end namespace mkfit
135 #endif
static constexpr int m_nphi
Definition: Config.h:46
constexpr float c_drmax_els
Definition: Config.h:102
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:76
constexpr float c_dpt_common
Definition: Config.h:95
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:56
constexpr bool nan_n_silly_print_bad_cands_bkfit
Definition: Config.h:29
constexpr bool usePtMultScat
Definition: Config.h:52
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:71
constexpr int nLayers
Definition: Config.h:38
const float maxcth_ob
Definition: Config.cc:26
constexpr float c_dzmax_hpt
Definition: Config.h:99
constexpr float c_etamax_brl
Definition: Config.h:94
constexpr float mag_b1
Definition: Config.h:58
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:98
const float maxdPhi
Definition: Config.cc:18
constexpr float mag_a
Definition: Config.h:59
constexpr float Bfield
Definition: Config.h:55
constexpr float tailMissingHitPenalty_
Definition: Config.h:79
constexpr int numThreadsFinder
Definition: Config.h:87
constexpr bool useTrigApprox
Definition: Config.h:50
float cdist(float a)
Definition: Config.h:32
constexpr float overlapHitBonus_
Definition: Config.h:77
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:126
constexpr float track1GeVradius
Definition: Config.h:93
constexpr float c_dzmax_els
Definition: Config.h:101
constexpr float c_dzmax_brl
Definition: Config.h:96
constexpr bool nan_n_silly_check_cands_every_layer
Definition: Config.h:23
constexpr int numSeedsPerTask
Definition: Config.h:89
constexpr float mag_b0
Definition: Config.h:57
constexpr int numThreadsEvents
Definition: Config.h:88
double a
Definition: hdecay.h:121
Definition: Config.py:1
constexpr bool usePropToPlane
Definition: Config.h:51
constexpr float c_drmax_hpt
Definition: Config.h:100
const bool useHitsForDuplicates
Definition: Config.h:109
constexpr float c_drmax_brl
Definition: Config.h:97
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:75
constexpr int Niter
Definition: Config.h:49
const float minFracHitsShared
Definition: Config.cc:21
constexpr float missingHitPenalty_
Definition: Config.h:78