233 unsigned int countall = 0;
234 unsigned int countall_ = 0;
235 unsigned int countsel = 0;
236 unsigned int countpass = 0;
237 unsigned int countpass_ = 0;
239 unsigned int nInnerStubs = 0;
259 assert(iInnerMem->nStubs() == iInnerMem->nStubs());
260 for (
unsigned int j = 0;
j < iInnerMem->nStubs();
j++) {
261 const Stub* firstallstub = iInnerMem->getStub(
j);
268 bool negdisk = (firstallstub->
disk().
value() < 0);
269 int indexz = (((1 << (firstallstub->
z().
nbits() - 1)) + firstallstub->
z().
value()) >>
276 indexr = firstallstub->
r().
value();
282 indexr = (((1 << (firstallstub->
r().
nbits() - 1)) + firstallstub->
r().
value()) >>
301 if (iSeed_ < Seed::L1D1 || iSeed_ >
Seed::L2D1) {
313 lutval += (lutval2 << 10);
319 FPGAWord binlookup(lutval, lutwidth,
true, __LINE__, __FILE__);
326 constexpr
int andlookupbits = 1023;
327 constexpr
int shiftzdiffmax = 7;
328 constexpr
int andnewbin = 127;
329 constexpr
int divbin = 8;
330 constexpr
int andzbinfirst = 7;
331 constexpr
int shiftstart = 1;
332 constexpr
int andlast = 1;
333 constexpr
int maxlast = 8;
335 int lookupbits = binlookup.value() & andlookupbits;
336 int zdiffmax = (lookupbits >> shiftzdiffmax);
337 int newbin = (lookupbits & andnewbin);
338 int bin = newbin / divbin;
340 int zbinfirst = newbin & andzbinfirst;
351 for (
int ibin =
start; ibin <=
last; ibin++) {
356 <<
"In " <<
getName() <<
" have second stub(1) " << ibin <<
" " <<
j << endl;
364 if (zbin < zbinfirst || zbin - zbinfirst > zdiffmax) {
374 constexpr
int vmbitshift = 10;
375 constexpr
int andlookupbits_ = 1023;
376 constexpr
int andnewbin_ = 127;
377 constexpr
int divbin_ = 8;
378 constexpr
int shiftstart_ = 1;
379 constexpr
int andlast_ = 1;
381 int lookupbits_ = (
int)((binlookup.value() >> vmbitshift) & andlookupbits_);
382 int newbin_ = (lookupbits_ & andnewbin_);
383 int bin_ = newbin_ / divbin_;
385 int start_ = (bin_ >> shiftstart_);
386 int last_ = start_ + (bin_ & andlast_);
390 <<
"Will look in zbins for third stub" << start_ <<
" to " << last_ << endl;
393 for (
int ibin_ = start_; ibin_ <= last_; ibin_++) {
406 const Stub* innerFPGAStub = firstallstub;
407 const Stub* middleFPGAStub = secondvmstub.
stub();
408 const Stub* outerFPGAStub = thirdvmstub.
stub();
424 <<
"TrackletCalculatorDisplaced execute " <<
getName() <<
"[" <<
iSector_ <<
"]";
430 LLLSeeding(outerFPGAStub, outerStub, innerFPGAStub, innerStub, middleFPGAStub, middleStub);
436 throw cms::Exception(
"LogicError") << __FILE__ <<
" " << __LINE__ <<
" Invalid seeding!";
455 constexpr
int andlookupbits = 1023;
456 constexpr
int shiftzdiffmax = 7;
457 constexpr
int andnewbin = 127;
458 constexpr
int divbin = 8;
459 constexpr
int andzbinfirst = 7;
460 constexpr
int shiftstart = 1;
461 constexpr
int andlast = 1;
462 constexpr
int maxlast = 8;
464 int lookupbits = binlookup.value() & andlookupbits;
465 int zdiffmax = (lookupbits >> shiftzdiffmax);
466 int newbin = (lookupbits & andnewbin);
467 int bin = newbin / divbin;
469 int zbinfirst = newbin & andzbinfirst;
480 for (
int ibin =
start; ibin <=
last; ibin++) {
493 if (zbin < zbinfirst || zbin - zbinfirst > zdiffmax) {
501 constexpr
int vmbitshift = 10;
502 constexpr
int andlookupbits_ = 1023;
503 constexpr
int andnewbin_ = 127;
504 constexpr
int divbin_ = 8;
505 constexpr
int shiftstart_ = 1;
506 constexpr
int andlast_ = 1;
508 int lookupbits_ = (
int)((binlookup.value() >> vmbitshift) & andlookupbits_);
509 int newbin_ = (lookupbits_ & andnewbin_);
510 int bin_ = newbin_ / divbin_;
512 int start_ = (bin_ >> shiftstart_);
513 int last_ = start_ + (bin_ & andlast_);
515 for (
int ibin_ = start_; ibin_ <= last_; ibin_++) {
528 const Stub* innerFPGAStub = firstallstub;
529 const Stub* middleFPGAStub = secondvmstub.
stub();
530 const Stub* outerFPGAStub = thirdvmstub.
stub();
546 <<
"TrackletCalculatorDisplaced execute " <<
getName() <<
"[" <<
iSector_ <<
"]";
550 LLDSeeding(outerFPGAStub, outerStub, innerFPGAStub, innerStub, middleFPGAStub, middleStub);
570 constexpr
int andlookupbits = 511;
571 constexpr
int shiftrdiffmax = 6;
572 constexpr
int andnewbin = 63;
573 constexpr
int divbin = 8;
574 constexpr
int andrbinfirst = 7;
575 constexpr
int shiftstart = 1;
576 constexpr
int andlast = 1;
577 constexpr
int maxlast = 8;
579 int lookupbits = binlookup.value() & andlookupbits;
580 bool negdisk = firstallstub->
disk().
value() < 0;
581 int rdiffmax = (lookupbits >> shiftrdiffmax);
582 int newbin = (lookupbits & andnewbin);
583 int bin = newbin / divbin;
585 int rbinfirst = newbin & andrbinfirst;
593 for (
int ibin =
start; ibin <=
last; ibin++) {
598 <<
" in bin = " << ibin <<
" with " <<
outervmstubs_.at(
m)->nVMStubsBinned(ibin) <<
" stubs";
608 if (rbin < rbinfirst)
610 if (rbin - rbinfirst > rdiffmax)
614 constexpr
int vmbitshift = 10;
615 constexpr
int andlookupbits_ = 1023;
616 constexpr
int andnewbin_ = 127;
617 constexpr
int divbin_ = 8;
618 constexpr
int shiftstart_ = 1;
619 constexpr
int andlast_ = 1;
621 int lookupbits_ = (
int)((binlookup.value() >> vmbitshift) & andlookupbits_);
622 int newbin_ = (lookupbits_ & andnewbin_);
623 int bin_ = newbin_ / divbin_;
625 int start_ = (bin_ >> shiftstart_);
626 int last_ = start_ + (bin_ & andlast_);
633 for (
int ibin_ = start_; ibin_ <= last_; ibin_++) {
646 const Stub* innerFPGAStub = firstallstub;
647 const Stub* middleFPGAStub = secondvmstub.
stub();
648 const Stub* outerFPGAStub = thirdvmstub.
stub();
664 <<
"TrackletCalculatorDisplaced execute " <<
getName() <<
"[" <<
iSector_ <<
"]";
668 DDLSeeding(outerFPGAStub, outerStub, innerFPGAStub, innerStub, middleFPGAStub, middleStub);
Log< level::Info, true > LogVerbatim
std::vector< AllStubsMemory * > middleallstubs_
const FPGAWord & r() const
double lutwidthtab(unsigned int inner, unsigned int iSeed) const
std::vector< AllStubsMemory * > innerallstubs_
const FPGAWord & z() const
std::string strbare() const
Settings const & settings_
int lookup(unsigned int index) const
std::vector< VMStubsTEMemory * > innervmstubs_
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
unsigned int NLONGVMBINS() const
const FPGAWord & disk() const
bool LLDSeeding(const Stub *innerFPGAStub, const L1TStub *innerStub, const Stub *middleFPGAStub, const L1TStub *middleStub, const Stub *outerFPGAStub, const L1TStub *outerStub)
const Stub * stub() const
bool LLLSeeding(const Stub *innerFPGAStub, const L1TStub *innerStub, const Stub *middleFPGAStub, const L1TStub *middleStub, const Stub *outerFPGAStub, const L1TStub *outerStub)
const FPGAWord & vmbits() const
double lutwidthtabextended(unsigned int inner, unsigned int iSeed) const
unsigned int layerdisk() const
bool debugTracklet() const
std::vector< StubPairsMemory * > stubpairs_
TrackletLUT innerThirdTable_
bool DDLSeeding(const Stub *innerFPGAStub, const L1TStub *innerStub, const Stub *middleFPGAStub, const L1TStub *middleStub, const Stub *outerFPGAStub, const L1TStub *outerStub)
const std::string & stubword() const
TrackletLUT innerOverlapTable_
std::vector< AllStubsMemory * > outerallstubs_
std::vector< VMStubsTEMemory * > outervmstubs_
std::string const & getName() const