22 pttableinner_(settings),
23 pttableouter_(settings),
24 useregiontable_(settings),
25 innerTable_(settings),
26 innerOverlapTable_(settings) {
29 for (
unsigned int ilayer = 0; ilayer <
N_LAYER; ilayer++) {
34 for (
unsigned int idisk = 0; idisk <
N_DISK; idisk++) {
71 int nbins = 2.0 * (dphimax / dfinephi + 1.0);
92 TrackletLUT::VMRTableType::inneroverlap);
107 assert(outputProj !=
nullptr);
115 if (
output ==
"trackpar") {
122 if (
output.substr(0, 7) ==
"projout") {
127 unsigned int layerdisk =
output[8] -
'1';
128 unsigned int phiregion =
output[12] -
'A';
149 throw cms::Exception(
"BadConfig") << __FILE__ <<
" " << __LINE__ <<
" Could not find output : " <<
output;
158 if (
input ==
"outervmstubin") {
166 if (
tmp->getName()[11] ==
'X')
168 if (
tmp->getName()[11] ==
'Y')
170 if (
tmp->getName()[11] ==
'Z')
172 if (
tmp->getName()[11] ==
'W')
176 unsigned int iTP =
getName()[7] -
'A';
202 if (
input ==
"innerallstubin") {
212 tebuffer_ = tuple<CircularBuffer<TEData>,
unsigned int,
unsigned int,
unsigned int,
unsigned int>(
217 if (
input ==
"outerallstubin") {
223 throw cms::Exception(
"BadConfig") << __FILE__ <<
" " << __LINE__ <<
" Could not find input : " <<
input;
227 bool print = (iSector == 3) && (
getName() ==
"TP_L1L2D");
246 unsigned int countall = 0;
247 unsigned int countsel = 0;
249 unsigned int countteall = 0;
250 unsigned int stubpairs = 0;
252 unsigned int ntedata = 0;
254 unsigned int ninnerstubs = 0;
271 bool goodtedata =
false;
272 bool goodtedata__ =
false;
273 bool goodtedata___ =
false;
275 bool tebuffernearfull;
277 for (
unsigned int istep = 0; istep <
maxStep_; istep++) {
282 unsigned int& istub = std::get<1>(
tebuffer_);
283 unsigned int& imem = std::get<2>(
tebuffer_);
284 cout <<
"istep=" << istep <<
" TEBuffer: " << istub <<
" " << imem <<
" " << tedatabuffer.
rptr() <<
" " 285 << tedatabuffer.
wptr();
289 cout <<
" [" <<
k <<
" " << teunit.rptr() <<
" " << teunit.wptr() <<
" " << teunit.idle() <<
"]";
295 tebuffernearfull = tedatabuffer.
nearfull();
306 if (!teunit.empty()) {
311 if (teunitptr !=
nullptr) {
312 auto stubpair = teunitptr->
read();
320 const Stub* innerFPGAStub = stubpair.first;
323 const Stub* outerFPGAStub = stubpair.second;
359 bool notemptytebuffer = !tedatabuffer.
empty();
365 if (notemptytebuffer) {
367 notemptytebuffer =
false;
370 teunit.step(
print, istep, ite);
379 tedatabuffer.
store(tedata___);
383 unsigned int& istub = std::get<1>(
tebuffer_);
384 unsigned int& imem = std::get<2>(
tebuffer_);
385 unsigned int imemend = std::get<4>(
tebuffer_);
387 if ((!tebuffernearfull) && imem < imemend && istub <
innerallstubs_[imem]->nStubs()) {
396 bool negdisk = (stub->
disk().
value() < 0);
423 FPGAWord lookupbits(lutval, lutwidth,
true, __LINE__, __FILE__);
437 unsigned int useregindex = (innerfinephi << innerbend.
nbits()) + innerbend.
value();
440 unsigned int nrbits = 3;
441 int ir = ((
start & ((1 << (nrbits - 1)) - 1)) << 1) + (rzfinebinfirst >> (
NFINERZBITS - 1));
442 useregindex = (useregindex << nrbits) + ir;
457 for (
int ibin =
start; ibin <=
last; ibin++) {
459 if (!(usereg & (1 << ireg))) {
473 tedata.
regions_.emplace_back(tuple<int, int, int>(ibin -
start, ireg, nstubs));
474 countteall += nstubs;
491 }
else if ((!tebuffernearfull) && imem < imemend && istub == 0) {
495 goodtedata___ = goodtedata__;
496 goodtedata__ = goodtedata;
498 tedata___ = tedata__;
507 if (imem < imemend || (!tedatabuffer.
empty())) {
512 if (!(teunit.idle() && teunit.empty()))
void execute(unsigned int iSector, double phimin, double phimax)
unsigned int vmrlutrbits(unsigned int layerdisk) const
Log< level::Info, true > LogVerbatim
constexpr unsigned int N_RZBITS
const std::pair< const Stub *, const Stub * > & read()
unsigned int maxStep(std::string module) const
bool diskSeeding(const Stub *innerFPGAStub, const L1TStub *innerStub, const Stub *outerFPGAStub, const L1TStub *outerStub)
const FPGAWord & r() const
double lutwidthtab(unsigned int inner, unsigned int iSeed) const
unsigned int rptr() const
unsigned int wptr() const
const FPGAWord & z() const
double dphisectorHG() const
void addInput(MemoryBase *memory, std::string input) override
void initLayerDisksandISeed(unsigned int &layerdisk1, unsigned int &layerdisk2, unsigned int &iSeed)
Settings const & settings_
TrackletLUT pttableinner_
int lookup(unsigned int index) const
const FPGAWord & bend() const
std::vector< AllStubsMemory * > outerallstubs_
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
unsigned int nTracklets() const
void addOutputProjection(TrackletProjectionsMemory *&outputProj, MemoryBase *memory)
TrackletLUT useregiontable_
static std::string const input
const FPGAWord & disk() const
unsigned int nbitszfinebintable_
std::vector< TrackletEngineUnit > teunits_
bool overlapSeeding(const Stub *innerFPGAStub, const L1TStub *innerStub, const Stub *outerFPGAStub, const L1TStub *outerStub)
std::tuple< CircularBuffer< TEData >, unsigned int, unsigned int, unsigned int, unsigned int > tebuffer_
unsigned int nbitsallstubs(unsigned int layerdisk) const
double rmean(unsigned int iLayer) const
TrackletLUT innerOverlapTable_
unsigned int nbitsvmte(unsigned int inner, unsigned int iSeed) const
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
VMStubsTEMemory * outervmstubs_
TrackletParametersMemory * trackletpars_
void addOutput(MemoryBase *memory, std::string output) override
bool writeMonitorData(std::string module) const
double zmean(unsigned int iDisk) const
std::vector< AllInnerStubsMemory * > innerallstubs_
unsigned int nvmte(unsigned int inner, unsigned int iSeed) const
constexpr unsigned int NFINERZBITS
std::vector< std::vector< TrackletProjectionsMemory * > > trackletprojdisks_
unsigned int nallstubs(unsigned int layerdisk) const
bool debugTracklet() const
unsigned int nVMStubs() const
std::vector< std::vector< TrackletProjectionsMemory * > > trackletprojlayers_
unsigned int nbitsrfinebintable_
void initTPlut(bool fillInner, unsigned int iSeed, unsigned int layerdisk1, unsigned int layerdisk2, unsigned int nbitsfinephidiff, unsigned int iTP)
int nfinephi(unsigned int inner, unsigned int iSeed) const
void initTPregionlut(unsigned int iSeed, unsigned int layerdisk1, unsigned int layerdisk2, unsigned int iAllStub, unsigned int nbitsfinephidiff, unsigned int nbitsfinephi, const TrackletLUT &tplutinner, unsigned int iTP)
bool useSeed(unsigned int iSeed) const
const FPGAWord & phicorr() const
unsigned int nVMStubsBinned(unsigned int bin) const
TrackletLUT pttableouter_
unsigned int teunits(unsigned int iSeed) const
std::ofstream & ofstream(std::string fname)
double rmaxdiskvm() const
unsigned int ntrackletmax() const
unsigned int bits(unsigned int lsb, unsigned int nbit) const
std::string const & getName() const
void reset(double vett[256])
void initVMRTable(unsigned int layerdisk, VMRTableType type, int region=-1)
unsigned int vmrlutzbits(unsigned int layerdisk) const
bool barrelSeeding(const Stub *innerFPGAStub, const L1TStub *innerStub, const Stub *outerFPGAStub, const L1TStub *outerStub)
double rmaxdiskl1overlapvm() const
std::vector< std::tuple< int, int, int > > regions_