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