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;
254 assert(iInnerMem->nStubs() == iInnerMem->nStubs());
255 for (
unsigned int j = 0;
j < iInnerMem->nStubs();
j++) {
256 const Stub* firstallstub = iInnerMem->getStub(
j);
263 bool negdisk = (firstallstub->
disk().
value() < 0);
264 int indexz = (((1 << (firstallstub->
z().
nbits() - 1)) + firstallstub->
z().
value()) >>
271 indexr = firstallstub->
r().
value();
277 indexr = (((1 << (firstallstub->
r().
nbits() - 1)) + firstallstub->
r().
value()) >>
296 if (iSeed_ < Seed::L1D1 || iSeed_ >
Seed::L2D1) {
308 lutval += (lutval2 << 10);
314 FPGAWord binlookup(lutval, lutwidth,
true, __LINE__, __FILE__);
321 constexpr
int andlookupbits = 1023;
322 constexpr
int shiftzdiffmax = 7;
323 constexpr
int andnewbin = 127;
324 constexpr
int divbin = 8;
325 constexpr
int andzbinfirst = 7;
326 constexpr
int shiftstart = 1;
327 constexpr
int andlast = 1;
328 constexpr
int maxlast = 8;
330 int lookupbits = binlookup.value() & andlookupbits;
331 int zdiffmax = (lookupbits >> shiftzdiffmax);
332 int newbin = (lookupbits & andnewbin);
333 int bin = newbin / divbin;
335 int zbinfirst = newbin & andzbinfirst;
346 for (
int ibin =
start; ibin <=
last; ibin++) {
351 <<
"In " <<
getName() <<
" have second stub(1) " << ibin <<
" " <<
j << endl;
359 if (zbin < zbinfirst || zbin - zbinfirst > zdiffmax) {
369 constexpr
int vmbitshift = 10;
370 constexpr
int andlookupbits_ = 1023;
371 constexpr
int andnewbin_ = 127;
372 constexpr
int divbin_ = 8;
373 constexpr
int shiftstart_ = 1;
374 constexpr
int andlast_ = 1;
376 int lookupbits_ = (
int)((binlookup.value() >> vmbitshift) & andlookupbits_);
377 int newbin_ = (lookupbits_ & andnewbin_);
378 int bin_ = newbin_ / divbin_;
380 int start_ = (bin_ >> shiftstart_);
381 int last_ = start_ + (bin_ & andlast_);
385 <<
"Will look in zbins for third stub" << start_ <<
" to " << last_ << endl;
388 for (
int ibin_ = start_; ibin_ <= last_; ibin_++) {
401 const Stub* innerFPGAStub = firstallstub;
402 const Stub* middleFPGAStub = secondvmstub.
stub();
403 const Stub* outerFPGAStub = thirdvmstub.
stub();
419 <<
"TrackletCalculatorDisplaced execute " <<
getName() <<
"[" <<
iSector_ <<
"]";
425 LLLSeeding(outerFPGAStub, outerStub, innerFPGAStub, innerStub, middleFPGAStub, middleStub);
431 throw cms::Exception(
"LogicError") << __FILE__ <<
" " << __LINE__ <<
" Invalid seeding!";
450 constexpr
int andlookupbits = 1023;
451 constexpr
int shiftzdiffmax = 7;
452 constexpr
int andnewbin = 127;
453 constexpr
int divbin = 8;
454 constexpr
int andzbinfirst = 7;
455 constexpr
int shiftstart = 1;
456 constexpr
int andlast = 1;
457 constexpr
int maxlast = 8;
459 int lookupbits = binlookup.value() & andlookupbits;
460 int zdiffmax = (lookupbits >> shiftzdiffmax);
461 int newbin = (lookupbits & andnewbin);
462 int bin = newbin / divbin;
464 int zbinfirst = newbin & andzbinfirst;
475 for (
int ibin =
start; ibin <=
last; ibin++) {
488 if (zbin < zbinfirst || zbin - zbinfirst > zdiffmax) {
496 constexpr
int vmbitshift = 10;
497 constexpr
int andlookupbits_ = 1023;
498 constexpr
int andnewbin_ = 127;
499 constexpr
int divbin_ = 8;
500 constexpr
int shiftstart_ = 1;
501 constexpr
int andlast_ = 1;
503 int lookupbits_ = (
int)((binlookup.value() >> vmbitshift) & andlookupbits_);
504 int newbin_ = (lookupbits_ & andnewbin_);
505 int bin_ = newbin_ / divbin_;
507 int start_ = (bin_ >> shiftstart_);
508 int last_ = start_ + (bin_ & andlast_);
510 for (
int ibin_ = start_; ibin_ <= last_; ibin_++) {
523 const Stub* innerFPGAStub = firstallstub;
524 const Stub* middleFPGAStub = secondvmstub.
stub();
525 const Stub* outerFPGAStub = thirdvmstub.
stub();
541 <<
"TrackletCalculatorDisplaced execute " <<
getName() <<
"[" <<
iSector_ <<
"]";
545 LLDSeeding(outerFPGAStub, outerStub, innerFPGAStub, innerStub, middleFPGAStub, middleStub);
565 constexpr
int andlookupbits = 511;
566 constexpr
int shiftrdiffmax = 6;
567 constexpr
int andnewbin = 63;
568 constexpr
int divbin = 8;
569 constexpr
int andrbinfirst = 7;
570 constexpr
int shiftstart = 1;
571 constexpr
int andlast = 1;
572 constexpr
int maxlast = 8;
574 int lookupbits = binlookup.value() & andlookupbits;
575 bool negdisk = firstallstub->
disk().
value() < 0;
576 int rdiffmax = (lookupbits >> shiftrdiffmax);
577 int newbin = (lookupbits & andnewbin);
578 int bin = newbin / divbin;
580 int rbinfirst = newbin & andrbinfirst;
588 for (
int ibin =
start; ibin <=
last; ibin++) {
593 <<
" in bin = " << ibin <<
" with " <<
outervmstubs_.at(
m)->nVMStubsBinned(ibin) <<
" stubs";
603 if (rbin < rbinfirst)
605 if (rbin - rbinfirst > rdiffmax)
609 constexpr
int vmbitshift = 10;
610 constexpr
int andlookupbits_ = 1023;
611 constexpr
int andnewbin_ = 127;
612 constexpr
int divbin_ = 8;
613 constexpr
int shiftstart_ = 1;
614 constexpr
int andlast_ = 1;
616 int lookupbits_ = (
int)((binlookup.value() >> vmbitshift) & andlookupbits_);
617 int newbin_ = (lookupbits_ & andnewbin_);
618 int bin_ = newbin_ / divbin_;
620 int start_ = (bin_ >> shiftstart_);
621 int last_ = start_ + (bin_ & andlast_);
628 for (
int ibin_ = start_; ibin_ <= last_; ibin_++) {
641 const Stub* innerFPGAStub = firstallstub;
642 const Stub* middleFPGAStub = secondvmstub.
stub();
643 const Stub* outerFPGAStub = thirdvmstub.
stub();
659 <<
"TrackletCalculatorDisplaced execute " <<
getName() <<
"[" <<
iSector_ <<
"]";
663 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