CMS 3D CMS Logo

MatchCalculator.cc
Go to the documentation of this file.
11 
15 
16 #include <filesystem>
17 
18 using namespace std;
19 using namespace trklet;
20 
21 MatchCalculator::MatchCalculator(string name, Settings const& settings, Globals* global, unsigned int iSector)
22  : ProcessBase(name, settings, global, iSector) {
24 
25  phiregion_ = name[8] - 'A';
27 
28  fullMatches_.resize(12, nullptr);
29 
30  //TODO - need to sort out constants here
31  icorrshift_ = 7;
32 
33  if (layerdisk_ < N_PSLAYER) {
35  } else {
37  }
38  phi0shift_ = 3;
39  fact_ = 1;
40  if (layerdisk_ >= N_PSLAYER && layerdisk_ < N_LAYER) {
41  fact_ = (1 << (settings_.nzbitsstub(0) - settings_.nzbitsstub(5)));
45  phi0shift_ = 0;
46  }
47 
48  for (unsigned int iSeed = 0; iSeed < N_SEED; iSeed++) {
49  if (layerdisk_ < N_LAYER) {
50  phimatchcut_[iSeed] =
52  zmatchcut_[iSeed] = settings_.zmatchcut(iSeed, layerdisk_) / settings_.kz();
53  } else {
58  }
59  }
60 
61  if (iSector_ == 0 && layerdisk_ < N_LAYER && settings_.writeTable()) {
62  if (not std::filesystem::exists(settings_.tablePath())) {
63  int fail = system((string("mkdir -p ") + settings_.tablePath()).c_str());
64  if (fail)
65  throw cms::Exception("BadDir") << __FILE__ << " " << __LINE__ << " could not create directory "
66  << settings_.tablePath();
67  }
68 
69  const string filephicut = settings_.tablePath() + getName() + "_phicut.tab";
70  ofstream outphicut(filephicut);
71  if (outphicut.fail())
72  throw cms::Exception("BadFile") << __FILE__ << " " << __LINE__ << " could not create file " << filephicut;
73 
74  outphicut << "{" << endl;
75  for (unsigned int seedindex = 0; seedindex < N_SEED; seedindex++) {
76  if (seedindex != 0)
77  outphicut << "," << endl;
78  outphicut << phimatchcut_[seedindex];
79  }
80  outphicut << endl << "};" << endl;
81  outphicut.close();
82 
83  const string filezcut = settings_.tablePath() + getName() + "_zcut.tab";
84  ofstream outzcut(filezcut);
85  if (outzcut.fail())
86  throw cms::Exception("BadFile") << __FILE__ << " " << __LINE__ << " could not create file " << filezcut;
87 
88  outzcut << "{" << endl;
89  for (unsigned int seedindex = 0; seedindex < N_SEED; seedindex++) {
90  if (seedindex != 0)
91  outzcut << "," << endl;
92  outzcut << zmatchcut_[seedindex];
93  }
94  outzcut << endl << "};" << endl;
95  outzcut.close();
96  }
97 
98  if (iSector_ == 0 && layerdisk_ >= N_LAYER && settings_.writeTable()) {
99  if (not std::filesystem::exists(settings_.tablePath())) {
100  int fail = system((string("mkdir -p ") + settings_.tablePath()).c_str());
101  if (fail)
102  throw cms::Exception("BadDir") << __FILE__ << " " << __LINE__ << " could not create directory "
103  << settings_.tablePath();
104  }
105 
106  const string filePSphicut = settings_.tablePath() + getName() + "_PSphicut.tab";
107  ofstream outPSphicut(filePSphicut);
108  if (outPSphicut.fail())
109  throw cms::Exception("BadFile") << __FILE__ << " " << __LINE__ << " could not create file " << filePSphicut;
110  outPSphicut << "{" << endl;
111  for (unsigned int seedindex = 0; seedindex < N_SEED; seedindex++) {
112  if (seedindex != 0)
113  outPSphicut << "," << endl;
114  outPSphicut << rphicutPS_[seedindex];
115  }
116  outPSphicut << endl << "};" << endl;
117  outPSphicut.close();
118 
119  const string file2Sphicut = settings_.tablePath() + getName() + "_2Sphicut.tab";
120  ofstream out2Sphicut(file2Sphicut);
121  if (out2Sphicut.fail())
122  throw cms::Exception("BadFile") << __FILE__ << " " << __LINE__ << " could not create file " << file2Sphicut;
123  out2Sphicut << "{" << endl;
124  for (unsigned int seedindex = 0; seedindex < N_SEED; seedindex++) {
125  if (seedindex != 0)
126  out2Sphicut << "," << endl;
127  out2Sphicut << rphicut2S_[seedindex];
128  }
129  out2Sphicut << endl << "};" << endl;
130  out2Sphicut.close();
131 
132  const string filePSrcut = settings_.tablePath() + getName() + "_PSrcut.tab";
133  ofstream outPSrcut(filePSrcut);
134  if (outPSrcut.fail())
135  throw cms::Exception("BadFile") << __FILE__ << " " << __LINE__ << " could not create file " << filePSrcut;
136  outPSrcut << "{" << endl;
137  for (unsigned int seedindex = 0; seedindex < N_SEED; seedindex++) {
138  if (seedindex != 0)
139  outPSrcut << "," << endl;
140  outPSrcut << rcutPS_[seedindex];
141  }
142  outPSrcut << endl << "};" << endl;
143  outPSrcut.close();
144 
145  const string file2Srcut = settings_.tablePath() + getName() + "_2Srcut.tab";
146  ofstream out2Srcut(file2Srcut);
147  if (out2Srcut.fail())
148  throw cms::Exception("BadFile") << __FILE__ << " " << __LINE__ << " could not create file " << file2Srcut;
149  out2Srcut << "{" << endl;
150  for (unsigned int seedindex = 0; seedindex < N_SEED; seedindex++) {
151  if (seedindex != 0)
152  out2Srcut << "," << endl;
153  out2Srcut << rcut2S_[seedindex];
154  }
155  out2Srcut << endl << "};" << endl;
156  out2Srcut.close();
157  }
158 
159  for (unsigned int i = 0; i < N_DSS_MOD * 2; i++) {
161  (1 << (settings_.nbitsalpha() - 1)) / (settings_.rDSSinner(i) * settings_.rDSSinner(i)) /
162  settings_.kphi();
164  (1 << (settings_.nbitsalpha() - 1)) / (settings_.rDSSouter(i) * settings_.rDSSouter(i)) /
165  settings_.kphi();
166  }
167 }
168 
170  if (settings_.writetrace()) {
171  edm::LogVerbatim("Tracklet") << "In " << name_ << " adding output to " << memory->getName() << " to output "
172  << output;
173  }
174  if (output.substr(0, 8) == "matchout") {
175  auto* tmp = dynamic_cast<FullMatchMemory*>(memory);
176  assert(tmp != nullptr);
177  unsigned int iSeed = getISeed(memory->getName());
178  fullMatches_[iSeed] = tmp;
179  return;
180  }
181  throw cms::Exception("BadConfig") << __FILE__ << " " << __LINE__ << " could not find output " << output;
182 }
183 
185  if (settings_.writetrace()) {
186  edm::LogVerbatim("Tracklet") << "In " << name_ << " adding input from " << memory->getName() << " to input "
187  << input;
188  }
189  if (input == "allstubin") {
190  auto* tmp = dynamic_cast<AllStubsMemory*>(memory);
191  assert(tmp != nullptr);
192  allstubs_ = tmp;
193  return;
194  }
195  if (input == "allprojin") {
196  auto* tmp = dynamic_cast<AllProjectionsMemory*>(memory);
197  assert(tmp != nullptr);
198  allprojs_ = tmp;
199  return;
200  }
201  if (input.substr(0, 5) == "match" && input.substr(input.size() - 2, 2) == "in") {
202  auto* tmp = dynamic_cast<CandidateMatchMemory*>(memory);
203  assert(tmp != nullptr);
204  matches_.push_back(tmp);
205  return;
206  }
207  throw cms::Exception("BadConfig") << __FILE__ << " " << __LINE__ << " could not find input " << input;
208 }
209 
211  unsigned int countall = 0;
212  unsigned int countsel = 0;
213 
214  Tracklet* oldTracklet = nullptr;
215 
216  std::vector<std::pair<std::pair<Tracklet*, int>, const Stub*> > mergedMatches = mergeMatches(matches_);
217 
218  for (unsigned int j = 0; j < mergedMatches.size(); j++) {
219  if (settings_.debugTracklet() && j == 0) {
220  edm::LogVerbatim("Tracklet") << getName() << " has " << mergedMatches.size() << " candidate matches";
221  }
222 
223  countall++;
224 
225  const Stub* fpgastub = mergedMatches[j].second;
226  Tracklet* tracklet = mergedMatches[j].first.first;
227  const L1TStub* stub = fpgastub->l1tstub();
228 
229  //check that the matches are orderd correctly
230  //allow equal here since we can have more than one cadidate match per tracklet projection
231  if (oldTracklet != nullptr) {
232  assert(oldTracklet->TCID() <= tracklet->TCID());
233  }
234  oldTracklet = tracklet;
235 
236  if (layerdisk_ < N_LAYER) {
237  //Integer calculation
238 
239  int ir = fpgastub->r().value();
240  int iphi = tracklet->fpgaphiproj(layerdisk_ + 1).value();
241  int icorr = (ir * tracklet->fpgaphiprojder(layerdisk_ + 1).value()) >> icorrshift_;
242  iphi += icorr;
243 
244  int iz = tracklet->fpgazproj(layerdisk_ + 1).value();
245  int izcor = (ir * tracklet->fpgazprojder(layerdisk_ + 1).value() + (1 << (icorzshift_ - 1))) >> icorzshift_;
246  iz += izcor;
247 
248  int ideltaz = fpgastub->z().value() - iz;
249  int ideltaphi = (fpgastub->phi().value() << phi0shift_) - (iphi << (settings_.phi0bitshift() - 1 + phi0shift_));
250 
251  //Floating point calculations
252 
253  double phi = stub->phi() - phioffset_;
254  double r = stub->r();
255  double z = stub->z();
256 
257  if (settings_.useapprox()) {
258  double dphi = reco::reduceRange(phi - fpgastub->phiapprox(0.0, 0.0));
259  assert(std::abs(dphi) < 0.001);
260  phi = fpgastub->phiapprox(0.0, 0.0);
261  z = fpgastub->zapprox();
262  r = fpgastub->rapprox();
263  }
264 
265  if (phi < 0)
266  phi += 2 * M_PI;
267 
268  double dr = r - tracklet->rproj(layerdisk_ + 1);
270 
271  double dphi =
272  reco::reduceRange(phi - (tracklet->phiproj(layerdisk_ + 1) + dr * tracklet->phiprojder(layerdisk_ + 1)));
273 
274  double dz = z - (tracklet->zproj(layerdisk_ + 1) + dr * tracklet->zprojder(layerdisk_ + 1));
275 
276  double dphiapprox = reco::reduceRange(
277  phi - (tracklet->phiprojapprox(layerdisk_ + 1) + dr * tracklet->phiprojderapprox(layerdisk_ + 1)));
278 
279  double dzapprox = z - (tracklet->zprojapprox(layerdisk_ + 1) + dr * tracklet->zprojderapprox(layerdisk_ + 1));
280 
281  int seedindex = tracklet->getISeed();
282 
283  assert(phimatchcut_[seedindex] > 0);
284  assert(zmatchcut_[seedindex] > 0);
285 
286  if (settings_.bookHistos()) {
287  bool truthmatch = tracklet->stubtruthmatch(stub);
288 
290  hists->FillLayerResidual(layerdisk_ + 1,
291  seedindex,
292  dphiapprox * settings_.rmean(layerdisk_),
293  ideltaphi * settings_.kphi1() * settings_.rmean(layerdisk_),
294  ideltaz * fact_ * settings_.kz(),
295  dz,
296  truthmatch);
297  }
298 
299  if (std::abs(dphi) > 0.2 || std::abs(dphiapprox) > 0.2) {
300  edm::LogProblem("Tracklet") << "WARNING dphi and/or dphiapprox too large : " << dphi << " " << dphiapprox
301  << endl;
302  }
303 
304  bool imatch = false;
305  if (std::abs(dphi) < 0.2 && std::abs(dphiapprox) < 0.2) { //Changed the Asserts into if statements
306  if (settings_.writeMonitorData("Residuals")) {
307  double pt = 0.01 * settings_.c() * settings_.bfield() / std::abs(tracklet->rinv());
308 
309  globals_->ofstream("layerresiduals.txt")
310  << layerdisk_ + 1 << " " << seedindex << " " << pt << " "
311  << ideltaphi * settings_.kphi1() * settings_.rmean(layerdisk_) << " "
312  << dphiapprox * settings_.rmean(layerdisk_) << " "
313  << phimatchcut_[seedindex] * settings_.kphi1() * settings_.rmean(layerdisk_) << " "
314  << ideltaz * fact_ * settings_.kz() << " " << dz << " " << zmatchcut_[seedindex] * settings_.kz() << endl;
315  }
316 
317  imatch = (std::abs(ideltaphi) <= (int)phimatchcut_[seedindex]) &&
318  (std::abs(ideltaz * fact_) <= (int)zmatchcut_[seedindex]);
319  }
320  if (settings_.debugTracklet()) {
321  edm::LogVerbatim("Tracklet") << getName() << " imatch = " << imatch << " ideltaphi cut " << ideltaphi << " "
322  << phimatchcut_[seedindex] << " ideltaz*fact cut " << ideltaz * fact_ << " "
323  << zmatchcut_[seedindex];
324  }
325 
326  if (imatch) {
327  countsel++;
328 
329  tracklet->addMatch(layerdisk_ + 1,
330  ideltaphi,
331  ideltaz,
332  dphi,
333  dz,
334  dphiapprox,
335  dzapprox,
336  (phiregion_ << 7) + fpgastub->stubindex().value(),
337  stub->r(),
338  mergedMatches[j].second);
339 
340  if (settings_.debugTracklet()) {
341  edm::LogVerbatim("Tracklet") << "Accepted full match in layer " << getName() << " " << tracklet << " "
342  << iSector_;
343  }
344 
345  fullMatches_[seedindex]->addMatch(tracklet, mergedMatches[j].second);
346  }
347  } else { //disk matches
348 
349  //check that stubs and projections in same half of detector
350  assert(stub->z() * tracklet->t() > 0.0);
351 
352  int sign = (tracklet->t() > 0.0) ? 1 : -1;
353  int disk = sign * (layerdisk_ - (N_LAYER - 1));
354  assert(disk != 0);
355 
356  //Perform integer calculations here
357 
358  int iz = fpgastub->z().value();
359  int iphi = tracklet->fpgaphiprojdisk(disk).value();
360 
361  //TODO - need to express interms of constants
362  int shifttmp = 6;
363  int iphicorr = (iz * tracklet->fpgaphiprojderdisk(disk).value()) >> shifttmp;
364 
365  iphi += iphicorr;
366 
367  int ir = tracklet->fpgarprojdisk(disk).value();
368 
369  //TODO - need to express interms of constants
370  int shifttmp2 = 7;
371  int ircorr = (iz * tracklet->fpgarprojderdisk(disk).value()) >> shifttmp2;
372 
373  ir += ircorr;
374 
375  int ideltaphi = fpgastub->phi().value() * settings_.kphi() / settings_.kphi() - iphi;
376 
377  int irstub = fpgastub->r().value();
378  int ialphafact = 0;
379  if (!stub->isPSmodule()) {
380  assert(irstub < (int)N_DSS_MOD * 2);
381  if (abs(disk) <= 2) {
382  ialphafact = ialphafactinner_[irstub];
383  irstub = settings_.rDSSinner(irstub) / settings_.kr();
384  } else {
385  ialphafact = ialphafactouter_[irstub];
386  irstub = settings_.rDSSouter(irstub) / settings_.kr();
387  }
388  }
389 
390  //TODO stub and projection r should not use different # bits...
391  int ideltar = (irstub >> 1) - ir;
392 
393  if (!stub->isPSmodule()) {
394  int ialphanew = fpgastub->alphanew().value();
395  int iphialphacor = ((ideltar * ialphanew * ialphafact) >> settings_.alphashift());
396  ideltaphi += iphialphacor;
397  }
398 
399  //Perform floating point calculations here
400 
401  double phi = stub->phi() - phioffset_;
402  double z = stub->z();
403  double r = stub->r();
404 
405  if (settings_.useapprox()) {
406  double dphi = reco::reduceRange(phi - fpgastub->phiapprox(0.0, 0.0));
407  assert(std::abs(dphi) < 0.001);
408  phi = fpgastub->phiapprox(0.0, 0.0);
409  z = fpgastub->zapprox();
410  r = fpgastub->rapprox();
411  }
412 
413  if (phi < 0)
414  phi += 2 * M_PI;
415 
416  double dz = z - sign * settings_.zmean(layerdisk_ - N_LAYER);
417 
418  if (std::abs(dz) > settings_.dzmax()) {
419  throw cms::Exception("LogicError")
420  << __FILE__ << " " << __LINE__ << " " << name_ << "_" << iSector_ << " " << tracklet->getISeed()
421  << "\n stub " << stub->z() << " disk " << disk << " " << dz;
422  }
423 
424  double phiproj = tracklet->phiprojdisk(disk) + dz * tracklet->phiprojderdisk(disk);
425 
426  double rproj = tracklet->rprojdisk(disk) + dz * tracklet->rprojderdisk(disk);
427 
428  double deltar = r - rproj;
429 
430  double dr = stub->r() - rproj;
431 
432  double dphi = reco::reduceRange(phi - phiproj);
433 
434  double dphiapprox =
435  reco::reduceRange(phi - (tracklet->phiprojapproxdisk(disk) + dz * tracklet->phiprojderapproxdisk(disk)));
436 
437  double drapprox = stub->r() - (tracklet->rprojapproxdisk(disk) + dz * tracklet->rprojderapproxdisk(disk));
438 
439  double drphi = dphi * stub->r();
440  double drphiapprox = dphiapprox * stub->r();
441 
442  if (!stub->isPSmodule()) {
443  double alphanorm = stub->alphanorm();
444  dphi += dr * alphanorm * settings_.half2SmoduleWidth() / stub->r2();
445  dphiapprox += drapprox * alphanorm * settings_.half2SmoduleWidth() / stub->r2();
446 
447  drphi += dr * alphanorm * settings_.half2SmoduleWidth() / stub->r();
448  drphiapprox += dr * alphanorm * settings_.half2SmoduleWidth() / stub->r();
449  }
450 
451  int seedindex = tracklet->getISeed();
452 
453  int idrphicut = rphicutPS_[seedindex];
454  int idrcut = rcutPS_[seedindex];
455  if (!stub->isPSmodule()) {
456  idrphicut = rphicut2S_[seedindex];
457  idrcut = rcut2S_[seedindex];
458  }
459 
460  double drphicut = idrphicut * settings_.kphi() * settings_.kr();
461  double drcut = idrcut * settings_.krprojshiftdisk();
462 
463  bool match, imatch;
464  if (std::abs(dphi) < 0.25 && std::abs(dphiapprox) < 0.25) { //Changed the Asserts into if statements
465  if (settings_.writeMonitorData("Residuals")) {
466  double pt = 0.01 * settings_.c() * settings_.bfield() / std::abs(tracklet->rinv());
467 
468  globals_->ofstream("diskresiduals.txt")
469  << disk << " " << stub->isPSmodule() << " " << tracklet->layer() << " " << abs(tracklet->disk()) << " "
470  << pt << " " << ideltaphi * settings_.kphi() * stub->r() << " " << drphiapprox << " " << drphicut << " "
471  << ideltar * settings_.krprojshiftdisk() << " " << deltar << " " << drcut << " " << endl;
472  }
473 
474  match = (std::abs(drphi) < drphicut) && (std::abs(deltar) < drcut);
475 
476  imatch = (std::abs(ideltaphi * irstub) < idrphicut) && (std::abs(ideltar) < idrcut);
477  } else {
478  edm::LogProblem("Tracklet") << "WARNING dphi and/or dphiapprox too large : " << dphi << " " << dphiapprox
479  << "dphi " << dphi << " Seed / ISeed " << tracklet->getISeed() << endl;
480  match = false;
481  imatch = false;
482  }
483  if (settings_.debugTracklet()) {
484  edm::LogVerbatim("Tracklet") << "imatch match disk: " << imatch << " " << match << " " << std::abs(ideltaphi)
485  << " " << drphicut / (settings_.kphi() * stub->r()) << " " << std::abs(ideltar)
486  << " " << drcut / settings_.krprojshiftdisk() << " r = " << stub->r();
487  }
488 
489  if (imatch) {
490  countsel++;
491 
492  if (settings_.debugTracklet()) {
493  edm::LogVerbatim("Tracklet") << "MatchCalculator found match in disk " << getName();
494  }
495 
496  tracklet->addMatchDisk(disk,
497  ideltaphi,
498  ideltar,
499  drphi / stub->r(),
500  dr,
501  drphiapprox / stub->r(),
502  drapprox,
503  stub->alpha(settings_.stripPitch(stub->isPSmodule())),
504  (phiregion_ << 7) + fpgastub->stubindex().value(),
505  stub->z(),
506  fpgastub);
507  if (settings_.debugTracklet()) {
508  edm::LogVerbatim("Tracklet") << "Accepted full match in disk " << getName() << " " << tracklet << " "
509  << iSector_;
510  }
511 
512  fullMatches_[seedindex]->addMatch(tracklet, mergedMatches[j].second);
513  }
514  }
515  if (countall >= settings_.maxStep("MC"))
516  break;
517  }
518 
519  if (settings_.writeMonitorData("MC")) {
520  globals_->ofstream("matchcalculator.txt") << getName() << " " << countall << " " << countsel << endl;
521  }
522 }
523 
524 std::vector<std::pair<std::pair<Tracklet*, int>, const Stub*> > MatchCalculator::mergeMatches(
525  vector<CandidateMatchMemory*>& candmatch) {
526  std::vector<std::pair<std::pair<Tracklet*, int>, const Stub*> > tmp;
527 
528  std::vector<unsigned int> indexArray;
529  indexArray.reserve(candmatch.size());
530  for (unsigned int i = 0; i < candmatch.size(); i++) {
531  indexArray.push_back(0);
532  }
533 
534  int bestIndex = -1;
535  do {
536  int bestSector = 100;
537  int bestTCID = -1;
538  bestIndex = -1;
539  for (unsigned int i = 0; i < candmatch.size(); i++) {
540  if (indexArray[i] >= candmatch[i]->nMatches()) {
541  // skip as we were at the end
542  continue;
543  }
544  int TCID = candmatch[i]->getMatch(indexArray[i]).first.first->TCID();
545  int dSector = 0;
546  if (dSector > 2)
547  dSector -= N_SECTOR;
548  if (dSector < -2)
549  dSector += N_SECTOR;
550  assert(abs(dSector) < 2);
551  if (dSector == -1)
552  dSector = 2;
553  if (dSector < bestSector) {
554  bestSector = dSector;
555  bestTCID = TCID;
556  bestIndex = i;
557  }
558  if (dSector == bestSector) {
559  if (TCID < bestTCID || bestTCID < 0) {
560  bestTCID = TCID;
561  bestIndex = i;
562  }
563  }
564  }
565  if (bestIndex != -1) {
566  tmp.push_back(candmatch[bestIndex]->getMatch(indexArray[bestIndex]));
567  indexArray[bestIndex]++;
568  }
569  } while (bestIndex != -1);
570 
571  if (layerdisk_ < N_LAYER) {
572  int lastTCID = -1;
573  bool error = false;
574 
575  //Allow equal TCIDs since we can have multiple candidate matches
576  for (unsigned int i = 1; i < tmp.size(); i++) {
577  if (lastTCID > tmp[i].first.first->TCID()) {
578  edm::LogProblem("Tracklet") << "Wrong TCID ordering for projections in " << getName() << " last " << lastTCID
579  << " " << tmp[i].first.first->TCID();
580  error = true;
581  } else {
582  lastTCID = tmp[i].first.first->TCID();
583  }
584  }
585 
586  if (error) {
587  for (unsigned int i = 1; i < tmp.size(); i++) {
588  edm::LogProblem("Tracklet") << "Wrong order for in " << getName() << " " << i << " " << tmp[i].first.first
589  << " " << tmp[i].first.first->TCID();
590  }
591  }
592  }
593 
594  for (unsigned int i = 0; i < tmp.size(); i++) {
595  if (i > 0) {
596  //This allows for equal TCIDs. This means that we can e.g. have a track seeded
597  //in L1L2 that projects to both L3 and D4. The algorithm will pick up the first hit and
598  //drop the second
599 
600  assert(tmp[i - 1].first.first->TCID() <= tmp[i].first.first->TCID());
601  }
602  }
603 
604  return tmp;
605 }
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
trklet::MatchCalculator::phiregion_
unsigned int phiregion_
Definition: MatchCalculator.h:37
MatchCalculator.h
mps_fire.i
i
Definition: mps_fire.py:428
trklet::Settings::writetrace
bool writetrace() const
Definition: Settings.h:162
trklet::MatchCalculator::rphicutPS_
unsigned int rphicutPS_[N_SEED]
Definition: MatchCalculator.h:47
trklet::Settings::rphimatchcut
double rphimatchcut(unsigned int iSeed, unsigned int ilayer) const
Definition: Settings.h:136
input
static const std::string input
Definition: EdmProvDump.cc:48
MessageLogger.h
trklet::Settings::krprojshiftdisk
double krprojshiftdisk() const
Definition: Settings.h:364
trklet::Tracklet::fpgaphiprojdisk
const FPGAWord & fpgaphiprojdisk(int disk) const
Definition: Tracklet.h:266
trklet::Stub::phi
const FPGAWord & phi() const
Definition: Stub.h:51
AllStubsMemory.h
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
memory
Definition: HGCRecHitSoA.h:20
CandidateMatchMemory.h
trklet::N_SECTOR
constexpr unsigned int N_SECTOR
Definition: Settings.h:17
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)
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::settings_
Settings const & settings_
Definition: ProcessBase.h:44
compare.hists
hists
Definition: compare.py:319
trklet::Stub::phiapprox
double phiapprox(double phimin, double) const
Definition: Stub.cc:242
trklet::MatchCalculator::addInput
void addInput(MemoryBase *memory, std::string input) override
Definition: MatchCalculator.cc:184
trklet::Settings::kphi1
double kphi1() const
Definition: Settings.h:268
FullMatchMemory.h
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
relativeConstraints.error
error
Definition: relativeConstraints.py:53
trklet::MatchCalculator::rphicut2S_
unsigned int rphicut2S_[N_SEED]
Definition: MatchCalculator.h:48
trklet::MatchCalculator::rcutPS_
unsigned int rcutPS_[N_SEED]
Definition: MatchCalculator.h:49
trklet::MatchCalculator::icorzshift_
int icorzshift_
Definition: MatchCalculator.h:41
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
LEDCalibrationChannels.iphi
iphi
Definition: LEDCalibrationChannels.py:64
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::MatchCalculator::allprojs_
AllProjectionsMemory * allprojs_
Definition: MatchCalculator.h:56
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::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
edm::LogProblem
Log< level::Error, true > LogProblem
Definition: MessageLogger.h:131
trklet::Settings::rcut2S
double rcut2S(unsigned int iSeed, unsigned int idisk) const
Definition: Settings.h:141
trklet::N_LAYER
constexpr int N_LAYER
Definition: Settings.h:19
AllProjectionsMemory.h
trklet::MatchCalculator::ialphafactouter_
int ialphafactouter_[N_DSS_MOD *2]
Definition: MatchCalculator.h:53
trklet::MatchCalculator::addOutput
void addOutput(MemoryBase *memory, std::string output) override
Definition: MatchCalculator.cc:169
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::MatchCalculator::fullMatches_
std::vector< FullMatchMemory * > fullMatches_
Definition: MatchCalculator.h:59
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::MatchCalculator::phimatchcut_
unsigned int phimatchcut_[N_SEED]
Definition: MatchCalculator.h:45
trklet::Tracklet::zproj
double zproj(int layer) const
Definition: Tracklet.h:164
first
auto first
Definition: CAHitNtupletGeneratorKernelsImpl.h:112
trklet::Tracklet::phiprojderapproxdisk
double phiprojderapproxdisk(int disk) const
Definition: Tracklet.h:291
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::N_SEED
constexpr unsigned int N_SEED
Definition: Settings.h:22
trklet::Settings::drmax
double drmax() const
Definition: Settings.h:115
trklet::MatchCalculator::phi0shift_
int phi0shift_
Definition: MatchCalculator.h:42
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::N_DSS_MOD
constexpr unsigned int N_DSS_MOD
Definition: Settings.h:24
trklet::MatchCalculator::icorrshift_
int icorrshift_
Definition: MatchCalculator.h:40
trklet::Tracklet::TCID
int TCID() const
Definition: Tracklet.h:500
trklet::MatchCalculator::matches_
std::vector< CandidateMatchMemory * > matches_
Definition: MatchCalculator.h:58
HistBase.h
trklet::Settings::nzbitsstub
unsigned int nzbitsstub(unsigned int layerdisk) const
Definition: Settings.h:69
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::MatchCalculator::phioffset_
double phioffset_
Definition: MatchCalculator.h:43
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::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::MatchCalculator::layerdisk_
unsigned int layerdisk_
Definition: MatchCalculator.h:36
trklet::Tracklet::rprojderapproxdisk
double rprojderapproxdisk(int disk) const
Definition: Tracklet.h:301
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::Settings::nbitsalpha
int nbitsalpha() const
Definition: Settings.h:194
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::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::MatchCalculator::execute
void execute()
Definition: MatchCalculator.cc:210
trklet::Settings::tablePath
std::string const & tablePath() const
Definition: Settings.h:170
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
trklet::Tracklet::zprojder
double zprojder(int layer) const
Definition: Tracklet.h:169
trklet::Settings::useapprox
bool useapprox() const
Definition: Settings.h:211
flavorHistoryFilter_cfi.dr
dr
Definition: flavorHistoryFilter_cfi.py:37
Exception
Definition: hltDiff.cc:245
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::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::MatchCalculator::ialphafactinner_
int ialphafactinner_[N_DSS_MOD *2]
Definition: MatchCalculator.h:52
Exception.h
trklet::Settings::rphicut2S
double rphicut2S(unsigned int iSeed, unsigned int idisk) const
Definition: Settings.h:140
trklet::Tracklet::fpgarprojdisk
const FPGAWord & fpgarprojdisk(int disk) const
Definition: Tracklet.h:276
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
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
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
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
trklet::Globals::histograms
HistBase *& histograms()
Definition: Globals.h:40
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::Settings::c
double c() const
Definition: Settings.h:189
trklet::MatchCalculator::allstubs_
AllStubsMemory * allstubs_
Definition: MatchCalculator.h:55
trklet::MatchCalculator::zmatchcut_
unsigned int zmatchcut_[N_SEED]
Definition: MatchCalculator.h:46
Stub.h
trklet::MatchCalculator::fact_
int fact_
Definition: MatchCalculator.h:39
trklet::MatchCalculator::rcut2S_
unsigned int rcut2S_[N_SEED]
Definition: MatchCalculator.h:50
trklet::Tracklet::phiprojapprox
double phiprojapprox(int layer) const
Definition: Tracklet.h:184
Tracklet.h
trklet::MatchCalculator::mergeMatches
std::vector< std::pair< std::pair< Tracklet *, int >, const Stub * > > mergeMatches(std::vector< CandidateMatchMemory * > &candmatch)
Definition: MatchCalculator.cc:524
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
reco::reduceRange
constexpr T reduceRange(T x)
Definition: deltaPhi.h:18