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