CMS 3D CMS Logo

MatchProcessor.cc
Go to the documentation of this file.
6 
10 
11 #include <filesystem>
12 
13 using namespace std;
14 using namespace trklet;
15 
16 MatchProcessor::MatchProcessor(string name, Settings const& settings, Globals* global, unsigned int iSector)
17  : ProcessBase(name, settings, global, iSector), fullmatches_(12), inputProjBuffer_(3) {
19 
20  phiregion_ = name[8] - 'A';
21 
24 
25  //TODO should sort out constants here
26  icorrshift_ = 7;
27 
28  if (layer_ <= 3) {
30  } else {
32  }
33  phi0shift_ = 3;
34  fact_ = 1;
35  if (layer_ >= 4) {
36  fact_ = (1 << (settings_.nzbitsstub(0) - settings_.nzbitsstub(5)));
37  icorrshift_ -= (10 - settings_.nrbitsstub(layer_ - 1));
40  phi0shift_ = 0;
41  }
42 
43  nrbits_ = 5;
44  nphiderbits_ = 6;
45 
46  //to adjust globaly the phi and rz matching cuts
47  phifact_ = 1.0;
48  rzfact_ = 1.0;
49 
50  for (unsigned int iSeed = 0; iSeed < 12; iSeed++) {
51  if (layer_ > 0) {
52  phimatchcut_[iSeed] =
54  zmatchcut_[iSeed] = settings_.zmatchcut(iSeed, layer_ - 1) / settings_.kz();
55  }
56  if (disk_ != 0) {
57  rphicutPS_[iSeed] = settings_.rphicutPS(iSeed, abs(disk_) - 1) / (settings_.kphi() * settings_.kr());
58  rphicut2S_[iSeed] = settings_.rphicut2S(iSeed, abs(disk_) - 1) / (settings_.kphi() * settings_.kr());
59  rcut2S_[iSeed] = settings_.rcut2S(iSeed, abs(disk_) - 1) / settings_.krprojshiftdisk();
60  rcutPS_[iSeed] = settings_.rcutPS(iSeed, abs(disk_) - 1) / settings_.krprojshiftdisk();
61  }
62  }
63 
64  if (iSector_ == 0 && layer_ > 0 && settings_.writeTable()) {
65  if (not std::filesystem::exists(settings_.tablePath())) {
66  int fail = system((string("mkdir -p ") + settings_.tablePath()).c_str());
67  if (fail)
68  throw cms::Exception("BadDir") << __FILE__ << " " << __LINE__ << " could not create directory "
69  << settings_.tablePath();
70  }
71 
72  const string filephicut = settings_.tablePath() + getName() + "_phicut.tab";
73  ofstream outphicut(filephicut);
74  if (outphicut.fail())
75  throw cms::Exception("BadFile") << __FILE__ << " " << __LINE__ << " could not create file " << filephicut;
76 
77  outphicut << "{" << endl;
78  for (unsigned int seedindex = 0; seedindex < 12; seedindex++) {
79  if (seedindex != 0)
80  outphicut << "," << endl;
81  outphicut << phimatchcut_[seedindex];
82  }
83  outphicut << endl << "};" << endl;
84  outphicut.close();
85 
86  const string filezcut = settings_.tablePath() + getName() + "_zcut.tab";
87  ofstream outzcut(filezcut);
88  if (outzcut.fail())
89  throw cms::Exception("BadFile") << __FILE__ << " " << __LINE__ << " could not create file " << filezcut;
90 
91  outzcut << "{" << endl;
92  for (unsigned int seedindex = 0; seedindex < N_SEED; seedindex++) {
93  if (seedindex != 0)
94  outzcut << "," << endl;
95  outzcut << zmatchcut_[seedindex];
96  }
97  outzcut << endl << "};" << endl;
98  outzcut.close();
99  }
100 
101  if (layer_ > 0) {
102  unsigned int nbits = 3;
103  if (layer_ >= 4)
104  nbits = 4;
105 
106  for (unsigned int irinv = 0; irinv < 32; irinv++) {
107  double rinv = (irinv - 15.5) * (1 << (settings_.nbitsrinv() - 5)) * settings_.krinvpars();
108  double stripPitch =
110  double projbend = bend(settings_.rmean(layer_ - 1), rinv, stripPitch);
111  for (unsigned int ibend = 0; ibend < (unsigned int)(1 << nbits); ibend++) {
112  double stubbend = benddecode(ibend, layer_ <= (int)N_PSLAYER);
113  bool pass = std::abs(stubbend - projbend) < settings_.bendcutme(layer_ - 1);
114  table_.push_back(pass);
115  }
116  }
117 
118  if (settings_.writeTable()) {
119  if (not std::filesystem::exists(settings_.tablePath())) {
120  int fail = system((string("mkdir -p ") + settings_.tablePath()).c_str());
121  if (fail)
122  throw cms::Exception("BadDir") << __FILE__ << " " << __LINE__ << " could not create directory "
123  << settings_.tablePath();
124  }
125 
126  char layer = '0' + layer_;
127  string fname = "METable_L";
128  fname += layer;
129  fname += ".tab";
130  const string full_fname = settings_.tablePath() + fname;
131  ofstream out(full_fname);
132  if (out.fail())
133  throw cms::Exception("BadFile") << __FILE__ << " " << __LINE__ << " could not create file " << full_fname;
134 
135  out << "{" << endl;
136  for (unsigned int i = 0; i < table_.size(); i++) {
137  if (i != 0) {
138  out << "," << endl;
139  }
140  out << table_[i];
141  }
142  out << "};" << endl;
143  out.close();
144  }
145  }
146 
147  if (disk_ > 0) {
148  for (unsigned int iprojbend = 0; iprojbend < 32; iprojbend++) {
149  double projbend = 0.5 * (iprojbend - 15.0);
150  for (unsigned int ibend = 0; ibend < 8; ibend++) {
151  double stubbend = benddecode(ibend, true);
152  bool pass = std::abs(stubbend - projbend) < settings_.bendcutme(disk_ + 5);
153  tablePS_.push_back(pass);
154  }
155  for (unsigned int ibend = 0; ibend < 16; ibend++) {
156  double stubbend = benddecode(ibend, false);
157  bool pass = std::abs(stubbend - projbend) < settings_.bendcutme(disk_ + 5);
158  table2S_.push_back(pass);
159  }
160  }
161  }
162 
163  for (unsigned int i = 0; i < N_DSS_MOD * 2; i++) {
165  (1 << (settings_.nbitsalpha() - 1)) / (settings_.rDSSinner(i) * settings_.rDSSinner(i)) /
166  settings_.kphi();
168  (1 << (settings_.nbitsalpha() - 1)) / (settings_.rDSSouter(i) * settings_.rDSSouter(i)) /
169  settings_.kphi();
170  }
171 
172  barrel_ = layer_ > 0;
173 
177 
178  if (nvm_ == 32)
179  nvmbits_ = 5;
180  if (nvm_ == 16)
181  nvmbits_ = 4;
182  assert(nvmbits_ != -1);
183 
184  nMatchEngines_ = 4;
185  for (unsigned int iME = 0; iME < nMatchEngines_; iME++) {
187  matchengines_.push_back(tmpME);
188  }
189 }
190 
192  if (settings_.writetrace()) {
193  edm::LogVerbatim("Tracklet") << "In " << name_ << " adding output to " << memory->getName() << " to output "
194  << output;
195  }
196  if (output.find("matchout") != std::string::npos) {
197  auto* tmp = dynamic_cast<FullMatchMemory*>(memory);
198  assert(tmp != nullptr);
199  unsigned int iSeed = getISeed(tmp->getName());
200  assert(iSeed < fullmatches_.size());
201  assert(fullmatches_[iSeed] == nullptr);
202  fullmatches_[iSeed] = tmp;
203  return;
204  }
205  throw cms::Exception("BadConfig") << __FILE__ << " " << __LINE__ << " could not find output: " << output;
206 }
207 
209  if (settings_.writetrace()) {
210  edm::LogVerbatim("Tracklet") << "In " << name_ << " adding input from " << memory->getName() << " to input "
211  << input;
212  }
213  if (input == "allstubin") {
214  auto* tmp = dynamic_cast<AllStubsMemory*>(memory);
215  assert(tmp != nullptr);
216  allstubs_ = tmp;
217  return;
218  }
219  if (input == "vmstubin") {
220  auto* tmp = dynamic_cast<VMStubsMEMemory*>(memory);
221  assert(tmp != nullptr);
222  vmstubs_.push_back(tmp); //to allow more than one stub in? vmstubs_=tmp;
223  return;
224  }
225  if (input == "projin") {
226  auto* tmp = dynamic_cast<TrackletProjectionsMemory*>(memory);
227  assert(tmp != nullptr);
228  inputprojs_.push_back(tmp);
229  return;
230  }
231  throw cms::Exception("BadConfig") << __FILE__ << " " << __LINE__ << " could not find input: " << input;
232 }
233 
235  assert(vmstubs_.size() == 1);
236 
237  if (globals_->projectionRouterBendTable() == nullptr) { // move to constructor?!
238  auto* bendTablePtr = new ProjectionRouterBendTable();
239  bendTablePtr->init(settings_, globals_, nrbits_, nphiderbits_);
240  globals_->projectionRouterBendTable() = bendTablePtr;
241  }
242 
243  /*
244  The code is organized in three 'steps' corresponding to the PR, ME, and MC functions. The output from
245  the PR step is buffered in a 'circular' buffer, and similarly the ME output is put in a circular buffer.
246 
247  The implementation is done in steps, emulating what can be done in firmware. One each step we do:
248 
249  1) A projection is read and if there is space it is insert into the inputProjBuffer_
250 
251  2) Process next match in the ME - if there is an idle ME the next projection is inserted
252 
253  3) Readout match from ME and send to match calculator
254 
255  */
256 
257  Tracklet* oldTracklet = nullptr;
258 
259  unsigned int countme = 0;
260  unsigned int countall = 0;
261  unsigned int countsel = 0;
262  unsigned int countinputproj = 0;
263 
264  unsigned int iprojmem = 0;
265  unsigned int iproj = 0;
266 
267  inputProjBuffer_.reset();
268 
269  for (unsigned int i = 0; i < inputprojs_.size(); i++) {
270  countinputproj += inputprojs_[i]->nTracklets();
271  }
272 
273  for (unsigned int iME = 0; iME < nMatchEngines_; iME++) {
274  matchengines_[iME].reset();
275  }
276 
277  unsigned int step2delay = 0;
278  unsigned int step3delay = 0;
279 
280  for (unsigned int istep = 0; istep < settings_.maxStep("MP") + step3delay; istep++) {
281  bool projdone = false;
282  bool medone = true;
283  //Step 1
284  //First step here checks if we have more input projections to put into
285  //the input puffer for projections
286 
287  if (istep < settings_.maxStep("MP")) {
288  if (iprojmem < inputprojs_.size()) {
289  TrackletProjectionsMemory* projMem = inputprojs_[iprojmem];
290  if (projMem->nTracklets() == 0) {
291  iprojmem++;
292  } else if (iproj < projMem->nTracklets()) {
293  if (!inputProjBuffer_.almostfull()) {
294  if (settings_.debugTracklet()) {
295  edm::LogVerbatim("Tracklet") << getName() << " have projection in memory : " << projMem->getName();
296  }
297 
298  Tracklet* proj = projMem->getTracklet(iproj);
299  FPGAWord fpgaphi = barrel_ ? proj->fpgaphiproj(layer_) : proj->fpgaphiprojdisk(disk_);
300 
301  int iphi = (fpgaphi.value() >> (fpgaphi.nbits() - nvmbits_)) & (nvmbins_ - 1);
302 
303  int projrinv = -1;
304  if (barrel_) {
305  projrinv = (1 << (NRINVBITS - 1)) + (proj->fpgarinv().value() >> (proj->fpgarinv().nbits() - NRINVBITS));
306  } else {
307  //The next lines looks up the predicted bend based on:
308  // 1 - r projections
309  // 2 - phi derivative
310  // 3 - the sign - i.e. if track is forward or backward
311  int rindex = (proj->fpgarprojdisk(disk_).value() >> (proj->fpgarprojdisk(disk_).nbits() - nrbits_)) &
312  ((1 << nrbits_) - 1);
313 
314  int phiderindex = (proj->fpgaphiprojderdisk(disk_).value() >>
315  (proj->fpgaphiprojderdisk(disk_).nbits() - nphiderbits_)) &
316  ((1 << nphiderbits_) - 1);
317 
318  int signindex = (proj->fpgarprojderdisk(disk_).value() < 0);
319 
320  int bendindex = (signindex << (nphiderbits_ + nrbits_)) + (rindex << (nphiderbits_)) + phiderindex;
321 
322  projrinv = globals_->projectionRouterBendTable()->bendLoookup(abs(disk_) - 1, bendindex);
323 
324  proj->setBendIndex(projrinv, disk_);
325  }
326  assert(projrinv >= 0);
327 
328  unsigned int slot = barrel_ ? proj->zbin1projvm(layer_) : proj->rbin1projvm(disk_);
329  bool second = (barrel_ ? proj->zbin2projvm(layer_) : proj->rbin2projvm(disk_));
330 
331  int nfinephi = 3;
332  unsigned int projfinephi =
333  (fpgaphi.value() >> (fpgaphi.nbits() - (nvmbits_ + nfinephi))) & ((1 << nfinephi) - 1);
334  int projfinerz = barrel_ ? proj->finezvm(layer_) : proj->finervm(disk_);
335 
336  bool isPSseed = proj->PSseed() == 1;
337 
338  int nbins = 8;
339  if (layerdisk_ >= 6)
340  nbins = 16;
341 
342  VMStubsMEMemory* stubmem = vmstubs_[0];
343  bool usefirst = stubmem->nStubsBin(iphi * nbins + slot) != 0;
344  bool usesecond = (second && (stubmem->nStubsBin(iphi * nbins + slot + 1) != 0));
345 
346  if (usefirst) {
347  ProjectionTemp tmpProj(proj, slot, projrinv, projfinerz, projfinephi, iphi, usesecond, isPSseed);
348  inputProjBuffer_.store(tmpProj);
349  } else if (usesecond) {
350  ProjectionTemp tmpProj(proj, slot + 1, projrinv, projfinerz - 8, projfinephi, iphi, false, isPSseed);
351  inputProjBuffer_.store(tmpProj);
352  }
353  iproj++;
354  if (iproj == projMem->nTracklets()) {
355  iproj = 0;
356  iprojmem++;
357  }
358  }
359  }
360  } else {
361  projdone = true;
362  }
363  }
364 
365  //Step 2
366  //Check if we have ME that can process projection
367 
368  if (istep >= step2delay && istep < settings_.maxStep("MP") + step2delay) {
369  bool addedProjection = false;
370  for (unsigned int iME = 0; iME < nMatchEngines_; iME++) {
371  if (!matchengines_[iME].idle())
372  countme++;
373  matchengines_[iME].step();
374  //if match engine empty and we have queued projections add to match engine
375  if ((!addedProjection) && matchengines_[iME].idle() && (!inputProjBuffer_.empty())) {
376  ProjectionTemp tmpProj = inputProjBuffer_.read();
377  VMStubsMEMemory* stubmem = vmstubs_[0];
378 
379  if (settings_.debugTracklet()) {
380  edm::LogVerbatim("Tracklet") << getName() << " adding projection to match engine";
381  }
382 
383  int nbins = 8;
384  if (layerdisk_ >= 6)
385  nbins = 16;
386 
387  matchengines_[iME].init(stubmem,
388  tmpProj.iphi() * nbins + tmpProj.slot(),
389  tmpProj.projrinv(),
390  tmpProj.projfinerz(),
391  tmpProj.projfinephi(),
392  tmpProj.usesecond(),
393  tmpProj.isPSseed(),
394  tmpProj.proj());
395  addedProjection = true;
396  }
397  }
398  }
399 
400  //Step 3
401  //Check if we have candidate match to process
402 
403  if (istep >= step3delay) {
404  unsigned int iMEbest = nMatchEngines_;
405  int bestTCID = -1;
406  bool bestInPipeline = false;
407  for (unsigned int iME = 0; iME < nMatchEngines_; iME++) {
408  bool empty = matchengines_[iME].empty();
409  medone = medone && (empty && matchengines_[iME].idle());
410  if (empty && matchengines_[iME].idle())
411  continue;
412  int currentTCID = empty ? matchengines_[iME].currentProj()->TCID() : matchengines_[iME].peek().first->TCID();
413  if ((iMEbest == nMatchEngines_) || (currentTCID < bestTCID)) {
414  iMEbest = iME;
415  bestTCID = currentTCID;
416  bestInPipeline = empty;
417  }
418  }
419 
420  if (iMEbest != nMatchEngines_ && (!bestInPipeline)) {
421  const std::pair<Tracklet*, const Stub*>& candmatch = matchengines_[iMEbest].read();
422 
423  const Stub* fpgastub = candmatch.second;
424  Tracklet* tracklet = candmatch.first;
425 
426  if (oldTracklet != nullptr) {
427  //allow equal here since we can have more than one cadidate match per tracklet projection
428  assert(oldTracklet->TCID() <= tracklet->TCID());
429  }
430  oldTracklet = tracklet;
431 
432  bool match = matchCalculator(tracklet, fpgastub);
433 
434  if (settings_.debugTracklet() && match) {
435  edm::LogVerbatim("Tracklet") << getName() << " have match";
436  }
437 
438  countall++;
439  if (match)
440  countsel++;
441  }
442  }
443  if ((projdone && medone) || (istep == settings_.maxStep("MP") + step3delay - 1)) {
444  globals_->ofstream("matchprocessor.txt") << getName() << " " << istep << " " << countall << " " << countsel << " "
445  << countme << " " << countinputproj << endl;
446  break;
447  }
448  }
449 
450  if (settings_.writeMonitorData("MC")) {
451  globals_->ofstream("matchcalculator.txt") << getName() << " " << countall << " " << countsel << endl;
452  }
453 }
454 
455 bool MatchProcessor::matchCalculator(Tracklet* tracklet, const Stub* fpgastub) {
456  const L1TStub* stub = fpgastub->l1tstub();
457 
458  if (layer_ != 0) {
459  int ir = fpgastub->r().value();
460  int iphi = tracklet->fpgaphiproj(layer_).value();
461  int icorr = (ir * tracklet->fpgaphiprojder(layer_).value()) >> icorrshift_;
462  iphi += icorr;
463 
464  int iz = tracklet->fpgazproj(layer_).value();
465  int izcor = (ir * tracklet->fpgazprojder(layer_).value() + (1 << (icorzshift_ - 1))) >> icorzshift_;
466  iz += izcor;
467 
468  int ideltaz = fpgastub->z().value() - iz;
469  int ideltaphi = (fpgastub->phi().value() << phi0shift_) - (iphi << (settings_.phi0bitshift() - 1 + phi0shift_));
470 
471  //Floating point calculations
472 
473  double phi = stub->phi();
474  double r = stub->r();
475  double z = stub->z();
476 
477  if (settings_.useapprox()) {
478  double dphi = reco::reduceRange(phi - fpgastub->phiapprox(phimin_, phimax_));
479  assert(std::abs(dphi) < 0.001);
480  phi = fpgastub->phiapprox(phimin_, phimax_);
481  z = fpgastub->zapprox();
482  r = fpgastub->rapprox();
483  }
484 
485  if (phi < 0)
486  phi += 2 * M_PI;
487  phi -= phioffset_;
488 
489  double dr = r - tracklet->rproj(layer_);
491 
492  double dphi = reco::reduceRange(phi - (tracklet->phiproj(layer_) + dr * tracklet->phiprojder(layer_)));
493 
494  double dz = z - (tracklet->zproj(layer_) + dr * tracklet->zprojder(layer_));
495 
496  double dphiapprox =
497  reco::reduceRange(phi - (tracklet->phiprojapprox(layer_) + dr * tracklet->phiprojderapprox(layer_)));
498 
499  double dzapprox = z - (tracklet->zprojapprox(layer_) + dr * tracklet->zprojderapprox(layer_));
500 
501  int seedindex = tracklet->getISeed();
502 
503  assert(phimatchcut_[seedindex] > 0);
504  assert(zmatchcut_[seedindex] > 0);
505 
506  if (settings_.bookHistos()) {
507  bool truthmatch = tracklet->stubtruthmatch(stub);
508 
510  hists->FillLayerResidual(layer_,
511  seedindex,
512  dphiapprox * settings_.rmean(layer_ - 1),
513  ideltaphi * settings_.kphi1() * settings_.rmean(layer_ - 1),
514  ideltaz * fact_ * settings_.kz(),
515  dz,
516  truthmatch);
517  }
518 
519  if (settings_.writeMonitorData("Residuals")) {
520  double pt = 0.01 * settings_.c() * settings_.bfield() / std::abs(tracklet->rinv());
521 
522  globals_->ofstream("layerresiduals.txt")
523  << layer_ << " " << seedindex << " " << pt << " "
524  << ideltaphi * settings_.kphi1() * settings_.rmean(layer_ - 1) << " "
525  << dphiapprox * settings_.rmean(layer_ - 1) << " "
526  << phimatchcut_[seedindex] * settings_.kphi1() * settings_.rmean(layer_ - 1) << " "
527  << ideltaz * fact_ * settings_.kz() << " " << dz << " " << zmatchcut_[seedindex] * settings_.kz() << endl;
528  }
529 
530  bool imatch = (std::abs(ideltaphi) <= phifact_ * phimatchcut_[seedindex]) &&
531  (std::abs(ideltaz * fact_) <= rzfact_ * zmatchcut_[seedindex]);
532 
533  if (settings_.debugTracklet()) {
534  edm::LogVerbatim("Tracklet") << getName() << " imatch = " << imatch << " ideltaphi cut " << ideltaphi << " "
535  << phimatchcut_[seedindex] << " ideltaz*fact cut " << ideltaz * fact_ << " "
536  << zmatchcut_[seedindex];
537  }
538 
539  if (std::abs(dphi) > 0.2 || std::abs(dphiapprox) > 0.2) {
540  edm::LogPrint("Tracklet") << "WARNING dphi and/or dphiapprox too large : " << dphi << " " << dphiapprox;
541  }
542 
543  assert(std::abs(dphi) < 0.2);
544  assert(std::abs(dphiapprox) < 0.2);
545 
546  if (imatch) {
547  tracklet->addMatch(layer_,
548  ideltaphi,
549  ideltaz,
550  dphi,
551  dz,
552  dphiapprox,
553  dzapprox,
554  (phiregion_ << 7) + fpgastub->stubindex().value(),
555  stub->r(),
556  fpgastub);
557 
558  if (settings_.debugTracklet()) {
559  edm::LogVerbatim("Tracklet") << "Accepted full match in layer " << getName() << " " << tracklet << " "
560  << iSector_;
561  }
562 
563  int iSeed = tracklet->getISeed();
564  assert(fullmatches_[iSeed] != nullptr);
565  fullmatches_[iSeed]->addMatch(tracklet, fpgastub);
566 
567  return true;
568  } else {
569  return false;
570  }
571  } else { //disk matches
572 
573  //check that stubs and projections in same half of detector
574  assert(stub->z() * tracklet->t() > 0.0);
575 
576  int sign = (tracklet->t() > 0.0) ? 1 : -1;
577  int disk = sign * disk_;
578  assert(disk != 0);
579 
580  //Perform integer calculations here
581 
582  int iz = fpgastub->z().value();
583  int iphi = tracklet->fpgaphiprojdisk(disk).value();
584 
585  int shifttmp = 6; //TODO - express in terms of constants
586  assert(shifttmp >= 0);
587  int iphicorr = (iz * tracklet->fpgaphiprojderdisk(disk).value()) >> shifttmp;
588 
589  iphi += iphicorr;
590 
591  int ir = tracklet->fpgarprojdisk(disk).value();
592 
593  int shifttmp2 = 7; //TODO - express in terms of constants
594  assert(shifttmp2 >= 0);
595  int ircorr = (iz * tracklet->fpgarprojderdisk(disk).value()) >> shifttmp2;
596 
597  ir += ircorr;
598 
599  int ideltaphi = fpgastub->phi().value() * settings_.kphi() / settings_.kphi() - iphi;
600 
601  int irstub = fpgastub->r().value();
602  int ialphafact = 0;
603  if (!stub->isPSmodule()) {
604  assert(irstub < (int)N_DSS_MOD * 2);
605  if (disk_ <= 2) {
606  ialphafact = ialphafactinner_[irstub];
607  irstub = settings_.rDSSinner(irstub) / settings_.kr();
608  } else {
609  ialphafact = ialphafactouter_[irstub];
610  irstub = settings_.rDSSouter(irstub) / settings_.kr();
611  }
612  }
613 
614  int ideltar = (irstub * settings_.kr()) / settings_.krprojshiftdisk() - ir;
615 
616  if (!stub->isPSmodule()) {
617  int ialphanew = fpgastub->alphanew().value();
618  int iphialphacor = ((ideltar * ialphanew * ialphafact) >> settings_.alphashift());
619  ideltaphi += iphialphacor;
620  }
621 
622  //Perform floating point calculations here
623 
624  double phi = stub->phi();
625  double z = stub->z();
626  double r = stub->r();
627 
628  if (settings_.useapprox()) {
629  double dphi = reco::reduceRange(phi - fpgastub->phiapprox(phimin_, phimax_));
630  assert(std::abs(dphi) < 0.001);
631  phi = fpgastub->phiapprox(phimin_, phimax_);
632  z = fpgastub->zapprox();
633  r = fpgastub->rapprox();
634  }
635 
636  if (phi < 0)
637  phi += 2 * M_PI;
638  phi -= phioffset_;
639 
640  double dz = z - sign * settings_.zmean(disk_ - 1);
641 
642  if (std::abs(dz) > settings_.dzmax()) {
643  edm::LogProblem("Tracklet") << __FILE__ << ":" << __LINE__ << " " << name_ << "_" << iSector_ << " "
644  << tracklet->getISeed();
645  edm::LogProblem("Tracklet") << "stub " << stub->z() << " disk " << disk << " " << dz;
647  }
648 
649  double phiproj = tracklet->phiprojdisk(disk) + dz * tracklet->phiprojderdisk(disk);
650  double rproj = tracklet->rprojdisk(disk) + dz * tracklet->rprojderdisk(disk);
651  double deltar = r - rproj;
652 
653  double dr = stub->r() - rproj;
654  double drapprox = stub->r() - (tracklet->rprojapproxdisk(disk) + dz * tracklet->rprojderapproxdisk(disk));
655 
656  double dphi = reco::reduceRange(phi - phiproj);
657  double dphiapprox =
658  reco::reduceRange(phi - (tracklet->phiprojapproxdisk(disk) + dz * tracklet->phiprojderapproxdisk(disk)));
659 
660  double drphi = dphi * stub->r();
661  double drphiapprox = dphiapprox * stub->r();
662 
663  if (!stub->isPSmodule()) {
664  double alphanorm = stub->alphanorm();
665  dphi += dr * alphanorm * settings_.half2SmoduleWidth() / stub->r2();
666  ;
667  dphiapprox += drapprox * alphanorm * settings_.half2SmoduleWidth() / stub->r2();
668 
669  drphi += dr * alphanorm * settings_.half2SmoduleWidth() / stub->r();
670  drphiapprox += dr * alphanorm * settings_.half2SmoduleWidth() / stub->r();
671  }
672 
673  int seedindex = tracklet->getISeed();
674 
675  int idrphicut = rphicutPS_[seedindex];
676  int idrcut = rcutPS_[seedindex];
677  if (!stub->isPSmodule()) {
678  idrphicut = rphicut2S_[seedindex];
679  idrcut = rcut2S_[seedindex];
680  }
681 
682  double drphicut = idrphicut * settings_.kphi() * settings_.kr();
683  double drcut = idrcut * settings_.krprojshiftdisk();
684 
685  if (settings_.writeMonitorData("Residuals")) {
686  double pt = 0.01 * settings_.c() * settings_.bfield() / std::abs(tracklet->rinv());
687 
688  globals_->ofstream("diskresiduals.txt")
689  << disk_ << " " << stub->isPSmodule() << " " << tracklet->layer() << " " << abs(tracklet->disk()) << " " << pt
690  << " " << ideltaphi * settings_.kphi() * stub->r() << " " << drphiapprox << " " << drphicut << " "
691  << ideltar * settings_.krprojshiftdisk() << " " << deltar << " " << drcut << " " << endl;
692  }
693 
694  bool match = (std::abs(drphi) < drphicut) && (std::abs(deltar) < drcut);
695  bool imatch = (std::abs(ideltaphi * irstub) < idrphicut) && (std::abs(ideltar) < idrcut);
696 
697  if (settings_.debugTracklet()) {
698  edm::LogVerbatim("Tracklet") << "imatch match disk: " << imatch << " " << match << " " << std::abs(ideltaphi)
699  << " " << drphicut / (settings_.kphi() * stub->r()) << " " << std::abs(ideltar)
700  << " " << drcut / settings_.krprojshiftdisk() << " r = " << stub->r();
701  }
702 
703  if (imatch) {
704  if (settings_.debugTracklet()) {
705  edm::LogVerbatim("Tracklet") << "MatchCalculator found match in disk " << getName();
706  }
707 
708  if (std::abs(dphi) >= 0.25) {
709  edm::LogPrint("Tracklet") << "dphi " << dphi << " ISeed " << tracklet->getISeed();
710  }
711  assert(std::abs(dphi) < 0.25);
712  assert(std::abs(dphiapprox) < 0.25);
713 
714  tracklet->addMatchDisk(disk,
715  ideltaphi,
716  ideltar,
717  drphi / stub->r(),
718  dr,
719  drphiapprox / stub->r(),
720  drapprox,
721  stub->alpha(settings_.stripPitch(stub->isPSmodule())),
722  (phiregion_ << 7) + fpgastub->stubindex().value(),
723  stub->z(),
724  fpgastub);
725  if (settings_.debugTracklet()) {
726  edm::LogVerbatim("Tracklet") << "Accepted full match in disk " << getName() << " " << tracklet << " "
727  << iSector_;
728  }
729 
730  int iSeed = tracklet->getISeed();
731  assert(fullmatches_[iSeed] != nullptr);
732  fullmatches_[iSeed]->addMatch(tracklet, fpgastub);
733 
734  return true;
735  } else {
736  return false;
737  }
738  }
739 }
trklet::N_PSLAYER
constexpr unsigned int N_PSLAYER
Definition: Settings.h:21
Util.h
trklet::Tracklet::stubtruthmatch
bool stubtruthmatch(const L1TStub *stub)
Definition: Tracklet.cc:151
trklet::Tracklet::fpgaphiprojder
const FPGAWord & fpgaphiprojder(int layer) const
Definition: Tracklet.h:94
mps_fire.i
i
Definition: mps_fire.py:428
trklet::Settings::writetrace
bool writetrace() const
Definition: Settings.h:162
trklet::Settings::rphimatchcut
double rphimatchcut(unsigned int iSeed, unsigned int ilayer) const
Definition: Settings.h:136
trklet::VMStubsMEMemory
Definition: VMStubsMEMemory.h:16
input
static const std::string input
Definition: EdmProvDump.cc:48
MessageLogger.h
trklet::ProjectionTemp::usesecond
bool usesecond() const
Definition: ProjectionTemp.h:30
trklet::Settings::krprojshiftdisk
double krprojshiftdisk() const
Definition: Settings.h:364
trklet::MatchProcessor::vmstubs_
std::vector< VMStubsMEMemory * > vmstubs_
Definition: MatchProcessor.h:71
trklet::Tracklet::fpgaphiprojdisk
const FPGAWord & fpgaphiprojdisk(int disk) const
Definition: Tracklet.h:266
trklet::Stub::phi
const FPGAWord & phi() const
Definition: Stub.h:51
trklet::Settings::krinvpars
double krinvpars() const
Definition: Settings.h:350
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:72
trklet::Settings::dzmax
double dzmax() const
Definition: Settings.h:116
trklet::Tracklet::rprojderdisk
double rprojderdisk(int disk) const
Definition: Tracklet.h:321
deltaPhi.h
trklet::MatchProcessor::ialphafactouter_
int ialphafactouter_[N_DSS_MOD *2]
Definition: MatchProcessor.h:75
memory
Definition: HGCRecHitSoA.h:20
trklet::TrackletProjectionsMemory
Definition: TrackletProjectionsMemory.h:15
trklet::MatchProcessor::zmatchcut_
unsigned int zmatchcut_[N_SEED]
Definition: MatchProcessor.h:57
edm::LogPrint
Log< level::Warning, true > LogPrint
Definition: MessageLogger.h:130
trklet::Settings
Definition: Settings.h:31
trklet::L1TStub
Definition: L1TStub.h:12
trklet::L1TStub::z
double z() const
Definition: L1TStub.h:56
trklet::Tracklet::getISeed
int getISeed() const
Definition: Tracklet.cc:849
trklet::Tracklet::addMatch
void addMatch(int layer, int ideltaphi, int ideltaz, double dphi, double dz, double dphiapprox, double dzapprox, int stubid, double rstub, const trklet::Stub *stubptr)
Definition: Tracklet.cc:310
cms::cuda::assert
assert(be >=bs)
trklet::MatchProcessor::rzfact_
double rzfact_
Definition: MatchProcessor.h:65
Validation_hcalonly_cfi.sign
sign
Definition: Validation_hcalonly_cfi.py:32
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
deltar
Definition: deltar.py:1
trklet::Settings::rphicutPS
double rphicutPS(unsigned int iSeed, unsigned int idisk) const
Definition: Settings.h:138
trklet::Settings::rmean
double rmean(unsigned int iLayer) const
Definition: Settings.h:143
trklet::ProcessBase::nbits
unsigned int nbits(unsigned int power)
Definition: ProcessBase.cc:29
trklet::ProcessBase::settings_
Settings const & settings_
Definition: ProcessBase.h:44
compare.hists
hists
Definition: compare.py:319
ProjectionRouterBendTable.h
trklet::Stub::phiapprox
double phiapprox(double phimin, double) const
Definition: Stub.cc:242
trklet::Settings::kphi1
double kphi1() const
Definition: Settings.h:268
trklet::FPGAWord::nbits
int nbits() const
Definition: FPGAWord.h:25
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
trklet::Settings::rDSSinner
double rDSSinner(unsigned int iBin) const
Definition: Settings.h:150
trklet::Settings::half2SmoduleWidth
double half2SmoduleWidth() const
Definition: Settings.h:118
trklet::Globals
Definition: Globals.h:32
trklet::ProjectionTemp::projfinephi
unsigned int projfinephi() const
Definition: ProjectionTemp.h:28
trklet::MatchProcessor::addInput
void addInput(MemoryBase *memory, std::string input) override
Definition: MatchProcessor.cc:208
trklet::Stub::r
const FPGAWord & r() const
Definition: Stub.h:49
trklet::Settings::bfield
double bfield() const
Definition: Settings.h:230
trklet::Settings::bookHistos
bool bookHistos() const
Definition: Settings.h:184
trklet::Tracklet::fpgarprojderdisk
const FPGAWord & fpgarprojderdisk(int disk) const
Definition: Tracklet.h:281
trklet::Settings::nrbitsstub
unsigned int nrbitsstub(unsigned int layerdisk) const
Definition: Settings.h:71
trklet::HistBase
Definition: HistBase.h:16
trklet::Settings::writeTable
bool writeTable() const
Definition: Settings.h:168
trklet::Tracklet::fpgazprojder
const FPGAWord & fpgazprojder(int layer) const
Definition: Tracklet.h:109
trklet::Tracklet
Definition: Tracklet.h:28
trklet::Settings::rDSSouter
double rDSSouter(unsigned int iBin) const
Definition: Settings.h:153
trklet::MatchProcessor::icorzshift_
int icorzshift_
Definition: MatchProcessor.h:51
LEDCalibrationChannels.iphi
iphi
Definition: LEDCalibrationChannels.py:64
trklet::ProjectionTemp::iphi
unsigned int iphi() const
Definition: ProjectionTemp.h:29
trklet::MatchProcessor::fullmatches_
std::vector< FullMatchMemory * > fullmatches_
Definition: MatchProcessor.h:78
trklet::Tracklet::addMatchDisk
void addMatchDisk(int disk, int ideltaphi, int ideltar, double dphi, double dr, double dphiapprox, double drapprox, double alpha, int stubid, double zstub, const trklet::Stub *stubptr)
Definition: Tracklet.cc:325
trklet::Tracklet::fpgazproj
const FPGAWord & fpgazproj(int layer) const
Definition: Tracklet.h:99
trklet::Stub::z
const FPGAWord & z() const
Definition: Stub.h:50
trklet::MemoryBase::getName
std::string const & getName() const
Definition: MemoryBase.h:19
trklet::MatchProcessor::barrel_
bool barrel_
Definition: MatchProcessor.h:41
trklet::MatchProcessor::layerdisk_
unsigned int layerdisk_
Definition: MatchProcessor.h:40
trklet::Stub
Definition: Stub.h:16
trklet::Tracklet::rprojdisk
double rprojdisk(int disk) const
Definition: Tracklet.h:316
trklet::L1TStub::isPSmodule
unsigned int isPSmodule() const
Definition: L1TStub.h:93
trklet::Settings::alphashift
int alphashift() const
Definition: Settings.h:193
trklet::ProjectionTemp::projrinv
unsigned int projrinv() const
Definition: ProjectionTemp.h:26
edm::LogProblem
Log< level::Error, true > LogProblem
Definition: MessageLogger.h:131
trklet::MatchProcessor::inputProjBuffer_
CircularBuffer< ProjectionTemp > inputProjBuffer_
Definition: MatchProcessor.h:90
trklet::Settings::rcut2S
double rcut2S(unsigned int iSeed, unsigned int idisk) const
Definition: Settings.h:141
trklet::MatchProcessor::inputprojs_
std::vector< TrackletProjectionsMemory * > inputprojs_
Definition: MatchProcessor.h:72
trklet::MatchProcessor::rcutPS_
unsigned int rcutPS_[N_SEED]
Definition: MatchProcessor.h:61
LaserClient_cfi.nbins
nbins
Definition: LaserClient_cfi.py:51
trklet::Tracklet::phiprojder
double phiprojder(int layer) const
Definition: Tracklet.h:159
trklet::Settings::zmean
double zmean(unsigned int iDisk) const
Definition: Settings.h:146
trklet::Tracklet::phiprojderapprox
double phiprojderapprox(int layer) const
Definition: Tracklet.h:189
trklet::Tracklet::rproj
double rproj(int layer) const
Definition: Tracklet.h:194
trklet::MatchProcessor::nvmbins_
int nvmbins_
Definition: MatchProcessor.h:47
trklet::Tracklet::zproj
double zproj(int layer) const
Definition: Tracklet.h:164
trklet::MatchProcessor::rphicut2S_
unsigned int rphicut2S_[N_SEED]
Definition: MatchProcessor.h:60
trklet::FPGAWord
Definition: FPGAWord.h:9
trklet::Tracklet::phiprojderapproxdisk
double phiprojderapproxdisk(int disk) const
Definition: Tracklet.h:291
trklet::MatchProcessor::matchCalculator
bool matchCalculator(Tracklet *tracklet, const Stub *fpgastub)
Definition: MatchProcessor.cc:455
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
trklet::Tracklet::zprojderapprox
double zprojderapprox(int layer) const
Definition: Tracklet.h:179
trklet::ProcessBase::initLayerDisk
void initLayerDisk(unsigned int pos, int &layer, int &disk)
Definition: ProcessBase.cc:45
trklet::Settings::kr
double kr() const
Definition: Settings.h:271
trklet::MatchProcessor::disk_
int disk_
Definition: MatchProcessor.h:39
trklet::Settings::bendcutme
double bendcutme(unsigned int layerdisk) const
Definition: Settings.h:121
trklet::MatchProcessor::rphicutPS_
unsigned int rphicutPS_[N_SEED]
Definition: MatchProcessor.h:59
trklet::N_SEED
constexpr unsigned int N_SEED
Definition: Settings.h:22
trklet::Settings::drmax
double drmax() const
Definition: Settings.h:115
trklet::MatchProcessor::ialphafactinner_
int ialphafactinner_[N_DSS_MOD *2]
Definition: MatchProcessor.h:74
amptDefault_cfi.proj
proj
Definition: amptDefault_cfi.py:13
trklet::MatchProcessor::rcut2S_
unsigned int rcut2S_[N_SEED]
Definition: MatchProcessor.h:62
trklet::MemoryBase
Definition: MemoryBase.h:13
trklet::Settings::rcutPS
double rcutPS(unsigned int iSeed, unsigned int idisk) const
Definition: Settings.h:139
trklet::Stub::alphanew
const FPGAWord & alphanew() const
Definition: Stub.h:53
trklet::rinv
double rinv(double phi1, double phi2, double r1, double r2)
Definition: Util.h:173
trklet::N_DSS_MOD
constexpr unsigned int N_DSS_MOD
Definition: Settings.h:24
trklet::Tracklet::TCID
int TCID() const
Definition: Tracklet.h:500
HistBase.h
trklet::TrackletProjectionsMemory::getTracklet
Tracklet * getTracklet(unsigned int i)
Definition: TrackletProjectionsMemory.h:25
trklet::Settings::nzbitsstub
unsigned int nzbitsstub(unsigned int layerdisk) const
Definition: Settings.h:69
trklet::Settings::nvmme
unsigned int nvmme(unsigned int layerdisk) const
Definition: Settings.h:91
match
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
trklet::MatchProcessor::tablePS_
std::vector< bool > tablePS_
Definition: MatchProcessor.h:84
trklet::Tracklet::phiprojdisk
double phiprojdisk(int disk) const
Definition: Tracklet.h:306
trklet::Stub::rapprox
double rapprox() const
Definition: Stub.cc:209
createfilelist.int
int
Definition: createfilelist.py:10
trklet::MatchProcessor::nMatchEngines_
unsigned int nMatchEngines_
Definition: MatchProcessor.h:87
trklet::MatchProcessor::icorrshift_
int icorrshift_
Definition: MatchProcessor.h:50
trklet::ProjectionTemp::slot
unsigned int slot() const
Definition: ProjectionTemp.h:25
trklet::L1TStub::alphanorm
double alphanorm() const
Definition: L1TStub.cc:91
trklet::Tracklet::phiprojapproxdisk
double phiprojapproxdisk(int disk) const
Definition: Tracklet.h:286
Globals.h
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:49
trklet::MatchProcessor::phioffset_
double phioffset_
Definition: MatchProcessor.h:54
trklet::MatchProcessor::table2S_
std::vector< bool > table2S_
Definition: MatchProcessor.h:85
trklet::Settings::nbitsrinv
int nbitsrinv() const
Definition: Settings.h:300
trklet::Tracklet::rprojderapproxdisk
double rprojderapproxdisk(int disk) const
Definition: Tracklet.h:301
trklet::ProjectionTemp::projfinerz
int projfinerz() const
Definition: ProjectionTemp.h:27
trklet::L1TStub::alpha
double alpha(double pitch) const
Definition: L1TStub.cc:79
trklet
Definition: AllProjectionsMemory.h:9
trklet::FPGAWord::value
int value() const
Definition: FPGAWord.h:24
trklet::TrackletProjectionsMemory::nTracklets
unsigned int nTracklets() const
Definition: TrackletProjectionsMemory.h:23
trklet::Settings::nbitsalpha
int nbitsalpha() const
Definition: Settings.h:194
trklet::ProjectionRouterBendTable::bendLoookup
int bendLoookup(int diskindex, int bendindex)
Definition: ProjectionRouterBendTable.cc:54
trklet::Settings::stripPitch
double stripPitch(bool isPSmodule) const
Definition: Settings.h:237
trklet::Settings::kphi
double kphi() const
Definition: Settings.h:267
trklet::ProcessBase::getISeed
unsigned int getISeed(const std::string &name)
Definition: ProcessBase.cc:131
alignCSCRings.r
r
Definition: alignCSCRings.py:93
trklet::Globals::projectionRouterBendTable
ProjectionRouterBendTable *& projectionRouterBendTable()
Definition: Globals.h:46
alignmentValidation.fname
string fname
main script
Definition: alignmentValidation.py:959
trklet::Settings::writeMonitorData
bool writeMonitorData(std::string module) const
Definition: Settings.h:96
trklet::Tracklet::rinv
double rinv() const
Definition: Tracklet.h:409
std
Definition: JetResolutionObject.h:76
trklet::ProcessBase
Definition: ProcessBase.h:12
trklet::Settings::SS_zderL_shift
int SS_zderL_shift() const
Definition: Settings.h:319
trklet::Globals::ofstream
std::ofstream & ofstream(std::string fname)
Definition: Globals.cc:44
trklet::Stub::l1tstub
L1TStub * l1tstub()
Definition: Stub.h:69
PVValHelper::dz
Definition: PVValidationHelpers.h:51
trklet::Settings::tablePath
std::string const & tablePath() const
Definition: Settings.h:170
trklet::MatchProcessor::table_
std::vector< bool > table_
Definition: MatchProcessor.h:81
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
trklet::bend
double bend(double r, double rinv, double stripPitch)
Definition: Util.h:166
trklet::MatchProcessor::allstubs_
AllStubsMemory * allstubs_
Definition: MatchProcessor.h:70
trklet::MatchProcessor::nphiderbits_
int nphiderbits_
Definition: MatchProcessor.h:68
trklet::Tracklet::zprojder
double zprojder(int layer) const
Definition: Tracklet.h:169
trklet::Settings::useapprox
bool useapprox() const
Definition: Settings.h:211
relativeConstraints.empty
bool empty
Definition: relativeConstraints.py:46
trklet::MatchProcessor::layer_
int layer_
Definition: MatchProcessor.h:38
flavorHistoryFilter_cfi.dr
dr
Definition: flavorHistoryFilter_cfi.py:37
Exception
Definition: hltDiff.cc:245
trklet::MatchProcessor::phi0shift_
int phi0shift_
Definition: MatchProcessor.h:52
trklet::MatchProcessor::fact_
int fact_
Definition: MatchProcessor.h:49
trklet::Tracklet::phiproj
double phiproj(int layer) const
Definition: Tracklet.h:154
trklet::ProcessBase::getName
std::string const & getName() const
Definition: ProcessBase.h:22
trklet::Tracklet::fpgaphiproj
const FPGAWord & fpgaphiproj(int layer) const
Definition: Tracklet.h:104
trklet::Settings::kz
double kz() const
Definition: Settings.h:270
trklet::ProcessBase::name_
std::string name_
Definition: ProcessBase.h:38
trklet::Stub::stubindex
const FPGAWord & stubindex() const
Definition: Stub.h:55
trklet::Settings::nallstubs
unsigned int nallstubs(unsigned int layerdisk) const
Definition: Settings.h:94
trklet::Settings::phi0bitshift
int phi0bitshift() const
Definition: Settings.h:329
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
trklet::ProcessBase::iSector_
unsigned int iSector_
Definition: ProcessBase.h:39
trklet::Settings::debugTracklet
bool debugTracklet() const
Definition: Settings.h:161
trklet::Settings::zmatchcut
double zmatchcut(unsigned int iSeed, unsigned int ilayer) const
Definition: Settings.h:137
trklet::Settings::rcrit
double rcrit() const
Definition: Settings.h:257
Exception.h
trklet::MatchProcessor::phiregion_
unsigned int phiregion_
Definition: MatchProcessor.h:43
trklet::MatchProcessor::addOutput
void addOutput(MemoryBase *memory, std::string output) override
Definition: MatchProcessor.cc:191
trklet::Settings::rphicut2S
double rphicut2S(unsigned int iSeed, unsigned int idisk) const
Definition: Settings.h:140
trklet::ProjectionTemp
Definition: ProjectionTemp.h:9
trklet::Tracklet::fpgarprojdisk
const FPGAWord & fpgarprojdisk(int disk) const
Definition: Tracklet.h:276
trklet::MatchEngineUnit
Definition: MatchEngineUnit.h:18
trklet::Tracklet::disk
int disk() const
Definition: Tracklet.cc:824
trklet::Settings::maxStep
unsigned int maxStep(std::string module) const
Definition: Settings.h:103
trklet::L1TStub::r
double r() const
Definition: L1TStub.h:57
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
trklet::Settings::PS_zderL_shift
int PS_zderL_shift() const
Definition: Settings.h:318
trklet::Tracklet::rprojapproxdisk
double rprojapproxdisk(int disk) const
Definition: Tracklet.h:296
trklet::benddecode
double benddecode(int ibend, bool isPS)
Definition: Util.h:106
cms::Exception
Definition: Exception.h:70
trklet::ProcessBase::phimin_
double phimin_
Definition: ProcessBase.h:41
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
trklet::Tracklet::fpgaphiprojderdisk
const FPGAWord & fpgaphiprojderdisk(int disk) const
Definition: Tracklet.h:271
trklet::Globals::histograms
HistBase *& histograms()
Definition: Globals.h:40
MatchProcessor.h
trklet::ProcessBase::globals_
Globals * globals_
Definition: ProcessBase.h:45
trklet::Tracklet::phiprojderdisk
double phiprojderdisk(int disk) const
Definition: Tracklet.h:311
trklet::Tracklet::t
double t() const
Definition: Tracklet.h:412
trklet::ProjectionTemp::proj
Tracklet * proj() const
Definition: ProjectionTemp.h:24
trklet::Settings::c
double c() const
Definition: Settings.h:189
trklet::MatchProcessor::execute
void execute()
Definition: MatchProcessor.cc:234
trklet::MatchProcessor::phimatchcut_
unsigned int phimatchcut_[N_SEED]
Definition: MatchProcessor.h:56
trklet::ProcessBase::phimax_
double phimax_
Definition: ProcessBase.h:42
trklet::MatchProcessor::nvm_
int nvm_
Definition: MatchProcessor.h:45
trklet::VMStubsMEMemory::nStubsBin
unsigned int nStubsBin(unsigned int bin) const
Definition: VMStubsMEMemory.h:30
trklet::MatchProcessor::nrbits_
int nrbits_
Definition: MatchProcessor.h:67
trklet::Tracklet::phiprojapprox
double phiprojapprox(int layer) const
Definition: Tracklet.h:184
trklet::Stub::zapprox
double zapprox() const
Definition: Stub.cc:223
trklet::L1TStub::r2
double r2() const
Definition: L1TStub.h:59
trklet::Tracklet::layer
int layer() const
Definition: Tracklet.cc:817
trklet::Tracklet::zprojapprox
double zprojapprox(int layer) const
Definition: Tracklet.h:174
trklet::L1TStub::phi
double phi() const
Definition: L1TStub.h:62
trklet::ProjectionRouterBendTable
Definition: ProjectionRouterBendTable.h:16
trklet::MatchProcessor::matchengines_
std::vector< MatchEngineUnit > matchengines_
Definition: MatchProcessor.h:88
trklet::ProjectionTemp::isPSseed
bool isPSseed() const
Definition: ProjectionTemp.h:31
trklet::MatchProcessor::nvmbits_
int nvmbits_
Definition: MatchProcessor.h:46
trklet::NRINVBITS
constexpr unsigned int NRINVBITS
Definition: Settings.h:26
trklet::MatchProcessor::phifact_
double phifact_
Definition: MatchProcessor.h:64
reco::reduceRange
constexpr T reduceRange(T x)
Definition: deltaPhi.h:18