CMS 3D CMS Logo

Settings.h
Go to the documentation of this file.
1 #ifndef L1Trigger_TrackFindingTracklet_interface_Settings_h
2 #define L1Trigger_TrackFindingTracklet_interface_Settings_h
3 
4 #include <iostream>
5 #include <string>
6 #include <array>
7 #include <set>
8 #include <cassert>
9 #include <cmath>
10 #include <unordered_map>
11 #include <map>
12 #include <vector>
13 
16 
17 namespace tt {
18  class Setup;
19 }
20 
21 namespace trklet {
22 
23  constexpr unsigned int N_SECTOR = 9; // # of phi sectors for L1TK processing
24 
25  constexpr int N_LAYER = 6; // # of barrel layers assumed
26  constexpr int N_DISK = 5; // # of endcap disks assumed
27  constexpr unsigned int N_PSLAYER = 3; // # of barrel PS layers assumed
28  constexpr unsigned int N_SEED = 12; // # of tracklet+triplet seeds
29  constexpr unsigned int N_SEED_PROMPT = 8; // # of tracklet (prompt) seeds
30 
31  constexpr unsigned int N_DSS_MOD = 5; // # of rings with 2S modules per disk
32 
33  constexpr unsigned int N_BENDBITS_PS = 3; // Number of bend bits for PS modules
34  constexpr unsigned int N_BENDBITS_2S = 4; // Number of bend bits for 2S modules
35 
36  constexpr unsigned int NRINVBITS = 5; //number of bit for rinv in bend match table
37  constexpr unsigned int NFINERZBITS = 3; //number of bit for r or z within a r/z bin
38  constexpr unsigned int NFINEPHIBITS = 3; //number of bits for phi within a vm bin
39  constexpr unsigned int N_RZBITS = 3; //number of bit for the r/z bins
40  constexpr unsigned int N_PHIBITS = 3; //number of bit for the phi bins
41 
42  constexpr unsigned int N_VMSTUBSMAX = 15; // maximum number of stubs in VM bin
43  constexpr unsigned int N_BITSMEMADDRESS = 7; // Number of bits for address in memories
44 
45  constexpr double sixth = 1.0 / 6.0; //Commonly used factor
46  constexpr double third = 1.0 / 3.0; //Commonly used factor
47 
48  constexpr double VMROUTERCUTZL2 = 50.0; //Min L2 z for inner allstub
49  constexpr double VMROUTERCUTZL1L3L5 = 95.0; //Max z for inner barrel layers
50  constexpr double VMROUTERCUTZL1 = 70.0; //Max z for L1 barrel seeding
51  constexpr double VMROUTERCUTRD1D3 = 55.0; //Max r for disk seeds
52 
54  enum LayerDisk { L1 = 0, L2, L3, L4, L5, L6, D1, D2, D3, D4, D5 };
55 
56  class Settings {
57  public:
59  //Comment out to run tracklet-only algorithm
60 #ifdef CMSSW_GIT_HASH
61 #ifndef CMS_DICT_IMPL // Don't print message if genreflex being run.
62 #ifndef USEHYBRID
63 #pragma message "USEHYBRID is undefined, so Hybrid L1 tracking disabled."
64 #endif
65 #endif
66 #endif
67  }
68 
69  ~Settings() = default;
70 
71  void passSetup(const tt::Setup* setup) { setup_ = setup; }
72  const tt::Setup* setup() const { return setup_; }
73 
74  // processing & memory modules, wiring, etc.
75  std::string const& fitPatternFile() const { return fitPatternFile_; }
78  std::string const& wiresFile() const { return wiresFile_; }
79  std::string const& tableTEDFile() const { return tableTEDFile_; }
80  std::string const& tableTREFile() const { return tableTREFile_; }
81 
82  void setFitPatternFile(std::string fitPatternFileName) { fitPatternFile_ = fitPatternFileName; }
83  void setProcessingModulesFile(std::string processingModulesFileName) {
84  processingModulesFile_ = processingModulesFileName;
85  }
86  void setMemoryModulesFile(std::string memoryModulesFileName) { memoryModulesFile_ = memoryModulesFileName; }
87  void setWiresFile(std::string wiresFileName) { wiresFile_ = wiresFileName; }
88  void setTableTEDFile(std::string tableTEDFileName) { tableTEDFile_ = tableTEDFileName; }
89  void setTableTREFile(std::string tableTREFileName) { tableTREFile_ = tableTREFileName; }
90 
91  unsigned int nzbitsstub(unsigned int layerdisk) const { return nzbitsstub_[layerdisk]; }
92  unsigned int nphibitsstub(unsigned int layerdisk) const { return nphibitsstub_[layerdisk]; }
93  unsigned int nrbitsstub(unsigned int layerdisk) const { return nrbitsstub_[layerdisk]; }
94 
95  unsigned int nrbitsprojderdisk() const { return nrbitsprojderdisk_; }
96  unsigned int nbitsphiprojderL123() const { return nbitsphiprojderL123_; }
97  unsigned int nbitsphiprojderL456() const { return nbitsphiprojderL456_; }
98  unsigned int nbitszprojderL123() const { return nbitszprojderL123_; }
99  unsigned int nbitszprojderL456() const { return nbitszprojderL456_; }
100 
101  unsigned int nbendbitsmedisk() const { return nbendbitsmedisk_; }
102 
103  bool useSeed(unsigned int iSeed) const { return useseeding_.find(iSeed) != useseeding_.end(); }
104  unsigned int nbitsvmte(unsigned int inner, unsigned int iSeed) const {
105  if (combined_) {
106  return nbitsvmtecm_[inner][iSeed];
107  }
108  return nbitsvmte_[inner][iSeed];
109  }
110  unsigned int nvmte(unsigned int inner, unsigned int iSeed) const { return (1 << nbitsvmte(inner, iSeed)); }
111 
112  unsigned int nbitsvmme(unsigned int layerdisk) const { return nbitsvmme_[layerdisk]; }
113  unsigned int nvmme(unsigned int layerdisk) const { return (1 << nbitsvmme_[layerdisk]); }
114 
115  unsigned int nbitsallstubs(unsigned int layerdisk) const { return nbitsallstubs_[layerdisk]; }
116  unsigned int nallstubs(unsigned int layerdisk) const { return (1 << nbitsallstubs_[layerdisk]); }
117 
119  if (writeMonitorData_.find(module) == writeMonitorData_.end()) {
120  throw cms::Exception("BadConfig") << "Settings::writeMonitorData module = " << module << " not known";
121  }
122  return writeMonitorData_.at(module);
123  }
124 
125  unsigned int maxStep(std::string module) const {
126  if (maxstep_.find(module) == maxstep_.end()) {
127  throw cms::Exception("BadConfig")
128  << __FILE__ << " " << __LINE__ << " maxStep module = " << module << " not known";
129  }
131  }
132 
133  double zlength() const { return zlength_; }
134  double rmaxdisk() const { return rmaxdisk_; }
135  double rmindisk() const { return rmindisk_; }
136 
137  double drmax() const { return rmaxdisk_ / deltarzfract_; }
138  double dzmax() const { return zlength_ / deltarzfract_; }
139 
140  double half2SmoduleWidth() const { return half2SmoduleWidth_; }
141 
142  int nfinephi(unsigned int inner, unsigned int iSeed) const { return nfinephi_[inner][iSeed]; }
143  double nphireg(unsigned int inner, unsigned int iSeed) const {
144  if (combined_) {
145  return nphiregcm_[inner][iSeed];
146  }
147  return nphireg_[inner][iSeed];
148  }
149  double lutwidthtab(unsigned int inner, unsigned int iSeed) const { return lutwidthtab_[inner][iSeed]; }
150  double lutwidthtabextended(unsigned int inner, unsigned int iSeed) const {
151  return lutwidthtabextended_[inner][iSeed];
152  }
153 
154  unsigned int seedlayers(int inner, int seed) const {
155  int layerdisk = seedlayers_[seed][inner];
156  assert(layerdisk >= 0);
157  return layerdisk;
158  }
159 
160  unsigned int teunits(unsigned int iSeed) const { return teunits_[iSeed]; }
161 
162  unsigned int NTC(int seed) const { return ntc_[seed]; }
163 
164  unsigned int projlayers(unsigned int iSeed, unsigned int i) const { return projlayers_[iSeed][i]; }
165  unsigned int projdisks(unsigned int iSeed, unsigned int i) const { return projdisks_[iSeed][i]; }
166  double rphimatchcut(unsigned int iSeed, unsigned int ilayer) const { return rphimatchcut_[ilayer][iSeed]; }
167  double zmatchcut(unsigned int iSeed, unsigned int ilayer) const { return zmatchcut_[ilayer][iSeed]; }
168  double rphicutPS(unsigned int iSeed, unsigned int idisk) const { return rphicutPS_[idisk][iSeed]; }
169  double rcutPS(unsigned int iSeed, unsigned int idisk) const { return rcutPS_[idisk][iSeed]; }
170  double rphicut2S(unsigned int iSeed, unsigned int idisk) const { return rphicut2S_[idisk][iSeed]; }
171  double rcut2S(unsigned int iSeed, unsigned int idisk) const { return rcut2S_[idisk][iSeed]; }
172 
173  double rmean(unsigned int iLayer) const { return irmean_[iLayer] * rmaxdisk_ / 4096; }
174  double rmax(unsigned int iLayer) const { return rmean(iLayer) + drmax(); }
175  double rmin(unsigned int iLayer) const { return rmean(iLayer) - drmax(); }
176  double zmean(unsigned int iDisk) const { return izmean_[iDisk] * zlength_ / 2048; }
177  double zmax(unsigned int iDisk) const { return zmean(iDisk) + dzmax(); }
178  double zmin(unsigned int iDisk) const { return zmean(iDisk) - dzmax(); }
179 
180  double zmindisk(unsigned int iDisk) const { return zmean(iDisk) - zsepdisk_ / 2; }
181  double zmaxdisk(unsigned int iDisk) const { return zmean(iDisk) + zsepdisk_ / 2; }
182 
183  double rDSSinner(unsigned int iBin) const {
184  return rDSSinner_mod_[iBin / 2] + halfstrip_ * ((iBin % 2 == 0) ? -1 : 1);
185  }
186  double rDSSouter(unsigned int iBin) const {
187  return rDSSouter_mod_[iBin / 2] + halfstrip_ * ((iBin % 2 == 0) ? -1 : 1);
188  }
189 
190  unsigned int vmrlutzbits(unsigned int layerdisk) const { return vmrlutzbits_[layerdisk]; }
191  unsigned int vmrlutrbits(unsigned int layerdisk) const { return vmrlutrbits_[layerdisk]; }
192 
193  bool printDebugKF() const { return printDebugKF_; }
194  bool debugTracklet() const { return debugTracklet_; }
195  bool writetrace() const { return writetrace_; }
196 
197  bool warnNoMem() const { return warnNoMem_; }
198  bool warnNoDer() const { return warnNoDer_; }
199 
200  bool writeMem() const { return writeMem_; }
201  bool writeTable() const { return writeTable_; }
202  bool writeConfig() const { return writeConfig_; }
203 
204  std::string memPath() const { return memPath_; }
205  std::string tablePath() const { return tablePath_; }
206 
207  bool writeVerilog() const { return writeVerilog_; }
208  bool writeHLS() const { return writeHLS_; }
209  bool writeInvTable() const { return writeInvTable_; }
210  bool writeHLSInvTable() const { return writeHLSInvTable_; }
211 
212  unsigned int writememsect() const { return writememsect_; }
213 
214  bool enableTripletTables() const { return enableTripletTables_; }
215  bool writeTripletTables() const { return writeTripletTables_; }
216 
217  bool writeoutReal() const { return writeoutReal_; }
218 
219  bool bookHistos() const { return bookHistos_; }
220 
221  double ptcut() const { return ptcut_; }
222  double rinvcut() const { return 0.01 * c_ * bfield_ / ptcut_; } //0.01 to convert to cm-1
223 
224  double c() const { return c_; }
225 
226  double rinvmax() const { return 0.01 * c_ * bfield_ / ptmin_; }
227 
228  int alphashift() const { return alphashift_; }
229  int nbitsalpha() const { return nbitsalpha_; }
230  int alphaBitsTable() const { return alphaBitsTable_; }
231  int nrinvBitsTable() const { return nrinvBitsTable_; }
232 
233  unsigned int MEBinsBits() const { return MEBinsBits_; }
234  unsigned int MEBins() const { return 1u << MEBinsBits_; }
235  unsigned int MEBinsDisks() const { return MEBinsDisks_; }
236  unsigned int maxStubsPerBin() const { return maxStubsPerBin_; }
237 
239  std::string geo = extended_ ? "hourglassExtended" : "hourglass";
240  if (combined_)
241  geo += "Combined";
242  return geo;
243  }
244 
245  bool exactderivatives() const { return exactderivatives_; }
247  bool useapprox() const { return useapprox_; }
248  bool usephicritapprox() const { return usephicritapprox_; }
249 
250  unsigned int minIndStubs() const { return minIndStubs_; }
253  bool doKF() const { return doKF_; }
254  bool doMultipleMatches() const { return doMultipleMatches_; }
255  bool fakefit() const { return fakefit_; }
256  void setFakefit(bool fakefit) { fakefit_ = fakefit; }
260  }
263 
264  // configurable
265  unsigned int nHelixPar() const { return nHelixPar_; }
266  void setNHelixPar(unsigned int nHelixPar) { nHelixPar_ = nHelixPar; }
267 
268  bool extended() const { return extended_; }
270  bool combined() const { return combined_; }
272  bool reduced() const { return reduced_; }
273  void setReduced(bool reduced) { reduced_ = reduced; }
274  bool inventStubs() const { return inventStubs_; }
276 
277  double bfield() const { return bfield_; }
278  void setBfield(double bfield) { bfield_ = bfield; }
279 
280  unsigned int nStrips(bool isPSmodule) const { return isPSmodule ? nStrips_PS_ : nStrips_2S_; }
281  void setNStrips_PS(unsigned int nStrips_PS) { nStrips_PS_ = nStrips_PS; }
282  void setNStrips_2S(unsigned int nStrips_2S) { nStrips_2S_ = nStrips_2S; }
283 
284  double stripPitch(bool isPSmodule) const { return isPSmodule ? stripPitch_PS_ : stripPitch_2S_; }
285  void setStripPitch_PS(double stripPitch_PS) { stripPitch_PS_ = stripPitch_PS; }
286  void setStripPitch_2S(double stripPitch_2S) { stripPitch_2S_ = stripPitch_2S; }
287 
288  double sensorSpacing2S() const { return sensorSpacing_2S_; }
289 
290  double stripLength(bool isPSmodule) const { return isPSmodule ? stripLength_PS_ : stripLength_2S_; }
291  void setStripLength_PS(double stripLength_PS) { stripLength_PS_ = stripLength_PS; }
292  void setStripLength_2S(double stripLength_2S) { stripLength_2S_ = stripLength_2S; }
293 
294  //Following functions are used for duplicate removal
295  //Function which returns the value corresponding to the overlap size for the overlap rinv bins in DR
296  double rinvOverlapSize() const { return rinvOverlapSize_; }
297  //Function which returns the value corresponding to the overlap size for the overlap phi bins in DR
298  double phiOverlapSize() const { return phiOverlapSize_; }
299  //Function which returns the value corresponding to the number of tracks that are compared to all the other tracks per rinv bin
300  unsigned int numTracksComparedPerBin() const { return numTracksComparedPerBin_; }
301  //Returns the rinv bin edges you need for duplicate removal bins
302  const std::vector<double>& rinvBins() const { return rinvBins_; }
303  //Returns the phi bin edges you need for duplicate removal bins
304  const std::vector<double>& phiBins() const { return phiBins_; }
305 
306  std::string skimfile() const { return skimfile_; }
308 
309  unsigned int nbitstrackletindex() const { return nbitstrackletindex_; }
311 
312  unsigned int nbitsitc() const { return nbitsitc_; }
313  unsigned int nbitsseed() const { return (extended_ ? nbitsseedextended_ : nbitsseed_); }
314  unsigned int nbitstcindex() const { return nbitsseed() + nbitsitc(); }
315  void setNbitsitc(unsigned int nbitsitc) { nbitsitc_ = nbitsitc; }
316  void setNbitsseed(unsigned int nbitsseed) { nbitsseed_ = nbitsseed; }
318 
319  // Phi width of nonant including overlaps (at widest point).
320  double dphisectorHG() const {
321  //These values are used in the DTC emulation code.
322  double rsectmin = 21.8;
323  double rsectmax = 112.7;
324  return 2 * M_PI / N_SECTOR + rinvmax() * std::max(rcrit_ - rsectmin, rsectmax - rcrit_);
325  }
326 
327  double rcrit() const { return rcrit_; }
328 
329  double dphisector() const { return 2 * M_PI / N_SECTOR; }
330 
331  double phicritmin() const { return 0.5 * dphisectorHG() - M_PI / N_SECTOR; }
332  double phicritmax() const { return dphisectorHG() - 0.5 * dphisectorHG() + M_PI / N_SECTOR; }
333 
334  double phicritminmc() const { return phicritmin() - dphicritmc_; }
335  double phicritmaxmc() const { return phicritmax() + dphicritmc_; }
336 
337  // Stub digitization granularities
338  double kphi() const { return dphisectorHG() / (1 << nphibitsstub(0)); }
339  double kphi1() const { return dphisectorHG() / (1 << nphibitsstub(N_LAYER - 1)); }
340  double kphi(unsigned int layerdisk) const { return dphisectorHG() / (1 << nphibitsstub(layerdisk)); }
341 
342  double kz() const { return 2.0 * zlength_ / (1 << nzbitsstub_[0]); }
343  double kz(unsigned int layerdisk) const { return 2.0 * zlength_ / (1 << nzbitsstub_[layerdisk]); }
344  double kr() const { return rmaxdisk_ / (1 << nrbitsstub_[N_LAYER]); }
345  double krbarrel() const { return 2.0 * drmax() / (1 << nrbitsstub_[0]); }
346 
347  double maxrinv() const { return maxrinv_; }
348  double maxd0() const { return maxd0_; }
349  unsigned int nbitsd0() const { return nbitsd0_; }
350 
351  double kd0() const { return 2 * maxd0_ / (1 << nbitsd0_); }
352 
353  double rinvcutte() const { return 0.01 * c_ * bfield_ / ptcutte_; } //0.01 to convert to cm-1
354 
355  double rmindiskvm() const { return rmindiskvm_; }
356  double rmaxdiskvm() const { return rmaxdiskvm_; }
357 
358  double rmaxdiskl1overlapvm() const { return rmaxdiskl1overlapvm_; }
359  double rmindiskl2overlapvm() const { return rmindiskl2overlapvm_; }
360  double rmindiskl3overlapvm() const { return rmindiskl3overlapvm_; }
361 
362  double rPS2S() const { return rPS2S_; }
363 
364  double z0cut() const { return z0cut_; }
365 
366  double disp_z0cut() const { return disp_z0cut_; }
367 
368  unsigned int NLONGVMBITS() const { return NLONGVMBITS_; }
369  unsigned int NLONGVMBINS() const { return (1 << NLONGVMBITS_); }
370 
371  unsigned int ntrackletmax() const { return ((1 << nbitstrackletindex_) - 1); }
372 
373  //Bits used to store track parameter in tracklet
374  int nbitsrinv() const { return nbitsrinv_; }
375  int nbitsphi0() const { return nbitsphi0_; }
376  int nbitst() const { return nbitst_; }
377  int nbitsz0() const { return nbitsz0_; }
378 
379  //track and tracklet parameters
380  int rinv_shift() const { return rinv_shift_; }
381  int phi0_shift() const { return phi0_shift_; }
382  int t_shift() const { return t_shift_; }
383  int z0_shift() const { return z0_shift_; }
384 
385  //projections are coarsened from global to stub precision
386 
387  //projection to R parameters
388  int SS_phiL_shift() const { return SS_phiL_shift_; }
389  int PS_zL_shift() const { return PS_zL_shift_; }
390 
391  int SS_phiderL_shift() const { return SS_phiderL_shift_; }
392  int PS_zderL_shift() const { return PS_zderL_shift_; }
393  int SS_zderL_shift() const { return SS_zderL_shift_; }
394 
395  //projection to Z parameters
396  int SS_phiD_shift() const { return SS_phiD_shift_; }
397  int PS_rD_shift() const { return PS_rD_shift_; }
398 
399  int SS_phiderD_shift() const { return SS_phiderD_shift_; }
400  int PS_rderD_shift() const { return PS_rderD_shift_; }
401 
402  //numbers needed for matches & fit, unclear what they are.
403  int phi0bitshift() const { return phi0bitshift_; }
404  int phiderbitshift() const { return phiderbitshift_; }
405  int zderbitshift() const { return zderbitshift_; }
406 
407  int phiresidbits() const { return phiresidbits_; }
408  int zresidbits() const { return zresidbits_; }
409  int rresidbits() const { return rresidbits_; }
410 
411  //Trackfit
412  int fitrinvbitshift() const { return fitrinvbitshift_; }
413  int fitphi0bitshift() const { return fitphi0bitshift_; }
414  int fittbitshift() const { return fittbitshift_; }
415  int fitz0bitshift() const { return fitz0bitshift_; }
416 
417  //r correction bits
418  int rcorrbits() const { return rcorrbits_; }
419 
420  int chisqphifactbits() const { return chisqphifactbits_; }
421  int chisqzfactbits() const { return chisqzfactbits_; }
422 
423  // Helix param digisation granularities
424  //0.02 here is the maximum range in rinv values that can be represented
425  double krinvpars() const {
426  int shift = ceil(-log2(0.02 * rmaxdisk_ / ((1 << nbitsrinv_) * dphisectorHG())));
427  return dphisectorHG() / rmaxdisk_ / (1 << shift);
428  }
429  double kphi0pars() const { return 2 * kphi1(); }
430  double ktpars() const { return maxt_ / (1 << nbitst_); }
431  double kz0pars() const { return kz(); }
432  double kd0pars() const { return kd0(); }
433 
434  double kphider() const { return kphi() / kr() / 256; }
435  double kphiderdisk() const { return kphi() / kr() / 128; }
436  double kzder() const { return 1.0 / 64; }
437  double krder() const { return 1.0 / 128; }
438 
439  //This is a 'historical accident' and should be fixed so that we don't
440  //have the factor if 2
441  double krprojshiftdisk() const { return 2 * kr(); }
442 
443  double benddecode(int ibend, int layerdisk, bool isPSmodule) const {
444  if (layerdisk >= N_LAYER && (!isPSmodule))
445  layerdisk += (N_LAYER - 1);
446  double bend = benddecode_[layerdisk][ibend];
447  assert(bend < 99.0);
448  return bend;
449  }
450 
451  double bendcut(int ibend, int layerdisk, bool isPSmodule) const {
452  if (layerdisk >= N_LAYER && (!isPSmodule))
453  layerdisk += N_DISK;
454  double bendcut = bendcut_[layerdisk][ibend];
455  if (bendcut <= 0.0)
456  std::cout << "bendcut : " << layerdisk << " " << ibend << " " << isPSmodule << std::endl;
457  assert(bendcut > 0.0);
458  return bendcut;
459  }
460 
461  // DTC in given ATCA crate slot.
462  std::string slotToDTCname(unsigned int slot) const { return slotToDTCname_.at(slot); }
463 
464  // Tracker layers read by given DTC.
465  const std::vector<int>& dtcLayers(const std::string& dtcName) const {
466  auto iter = dtclayers_.find(dtcName);
467  assert(iter != dtclayers_.end());
468  return iter->second;
469  }
470 
471  double bendcutte(int ibend, int layerdisk, bool isPSmodule) const { return bendcut(ibend, layerdisk, isPSmodule); }
472 
473  double bendcutme(int ibend, int layerdisk, bool isPSmodule) const {
474  //Should understand why larger cut needed in disks
475  double fact = (layerdisk < N_LAYER) ? 1.0 : 1.8;
476  return fact * bendcut(ibend, layerdisk, isPSmodule);
477  }
478 
479  bool useCalcBendCuts = true;
480 
481  double bendcutTE(unsigned int seed, bool inner) const {
482  if (inner) {
483  return bendcutTE_[seed][0];
484  } else {
485  return bendcutTE_[seed][1];
486  }
487  }
488 
489  double bendcutME(unsigned int layerdisk, bool isPSmodule) const {
490  if (layerdisk >= N_LAYER && (!isPSmodule))
491  layerdisk += N_DISK;
492 
493  return bendcutME_[layerdisk];
494  }
495 
496  //layers/disks used by each seed
497  std::array<std::array<int, 3>, N_SEED> seedlayers() const { return seedlayers_; }
498 
499  //projection layers by seed index. For each seeding index (row) the list of layers that we consider projections to
500  std::array<std::array<unsigned int, N_LAYER - 2>, N_SEED> projlayers() const { return projlayers_; }
501 
502  //projection disks by seed index. For each seeding index (row) the list of diks that we consider projections to
503  std::array<std::array<unsigned int, N_DISK>, N_SEED> projdisks() const { return projdisks_; }
504 
505  private:
507 
514 
515  double rcrit_{55.0}; // critical radius for the hourglass configuration
516 
517  double dphicritmc_{0.005};
518 
519  //fraction of full r and z range that stubs can be located within layer/disk
520  double deltarzfract_{32.0};
521 
522  double maxt_{32.0}; //range in t that we must cover
523 
524  std::array<unsigned int, N_LAYER> irmean_{{851, 1269, 1784, 2347, 2936, 3697}};
525  std::array<unsigned int, N_DISK> izmean_{{2239, 2645, 3163, 3782, 4523}};
526 
527  std::array<unsigned int, N_LAYER + N_DISK> nzbitsstub_{{12, 12, 12, 8, 8, 8, 7, 7, 7, 7, 7}};
528  std::array<unsigned int, N_LAYER + N_DISK> nphibitsstub_{{14, 14, 14, 17, 17, 17, 14, 14, 14, 14, 14}};
529  std::array<unsigned int, N_LAYER + N_DISK> nrbitsstub_{{7, 7, 7, 7, 7, 7, 12, 12, 12, 12, 12}};
530 
531  unsigned int nrbitsprojderdisk_{9};
532  unsigned int nbitsphiprojderL123_{10};
533  unsigned int nbitsphiprojderL456_{10};
534  unsigned int nbitszprojderL123_{10};
535  unsigned int nbitszprojderL456_{9};
536 
537  unsigned int nbendbitsmedisk_{4}; // Always 4 bits even for PS disk hits, for HLS compatibility
538 
539  std::set<unsigned int> useseeding_{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11};
540 
541  std::array<unsigned int, N_LAYER + N_DISK> nbitsallstubs_{{3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2}};
542  std::array<unsigned int, N_LAYER + N_DISK> nbitsvmme_{{2, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2}};
543  std::array<std::array<unsigned int, N_SEED>, 3> nbitsvmte_{
544  {{{2, 2, 2, 2, 2, 2, 1, 1, 2, 2, 3, 2}}, // (3 = #stubs/triplet, only row 1+2 used for tracklet)
545  {{3, 2, 3, 3, 2, 2, 2, 2, 3, 3, 2, 2}},
546  {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1}}}};
547 
548  std::array<std::array<unsigned int, N_SEED>, 3> nbitsvmtecm_{
549  {{{2, 2, 2, 2, 2, 2, 1, 1, 2, 2, 3, 2}}, // (3 = #stubs/triplet, only row 1+2 used for tracklet)
550  {{3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2}},
551  {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1}}}};
552 
553  // FIX: There should be 3 PS10G slots & 3 PS (5G) ones.
554  // (Will change output files used by HLS).
555  std::vector<std::string> slotToDTCname_{
556  "PS10G_1", "PS10G_2", "PS10G_3", "PS10G_4", "PS_1", "PS_2", "2S_1", "2S_2", "2S_3", "2S_4", "2S_5", "2S_6"};
557 
558  std::map<std::string, std::vector<int> > dtclayers_{{"PS10G_1", {0, 6, 8, 10}},
559  {"PS10G_2", {0, 7, 9}},
560  {"PS10G_3", {1, 7}},
561  {"PS10G_4", {6, 8, 10}},
562  {"PS_1", {2, 7}},
563  {"PS_2", {2, 9}},
564  {"2S_1", {3, 4}},
565  {"2S_2", {4}},
566  {"2S_3", {5}},
567  {"2S_4", {5, 8}},
568  {"2S_5", {6, 9}},
569  {"2S_6", {7, 10}}};
570 
571  double rmindiskvm_{22.5};
572  double rmaxdiskvm_{67.0};
573 
574  double rmaxdiskl1overlapvm_{45.0};
575  double rmindiskl2overlapvm_{40.0};
576  double rmindiskl3overlapvm_{50.0};
577 
578  double rPS2S_{60.0};
579 
580  double z0cut_{15.0};
581 
582  double disp_z0cut_{27.0};
583 
584  unsigned int NLONGVMBITS_{3};
585 
586  double zlength_{120.0};
587  double rmaxdisk_{120.0};
588  double rmindisk_{20.0};
589 
590  double zsepdisk_{1.5}; //cm
591 
592  double half2SmoduleWidth_{4.57};
593 
594  double maxrinv_{0.006};
595  double maxd0_{10.0};
596 
597  unsigned int nbitsd0_{13};
598 
599  double ptmin_{2.0}; //minumim pt for tracks
600 
601  double ptcutte_{1.8}; //Minimum pt in TE
602 
603  // VALUE AUTOMATICALLY INCREASED FOR EXTENDED TRACKING BY PYTHON CFG
604  unsigned int nbitstrackletindex_{7}; //Bits used to store the tracklet index
605 
606  unsigned int nbitsitc_{4}; //Bits used to store the iTC, a unique
607  //identifier assigned to each TC within a sector
608  unsigned int nbitsseed_{3}; //Bits used to store the seed number
609  unsigned int nbitsseedextended_{4}; //Bits used to store the seed number
610  //in the extended project
611 
612  //Bits used to store track parameter in tracklet
613  int nbitsrinv_{14};
614  int nbitsphi0_{18};
615  int nbitst_{14};
616  int nbitsz0_{10};
617 
618  //track and tracklet parameters
619  int rinv_shift_{-8}; // Krinv = 2^shift * Kphi/Kr
620  int phi0_shift_{1}; // Kphi0 = 2^shift * Kphi
621  int t_shift_{-10}; // Kt = 2^shift * Kz/Kr
622  int z0_shift_{0}; // Kz0 = 2^shift * kz
623 
624  //projections are coarsened from global to stub precision
625 
626  //projection to R parameters
628  int PS_zL_shift_{0}; // z projections have global precision in ITC
629 
631  int PS_zderL_shift_{-7}; // Kderz = 2^shift * Kz/Kr
633 
634  //projection to Z parameters
636  int PS_rD_shift_{1}; // a bug?! coarser by a factor of two then stubs??
637 
639  int PS_rderD_shift_{-6}; //Kderrdisk = 2^shift * Kr/Kz
640 
641  //numbers needed for matches & fit, unclear what they are.
645 
646  int phiresidbits_{12};
647  int zresidbits_{9};
648  int rresidbits_{7};
649 
650  //Trackfit
651  int fitrinvbitshift_{9}; //6 OK?
652  int fitphi0bitshift_{6}; //4 OK?
653  int fittbitshift_{10}; //4 OK? //lower number gives rounding problems
654  int fitz0bitshift_{8}; //6 OK?
655 
656  //r correction bits
657  int rcorrbits_{6};
658 
661 
662  std::array<unsigned int, N_SEED> teunits_{{5, 2, 5, 3, 3, 2, 3, 2, 0, 0, 0, 0}}; //teunits used by seed
663 
664  std::array<unsigned int, N_LAYER + N_DISK> vmrlutzbits_{
665  {7, 7, 7, 7, 7, 7, 3, 3, 3, 3, 3}}; // zbits used by LUT in VMR
666  std::array<unsigned int, N_LAYER + N_DISK> vmrlutrbits_{
667  {4, 4, 4, 4, 4, 4, 8, 8, 8, 8, 8}}; // rbits used by LUT in VMR
668 
669  std::array<std::array<unsigned int, N_SEED>, 3> nfinephi_{
670  {{{2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2}}, //inner (3 = #stubs/triplet, only row 1+2 used for tracklet)
671  {{3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3}}, //outer
672  {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3}}}}; //outermost (triplets only)
673 
674  //These are the number of bits used for the VM regions in the TE by seedindex
675  //FIXME not independed nbitsvmte
676  std::array<std::array<unsigned int, N_SEED>, 3> nphireg_{
677  {{{5, 4, 4, 4, 4, 4, 4, 3, 4, 4, 5, 4}}, //inner
678  {{5, 4, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4}}, //outer
679  {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4}}}}; //outermost (triplets only)
680 
681  //For combined modules
682  std::array<std::array<unsigned int, N_SEED>, 3> nphiregcm_{
683  {{{5, 4, 4, 4, 4, 4, 4, 3, 4, 4, 5, 4}}, //inner
684  {{5, 5, 5, 5, 5, 5, 5, 5, 4, 4, 4, 4}}, //outer
685  {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4}}}}; //outermost (triplets only)
686 
687  // These are the number of bits to represent lutval for VM memories in TE
688  std::array<std::array<unsigned int, N_SEED>, 3> lutwidthtab_{{{{10, 10, 10, 10, 10, 10, 10, 10, 0, 0, 11, 0}},
689  {{6, 6, 6, 6, 10, 10, 10, 10, 0, 0, 6, 0}},
690  {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 6}}}};
691 
692  // These are the number of bits to represent lutval for VM memories in TED
693  // TO DO: tune lutwidthtabextended_ values
694 
695  /* std::array<std::array<unsigned int, N_SEED>, 3> lutwidthtabextended_{ */
696  /* {{{11, 11, 21, 21, 21, 21, 11, 11, 0, 0, 21, 0}}, */
697  /* {{6, 6, 6, 6, 10, 10, 10, 10, 0, 0, 6, 0}}, */
698  /* {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 6}}}}; */
699 
700  std::array<std::array<unsigned int, N_SEED>, 3> lutwidthtabextended_{
701  {{{21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21}},
702  {{21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21}},
703  {{21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21}}}};
704 
705  //layers/disks used by each seed
706  std::array<std::array<int, 3>, N_SEED> seedlayers_{{{{0, 1, -1}}, //L1L2
707  {{1, 2, -1}}, //1 L2L3
708  {{2, 3, -1}}, //2 L3L4
709  {{4, 5, -1}}, //3 L5L6
710  {{6, 7, -1}}, //4 D1D2
711  {{8, 9, -1}}, //5 D3D4
712  {{0, 6, -1}}, //6 L1D1
713  {{1, 6, -1}}, //7 L2D1
714  {{2, 3, 1}}, //8 L2L3L4
715  {{4, 5, 3}}, //9 L4L5L6
716  {{1, 2, 6}}, //10 L2L3D1
717  {{6, 7, 1}}}}; //11 D1D2L2
718 
719  //Number of tracklet calculators for the prompt seeding combinations
720  std::array<unsigned int, N_SEED> ntc_{{12, 4, 4, 4, 4, 4, 8, 4, 0, 0, 0, 0}};
721 
722  //projection layers by seed index. For each seeding index (row) the list of layers that we consider projections to
723  std::array<std::array<unsigned int, N_LAYER - 2>, N_SEED> projlayers_{{{{3, 4, 5, 6}}, //0 L1L2
724  {{1, 4, 5, 6}}, //1 L2L3
725  {{1, 2, 5, 6}}, //2 L3L4
726  {{1, 2, 3, 4}}, //3 L5L6
727  {{1, 2}}, //4 D1D2
728  {{1}}, //5 D3D4
729  {{}}, //6 L1D1
730  {{1}}, //7 L2D1
731  {{1, 5, 6}}, //8 L2L3L4
732  {{1, 2, 3}}, //9 L4L5L6
733  {{1}}, //10 L2L3D1
734  {{1}}}}; //11 D1D2L2
735 
736  //projection disks by seed index. For each seeding index (row) the list of diks that we consider projections to
737  std::array<std::array<unsigned int, N_DISK>, N_SEED> projdisks_{{{{1, 2, 3, 4}}, //0 L1L2
738  {{1, 2, 3, 4}}, //1 L2L3
739  {{1, 2}}, //2 L3L4
740  {{}}, //3 L5L6
741  {{3, 4, 5}}, //4 D1D2
742  {{1, 2, 5}}, //5 D3D4
743  {{2, 3, 4, 5}}, //6 L1D1
744  {{2, 3, 4}}, //7 L2D1
745  {{1, 2, 3}}, //8 L2L3L4
746  {{}}, //9 L4L5L6
747  {{2, 3, 4}}, //10 L2L3D1
748  {{3, 4}}}}; //11 D1D2L2
749 
750  //rphi cuts for layers - the column is the seedindex
751  std::array<std::array<double, N_SEED>, N_LAYER> rphimatchcut_{
752  {{{0.0, 0.1, 0.07, 0.08, 0.07, 0.05, 0.0, 0.05, 0.08, 0.15, 0.125, 0.15}}, //Layer 1
753  {{0.0, 0.0, 0.06, 0.08, 0.05, 0.0, 0.0, 0.0, 0.0, 0.1, 0.0, 0.0}}, //Layer 2
754  {{0.1, 0.0, 0.0, 0.08, 0.0, 0.0, 0.0, 0.0, 0.0, 0.08, 0.0, 0.0}}, //Layer 3
755  {{0.19, 0.19, 0.0, 0.05, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}}, //Layer 4
756  {{0.4, 0.4, 0.08, 0.0, 0.0, 0.0, 0.0, 0.0, 0.08, 0.0, 0.0, 0.0}}, //Layer 5
757  {{0.5, 0.0, 0.19, 0.0, 0.0, 0.0, 0.0, 0.0, 0.2, 0.0, 0.0, 0.0}}}}; //Layer 6
758 
759  //z cuts for layers - the column is the seedindex
760  std::array<std::array<double, N_SEED>, N_LAYER> zmatchcut_{
761  {{{0.0, 0.7, 5.5, 15.0, 1.5, 2.0, 0.0, 1.5, 1.0, 8.0, 1.0, 1.5}}, //Layer 1
762  {{0.0, 0.0, 3.5, 15.0, 1.25, 0.0, 0.0, 0.0, 0.0, 7.0, 0.0, 0.0}}, //Layer 2
763  {{0.7, 0.0, 0.0, 9.0, 0.0, 0.0, 0.0, 0.0, 0.0, 5.0, 0.0, 0.0}}, //Layer 3
764  {{3.0, 3.0, 0.0, 7.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}}, //Layer 4
765  {{3.0, 3.0, 8.0, 0.0, 0.0, 0.0, 0.0, 0.0, 4.5, 0.0, 0.0, 0.0}}, //Layer 5
766  {{4.0, 0.0, 9.5, 0.0, 0.0, 0.0, 0.0, 0.0, 4.5, 0.0, 0.0, 0.0}}}}; //Layer 6
767 
768  //rphi cuts for PS modules in disks - the column is the seedindex
769  std::array<std::array<double, N_SEED>, N_DISK> rphicutPS_{
770  {{{0.2, 0.2, 0.0, 0.0, 0.0, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}}, //disk 1
771  {{0.2, 0.2, 0.0, 0.0, 0.0, 0.1, 0.1, 0.1, 0.0, 0.0, 0.15, 0.0}}, //disk 2
772  {{0.25, 0.2, 0.0, 0.0, 0.15, 0.0, 0.2, 0.15, 0.0, 0.0, 0.0, 0.2}}, //disk 3
773  {{0.5, 0.2, 0.0, 0.0, 0.2, 0.0, 0.3, 0.5, 0.0, 0.0, 0.0, 0.0}}, //disk 4
774  {{0.0, 0.0, 0.0, 0.0, 0.25, 0.1, 0.5, 0.0, 0.0, 0.0, 0.0, 0.0}}}}; //disk 5
775 
776  //r cuts for PS modules in disks - the column is the seedindex
777  std::array<std::array<double, N_SEED>, N_DISK> rcutPS_{
778  {{{0.5, 0.5, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}}, //disk 1
779  {{0.5, 0.5, 0.0, 0.0, 0.0, 0.5, 0.5, 0.5, 0.0, 0.0, 0.5, 0.0}}, //disk 2
780  {{0.5, 0.5, 0.0, 0.0, 0.5, 0.0, 0.6, 0.8, 0.0, 0.0, 0.0, 0.4}}, //disk 3
781  {{0.5, 0.5, 0.0, 0.0, 0.8, 0.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0}}, //disk 4
782  {{0.0, 0.0, 0.0, 0.0, 1.0, 0.5, 2.0, 0.0, 0.0, 0.0, 0.0, 0.0}}}}; //disk 5
783 
784  //rphi cuts for 2S modules in disks = the column is the seedindex
785  std::array<std::array<double, N_SEED>, N_DISK> rphicut2S_{
786  {{{0.5, 0.5, 0.8, 0.0, 0.0, 0.0, 0.0, 0.0, 0.2, 0.0, 0.0, 0.0}}, //disk 1
787  {{0.5, 0.5, 0.8, 0.0, 0.0, 0.0, 0.5, 0.15, 0.3, 0.0, 0.68, 0.0}}, //disk 2
788  {{0.5, 0.5, 0.0, 0.0, 0.15, 0.0, 0.2, 0.25, 0.0, 0.0, 0.8, 0.1}}, //disk 3
789  {{0.5, 0.5, 0.0, 0.0, 0.2, 0.0, 0.25, 0.5, 0.0, 0.0, 0.6, 0.4}}, //disk 4
790  {{0.0, 0.0, 0.0, 0.0, 0.4, 0.2, 0.4, 0.0, 0.0, 0.0, 0.0, 0.8}}}}; //disk 5
791 
792  //r cuts for 2S modules in disks -the column is the seedindex
793  std::array<std::array<double, N_SEED>, N_DISK> rcut2S_{
794  {{{3.8, 3.8, 3.8, 0.0, 0.0, 0.0, 0.0, 0.0, 3.0, 0.0, 0.0, 0.0}}, //disk 1
795  {{3.8, 3.8, 3.8, 0.0, 0.0, 0.0, 3.8, 3.4, 3.0, 0.0, 3.0, 0.0}}, //disk 2
796  {{3.6, 3.8, 0.0, 0.0, 3.6, 0.0, 3.6, 3.8, 0.0, 0.0, 3.8, 3.0}}, //disk 3
797  {{3.6, 3.8, 0.0, 0.0, 3.6, 0.0, 3.5, 3.8, 0.0, 0.0, 3.0, 3.0}}, //disk 4
798  {{0.0, 0.0, 0.0, 0.0, 3.6, 3.4, 3.7, 0.0, 0.0, 0.0, 0.0, 3.0}}}}; //disk 5
799 
800  //returns the mean bend (in strips at a 1.8 mm separation) for bendcode
801  std::array<std::array<double, 16>, 16> benddecode_{
802  {{{0.0, 0.5, 0.7, 0.8, 89.9, -1.0, -0.9, -0.8, 99.9, 99.9, 99.9, 99.9, 99.9, 99.9, 99.9, 99.9}}, //L1 PS
803  {{0.0, 0.7, 1.0, 1.5, 89.9, -1.5, -1.0, -0.7, 99.9, 99.9, 99.9, 99.9, 99.9, 99.9, 99.9, 99.9}}, //L2 PS
804  {{0.0, 1.0, 1.8, 2.2, 89.9, -2.2, -1.8, -1.0, 99.9, 99.9, 99.9, 99.9, 99.9, 99.9, 99.9, 99.9}}, //L3 PS
805  {{0.0, 0.7, 1.2, 1.8, 2.1, 2.6, 3.2, 3.5, 89.9, -3.5, -3.2, -2.6, -2.1, -1.8, -1.2, -0.7}}, //L4 2S
806  {{0.0, 0.8, 1.2, 1.8, 2.2, 3.2, 4.1, 4.4, 89.9, -4.4, -4.1, -3.2, -2.2, -1.8, -1.2, -0.8}}, //L5 2S
807  {{0.0, 0.9, 1.8, 2.8, 3.8, 4.5, 5.3, 5.9, 89.9, -5.9, -5.3, -4.5, -3.8, -2.8, -1.8, -0.9}}, //L6 2S
808  {{0.0, 0.8, 1.2, 2.0, 89.9, -2.0, -1.2, -0.8, 99.9, 99.9, 99.9, 99.9, 99.9, 99.9, 99.9, 99.9}}, //D1 PS
809  {{0.0, 1.5, 1.8, 2.4, 89.9, -2.4, -1.8, -1.4, 99.9, 99.9, 99.9, 99.9, 99.9, 99.9, 99.9, 99.9}}, //D2 PS
810  {{0.0, 1.7, 2.0, 2.2, 89.9, -2.2, -2.0, -1.7, 99.9, 99.9, 99.9, 99.9, 99.9, 99.9, 99.9, 99.9}}, //D3 PS
811  {{0.0, 1.8, 2.0, 2.4, 89.9, -2.4, -2.0, -1.8, 99.9, 99.9, 99.9, 99.9, 99.9, 99.9, 99.9, 99.9}}, //D4 PS
812  {{0.0, 2.0, 2.2, 2.4, 89.9, -2.4, -2.0, -1.8, 99.9, 99.9, 99.9, 99.9, 99.9, 99.9, 99.9, 99.9}}, //D5 PS
813  {{0.0, 1.8, 2.3, 2.5, 3.0, 3.9, 4.5, 5.2, 89.9, -5.2, -4.5, -3.9, -3.0, -2.5, -2.3, -1.8}}, //D1 2S
814  {{0.0, 2.0, 2.4, 2.9, 3.2, 4.0, 4.8, 5.2, 89.9, -5.2, -4.8, -4.0, -3.2, -2.9, -2.4, -2.0}}, //D2 2S
815  {{0.0, 2.0, 2.4, 2.7, 3.6, 3.7, 4.4, 4.6, 89.9, -4.6, -4.4, -3.7, -3.6, -2.7, -2.4, -2.0}}, //D3 2S
816  {{0.0, 2.0, 2.6, 3.2, 3.8, 4.0, 4.4, 4.4, 89.9, -4.4, -4.4, -4.0, -3.8, -3.2, -2.6, -2.0}}, //D4 2S
817  {{0.0, 2.0, 3.2, 3.4, 3.9, 3.9, 4.4, 4.4, 89.9, -4.4, -4.4, -3.9, -3.9, -3.4, -3.2, -2.0}}}}; //D5 2S
818 
819  //returns the bend 'cut' (in strips at a 1.8 mm separation) for bendcode
820  std::array<std::array<double, 16>, 16> bendcut_{
821  {{{1.5, 1.2, 0.8, 0.8, 99.9, 0.8, 0.8, 1.2, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0}}, //L1 PS
822  {{1.5, 1.3, 1.0, 1.0, 99.9, 1.0, 1.0, 1.3, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0}}, //L2 PS
823  {{1.6, 1.5, 1.0, 1.0, 99.9, 1.0, 1.0, 1.5, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0}}, //L3 PS
824  {{1.6, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 99.9, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}}, //L4 2S
825  {{1.6, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 99.9, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}}, //L5 2S
826  {{1.6, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 99.9, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}}, //L6 2S
827  {{1.8, 1.6, 1.6, 1.6, 99.9, 1.6, 1.6, 1.6, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0}}, //D1 PS
828  {{1.8, 1.6, 1.6, 1.6, 99.9, 1.6, 1.6, 1.6, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0}}, //D2 PS
829  {{1.8, 1.6, 1.6, 1.6, 99.9, 1.6, 1.6, 1.6, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0}}, //D3 PS
830  {{2.2, 1.6, 1.6, 1.6, 99.9, 1.6, 1.6, 1.6, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0}}, //D4 PS
831  {{2.2, 1.6, 1.6, 1.6, 99.9, 1.6, 1.6, 1.6, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0}}, //D5 PS
832  {{2.0, 1.2, 1.2, 1.2, 1.5, 1.5, 1.5, 1.5, 99.9, 1.5, 1.5, 1.5, 1.5, 1.2, 1.2, 1.2}}, //D1 2S
833  {{2.0, 1.2, 1.2, 1.2, 1.5, 1.5, 1.5, 1.5, 99.9, 1.5, 1.5, 1.5, 1.5, 1.2, 1.2, 1.2}}, //D2 2S
834  {{2.2, 1.5, 1.5, 1.5, 2.0, 2.0, 2.0, 2.0, 99.9, 2.0, 2.0, 2.0, 2.0, 1.5, 1.5, 1.5}}, //D3 2S
835  {{2.5, 1.5, 1.5, 2.0, 2.0, 2.0, 2.0, 2.0, 99.9, 2.0, 2.0, 2.0, 2.0, 2.0, 1.5, 1.5}}, //D4 2S
836  {{2.5, 1.5, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 99.9, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 1.5}}}}; //D5 2S
837 
838  double FEbendcut = sqrt(1 / 6.0);
839 
840  double bendcutTE_[N_SEED_PROMPT][2] = {{2.2 * FEbendcut, 2.5 * FEbendcut}, //L1L2
841  {2.0 * FEbendcut, 2.0 * FEbendcut}, //L2L3
842  {2.0 * FEbendcut, 2.6 * FEbendcut}, //L3L4
843  {2.4 * FEbendcut, 2.4 * FEbendcut}, //L5L6
844  {2.5 * FEbendcut, 2.2 * FEbendcut}, //D1D2 PS
845  {2.0 * FEbendcut, 2.0 * FEbendcut}, //D3D4 PS
846  {2.0 * FEbendcut, 2.4 * FEbendcut}, //L1D1 PS
847  {2.2 * FEbendcut, 2.2 * FEbendcut}}; //L2D1 PS
848 
849  double bendcutME_[N_LAYER + 2 * N_DISK] = {2.0 * FEbendcut, //0 L1
850  2.5 * FEbendcut, //1 L2
851  2.0 * FEbendcut, //2 L3
852  2.5 * FEbendcut, //3 L4
853  2.2 * FEbendcut, //4 L5
854  2.3 * FEbendcut, //5 L6
855  4.0 * FEbendcut, //6 D1 PS
856  3.5 * FEbendcut, //7 D2 PS
857  3.5 * FEbendcut, //8 D3 PS
858  3.5 * FEbendcut, //9 D4 PS
859  2.7 * FEbendcut, //10 D5 PS
860  3.5 * FEbendcut, //11 D1 2S
861  3.4 * FEbendcut, //12 D2 2S
862  3.5 * FEbendcut, //13 D3 2S
863  3.7 * FEbendcut, //14 D4 2S
864  3.5 * FEbendcut}; //15 D5 2S
865 
866  // Offset to the maximum number of steps in each processing step:
867  // Set to 0 (default) means standard truncation
868  // Set to large value, e.g. 10000, to disable truncation
869  unsigned int maxstepoffset_{0};
870  // turn off truncation for displaced tracking (not implemented properly for displaced seeding)
871  unsigned int maxstepoffset_extended_{10000};
872 
873  //Number of processing steps for one event (108=18TM*240MHz/40MHz)
874 
875  //IR should be set to 108 to match the FW for the summer chain, but ultimately should be at 156
876  std::unordered_map<std::string, unsigned int> maxstep_{
877  {"IR", 156}, //IR will run at a higher clock speed to handle
878  //input links running at 25 Gbits/s
879  //Set to 108 to match firmware project 240 MHz clock
880 
881  {"VMR", 107},
882  {"TE", 107},
883  {"TC", 108},
884  {"PR", 108},
885  {"ME", 108},
886  //NOTE: The MC is set to 108, but `mergedepth`
887  //removes 3 iterations to emulate the delay
888  //due to the HLS priority encoder
889  {"MC", 108},
890  {"TB", 108},
891  {"MP", 108},
892  {"TP", 108},
893  {"TRE", 108},
894  {"DR", 108}}; //Specifies how many tracks allowed per bin in DR
895 
896  // If set to true this will generate debub printout in text files
897  std::unordered_map<std::string, bool> writeMonitorData_{{"IL", false},
898  {"TE", false},
899  {"CT", false},
900  {"HitPattern", false},
901  {"ChiSq", false},
902  {"Seeds", false},
903  {"FT", false},
904  {"Residuals", false},
905  {"StubBend", false},
906  {"MC", false},
907  {"MP", false},
908  {"ME", false},
909  {"AP", false},
910  {"VMP", false},
911  {"TrackProjOcc", false},
912  {"TC", false},
913  {"Pars", false},
914  {"TPars", false},
915  {"TPD", false},
916  {"TrackletPars", false},
917  {"TED", false},
918  {"TP", false},
919  {"TRE", false},
920  {"VMR", false},
921  {"StubsLayer", false},
922  {"StubsLayerSector", false},
923  {"HitEff", false},
924  {"MatchEff", false},
925  {"IFit", false},
926  {"AS", false},
927  {"WriteEmptyProj", false}};
928 
929  std::array<double, N_DSS_MOD> rDSSinner_mod_{{68.9391, 78.7750, 85.4550, 96.3150, 102.3160}};
930  std::array<double, N_DSS_MOD> rDSSouter_mod_{{66.4903, 76.7750, 84.4562, 94.9920, 102.3160}};
931 
932  //we want the center of the two strip positions in a module, not just the center of a module
933  double halfstrip_{2.5};
934 
935  // various printouts for debugging and warnings
936  bool printDebugKF_{false}; // if true print lots of debugging statements related to the KF fit
937  bool debugTracklet_{false}; //Print detailed debug information about tracklet tracking
938  bool writetrace_{false}; //Print out details about parsing configuration files
939 
940  bool warnNoMem_{false}; //If true will print out warnings about missing projection memories
941  bool warnNoDer_{false}; //If true will print out warnings about missing track fit derivatives
942 
943  //--- These used to create files needed by HLS code.
944  bool writeMem_{false}; //If true will print out content of memories (between algo steps) to files
945  bool writeTable_{false}; //If true will print out content of LUTs to files
946  bool writeConfig_{false}; //If true will print out the autogenerated configuration as files
947  std::string memPath_{"../data/MemPrints/"}; //path for writing memories
948  std::string tablePath_{"../data/LUTs/"}; //path for writing LUTs
949 
950  // Write various lookup tables and autogenerated code (from iMath)
951  bool writeVerilog_{false}; //Write out auto-generated Verilog mudules used by TCs
952  bool writeHLS_{false}; //Write out auto-generated HLS mudules used by TCs
953  bool writeInvTable_{false}; //Write out tables of drinv and invt in tracklet calculator for Verilog module
954  bool writeHLSInvTable_{false}; //Write out tables of drinv and invt in tracklet calculator for HLS module
955 
956  unsigned int writememsect_{3}; //writemem only for this sector (note that the files will have _4 extension)
957 
958  bool enableTripletTables_{false}; //Enable the application of the TED and
959  //TRE tables; when this flag is false,
960  //the tables will not be read from disk
961  bool writeTripletTables_{false}; //Train and write the TED and TRE tables. N.B.: the tables
962  //cannot be applied while they are being trained, i.e.,
963  //this flag effectively turns off the cuts in
964  //TrackletEngineDisplaced and TripletEngine
965 
966  bool writeoutReal_{false};
967 
968  //set to true/false to turn on/off histogram booking internal to the tracking (class "HistBase/HistImp", does nothing in central CMSSW)
969  bool bookHistos_{false};
970 
971  // pt constants
972  double ptcut_{1.91}; //Minimum pt cut
973 
974  // Parameters for bit sizes
975  int alphashift_{12};
976  int nbitsalpha_{4}; //bits used to store alpha
977  int alphaBitsTable_{2}; //For number of bits in track derivative table
978  int nrinvBitsTable_{3}; //number of bits for tabulating rinv dependence
979 
980  unsigned int MEBinsBits_{3};
981  unsigned int MEBinsDisks_{8}; //on each side
982  unsigned int maxStubsPerBin_{15}; //16 causes overflow!
983 
984  // Options for chisq fit
985  bool exactderivatives_{false};
986  bool exactderivativesforfloating_{true}; //only for the floating point
987  bool useapprox_{true}; //use approximate postion based on integer representation for floating point
988  bool usephicritapprox_{false}; //use floating point approximate version of phicrit cut if true
989 
990  // Duplicate Removal
991  // "merge" (hybrid dup removal)
992  // "ichi" (pairwise, keep track with best ichisq), "nstub" (pairwise, keep track with more stubs)
993  // "grid" (TMTT-like removal), "" (no removal)
994  unsigned int minIndStubs_{3}; // not used with merge removal
995 
996 #ifdef USEHYBRID
997  // Duplicate track removal algo. VALUE HERE OVERRIDDEN BY PYTHON CFG
998  std::string removalType_{"merge"};
999  // "CompareBest" (recommended) Compares only the best stub in each track for each region (best = smallest phi residual)
1000  // and will merge the two tracks if stubs are shared in three or more regions
1001  // "CompareAll" Compares all stubs in a region, looking for matches, and will merge the two tracks if stubs are shared in three or more regions
1002  std::string mergeComparison_{"CompareBest"};
1003  bool doKF_{true};
1004 #else
1007  bool doKF_{false};
1008 #endif
1009 
1010  // VALUE OVERRIDDEN BY PYTHON CFG
1011  // When false, match calculator does not save multiple matches, even when doKF=true.
1012  // This is a temporary fix for compatibilty with HLS. We will need to implement multiple match
1013  // printing in emulator eventually, possibly after CMSSW-integration inspired rewrites
1014  // Use false when generating HLS files, use true when doing full hybrid tracking
1016 
1017  // NEXT 2 VALUES OVERRIDDEN BY PYTHON CFG
1018  // if true, run a dummy fit, producing TTracks directly from output of tracklet pattern reco stage
1019  bool fakefit_{false};
1020  // if true, EDProducer fills additional bit & clock accurate TrackBuilder EDProduct
1022 
1023  // NEXT 3 VALUES OVERRIDDEN BY PYTHON CFG
1024  unsigned int nHelixPar_{4}; // 4 or 5 param helix fit
1025  bool extended_{false}; // turn on displaced tracking
1026  bool reduced_{false}; // use reduced (Summer Chain) config
1027  bool inventStubs_{true}; // invent seeding stub coordinates based on tracklet traj
1028 
1029  // Use combined TP (TE+TC) and MP (PR+ME+MC) configuration (with prompt tracking)
1030  bool combined_{false};
1031  // N.B. To use combined modules with extended tracking, edit
1032  // Tracklet_cfi.py to refer to *_hourglassExtendedCombined.dat,
1033  // but leave combined_=false.
1034 
1035  std::string skimfile_{""}; //if not empty events will be written out in ascii format to this file
1036 
1037  double bfield_{3.8112}; //B-field in T
1038  double c_{0.299792458}; //speed of light m/ns
1039 
1040  unsigned int nStrips_PS_{960};
1041  unsigned int nStrips_2S_{1016};
1042 
1043  double stripPitch_PS_{0.01};
1044  double stripPitch_2S_{0.009};
1045 
1046  double stripLength_PS_{0.1467};
1047  double stripLength_2S_{5.0250};
1048 
1049  //Following values are used for duplicate removal
1050  //Rinv bins were optimised to ensure a similar number of tracks in each bin prior to DR
1051  //Rinv bin edges for 6 bins.
1052  std::vector<double> rinvBins_{-rinvcut(), -0.004968, -0.003828, 0, 0.003828, 0.004968, rinvcut()};
1053  //Phi bin edges for 2 bins.
1054  std::vector<double> phiBins_{0, dphisectorHG() / 2, dphisectorHG()};
1055  //Overlap size for the overlap rinv bins in DR
1056  double rinvOverlapSize_{0.0004};
1057  //Overlap size for the overlap phi bins in DR
1058  double phiOverlapSize_{M_PI / 360};
1059  //The maximum number of tracks that are compared to all the other tracks per rinv bin
1061 
1062  double sensorSpacing_2S_{0.18};
1063  };
1064 
1065  constexpr unsigned int N_TILTED_RINGS = 12; // # of tilted rings per half-layer in TBPS layers
1066  constexpr std::array<unsigned int, N_PSLAYER> N_MOD_PLANK = {{7, 11, 15}}; // # of flat barrel modules/plank in TBPS
1067 
1068  constexpr unsigned int N_TRKLSEED = 7; // # of tracklet seeds
1069  constexpr unsigned int N_PROJ = 4; // # of projections (beyond stubs from tracklet seed)
1070 
1071  // chi2 fitting
1072  constexpr unsigned int N_FITPARAM = 4; // # of fit parameters for chi2 fit
1073  constexpr unsigned int N_FITSTUB = 6; // max # of number of stubs used
1074 
1075  constexpr unsigned int N_TRACKDER_PTBIN = 4;
1076  constexpr unsigned int N_TRACKDER_INDEX = 1000;
1077 
1078 } // namespace trklet
1079 
1080 #endif
unsigned int MEBinsBits() const
Definition: Settings.h:233
double rphicutPS(unsigned int iSeed, unsigned int idisk) const
Definition: Settings.h:168
unsigned int NLONGVMBITS_
Definition: Settings.h:584
void setStripLength_PS(double stripLength_PS)
Definition: Settings.h:291
unsigned int vmrlutrbits(unsigned int layerdisk) const
Definition: Settings.h:191
unsigned int writememsect_
Definition: Settings.h:956
std::array< std::array< double, N_SEED >, N_DISK > rcut2S_
Definition: Settings.h:793
unsigned int nHelixPar_
Definition: Settings.h:1024
constexpr int32_t ceil(float num)
constexpr unsigned int N_RZBITS
Definition: Settings.h:39
int zderbitshift() const
Definition: Settings.h:405
double dphicritmc_
Definition: Settings.h:517
std::array< unsigned int, N_SEED > teunits_
Definition: Settings.h:662
double phiOverlapSize_
Definition: Settings.h:1058
void setMemoryModulesFile(std::string memoryModulesFileName)
Definition: Settings.h:86
double kz() const
Definition: Settings.h:342
double stripLength(bool isPSmodule) const
Definition: Settings.h:290
double sensorSpacing2S() const
Definition: Settings.h:288
std::string memoryModulesFile_
Definition: Settings.h:510
const std::vector< int > & dtcLayers(const std::string &dtcName) const
Definition: Settings.h:465
int chisqzfactbits() const
Definition: Settings.h:421
int PS_rD_shift() const
Definition: Settings.h:397
int PS_zL_shift() const
Definition: Settings.h:389
double zmatchcut(unsigned int iSeed, unsigned int ilayer) const
Definition: Settings.h:167
constexpr double VMROUTERCUTZL1L3L5
Definition: Settings.h:49
int nrinvBitsTable() const
Definition: Settings.h:231
bool writeInvTable_
Definition: Settings.h:953
constexpr int N_DISK
Definition: Settings.h:26
bool writeHLS() const
Definition: Settings.h:208
unsigned int maxStep(std::string module) const
Definition: Settings.h:125
double disp_z0cut_
Definition: Settings.h:582
int PS_rderD_shift() const
Definition: Settings.h:400
std::string tablePath_
Definition: Settings.h:948
int PS_zderL_shift() const
Definition: Settings.h:392
double lutwidthtab(unsigned int inner, unsigned int iSeed) const
Definition: Settings.h:149
bool bookHistos() const
Definition: Settings.h:219
double bendcutME(unsigned int layerdisk, bool isPSmodule) const
Definition: Settings.h:489
unsigned int nrbitsstub(unsigned int layerdisk) const
Definition: Settings.h:93
double rPS2S() const
Definition: Settings.h:362
bool writeTable() const
Definition: Settings.h:201
double zmax(unsigned int iDisk) const
Definition: Settings.h:177
void setStoreTrackBuilderOutput(bool storeTrackBuilderOutput)
Definition: Settings.h:258
bool writeVerilog_
Definition: Settings.h:951
double kphi1() const
Definition: Settings.h:339
std::array< std::array< int, 3 >, N_SEED > seedlayers() const
Definition: Settings.h:497
unsigned int NLONGVMBITS() const
Definition: Settings.h:368
std::array< std::array< double, 16 >, 16 > bendcut_
Definition: Settings.h:820
constexpr double VMROUTERCUTZL1
Definition: Settings.h:50
double kphiderdisk() const
Definition: Settings.h:435
int alphaBitsTable() const
Definition: Settings.h:230
unsigned int nStrips_PS_
Definition: Settings.h:1040
double rDSSinner(unsigned int iBin) const
Definition: Settings.h:183
std::string skimfile() const
Definition: Settings.h:306
unsigned int nbitstrackletindex() const
Definition: Settings.h:309
unsigned int NTC(int seed) const
Definition: Settings.h:162
double kz0pars() const
Definition: Settings.h:431
unsigned int seedlayers(int inner, int seed) const
Definition: Settings.h:154
double rinvOverlapSize() const
Definition: Settings.h:296
void setFitPatternFile(std::string fitPatternFileName)
Definition: Settings.h:82
double rinvOverlapSize_
Definition: Settings.h:1056
std::vector< double > phiBins_
Definition: Settings.h:1054
double stripLength_PS_
Definition: Settings.h:1046
void setStripLength_2S(double stripLength_2S)
Definition: Settings.h:292
double benddecode(int ibend, int layerdisk, bool isPSmodule) const
Definition: Settings.h:443
std::array< std::array< unsigned int, N_SEED >, 3 > nphireg_
Definition: Settings.h:676
double kphider() const
Definition: Settings.h:434
constexpr unsigned int NRINVBITS
Definition: Settings.h:36
bool enableTripletTables() const
Definition: Settings.h:214
std::unordered_map< std::string, bool > writeMonitorData_
Definition: Settings.h:897
constexpr unsigned int N_SEED
Definition: Settings.h:28
bool combined() const
Definition: Settings.h:270
unsigned int maxstepoffset_
Definition: Settings.h:869
void setInventStubs(bool inventStubs)
Definition: Settings.h:275
Class to process and provide run-time constants used by Track Trigger emulators.
Definition: Setup.h:44
LayerDisk
Definition: Settings.h:54
bool enableTripletTables_
Definition: Settings.h:958
double disp_z0cut() const
Definition: Settings.h:366
std::string const & wiresFile() const
Definition: Settings.h:78
std::string const & tableTREFile() const
Definition: Settings.h:80
const tt::Setup * setup() const
Definition: Settings.h:72
std::string geomext() const
Definition: Settings.h:238
double dphisectorHG() const
Definition: Settings.h:320
double phicritmaxmc() const
Definition: Settings.h:335
double kphi(unsigned int layerdisk) const
Definition: Settings.h:340
unsigned int MEBinsDisks_
Definition: Settings.h:981
double rmindisk() const
Definition: Settings.h:135
std::string wiresFile_
Definition: Settings.h:511
unsigned int nbendbitsmedisk() const
Definition: Settings.h:101
std::string slotToDTCname(unsigned int slot) const
Definition: Settings.h:462
double maxd0() const
Definition: Settings.h:348
double zlength() const
Definition: Settings.h:133
double deltarzfract_
Definition: Settings.h:520
double rinvmax() const
Definition: Settings.h:226
double bendcut(int ibend, int layerdisk, bool isPSmodule) const
Definition: Settings.h:451
unsigned int nbitsseed() const
Definition: Settings.h:313
constexpr unsigned int N_BENDBITS_2S
Definition: Settings.h:34
constexpr unsigned int N_PROJ
Definition: Settings.h:1069
bool writeVerilog() const
Definition: Settings.h:207
void setNStrips_2S(unsigned int nStrips_2S)
Definition: Settings.h:282
double FEbendcut
Definition: Settings.h:838
unsigned int MEBinsDisks() const
Definition: Settings.h:235
void setReduced(bool reduced)
Definition: Settings.h:273
bool writeMem() const
Definition: Settings.h:200
bool exactderivatives() const
Definition: Settings.h:245
bool exactderivativesforfloating() const
Definition: Settings.h:246
std::array< unsigned int, N_LAYER > irmean_
Definition: Settings.h:524
double krder() const
Definition: Settings.h:437
std::vector< double > rinvBins_
Definition: Settings.h:1052
double rmindiskvm() const
Definition: Settings.h:355
double kd0pars() const
Definition: Settings.h:432
double ktpars() const
Definition: Settings.h:430
bool writetrace() const
Definition: Settings.h:195
bool printDebugKF() const
Definition: Settings.h:193
double rphimatchcut(unsigned int iSeed, unsigned int ilayer) const
Definition: Settings.h:166
double krinvpars() const
Definition: Settings.h:425
std::set< unsigned int > useseeding_
Definition: Settings.h:539
std::array< std::array< unsigned int, N_LAYER - 2 >, N_SEED > projlayers_
Definition: Settings.h:723
int phi0_shift() const
Definition: Settings.h:381
double dzmax() const
Definition: Settings.h:138
double stripLength_2S_
Definition: Settings.h:1047
unsigned int minIndStubs() const
Definition: Settings.h:250
double ptcut() const
Definition: Settings.h:221
bool reduced() const
Definition: Settings.h:272
constexpr unsigned int N_VMSTUBSMAX
Definition: Settings.h:42
constexpr unsigned int N_DSS_MOD
Definition: Settings.h:31
assert(be >=bs)
unsigned int minIndStubs_
Definition: Settings.h:994
constexpr double VMROUTERCUTZL2
Definition: Settings.h:48
unsigned int nbitsd0() const
Definition: Settings.h:349
double zmin(unsigned int iDisk) const
Definition: Settings.h:178
double phicritminmc() const
Definition: Settings.h:334
void setNbitsseedextended(unsigned int nbitsseed)
Definition: Settings.h:317
int fittbitshift() const
Definition: Settings.h:414
std::string processingModulesFile_
Definition: Settings.h:509
void setNStrips_PS(unsigned int nStrips_PS)
Definition: Settings.h:281
std::string const & tableTEDFile() const
Definition: Settings.h:79
std::string tableTEDFile_
Definition: Settings.h:512
constexpr unsigned int N_BENDBITS_PS
Definition: Settings.h:33
int fitz0bitshift() const
Definition: Settings.h:415
constexpr double third
Definition: Settings.h:46
unsigned int nbitszprojderL123_
Definition: Settings.h:534
int rresidbits() const
Definition: Settings.h:409
bool useCalcBendCuts
Definition: Settings.h:479
bool writeHLSInvTable_
Definition: Settings.h:954
unsigned int NLONGVMBINS() const
Definition: Settings.h:369
double kphi0pars() const
Definition: Settings.h:429
bool warnNoMem() const
Definition: Settings.h:197
unsigned int nbitszprojderL456() const
Definition: Settings.h:99
std::string skimfile_
Definition: Settings.h:1035
std::string memPath() const
Definition: Settings.h:204
int rcorrbits() const
Definition: Settings.h:418
unsigned int projlayers(unsigned int iSeed, unsigned int i) const
Definition: Settings.h:164
unsigned int nrbitsprojderdisk_
Definition: Settings.h:531
void setRemovalType(std::string removalType)
Definition: Settings.h:261
std::string tablePath() const
Definition: Settings.h:205
int SS_phiderD_shift_
Definition: Settings.h:638
const std::vector< double > & phiBins() const
Definition: Settings.h:304
std::string memPath_
Definition: Settings.h:947
int nbitst() const
Definition: Settings.h:376
unsigned int nrbitsprojderdisk() const
Definition: Settings.h:95
unsigned int nbitsphiprojderL456() const
Definition: Settings.h:97
double rmindiskl2overlapvm() const
Definition: Settings.h:359
std::array< unsigned int, N_LAYER+N_DISK > nphibitsstub_
Definition: Settings.h:528
double kzder() const
Definition: Settings.h:436
double zlength_
Definition: Settings.h:586
double zsepdisk_
Definition: Settings.h:590
unsigned int nbitsallstubs(unsigned int layerdisk) const
Definition: Settings.h:115
Definition: TTTypes.h:54
double dphisector() const
Definition: Settings.h:329
std::array< std::array< unsigned int, N_SEED >, 3 > nbitsvmtecm_
Definition: Settings.h:548
unsigned int nbitsseedextended_
Definition: Settings.h:609
int SS_phiderL_shift_
Definition: Settings.h:630
~Settings()=default
double half2SmoduleWidth() const
Definition: Settings.h:140
unsigned int nzbitsstub(unsigned int layerdisk) const
Definition: Settings.h:91
unsigned int nphibitsstub(unsigned int layerdisk) const
Definition: Settings.h:92
int numTracksComparedPerBin_
Definition: Settings.h:1060
double rmean(unsigned int iLayer) const
Definition: Settings.h:173
unsigned int nbitszprojderL123() const
Definition: Settings.h:98
std::array< unsigned int, N_LAYER+N_DISK > nrbitsstub_
Definition: Settings.h:529
int t_shift() const
Definition: Settings.h:382
constexpr std::array< unsigned int, N_PSLAYER > N_MOD_PLANK
Definition: Settings.h:1066
unsigned int nbitsseed_
Definition: Settings.h:608
void setStripPitch_PS(double stripPitch_PS)
Definition: Settings.h:285
std::array< double, N_DSS_MOD > rDSSinner_mod_
Definition: Settings.h:929
double phicritmin() const
Definition: Settings.h:331
std::array< std::array< unsigned int, N_SEED >, 3 > lutwidthtabextended_
Definition: Settings.h:700
double rmindiskl3overlapvm() const
Definition: Settings.h:360
double rDSSouter(unsigned int iBin) const
Definition: Settings.h:186
constexpr unsigned int N_TILTED_RINGS
Definition: Settings.h:1065
double ptcutte_
Definition: Settings.h:601
double maxrinv_
Definition: Settings.h:594
constexpr unsigned int N_TRKLSEED
Definition: Settings.h:1068
T sqrt(T t)
Definition: SSEVec.h:19
double phiOverlapSize() const
Definition: Settings.h:298
unsigned int MEBinsBits_
Definition: Settings.h:980
int nbitsrinv() const
Definition: Settings.h:374
double bfield() const
Definition: Settings.h:277
double stripPitch(bool isPSmodule) const
Definition: Settings.h:284
double rmindiskvm_
Definition: Settings.h:571
std::array< std::array< double, N_SEED >, N_DISK > rphicutPS_
Definition: Settings.h:769
double half2SmoduleWidth_
Definition: Settings.h:592
std::array< std::array< unsigned int, N_SEED >, 3 > nphiregcm_
Definition: Settings.h:682
unsigned int nbitsvmte(unsigned int inner, unsigned int iSeed) const
Definition: Settings.h:104
constexpr double VMROUTERCUTRD1D3
Definition: Settings.h:51
void setSkimfile(std::string skimfile)
Definition: Settings.h:307
double bendcutme(int ibend, int layerdisk, bool isPSmodule) const
Definition: Settings.h:473
unsigned int nStrips(bool isPSmodule) const
Definition: Settings.h:280
double lutwidthtabextended(unsigned int inner, unsigned int iSeed) const
Definition: Settings.h:150
std::array< std::array< unsigned int, N_LAYER - 2 >, N_SEED > projlayers() const
Definition: Settings.h:500
unsigned int nbitsphiprojderL456_
Definition: Settings.h:533
unsigned int numTracksComparedPerBin() const
Definition: Settings.h:300
double rmindisk_
Definition: Settings.h:588
std::string removalType() const
Definition: Settings.h:251
std::array< unsigned int, N_LAYER+N_DISK > nbitsallstubs_
Definition: Settings.h:541
bool doMultipleMatches() const
Definition: Settings.h:254
int alphashift() const
Definition: Settings.h:228
unsigned int MEBins() const
Definition: Settings.h:234
std::string fitPatternFile_
Definition: Settings.h:508
std::array< unsigned int, N_LAYER+N_DISK > vmrlutzbits_
Definition: Settings.h:664
bool fakefit() const
Definition: Settings.h:255
double rinvcut() const
Definition: Settings.h:222
unsigned int projdisks(unsigned int iSeed, unsigned int i) const
Definition: Settings.h:165
unsigned int nbitsitc() const
Definition: Settings.h:312
unsigned int nbitsvmme(unsigned int layerdisk) const
Definition: Settings.h:112
void setFakefit(bool fakefit)
Definition: Settings.h:256
std::string const & fitPatternFile() const
Definition: Settings.h:75
int z0_shift() const
Definition: Settings.h:383
bool writeMonitorData(std::string module) const
Definition: Settings.h:118
double rmaxdiskl1overlapvm_
Definition: Settings.h:574
double stripPitch_2S_
Definition: Settings.h:1044
double bendcutte(int ibend, int layerdisk, bool isPSmodule) const
Definition: Settings.h:471
bool inventStubs() const
Definition: Settings.h:274
std::string const & memoryModulesFile() const
Definition: Settings.h:77
double zmean(unsigned int iDisk) const
Definition: Settings.h:176
double bendcutME_[N_LAYER+2 *N_DISK]
Definition: Settings.h:849
unsigned int nbitstcindex() const
Definition: Settings.h:314
unsigned int nvmte(unsigned int inner, unsigned int iSeed) const
Definition: Settings.h:110
#define M_PI
std::array< std::array< double, N_SEED >, N_DISK > rphicut2S_
Definition: Settings.h:785
constexpr unsigned int NFINERZBITS
Definition: Settings.h:37
int SS_phiD_shift() const
Definition: Settings.h:396
unsigned int nallstubs(unsigned int layerdisk) const
Definition: Settings.h:116
double bendcutTE_[N_SEED_PROMPT][2]
Definition: Settings.h:840
bool debugTracklet() const
Definition: Settings.h:194
constexpr unsigned int N_SECTOR
Definition: Settings.h:23
double rcut2S(unsigned int iSeed, unsigned int idisk) const
Definition: Settings.h:171
int SS_phiderD_shift() const
Definition: Settings.h:399
unsigned int nbitszprojderL456_
Definition: Settings.h:535
double stripPitch_PS_
Definition: Settings.h:1043
unsigned int maxstepoffset_extended_
Definition: Settings.h:871
constexpr unsigned int N_PSLAYER
Definition: Settings.h:27
constexpr unsigned int N_TRACKDER_PTBIN
Definition: Settings.h:1075
double kr() const
Definition: Settings.h:344
unsigned int nbitsphiprojderL123_
Definition: Settings.h:532
unsigned int nbitstrackletindex_
Definition: Settings.h:604
const double fact
std::array< std::array< double, 16 >, 16 > benddecode_
Definition: Settings.h:801
double drmax() const
Definition: Settings.h:137
double z0cut() const
Definition: Settings.h:364
bool doMultipleMatches_
Definition: Settings.h:1015
bool storeTrackBuilderOutput() const
Definition: Settings.h:257
double rmaxdisk() const
Definition: Settings.h:134
double rmaxdiskvm_
Definition: Settings.h:572
double rphicut2S(unsigned int iSeed, unsigned int idisk) const
Definition: Settings.h:170
unsigned int nbitsitc_
Definition: Settings.h:606
std::array< unsigned int, N_LAYER+N_DISK > vmrlutrbits_
Definition: Settings.h:666
double rcutPS(unsigned int iSeed, unsigned int idisk) const
Definition: Settings.h:169
double kd0() const
Definition: Settings.h:351
bool printDebugKF_
Definition: Settings.h:936
void setProcessingModulesFile(std::string processingModulesFileName)
Definition: Settings.h:83
std::array< std::array< double, N_SEED >, N_LAYER > zmatchcut_
Definition: Settings.h:760
std::array< std::array< unsigned int, N_SEED >, 3 > nfinephi_
Definition: Settings.h:669
unsigned int nHelixPar() const
Definition: Settings.h:265
double kz(unsigned int layerdisk) const
Definition: Settings.h:343
constexpr unsigned int NFINEPHIBITS
Definition: Settings.h:38
unsigned int nbitsd0_
Definition: Settings.h:597
double rmax(unsigned int iLayer) const
Definition: Settings.h:174
double sensorSpacing_2S_
Definition: Settings.h:1062
std::array< std::array< double, N_SEED >, N_DISK > rcutPS_
Definition: Settings.h:777
std::string const & processingModulesFile() const
Definition: Settings.h:76
constexpr unsigned int N_TRACKDER_INDEX
Definition: Settings.h:1076
bool writeTripletTables_
Definition: Settings.h:961
constexpr unsigned int N_FITPARAM
Definition: Settings.h:1072
double rmindiskl2overlapvm_
Definition: Settings.h:575
int nfinephi(unsigned int inner, unsigned int iSeed) const
Definition: Settings.h:142
int SS_phiderL_shift() const
Definition: Settings.h:391
void setDoMultipleMatches(bool doMultipleMatches)
Definition: Settings.h:262
bool writeConfig() const
Definition: Settings.h:202
unsigned int nbitsphiprojderL123() const
Definition: Settings.h:96
bool storeTrackBuilderOutput_
Definition: Settings.h:1021
int chisqphifactbits_
Definition: Settings.h:659
bool useSeed(unsigned int iSeed) const
Definition: Settings.h:103
void setNbitsitc(unsigned int nbitsitc)
Definition: Settings.h:315
const tt::Setup * setup_
Definition: Settings.h:506
double c() const
Definition: Settings.h:224
std::string mergeComparison() const
Definition: Settings.h:252
bool extended() const
Definition: Settings.h:268
bool writeHLSInvTable() const
Definition: Settings.h:210
constexpr double sixth
Definition: Settings.h:45
unsigned int nvmme(unsigned int layerdisk) const
Definition: Settings.h:113
std::string removalType_
Definition: Settings.h:1005
int zresidbits() const
Definition: Settings.h:408
unsigned int maxStubsPerBin() const
Definition: Settings.h:236
double halfstrip_
Definition: Settings.h:933
std::string mergeComparison_
Definition: Settings.h:1006
std::array< unsigned int, N_LAYER+N_DISK > nbitsvmme_
Definition: Settings.h:542
unsigned int teunits(unsigned int iSeed) const
Definition: Settings.h:160
int phiresidbits() const
Definition: Settings.h:407
unsigned int nbendbitsmedisk_
Definition: Settings.h:537
double nphireg(unsigned int inner, unsigned int iSeed) const
Definition: Settings.h:143
std::vector< std::string > slotToDTCname_
Definition: Settings.h:555
int fitphi0bitshift_
Definition: Settings.h:652
bool writeoutReal() const
Definition: Settings.h:217
double rmin(unsigned int iLayer) const
Definition: Settings.h:175
int rinv_shift() const
Definition: Settings.h:380
unsigned int nStrips_2S_
Definition: Settings.h:1041
constexpr unsigned int N_FITSTUB
Definition: Settings.h:1073
void setNbitstrackletindex(unsigned int nbitstrackletindex)
Definition: Settings.h:310
double rmindiskl3overlapvm_
Definition: Settings.h:576
static unsigned int const shift
double rmaxdiskvm() const
Definition: Settings.h:356
void setNHelixPar(unsigned int nHelixPar)
Definition: Settings.h:266
unsigned int ntrackletmax() const
Definition: Settings.h:371
int fitrinvbitshift() const
Definition: Settings.h:412
std::array< std::array< unsigned int, N_SEED >, 3 > nbitsvmte_
Definition: Settings.h:543
bool writeInvTable() const
Definition: Settings.h:209
int nbitsalpha() const
Definition: Settings.h:229
void setWiresFile(std::string wiresFileName)
Definition: Settings.h:87
double phicritmax() const
Definition: Settings.h:332
int chisqphifactbits() const
Definition: Settings.h:420
std::array< std::array< unsigned int, N_DISK >, N_SEED > projdisks_
Definition: Settings.h:737
bool exactderivativesforfloating_
Definition: Settings.h:986
void setBfield(double bfield)
Definition: Settings.h:278
void setTableTREFile(std::string tableTREFileName)
Definition: Settings.h:89
double rinvcutte() const
Definition: Settings.h:353
double krbarrel() const
Definition: Settings.h:345
double zmaxdisk(unsigned int iDisk) const
Definition: Settings.h:181
std::array< std::array< unsigned int, N_SEED >, 3 > lutwidthtab_
Definition: Settings.h:688
void passSetup(const tt::Setup *setup)
Definition: Settings.h:71
double krprojshiftdisk() const
Definition: Settings.h:441
int fitrinvbitshift_
Definition: Settings.h:651
double maxrinv() const
Definition: Settings.h:347
std::array< std::array< int, 3 >, N_SEED > seedlayers_
Definition: Settings.h:706
std::array< unsigned int, N_LAYER+N_DISK > nzbitsstub_
Definition: Settings.h:527
double kphi() const
Definition: Settings.h:338
int nbitsphi0() const
Definition: Settings.h:375
bool usephicritapprox() const
Definition: Settings.h:248
void setTableTEDFile(std::string tableTEDFileName)
Definition: Settings.h:88
int fitphi0bitshift() const
Definition: Settings.h:413
bool doKF() const
Definition: Settings.h:253
bool usephicritapprox_
Definition: Settings.h:988
int SS_zderL_shift() const
Definition: Settings.h:393
void setNbitsseed(unsigned int nbitsseed)
Definition: Settings.h:316
std::array< std::array< unsigned int, N_DISK >, N_SEED > projdisks() const
Definition: Settings.h:503
int nbitsz0() const
Definition: Settings.h:377
std::unordered_map< std::string, unsigned int > maxstep_
Definition: Settings.h:876
void setStripPitch_2S(double stripPitch_2S)
Definition: Settings.h:286
bool debugTracklet_
Definition: Settings.h:937
int SS_phiL_shift() const
Definition: Settings.h:388
bool writeTripletTables() const
Definition: Settings.h:215
std::array< std::array< double, N_SEED >, N_LAYER > rphimatchcut_
Definition: Settings.h:751
constexpr unsigned int N_PHIBITS
Definition: Settings.h:40
std::map< std::string, std::vector< int > > dtclayers_
Definition: Settings.h:558
bool writeoutReal_
Definition: Settings.h:966
bool useapprox() const
Definition: Settings.h:247
std::array< unsigned int, N_SEED > ntc_
Definition: Settings.h:720
const std::vector< double > & rinvBins() const
Definition: Settings.h:302
void setCombined(bool combined)
Definition: Settings.h:271
constexpr unsigned int N_BITSMEMADDRESS
Definition: Settings.h:43
bool exactderivatives_
Definition: Settings.h:985
void setExtended(bool extended)
Definition: Settings.h:269
int phiderbitshift() const
Definition: Settings.h:404
unsigned int writememsect() const
Definition: Settings.h:212
bool warnNoDer() const
Definition: Settings.h:198
std::string tableTREFile_
Definition: Settings.h:513
std::array< unsigned int, N_DISK > izmean_
Definition: Settings.h:525
double zmindisk(unsigned int iDisk) const
Definition: Settings.h:180
int phi0bitshift() const
Definition: Settings.h:403
constexpr unsigned int N_SEED_PROMPT
Definition: Settings.h:29
unsigned int maxStubsPerBin_
Definition: Settings.h:982
unsigned int vmrlutzbits(unsigned int layerdisk) const
Definition: Settings.h:190
double bendcutTE(unsigned int seed, bool inner) const
Definition: Settings.h:481
constexpr int N_LAYER
Definition: Settings.h:25
double rmaxdiskl1overlapvm() const
Definition: Settings.h:358
double rcrit() const
Definition: Settings.h:327
double rmaxdisk_
Definition: Settings.h:587
std::array< double, N_DSS_MOD > rDSSouter_mod_
Definition: Settings.h:930