CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
trklet::MatchProcessor Class Reference

#include <MatchProcessor.h>

Inheritance diagram for trklet::MatchProcessor:
trklet::ProcessBase

Public Member Functions

void addInput (MemoryBase *memory, std::string input) override
 
void addOutput (MemoryBase *memory, std::string output) override
 
void execute (unsigned int iSector, double phimin)
 
bool matchCalculator (Tracklet *tracklet, const Stub *fpgastub, bool print, unsigned int istep)
 
 MatchProcessor (std::string name, Settings const &settings, Globals *global)
 
 ~MatchProcessor () override=default
 
- Public Member Functions inherited from trklet::ProcessBase
unsigned int getISeed (const std::string &name)
 
std::string const & getName () const
 
unsigned int initLayerDisk (unsigned int pos)
 
void initLayerDisk (unsigned int pos, int &layer, int &disk)
 
void initLayerDisk (unsigned int pos, int &layer, int &disk, int &layerdisk)
 
void initLayerDisksandISeed (unsigned int &layerdisk1, unsigned int &layerdisk2, unsigned int &iSeed)
 
unsigned int nbits (unsigned int power)
 
 ProcessBase (std::string name, Settings const &settings, Globals *global)
 
virtual ~ProcessBase ()=default
 

Private Attributes

AllStubsMemoryallstubs_
 
bool barrel_
 
int dzshift_
 
std::vector< FullMatchMemory * > fullmatches_
 
int ialphafactinner_ [N_DSS_MOD *2]
 
int ialphafactouter_ [N_DSS_MOD *2]
 
int icorrshift_
 
int icorzshift_
 
CircularBuffer< ProjectionTempinputProjBuffer_
 
std::vector< TrackletProjectionsMemory * > inputprojs_
 
unsigned int layerdisk_
 
TrackletLUT luttable_
 
std::vector< MatchEngineUnitmatchengines_
 
unsigned int nMatchEngines_
 
int nphiderbits_
 
int nrbits_
 
int nrinv_
 
int nvm_
 
int nvmbins_
 
int nvmbits_
 
TrackletLUT phimatchcuttable_
 
double phimin_
 
unsigned int phiregion_
 
int phishift_
 
TrackletLUT rcut2Stable_
 
TrackletLUT rcutPStable_
 
TrackletLUT rinvbendlut_
 
TrackletLUT rphicut2Stable_
 
TrackletLUT rphicutPStable_
 
std::vector< VMStubsMEMemory * > vmstubs_
 
TrackletLUT zmatchcuttable_
 

Additional Inherited Members

- Protected Attributes inherited from trklet::ProcessBase
Globalsglobals_
 
std::string name_
 
Settings const & settings_
 

Detailed Description

Definition at line 25 of file MatchProcessor.h.

Constructor & Destructor Documentation

◆ MatchProcessor()

MatchProcessor::MatchProcessor ( std::string  name,
Settings const &  settings,
Globals global 
)

Definition at line 16 of file MatchProcessor.cc.

17  : ProcessBase(name, settings, global),
18  phimatchcuttable_(settings),
19  zmatchcuttable_(settings),
20  rphicutPStable_(settings),
21  rphicut2Stable_(settings),
22  rcutPStable_(settings),
23  rcut2Stable_(settings),
24  fullmatches_(12),
25  rinvbendlut_(settings),
26  luttable_(settings),
27  inputProjBuffer_(3) {
28  phiregion_ = name[8] - 'A';
29 
31 
33 
36 
37  if (barrel_) {
40  } else {
43  }
44 
46 
47  nrbits_ = 5;
48  nphiderbits_ = 6;
49 
50  if (!barrel_) {
53  }
54 
55  nrinv_ = NRINVBITS;
56 
57  unsigned int region = getName()[8] - 'A';
59 
60  if (barrel_) {
61  phimatchcuttable_.initmatchcut(layerdisk_, TrackletLUT::MatchType::barrelphi, region);
62  zmatchcuttable_.initmatchcut(layerdisk_, TrackletLUT::MatchType::barrelz, region);
63  } else {
64  rphicutPStable_.initmatchcut(layerdisk_, TrackletLUT::MatchType::diskPSphi, region);
65  rphicut2Stable_.initmatchcut(layerdisk_, TrackletLUT::MatchType::disk2Sphi, region);
66  rcutPStable_.initmatchcut(layerdisk_, TrackletLUT::MatchType::diskPSr, region);
67  rcut2Stable_.initmatchcut(layerdisk_, TrackletLUT::MatchType::disk2Sr, region);
68  }
69 
70  for (unsigned int i = 0; i < N_DSS_MOD * 2; i++) {
72  (1 << (settings_.nbitsalpha() - 1)) / (settings_.rDSSinner(i) * settings_.rDSSinner(i)) /
73  settings_.kphi();
75  (1 << (settings_.nbitsalpha() - 1)) / (settings_.rDSSouter(i) * settings_.rDSSouter(i)) /
76  settings_.kphi();
77  }
78 
82 
83  nMatchEngines_ = 4;
84  for (unsigned int iME = 0; iME < nMatchEngines_; iME++) {
86  matchengines_.push_back(tmpME);
87  }
88 }

References trklet::Settings::alphashift(), cms::cuda::assert(), barrel_, trklet::IMATH_TrackletCalculator::der_phiD_final, dzshift_, trklet::ProcessBase::getName(), trklet::Settings::half2SmoduleWidth(), mps_fire::i, ialphafactinner_, ialphafactouter_, icorrshift_, icorzshift_, trklet::ilog2(), trklet::TrackletLUT::initBendMatch(), trklet::ProcessBase::initLayerDisk(), trklet::TrackletLUT::initmatchcut(), trklet::TrackletLUT::initProjectionBend(), trklet::Globals::ITC_L1L2(), trklet::VarBase::K(), trklet::Settings::kphi(), trklet::Settings::kphider(), trklet::Settings::kphiderdisk(), trklet::Settings::krbarrel(), trklet::Settings::krder(), trklet::Settings::krprojshiftdisk(), trklet::Settings::kz(), trklet::Settings::kzder(), layerdisk_, luttable_, matchengines_, trklet::N_DSS_MOD, trklet::N_LAYER, trklet::Settings::nallstubs(), Skims_PA_cff::name, trklet::Settings::nbitsallstubs(), trklet::Settings::nbitsalpha(), trklet::Settings::nbitsvmme(), nMatchEngines_, trklet::Settings::nphibitsstub(), nphiderbits_, nrbits_, nrinv_, trklet::NRINVBITS, nvm_, nvmbins_, nvmbits_, trklet::Settings::nvmme(), trklet::Settings::nzbitsstub(), phimatchcuttable_, phiregion_, phishift_, rcut2Stable_, rcutPStable_, trklet::Settings::rDSSinner(), trklet::Settings::rDSSouter(), HLT_FULL_cff::region, rinvbendlut_, rphicut2Stable_, rphicutPStable_, trklet::ProcessBase::settings_, and zmatchcuttable_.

◆ ~MatchProcessor()

trklet::MatchProcessor::~MatchProcessor ( )
overridedefault

Member Function Documentation

◆ addInput()

void MatchProcessor::addInput ( MemoryBase memory,
std::string  input 
)
overridevirtual

Implements trklet::ProcessBase.

Definition at line 107 of file MatchProcessor.cc.

107  {
108  if (settings_.writetrace()) {
109  edm::LogVerbatim("Tracklet") << "In " << name_ << " adding input from " << memory->getName() << " to input "
110  << input;
111  }
112  if (input == "allstubin") {
113  auto* tmp = dynamic_cast<AllStubsMemory*>(memory);
114  assert(tmp != nullptr);
115  allstubs_ = tmp;
116  return;
117  }
118  if (input == "vmstubin") {
119  auto* tmp = dynamic_cast<VMStubsMEMemory*>(memory);
120  assert(tmp != nullptr);
121  vmstubs_.push_back(tmp); //to allow more than one stub in? vmstubs_=tmp;
122  return;
123  }
124  if (input == "projin") {
125  auto* tmp = dynamic_cast<TrackletProjectionsMemory*>(memory);
126  assert(tmp != nullptr);
127  inputprojs_.push_back(tmp);
128  return;
129  }
130  throw cms::Exception("BadConfig") << __FILE__ << " " << __LINE__ << " could not find input: " << input;
131 }

References allstubs_, cms::cuda::assert(), Exception, input, inputprojs_, trklet::ProcessBase::name_, trklet::ProcessBase::settings_, createJobs::tmp, vmstubs_, and trklet::Settings::writetrace().

◆ addOutput()

void MatchProcessor::addOutput ( MemoryBase memory,
std::string  output 
)
overridevirtual

Implements trklet::ProcessBase.

Definition at line 90 of file MatchProcessor.cc.

90  {
91  if (settings_.writetrace()) {
92  edm::LogVerbatim("Tracklet") << "In " << name_ << " adding output to " << memory->getName() << " to output "
93  << output;
94  }
95  if (output.find("matchout") != std::string::npos) {
96  auto* tmp = dynamic_cast<FullMatchMemory*>(memory);
97  assert(tmp != nullptr);
98  unsigned int iSeed = getISeed(tmp->getName());
99  assert(iSeed < fullmatches_.size());
100  assert(fullmatches_[iSeed] == nullptr);
101  fullmatches_[iSeed] = tmp;
102  return;
103  }
104  throw cms::Exception("BadConfig") << __FILE__ << " " << __LINE__ << " could not find output: " << output;
105 }

References cms::cuda::assert(), Exception, fullmatches_, trklet::ProcessBase::getISeed(), trklet::ProcessBase::name_, convertSQLitetoXML_cfg::output, trklet::ProcessBase::settings_, createJobs::tmp, and trklet::Settings::writetrace().

◆ execute()

void MatchProcessor::execute ( unsigned int  iSector,
double  phimin 
)

Definition at line 133 of file MatchProcessor.cc.

133  {
134  assert(vmstubs_.size() == 1);
135 
136  /*
137  The code is organized in three 'steps' corresponding to the PR, ME, and MC functions. The output from
138  the PR step is buffered in a 'circular' buffer, and similarly the ME output is put in a circular buffer.
139 
140  The implementation is done in steps, emulating what can be done in firmware. One each step we do:
141 
142  1) A projection is read and if there is space it is insert into the inputProjBuffer_
143 
144  2) Process next match in the ME - if there is an idle ME the next projection is inserted
145 
146  3) Readout match from ME and send to match calculator
147 
148  */
149 
150  bool print = getName() == "MP_L3PHIC" && iSector == 3;
151  print = false;
152 
153  phimin_ = phimin;
154 
155  Tracklet* oldTracklet = nullptr;
156 
157  unsigned int countme = 0;
158  unsigned int countall = 0;
159  unsigned int countsel = 0;
160  unsigned int countinputproj = 0;
161 
162  unsigned int iprojmem = 0;
163  while (iprojmem < inputprojs_.size() && inputprojs_[iprojmem]->nTracklets() == 0) {
164  iprojmem++;
165  }
166 
167  unsigned int iproj = 0;
168 
169  inputProjBuffer_.reset();
170 
171  for (const auto& inputproj : inputprojs_) {
172  countinputproj += inputproj->nTracklets();
173  }
174 
175  for (auto& matchengine : matchengines_) {
176  matchengine.reset();
177  }
178 
179  ProjectionTemp tmpProj_, tmpProj__;
180  bool good_ = false;
181  bool good__ = false;
182 
183  for (unsigned int istep = 0; istep < settings_.maxStep("MP"); istep++) {
184  bool projBuffNearFull = inputProjBuffer_.nearfull();
185 
186  // This print statement is useful for detailed comparison with the HLS code
187  // It prints out detailed status information for each clock step
188  /*
189  if (print) {
190  cout << "istep = "<<istep<<" projBuff: "<<inputProjBuffer_.rptr()<<" "<<inputProjBuffer_.wptr()<<" "<<projBuffNearFull;
191  unsigned int iMEU = 0;
192  for (auto& matchengine : matchengines_) {
193  cout <<" MEU"<<iMEU<<": "<<matchengine.rptr()<<" "<<matchengine.wptr()
194  <<" "<<matchengine.idle()<<" "<<matchengine.empty()
195  <<" "<<matchengine.have_()<<matchengine.have__()
196  <<" "<<matchengine.TCID();
197  iMEU++;
198  }
199  cout << std::endl;
200  }
201  */
202 
203  bool projdone = false;
204 
205  //Step 3
206  //Check if we have candidate match to process
207 
208  unsigned int iMEbest = 0;
209  int bestTCID = matchengines_[0].TCID();
210  bool meactive = matchengines_[0].active();
211  for (unsigned int iME = 1; iME < nMatchEngines_; iME++) {
212  meactive = meactive || matchengines_[iME].active();
213  int tcid = matchengines_[iME].TCID();
214  if (tcid < bestTCID) {
215  bestTCID = tcid;
216  iMEbest = iME;
217  }
218  }
219 
220  if (!matchengines_[iMEbest].empty()) {
221  std::pair<Tracklet*, const Stub*> candmatch = matchengines_[iMEbest].read();
222 
223  const Stub* fpgastub = candmatch.second;
224  Tracklet* tracklet = candmatch.first;
225 
226  if (oldTracklet != nullptr) {
227  //allow equal here since we can have more than one cadidate match per tracklet projection
228  //cout << "old new : "<<oldTracklet->TCID()<<" "<<tracklet->TCID()<<" "<<iMEbest<<endl;
229  assert(oldTracklet->TCID() <= tracklet->TCID());
230  }
231  oldTracklet = tracklet;
232 
233  bool match = matchCalculator(tracklet, fpgastub, print, istep);
234 
235  if (settings_.debugTracklet() && match) {
236  edm::LogVerbatim("Tracklet") << getName() << " have match";
237  }
238 
239  countall++;
240  if (match)
241  countsel++;
242  }
243 
244  //Step 2
245  //Check if we have ME that can process projection
246 
247  bool addedProjection = false;
248  for (unsigned int iME = 0; iME < nMatchEngines_; iME++) {
249  if (!matchengines_[iME].idle())
250  countme++;
251  //if match engine empty and we have queued projections add to match engine
252  if ((!addedProjection) && matchengines_[iME].idle() && (!inputProjBuffer_.empty())) {
253  ProjectionTemp tmpProj = inputProjBuffer_.read();
254  VMStubsMEMemory* stubmem = vmstubs_[0];
255 
256  if (settings_.debugTracklet()) {
257  edm::LogVerbatim("Tracklet") << getName() << " adding projection to match engine";
258  }
259 
260  int nbins = (1 << N_RZBITS);
261  if (layerdisk_ >= N_LAYER) {
262  nbins *= 2; //twice as many bins in disks (since there are two disks)
263  }
264 
265  matchengines_[iME].init(stubmem,
266  nbins,
267  tmpProj.slot(),
268  tmpProj.iphi(),
269  tmpProj.shift(),
270  tmpProj.projrinv(),
271  tmpProj.projfinerz(),
272  tmpProj.projfinephi(),
273  tmpProj.use(0, 0),
274  tmpProj.use(0, 1),
275  tmpProj.use(1, 0),
276  tmpProj.use(1, 1),
277  tmpProj.isPSseed(),
278  tmpProj.proj(),
279  print && (iME == 0));
280  addedProjection = true;
281  } else {
282  matchengines_[iME].step(print && iME == 0);
283  }
284  }
285 
286  //Step 1
287  //First step here checks if we have more input projections to put into
288  //the input puffer for projections
289 
290  if (good__) {
291  inputProjBuffer_.store(tmpProj__);
292  }
293 
294  good__ = good_;
295  tmpProj__ = tmpProj_;
296 
297  good_ = false;
298 
299  if (istep < settings_.maxStep("MP")) {
300  if (iprojmem < inputprojs_.size()) {
301  TrackletProjectionsMemory* projMem = inputprojs_[iprojmem];
302  if (!projBuffNearFull) {
303  if (settings_.debugTracklet()) {
304  edm::LogVerbatim("Tracklet") << getName() << " have projection in memory : " << projMem->getName();
305  }
306 
307  Tracklet* proj = projMem->getTracklet(iproj);
308 
309  FPGAWord fpgaphi = proj->proj(layerdisk_).fpgaphiproj();
310 
311  unsigned int iphi = (fpgaphi.value() >> (fpgaphi.nbits() - nvmbits_)) & (nvmbins_ - 1);
312 
313  int nextrabits = 2;
314  int overlapbits = nvmbits_ + nextrabits;
315 
316  unsigned int extrabits = fpgaphi.bits(fpgaphi.nbits() - overlapbits, nextrabits);
317 
318  unsigned int ivmPlus = iphi;
319 
320  int shift = 0;
321 
322  if (extrabits == ((1U << nextrabits) - 1) && iphi != ((1U << settings_.nbitsvmme(layerdisk_)) - 1)) {
323  shift = 1;
324  ivmPlus++;
325  }
326  unsigned int ivmMinus = iphi;
327  if (extrabits == 0 && iphi != 0) {
328  shift = -1;
329  ivmMinus--;
330  }
331 
332  int projrinv = -1;
333  if (barrel_) {
334  FPGAWord phider = proj->proj(layerdisk_).fpgaphiprojder();
335  projrinv = (1 << (nrinv_ - 1)) - 1 - (phider.value() >> (phider.nbits() - nrinv_));
336  } else {
337  //The next lines looks up the predicted bend based on:
338  // 1 - r projections
339  // 2 - phi derivative
340  // 3 - the sign - i.e. if track is forward or backward
341 
342  int rindex = (proj->proj(layerdisk_).fpgarzproj().value() >>
343  (proj->proj(layerdisk_).fpgarzproj().nbits() - nrbits_)) &
344  ((1 << nrbits_) - 1);
345 
346  int phiderindex = (proj->proj(layerdisk_).fpgaphiprojder().value() >>
347  (proj->proj(layerdisk_).fpgaphiprojder().nbits() - nphiderbits_)) &
348  ((1 << nphiderbits_) - 1);
349 
350  int signindex = proj->proj(layerdisk_).fpgarzprojder().value() < 0;
351 
352  int bendindex = (signindex << (nphiderbits_ + nrbits_)) + (rindex << (nphiderbits_)) + phiderindex;
353 
354  projrinv = rinvbendlut_.lookup(bendindex);
355 
356  proj->proj(layerdisk_).setBendIndex(projrinv);
357  }
358  assert(projrinv >= 0);
359 
360  unsigned int slot = proj->proj(layerdisk_).fpgarzbin1projvm().value();
361  bool second = proj->proj(layerdisk_).fpgarzbin2projvm().value();
362 
363  unsigned int projfinephi =
364  (fpgaphi.value() >> (fpgaphi.nbits() - (nvmbits_ + NFINEPHIBITS))) & ((1 << NFINEPHIBITS) - 1);
365  int projfinerz = proj->proj(layerdisk_).fpgafinerzvm().value();
366 
367  bool isPSseed = proj->PSseed();
368 
369  int nbins = (1 << N_RZBITS);
370  if (layerdisk_ >= N_LAYER) {
371  nbins *= 2; //twice as many bins in disks (since there are two disks)
372  }
373 
374  VMStubsMEMemory* stubmem = vmstubs_[0];
375  bool usefirstMinus = stubmem->nStubsBin(ivmMinus * nbins + slot) != 0;
376  bool usesecondMinus = (second && (stubmem->nStubsBin(ivmMinus * nbins + slot + 1) != 0));
377  bool usefirstPlus = ivmPlus != ivmMinus && stubmem->nStubsBin(ivmPlus * nbins + slot) != 0;
378  bool usesecondPlus = ivmPlus != ivmMinus && (second && (stubmem->nStubsBin(ivmPlus * nbins + slot + 1) != 0));
379 
380  good_ = usefirstPlus || usesecondPlus || usefirstMinus || usesecondMinus;
381 
382  if (good_) {
383  ProjectionTemp tmpProj(proj,
384  slot,
385  projrinv,
386  projfinerz,
387  projfinephi,
388  ivmMinus,
389  shift,
390  usefirstMinus,
391  usefirstPlus,
392  usesecondMinus,
393  usesecondPlus,
394  isPSseed);
395  tmpProj_ = tmpProj;
396  }
397 
398  iproj++;
399  if (iproj == projMem->nTracklets()) {
400  iproj = 0;
401  do {
402  iprojmem++;
403  } while (iprojmem < inputprojs_.size() && inputprojs_[iprojmem]->nTracklets() == 0);
404  }
405  }
406 
407  } else {
408  projdone = true && !good_ && !good__;
409  }
410  }
411 
412  //
413  // Check if done
414  //
415  //
416  //
417 
418  if ((projdone && !meactive) || (istep == settings_.maxStep("MP") - 1)) {
419  if (settings_.writeMonitorData("MP")) {
420  globals_->ofstream("matchprocessor.txt") << getName() << " " << istep << " " << countall << " " << countsel
421  << " " << countme << " " << countinputproj << endl;
422  }
423  break;
424  }
425  }
426 
427  if (settings_.writeMonitorData("MC")) {
428  globals_->ofstream("matchcalculator.txt") << getName() << " " << countall << " " << countsel << endl;
429  }
430 }

References cms::cuda::assert(), barrel_, trklet::FPGAWord::bits(), trklet::Settings::debugTracklet(), relativeConstraints::empty, trklet::MemoryBase::getName(), trklet::ProcessBase::getName(), trklet::TrackletProjectionsMemory::getTracklet(), trklet::ProcessBase::globals_, inputProjBuffer_, inputprojs_, trklet::ProjectionTemp::iphi(), LEDCalibrationChannels::iphi, trklet::ProjectionTemp::isPSseed(), layerdisk_, trklet::TrackletLUT::lookup(), match(), matchCalculator(), matchengines_, trklet::Settings::maxStep(), trklet::N_LAYER, trklet::N_RZBITS, LaserClient_cfi::nbins, trklet::FPGAWord::nbits(), trklet::Settings::nbitsvmme(), trklet::NFINEPHIBITS, nMatchEngines_, nphiderbits_, nrbits_, nrinv_, trklet::VMStubsMEMemory::nStubsBin(), trklet::TrackletProjectionsMemory::nTracklets(), nvmbins_, nvmbits_, trklet::Globals::ofstream(), phimin, phimin_, print(), amptDefault_cfi::proj, trklet::ProjectionTemp::proj(), trklet::ProjectionTemp::projfinephi(), trklet::ProjectionTemp::projfinerz(), trklet::ProjectionTemp::projrinv(), rinvbendlut_, edm::second(), trklet::ProcessBase::settings_, edm::shift, trklet::ProjectionTemp::shift(), trklet::ProjectionTemp::slot(), trklet::Tracklet::TCID(), mitigatedMETSequence_cff::U, trklet::ProjectionTemp::use(), trklet::FPGAWord::value(), vmstubs_, and trklet::Settings::writeMonitorData().

◆ matchCalculator()

bool MatchProcessor::matchCalculator ( Tracklet tracklet,
const Stub fpgastub,
bool  print,
unsigned int  istep 
)

Definition at line 432 of file MatchProcessor.cc.

432  {
433  const L1TStub* stub = fpgastub->l1tstub();
434 
435  if (layerdisk_ < N_LAYER) {
436  const Projection& proj = tracklet->proj(layerdisk_);
437  int ir = fpgastub->r().value();
438  int iphi = proj.fpgaphiproj().value();
439  int icorr = (ir * proj.fpgaphiprojder().value()) >> icorrshift_;
440  iphi += icorr;
441 
442  int iz = proj.fpgarzproj().value();
443  int izcor = (ir * proj.fpgarzprojder().value() + (1 << (icorzshift_ - 1))) >> icorzshift_;
444  iz += izcor;
445 
446  int ideltaz = fpgastub->z().value() - iz;
447  int ideltaphi = (fpgastub->phi().value() - iphi) << phishift_;
448 
449  //Floating point calculations
450 
451  double phi = stub->phi();
452  double r = stub->r();
453  double z = stub->z();
454 
455  if (settings_.useapprox()) {
456  double dphi = reco::reduceRange(phi - fpgastub->phiapprox(phimin_, 0.0));
457  assert(std::abs(dphi) < 0.001);
458  phi = fpgastub->phiapprox(phimin_, 0.0);
459  z = fpgastub->zapprox();
460  r = fpgastub->rapprox();
461  }
462 
463  if (phi < 0)
464  phi += 2 * M_PI;
465  phi -= phimin_;
466 
467  double dr = r - settings_.rmean(layerdisk_);
469 
470  double dphi = reco::reduceRange(phi - (proj.phiproj() + dr * proj.phiprojder()));
471 
472  double dz = z - (proj.rzproj() + dr * proj.rzprojder());
473 
474  double dphiapprox = reco::reduceRange(phi - (proj.phiprojapprox() + dr * proj.phiprojderapprox()));
475 
476  double dzapprox = z - (proj.rzprojapprox() + dr * proj.rzprojderapprox());
477 
478  int seedindex = tracklet->getISeed();
479 
480  assert(phimatchcuttable_.lookup(seedindex) > 0);
481  assert(zmatchcuttable_.lookup(seedindex) > 0);
482 
483  if (settings_.bookHistos()) {
484  bool truthmatch = tracklet->stubtruthmatch(stub);
485 
487  hists->FillLayerResidual(layerdisk_ + 1,
488  seedindex,
489  dphiapprox * settings_.rmean(layerdisk_),
490  ideltaphi * settings_.kphi1() * settings_.rmean(layerdisk_),
491  (ideltaz << dzshift_) * settings_.kz(),
492  dz,
493  truthmatch);
494  }
495 
496  if (settings_.writeMonitorData("Residuals")) {
497  double pt = 0.01 * settings_.c() * settings_.bfield() / std::abs(tracklet->rinv());
498 
499  globals_->ofstream("layerresiduals.txt")
500  << layerdisk_ + 1 << " " << seedindex << " " << pt << " "
501  << ideltaphi * settings_.kphi1() * settings_.rmean(layerdisk_) << " "
502  << dphiapprox * settings_.rmean(layerdisk_) << " "
503  << phimatchcuttable_.lookup(seedindex) * settings_.kphi1() * settings_.rmean(layerdisk_) << " "
504  << (ideltaz << dzshift_) * settings_.kz() << " " << dz << " "
505  << zmatchcuttable_.lookup(seedindex) * settings_.kz() << endl;
506  }
507 
508  bool imatch = (std::abs(ideltaphi) <= phimatchcuttable_.lookup(seedindex)) &&
509  (std::abs(ideltaz << dzshift_) <= zmatchcuttable_.lookup(seedindex));
510 
511  if (settings_.debugTracklet()) {
512  edm::LogVerbatim("Tracklet") << getName() << " imatch = " << imatch << " ideltaphi cut " << ideltaphi << " "
513  << phimatchcuttable_.lookup(seedindex) << " ideltaz<<dzshift cut "
514  << (ideltaz << dzshift_) << " " << zmatchcuttable_.lookup(seedindex);
515  }
516 
517  //This would catch significant consistency problems in the configuration - helps to debug if there are problems.
518  if (std::abs(dphi) > 0.5 * settings_.dphisectorHG() || std::abs(dphiapprox) > 0.5 * settings_.dphisectorHG()) {
519  throw cms::Exception("LogicError") << "WARNING dphi and/or dphiapprox too large : " << dphi << " " << dphiapprox
520  << endl;
521  }
522 
523  if (imatch) {
524  tracklet->addMatch(layerdisk_,
525  ideltaphi,
526  ideltaz,
527  dphi,
528  dz,
529  dphiapprox,
530  dzapprox,
531  (phiregion_ << N_BITSMEMADDRESS) + fpgastub->stubindex().value(),
532  fpgastub);
533 
534  if (settings_.debugTracklet()) {
535  edm::LogVerbatim("Tracklet") << "Accepted full match in layer " << getName() << " " << tracklet;
536  }
537 
538  int iSeed = tracklet->getISeed();
539  assert(fullmatches_[iSeed] != nullptr);
540  fullmatches_[iSeed]->addMatch(tracklet, fpgastub);
541 
542  return true;
543  } else {
544  return false;
545  }
546  } else { //disk matches
547 
548  //check that stubs and projections in same half of detector
549  assert(stub->z() * tracklet->t() > 0.0);
550 
551  int sign = (tracklet->t() > 0.0) ? 1 : -1;
552  int disk = sign * (layerdisk_ - N_LAYER + 1);
553  assert(disk != 0);
554 
555  //Perform integer calculations here
556 
557  int iz = fpgastub->z().value();
558 
559  const Projection& proj = tracklet->proj(layerdisk_);
560 
561  int iphi = proj.fpgaphiproj().value();
562  int iphicorr = (iz * proj.fpgaphiprojder().value()) >> icorrshift_;
563 
564  iphi += iphicorr;
565 
566  int ir = proj.fpgarzproj().value();
567  int ircorr = (iz * proj.fpgarzprojder().value()) >> icorzshift_;
568  ir += ircorr;
569 
570  int ideltaphi = fpgastub->phi().value() - iphi;
571 
572  int irstub = fpgastub->r().value();
573  int ialphafact = 0;
574  if (!stub->isPSmodule()) {
575  assert(irstub < (int)N_DSS_MOD * 2);
576  if (layerdisk_ - N_LAYER <= 1) {
577  ialphafact = ialphafactinner_[irstub];
578  irstub = settings_.rDSSinner(irstub) / settings_.kr();
579  } else {
580  ialphafact = ialphafactouter_[irstub];
581  irstub = settings_.rDSSouter(irstub) / settings_.kr();
582  }
583  }
584 
585  int ideltar = (irstub * settings_.kr()) / settings_.krprojshiftdisk() - ir;
586 
587  if (!stub->isPSmodule()) {
588  int ialpha = fpgastub->alpha().value();
589  int iphialphacor = ((ideltar * ialpha * ialphafact) >> settings_.alphashift());
590  ideltaphi += iphialphacor;
591  }
592 
593  //Perform floating point calculations here
594 
595  double phi = stub->phi();
596  double z = stub->z();
597  double r = stub->r();
598 
599  if (settings_.useapprox()) {
600  double dphi = reco::reduceRange(phi - fpgastub->phiapprox(phimin_, 0.0));
601  assert(std::abs(dphi) < 0.001);
602  phi = fpgastub->phiapprox(phimin_, 0.0);
603  z = fpgastub->zapprox();
604  r = fpgastub->rapprox();
605  }
606 
607  if (phi < 0)
608  phi += 2 * M_PI;
609  phi -= phimin_;
610 
611  double dz = z - sign * settings_.zmean(layerdisk_ - N_LAYER);
612 
613  if (std::abs(dz) > settings_.dzmax()) {
614  edm::LogProblem("Tracklet") << __FILE__ << ":" << __LINE__ << " " << name_ << " " << tracklet->getISeed();
615  edm::LogProblem("Tracklet") << "stub " << stub->z() << " disk " << disk << " " << dz;
617  }
618 
619  double phiproj = proj.phiproj() + dz * proj.phiprojder();
620  double rproj = proj.rzproj() + dz * proj.rzprojder();
621  double deltar = r - rproj;
622 
623  double dr = stub->r() - rproj;
624  double drapprox = stub->r() - (proj.rzprojapprox() + dz * proj.rzprojderapprox());
625 
626  double dphi = reco::reduceRange(phi - phiproj);
627 
628  double dphiapprox = reco::reduceRange(phi - (proj.phiprojapprox() + dz * proj.phiprojderapprox()));
629 
630  double drphi = dphi * stub->r();
631  double drphiapprox = dphiapprox * stub->r();
632 
633  if (!stub->isPSmodule()) {
634  double alphanorm = stub->alphanorm();
635  dphi += dr * alphanorm * settings_.half2SmoduleWidth() / stub->r2();
636  ;
637  dphiapprox += drapprox * alphanorm * settings_.half2SmoduleWidth() / stub->r2();
638 
639  drphi += dr * alphanorm * settings_.half2SmoduleWidth() / stub->r();
640  drphiapprox += dr * alphanorm * settings_.half2SmoduleWidth() / stub->r();
641  }
642 
643  int seedindex = tracklet->getISeed();
644 
645  int idrphicut = rphicutPStable_.lookup(seedindex);
646  int idrcut = rcutPStable_.lookup(seedindex);
647  if (!stub->isPSmodule()) {
648  idrphicut = rphicut2Stable_.lookup(seedindex);
649  idrcut = rcut2Stable_.lookup(seedindex);
650  }
651 
652  double drphicut = idrphicut * settings_.kphi() * settings_.kr();
653  double drcut = idrcut * settings_.krprojshiftdisk();
654 
655  if (settings_.writeMonitorData("Residuals")) {
656  double pt = 0.01 * settings_.c() * settings_.bfield() / std::abs(tracklet->rinv());
657 
658  globals_->ofstream("diskresiduals.txt")
659  << layerdisk_ - N_LAYER + 1 << " " << stub->isPSmodule() << " " << tracklet->layer() << " "
660  << abs(tracklet->disk()) << " " << pt << " " << ideltaphi * settings_.kphi() * stub->r() << " " << drphiapprox
661  << " " << drphicut << " " << ideltar * settings_.krprojshiftdisk() << " " << deltar << " " << drcut << " "
662  << endl;
663  }
664 
665  bool match = (std::abs(drphi) < drphicut) && (std::abs(deltar) < drcut);
666  bool imatch = (std::abs(ideltaphi * irstub) < idrphicut) && (std::abs(ideltar) < idrcut);
667 
668  if (settings_.debugTracklet()) {
669  edm::LogVerbatim("Tracklet") << "imatch match disk: " << imatch << " " << match << " " << std::abs(ideltaphi)
670  << " " << drphicut / (settings_.kphi() * stub->r()) << " " << std::abs(ideltar)
671  << " " << drcut / settings_.krprojshiftdisk() << " r = " << stub->r();
672  }
673 
674  if (imatch) {
675  if (settings_.debugTracklet()) {
676  edm::LogVerbatim("Tracklet") << "MatchCalculator found match in disk " << getName();
677  }
678 
679  if (std::abs(dphi) >= third * settings_.dphisectorHG()) {
680  edm::LogPrint("Tracklet") << "dphi " << dphi << " ISeed " << tracklet->getISeed();
681  }
683  assert(std::abs(dphiapprox) < third * settings_.dphisectorHG());
684 
685  tracklet->addMatch(layerdisk_,
686  ideltaphi,
687  ideltar,
688  drphi / stub->r(),
689  dr,
690  drphiapprox / stub->r(),
691  drapprox,
692  (phiregion_ << N_BITSMEMADDRESS) + fpgastub->stubindex().value(),
693  fpgastub);
694 
695  if (settings_.debugTracklet()) {
696  edm::LogVerbatim("Tracklet") << "Accepted full match in disk " << getName() << " " << tracklet;
697  }
698 
699  int iSeed = tracklet->getISeed();
700  assert(fullmatches_[iSeed] != nullptr);
701  fullmatches_[iSeed]->addMatch(tracklet, fpgastub);
702 
703  return true;
704  } else {
705  return false;
706  }
707  }
708 }

References funct::abs(), trklet::Tracklet::addMatch(), trklet::Stub::alpha(), trklet::L1TStub::alphanorm(), trklet::Settings::alphashift(), cms::cuda::assert(), trklet::Settings::bfield(), trklet::Settings::bookHistos(), trklet::Settings::c(), trklet::Settings::debugTracklet(), trklet::Tracklet::disk(), trklet::Settings::dphisectorHG(), flavorHistoryFilter_cfi::dr, trklet::Settings::drmax(), PVValHelper::dz, trklet::Settings::dzmax(), dzshift_, Exception, fullmatches_, trklet::Tracklet::getISeed(), trklet::ProcessBase::getName(), trklet::ProcessBase::globals_, trklet::Settings::half2SmoduleWidth(), trklet::Globals::histograms(), compare::hists, ialphafactinner_, ialphafactouter_, icorrshift_, icorzshift_, LEDCalibrationChannels::iphi, trklet::L1TStub::isPSmodule(), trklet::Settings::kphi(), trklet::Settings::kphi1(), trklet::Settings::kr(), trklet::Settings::krprojshiftdisk(), trklet::Settings::kz(), trklet::Stub::l1tstub(), trklet::Tracklet::layer(), layerdisk_, trklet::TrackletLUT::lookup(), M_PI, match(), trklet::N_BITSMEMADDRESS, trklet::N_DSS_MOD, trklet::N_LAYER, trklet::ProcessBase::name_, trklet::Globals::ofstream(), trklet::Stub::phi(), trklet::L1TStub::phi(), trklet::Stub::phiapprox(), phimatchcuttable_, phimin_, phiregion_, phishift_, amptDefault_cfi::proj, trklet::Tracklet::proj(), DiDispStaMuonMonitor_cfi::pt, trklet::L1TStub::r(), trklet::Stub::r(), alignCSCRings::r, trklet::L1TStub::r2(), trklet::Stub::rapprox(), rcut2Stable_, rcutPStable_, trklet::Settings::rDSSinner(), trklet::Settings::rDSSouter(), reco::reduceRange(), trklet::Tracklet::rinv(), trklet::Settings::rmean(), rphicut2Stable_, rphicutPStable_, trklet::ProcessBase::settings_, Validation_hcalonly_cfi::sign, trklet::Stub::stubindex(), trklet::Tracklet::stubtruthmatch(), trklet::Tracklet::t(), trklet::third, trklet::Settings::useapprox(), trklet::FPGAWord::value(), trklet::Settings::writeMonitorData(), trklet::L1TStub::z(), trklet::Stub::z(), trklet::Stub::zapprox(), zmatchcuttable_, and trklet::Settings::zmean().

Referenced by execute().

Member Data Documentation

◆ allstubs_

AllStubsMemory* trklet::MatchProcessor::allstubs_
private

Definition at line 65 of file MatchProcessor.h.

Referenced by addInput().

◆ barrel_

bool trklet::MatchProcessor::barrel_
private

Definition at line 40 of file MatchProcessor.h.

Referenced by execute(), and MatchProcessor().

◆ dzshift_

int trklet::MatchProcessor::dzshift_
private

Definition at line 49 of file MatchProcessor.h.

Referenced by matchCalculator(), and MatchProcessor().

◆ fullmatches_

std::vector<FullMatchMemory*> trklet::MatchProcessor::fullmatches_
private

Definition at line 73 of file MatchProcessor.h.

Referenced by addOutput(), and matchCalculator().

◆ ialphafactinner_

int trklet::MatchProcessor::ialphafactinner_[N_DSS_MOD *2]
private

Definition at line 69 of file MatchProcessor.h.

Referenced by matchCalculator(), and MatchProcessor().

◆ ialphafactouter_

int trklet::MatchProcessor::ialphafactouter_[N_DSS_MOD *2]
private

Definition at line 70 of file MatchProcessor.h.

Referenced by matchCalculator(), and MatchProcessor().

◆ icorrshift_

int trklet::MatchProcessor::icorrshift_
private

Definition at line 50 of file MatchProcessor.h.

Referenced by matchCalculator(), and MatchProcessor().

◆ icorzshift_

int trklet::MatchProcessor::icorzshift_
private

Definition at line 51 of file MatchProcessor.h.

Referenced by matchCalculator(), and MatchProcessor().

◆ inputProjBuffer_

CircularBuffer<ProjectionTemp> trklet::MatchProcessor::inputProjBuffer_
private

Definition at line 86 of file MatchProcessor.h.

Referenced by execute().

◆ inputprojs_

std::vector<TrackletProjectionsMemory*> trklet::MatchProcessor::inputprojs_
private

Definition at line 67 of file MatchProcessor.h.

Referenced by addInput(), and execute().

◆ layerdisk_

unsigned int trklet::MatchProcessor::layerdisk_
private

Definition at line 39 of file MatchProcessor.h.

Referenced by execute(), matchCalculator(), and MatchProcessor().

◆ luttable_

TrackletLUT trklet::MatchProcessor::luttable_
private

Definition at line 79 of file MatchProcessor.h.

Referenced by MatchProcessor().

◆ matchengines_

std::vector<MatchEngineUnit> trklet::MatchProcessor::matchengines_
private

Definition at line 84 of file MatchProcessor.h.

Referenced by execute(), and MatchProcessor().

◆ nMatchEngines_

unsigned int trklet::MatchProcessor::nMatchEngines_
private

Definition at line 83 of file MatchProcessor.h.

Referenced by execute(), and MatchProcessor().

◆ nphiderbits_

int trklet::MatchProcessor::nphiderbits_
private

Definition at line 63 of file MatchProcessor.h.

Referenced by execute(), and MatchProcessor().

◆ nrbits_

int trklet::MatchProcessor::nrbits_
private

Definition at line 62 of file MatchProcessor.h.

Referenced by execute(), and MatchProcessor().

◆ nrinv_

int trklet::MatchProcessor::nrinv_
private

Definition at line 47 of file MatchProcessor.h.

Referenced by execute(), and MatchProcessor().

◆ nvm_

int trklet::MatchProcessor::nvm_
private

Definition at line 44 of file MatchProcessor.h.

Referenced by MatchProcessor().

◆ nvmbins_

int trklet::MatchProcessor::nvmbins_
private

Definition at line 46 of file MatchProcessor.h.

Referenced by execute(), and MatchProcessor().

◆ nvmbits_

int trklet::MatchProcessor::nvmbits_
private

Definition at line 45 of file MatchProcessor.h.

Referenced by execute(), and MatchProcessor().

◆ phimatchcuttable_

TrackletLUT trklet::MatchProcessor::phimatchcuttable_
private

Definition at line 54 of file MatchProcessor.h.

Referenced by matchCalculator(), and MatchProcessor().

◆ phimin_

double trklet::MatchProcessor::phimin_
private

Definition at line 81 of file MatchProcessor.h.

Referenced by execute(), and matchCalculator().

◆ phiregion_

unsigned int trklet::MatchProcessor::phiregion_
private

Definition at line 42 of file MatchProcessor.h.

Referenced by matchCalculator(), and MatchProcessor().

◆ phishift_

int trklet::MatchProcessor::phishift_
private

Definition at line 52 of file MatchProcessor.h.

Referenced by matchCalculator(), and MatchProcessor().

◆ rcut2Stable_

TrackletLUT trklet::MatchProcessor::rcut2Stable_
private

Definition at line 60 of file MatchProcessor.h.

Referenced by matchCalculator(), and MatchProcessor().

◆ rcutPStable_

TrackletLUT trklet::MatchProcessor::rcutPStable_
private

Definition at line 59 of file MatchProcessor.h.

Referenced by matchCalculator(), and MatchProcessor().

◆ rinvbendlut_

TrackletLUT trklet::MatchProcessor::rinvbendlut_
private

Definition at line 76 of file MatchProcessor.h.

Referenced by execute(), and MatchProcessor().

◆ rphicut2Stable_

TrackletLUT trklet::MatchProcessor::rphicut2Stable_
private

Definition at line 58 of file MatchProcessor.h.

Referenced by matchCalculator(), and MatchProcessor().

◆ rphicutPStable_

TrackletLUT trklet::MatchProcessor::rphicutPStable_
private

Definition at line 57 of file MatchProcessor.h.

Referenced by matchCalculator(), and MatchProcessor().

◆ vmstubs_

std::vector<VMStubsMEMemory*> trklet::MatchProcessor::vmstubs_
private

Definition at line 66 of file MatchProcessor.h.

Referenced by addInput(), and execute().

◆ zmatchcuttable_

TrackletLUT trklet::MatchProcessor::zmatchcuttable_
private

Definition at line 55 of file MatchProcessor.h.

Referenced by matchCalculator(), and MatchProcessor().

trklet::ProcessBase::ProcessBase
ProcessBase(std::string name, Settings const &settings, Globals *global)
Definition: ProcessBase.cc:14
trklet::Tracklet::stubtruthmatch
bool stubtruthmatch(const L1TStub *stub)
Definition: Tracklet.cc:138
mps_fire.i
i
Definition: mps_fire.py:428
trklet::Settings::writetrace
bool writetrace() const
Definition: Settings.h:183
trklet::VMStubsMEMemory
Definition: VMStubsMEMemory.h:16
input
static const std::string input
Definition: EdmProvDump.cc:48
trklet::MatchProcessor::phimatchcuttable_
TrackletLUT phimatchcuttable_
Definition: MatchProcessor.h:54
trklet::TrackletLUT::lookup
int lookup(unsigned int index) const
Definition: TrackletLUT.cc:900
trklet::Settings::krprojshiftdisk
double krprojshiftdisk() const
Definition: Settings.h:400
trklet::TrackletLUT::initProjectionBend
void initProjectionBend(double k_phider, unsigned int idisk, unsigned int nrbits, unsigned int nphiderbits)
Definition: TrackletLUT.cc:393
trklet::MatchProcessor::vmstubs_
std::vector< VMStubsMEMemory * > vmstubs_
Definition: MatchProcessor.h:66
trklet::Stub::phi
const FPGAWord & phi() const
Definition: Stub.h:62
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:129
phimin
float phimin
Definition: ReggeGribovPartonMCHadronizer.h:107
trklet::MatchProcessor::ialphafactouter_
int ialphafactouter_[N_DSS_MOD *2]
Definition: MatchProcessor.h:70
memory
Definition: HGCRecHitSoA.h:20
trklet::TrackletProjectionsMemory
Definition: TrackletProjectionsMemory.h:15
edm::LogPrint
Log< level::Warning, true > LogPrint
Definition: MessageLogger.h:130
trklet::L1TStub
Definition: L1TStub.h:14
trklet::L1TStub::z
double z() const
Definition: L1TStub.h:57
trklet::Tracklet::getISeed
int getISeed() const
Definition: Tracklet.cc:798
trklet::Settings::nbitsallstubs
unsigned int nbitsallstubs(unsigned int layerdisk) const
Definition: Settings.h:106
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::rmean
double rmean(unsigned int iLayer) const
Definition: Settings.h:164
trklet::ProcessBase::settings_
Settings const & settings_
Definition: ProcessBase.h:40
compare.hists
hists
Definition: compare.py:318
trklet::Stub::phiapprox
double phiapprox(double phimin, double) const
Definition: Stub.cc:177
trklet::MatchProcessor::rcutPStable_
TrackletLUT rcutPStable_
Definition: MatchProcessor.h:59
trklet::Settings::kphi1
double kphi1() const
Definition: Settings.h:299
trklet::Settings::kphiderdisk
double kphiderdisk() const
Definition: Settings.h:394
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:171
trklet::Settings::half2SmoduleWidth
double half2SmoduleWidth() const
Definition: Settings.h:131
trklet::ProjectionTemp::projfinephi
unsigned int projfinephi() const
Definition: ProjectionTemp.h:32
trklet::Stub::r
const FPGAWord & r() const
Definition: Stub.h:60
trklet::Settings::bfield
double bfield() const
Definition: Settings.h:253
trklet::Settings::bookHistos
bool bookHistos() const
Definition: Settings.h:207
trklet::HistBase
Definition: HistBase.h:16
trklet::Tracklet
Definition: Tracklet.h:27
trklet::Settings::kphider
double kphider() const
Definition: Settings.h:393
trklet::Settings::rDSSouter
double rDSSouter(unsigned int iBin) const
Definition: Settings.h:174
trklet::MatchProcessor::phishift_
int phishift_
Definition: MatchProcessor.h:52
trklet::MatchProcessor::icorzshift_
int icorzshift_
Definition: MatchProcessor.h:51
trklet::Projection
Definition: Projection.h:10
LEDCalibrationChannels.iphi
iphi
Definition: LEDCalibrationChannels.py:64
trklet::ProjectionTemp::iphi
unsigned int iphi() const
Definition: ProjectionTemp.h:33
trklet::MatchProcessor::fullmatches_
std::vector< FullMatchMemory * > fullmatches_
Definition: MatchProcessor.h:73
trklet::Tracklet::proj
Projection & proj(int layerdisk)
Definition: Tracklet.h:87
trklet::NFINEPHIBITS
constexpr unsigned int NFINEPHIBITS
Definition: Settings.h:34
trklet::Stub::z
const FPGAWord & z() const
Definition: Stub.h:61
trklet::MemoryBase::getName
std::string const & getName() const
Definition: MemoryBase.h:19
trklet::MatchProcessor::barrel_
bool barrel_
Definition: MatchProcessor.h:40
trklet::MatchProcessor::layerdisk_
unsigned int layerdisk_
Definition: MatchProcessor.h:39
trklet::Settings::dphisectorHG
double dphisectorHG() const
Definition: Settings.h:281
trklet::Stub
Definition: Stub.h:18
trklet::FPGAWord::bits
unsigned int bits(unsigned int lsb, unsigned int nbit) const
Definition: FPGAWord.cc:74
trklet::L1TStub::isPSmodule
unsigned int isPSmodule() const
Definition: L1TStub.h:94
trklet::Settings::alphashift
int alphashift() const
Definition: Settings.h:216
trklet::MatchProcessor::nrinv_
int nrinv_
Definition: MatchProcessor.h:47
trklet::ProjectionTemp::projrinv
unsigned int projrinv() const
Definition: ProjectionTemp.h:30
trklet::Settings::krder
double krder() const
Definition: Settings.h:396
edm::LogProblem
Log< level::Error, true > LogProblem
Definition: MessageLogger.h:131
trklet::ProjectionTemp::use
bool use(unsigned int nextrzbin, unsigned int nextiphibin) const
Definition: ProjectionTemp.h:35
trklet::Settings::nbitsvmme
unsigned int nbitsvmme(unsigned int layerdisk) const
Definition: Settings.h:103
trklet::MatchProcessor::inputProjBuffer_
CircularBuffer< ProjectionTemp > inputProjBuffer_
Definition: MatchProcessor.h:86
trklet::MatchProcessor::rinvbendlut_
TrackletLUT rinvbendlut_
Definition: MatchProcessor.h:76
DDAxes::z
trklet::MatchProcessor::inputprojs_
std::vector< TrackletProjectionsMemory * > inputprojs_
Definition: MatchProcessor.h:67
trklet::N_LAYER
constexpr int N_LAYER
Definition: Settings.h:21
LaserClient_cfi.nbins
nbins
Definition: LaserClient_cfi.py:51
trklet::Settings::zmean
double zmean(unsigned int iDisk) const
Definition: Settings.h:167
trklet::IMATH_TrackletCalculator::der_phiD_final
VarAdjustK der_phiD_final
Definition: IMATH_TrackletCalculator.h:339
trklet::MatchProcessor::nvmbins_
int nvmbins_
Definition: MatchProcessor.h:46
trklet::MatchProcessor::rphicutPStable_
TrackletLUT rphicutPStable_
Definition: MatchProcessor.h:57
trklet::FPGAWord
Definition: FPGAWord.h:9
mitigatedMETSequence_cff.U
U
Definition: mitigatedMETSequence_cff.py:36
trklet::ProcessBase::initLayerDisk
void initLayerDisk(unsigned int pos, int &layer, int &disk)
Definition: ProcessBase.cc:33
trklet::Settings::kr
double kr() const
Definition: Settings.h:304
trklet::ProjectionTemp::shift
int shift() const
Definition: ProjectionTemp.h:34
trklet::Settings::drmax
double drmax() const
Definition: Settings.h:128
trklet::MatchProcessor::ialphafactinner_
int ialphafactinner_[N_DSS_MOD *2]
Definition: MatchProcessor.h:69
amptDefault_cfi.proj
proj
Definition: amptDefault_cfi.py:13
trklet::N_DSS_MOD
constexpr unsigned int N_DSS_MOD
Definition: Settings.h:27
print
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:46
trklet::Tracklet::TCID
int TCID() const
Definition: Tracklet.h:212
trklet::VarBase::K
double K() const
Definition: imath.h:246
trklet::Globals::ITC_L1L2
IMATH_TrackletCalculator * ITC_L1L2()
Definition: Globals.h:48
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:82
trklet::Settings::nvmme
unsigned int nvmme(unsigned int layerdisk) const
Definition: Settings.h:104
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::Settings::kzder
double kzder() const
Definition: Settings.h:395
trklet::Stub::rapprox
double rapprox() const
Definition: Stub.cc:144
HLT_FULL_cff.region
region
Definition: HLT_FULL_cff.py:88286
trklet::MatchProcessor::nMatchEngines_
unsigned int nMatchEngines_
Definition: MatchProcessor.h:83
trklet::MatchProcessor::icorrshift_
int icorrshift_
Definition: MatchProcessor.h:50
trklet::ProjectionTemp::slot
unsigned int slot() const
Definition: ProjectionTemp.h:29
trklet::L1TStub::alphanorm
double alphanorm() const
Definition: L1TStub.cc:85
trklet::Settings::nphibitsstub
unsigned int nphibitsstub(unsigned int layerdisk) const
Definition: Settings.h:83
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:49
trklet::Tracklet::addMatch
void addMatch(unsigned int layerdisk, int ideltaphi, int ideltarz, double dphi, double drz, double dphiapprox, double drzapprox, int stubid, const trklet::Stub *stubptr)
Definition: Tracklet.cc:295
trklet::ProjectionTemp::projfinerz
int projfinerz() const
Definition: ProjectionTemp.h:31
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:217
trklet::Settings::kphi
double kphi() const
Definition: Settings.h:298
trklet::ProcessBase::getISeed
unsigned int getISeed(const std::string &name)
Definition: ProcessBase.cc:119
trklet::N_BITSMEMADDRESS
constexpr unsigned int N_BITSMEMADDRESS
Definition: Settings.h:39
alignCSCRings.r
r
Definition: alignCSCRings.py:93
trklet::Settings::krbarrel
double krbarrel() const
Definition: Settings.h:305
DDAxes::phi
trklet::Settings::writeMonitorData
bool writeMonitorData(std::string module) const
Definition: Settings.h:109
trklet::Tracklet::rinv
double rinv() const
Definition: Tracklet.h:120
trklet::MatchProcessor::zmatchcuttable_
TrackletLUT zmatchcuttable_
Definition: MatchProcessor.h:55
trklet::MatchProcessor::luttable_
TrackletLUT luttable_
Definition: MatchProcessor.h:79
edm::shift
static unsigned const int shift
Definition: LuminosityBlockID.cc:7
trklet::Globals::ofstream
std::ofstream & ofstream(std::string fname)
Definition: Globals.cc:44
trklet::Stub::l1tstub
L1TStub * l1tstub()
Definition: Stub.h:77
PVValHelper::dz
Definition: PVValidationHelpers.h:51
trklet::MatchProcessor::matchCalculator
bool matchCalculator(Tracklet *tracklet, const Stub *fpgastub, bool print, unsigned int istep)
Definition: MatchProcessor.cc:432
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
trklet::MatchProcessor::allstubs_
AllStubsMemory * allstubs_
Definition: MatchProcessor.h:65
trklet::TrackletLUT::initmatchcut
void initmatchcut(unsigned int layerdisk, MatchType type, unsigned int region)
Definition: TrackletLUT.cc:13
trklet::MatchProcessor::nphiderbits_
int nphiderbits_
Definition: MatchProcessor.h:63
trklet::MatchProcessor::rphicut2Stable_
TrackletLUT rphicut2Stable_
Definition: MatchProcessor.h:58
trklet::Settings::useapprox
bool useapprox() const
Definition: Settings.h:234
relativeConstraints.empty
bool empty
Definition: relativeConstraints.py:46
flavorHistoryFilter_cfi.dr
dr
Definition: flavorHistoryFilter_cfi.py:37
Exception
Definition: hltDiff.cc:245
trklet::MatchProcessor::rcut2Stable_
TrackletLUT rcut2Stable_
Definition: MatchProcessor.h:60
trklet::ProcessBase::getName
std::string const & getName() const
Definition: ProcessBase.h:22
trklet::Settings::kz
double kz() const
Definition: Settings.h:302
trklet::ProcessBase::name_
std::string name_
Definition: ProcessBase.h:38
trklet::Stub::stubindex
const FPGAWord & stubindex() const
Definition: Stub.h:66
trklet::Settings::nallstubs
unsigned int nallstubs(unsigned int layerdisk) const
Definition: Settings.h:107
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
trklet::Settings::debugTracklet
bool debugTracklet() const
Definition: Settings.h:182
trklet::MatchProcessor::phimin_
double phimin_
Definition: MatchProcessor.h:81
trklet::MatchProcessor::phiregion_
unsigned int phiregion_
Definition: MatchProcessor.h:42
trklet::TrackletLUT::initBendMatch
void initBendMatch(unsigned int layerdisk)
Definition: TrackletLUT.cc:443
trklet::ProjectionTemp
Definition: ProjectionTemp.h:9
trklet::MatchEngineUnit
Definition: MatchEngineUnit.h:19
trklet::Tracklet::disk
int disk() const
Definition: Tracklet.cc:779
trklet::Settings::maxStep
unsigned int maxStep(std::string module) const
Definition: Settings.h:116
trklet::L1TStub::r
double r() const
Definition: L1TStub.h:58
trklet::N_RZBITS
constexpr unsigned int N_RZBITS
Definition: Settings.h:35
trklet::MatchProcessor::dzshift_
int dzshift_
Definition: MatchProcessor.h:49
trklet::Stub::alpha
const FPGAWord & alpha() const
Definition: Stub.h:64
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
trklet::third
constexpr double third
Definition: Settings.h:42
trklet::ilog2
int ilog2(double factor)
Definition: Util.h:106
trklet::Globals::histograms
HistBase *& histograms()
Definition: Globals.h:38
trklet::ProcessBase::globals_
Globals * globals_
Definition: ProcessBase.h:41
trklet::Tracklet::t
double t() const
Definition: Tracklet.h:123
trklet::ProjectionTemp::proj
Tracklet * proj() const
Definition: ProjectionTemp.h:28
trklet::Settings::c
double c() const
Definition: Settings.h:212
trklet::MatchProcessor::nvm_
int nvm_
Definition: MatchProcessor.h:44
trklet::VMStubsMEMemory::nStubsBin
unsigned int nStubsBin(unsigned int bin) const
Definition: VMStubsMEMemory.h:30
trklet::MatchProcessor::nrbits_
int nrbits_
Definition: MatchProcessor.h:62
trklet::Stub::zapprox
double zapprox() const
Definition: Stub.cc:158
trklet::L1TStub::r2
double r2() const
Definition: L1TStub.h:60
trklet::Tracklet::layer
int layer() const
Definition: Tracklet.cc:770
trklet::L1TStub::phi
double phi() const
Definition: L1TStub.h:63
trklet::MatchProcessor::matchengines_
std::vector< MatchEngineUnit > matchengines_
Definition: MatchProcessor.h:84
trklet::ProjectionTemp::isPSseed
bool isPSseed() const
Definition: ProjectionTemp.h:36
trklet::MatchProcessor::nvmbits_
int nvmbits_
Definition: MatchProcessor.h:45
trklet::NRINVBITS
constexpr unsigned int NRINVBITS
Definition: Settings.h:32
reco::reduceRange
constexpr T reduceRange(T x)
Definition: deltaPhi.h:18