|
 |
Go to the documentation of this file.
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);
106 outputProj = dynamic_cast<TrackletProjectionsMemory*>(
memory);
107 assert(outputProj !=
nullptr);
115 if (
output ==
"trackpar") {
116 auto*
tmp = dynamic_cast<TrackletParametersMemory*>(
memory);
122 if (
output.substr(0, 7) ==
"projout") {
124 auto*
tmp = dynamic_cast<TrackletProjectionsMemory*>(
memory);
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") {
159 auto*
tmp = dynamic_cast<VMStubsTEMemory*>(
memory);
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") {
203 auto*
tmp = dynamic_cast<AllInnerStubsMemory*>(
memory);
212 tebuffer_ = tuple<CircularBuffer<TEData>,
unsigned int,
unsigned int,
unsigned int,
unsigned int>(
217 if (
input ==
"outerallstubin") {
218 auto*
tmp = dynamic_cast<AllStubsMemory*>(
memory);
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()))
unsigned int teunits(unsigned int iSeed) const
unsigned int ntrackletmax() const
static const std::string input
int lookup(unsigned int index) const
TrackletParametersMemory * trackletpars_
unsigned int nbitszfinebintable_
double rmaxdiskl1overlapvm() const
const FPGAWord & bend() 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)
unsigned int vmrlutrbits(unsigned int layerdisk) const
unsigned int nbitsallstubs(unsigned int layerdisk) const
void initVMRTable(unsigned int layerdisk, VMRTableType type, int region=-1)
double rmean(unsigned int iLayer) const
bool barrelSeeding(const Stub *innerFPGAStub, const L1TStub *innerStub, const Stub *outerFPGAStub, const L1TStub *outerStub)
double lutwidthtab(unsigned int inner, unsigned int iSeed) const
Settings const & settings_
std::vector< TrackletEngineUnit > teunits_
std::vector< std::vector< TrackletProjectionsMemory * > > trackletprojlayers_
const FPGAWord & r() const
unsigned int nVMStubs() const
std::tuple< CircularBuffer< TEData >, unsigned int, unsigned int, unsigned int, unsigned int > tebuffer_
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
void execute(unsigned int iSector, double phimin, double phimax)
TrackletLUT pttableouter_
const FPGAWord & disk() const
const FPGAWord & z() const
TrackletLUT pttableinner_
double dphisectorHG() const
unsigned int bits(unsigned int lsb, unsigned int nbit) const
const std::pair< const Stub *, const Stub * > & read()
TrackletLUT useregiontable_
double zmean(unsigned int iDisk) const
void initLayerDisksandISeed(unsigned int &layerdisk1, unsigned int &layerdisk2, unsigned int &iSeed)
bool diskSeeding(const Stub *innerFPGAStub, const L1TStub *innerStub, const Stub *outerFPGAStub, const L1TStub *outerStub)
int nfinephi(unsigned int inner, unsigned int iSeed) const
unsigned int wptr() const
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
bool overlapSeeding(const Stub *innerFPGAStub, const L1TStub *innerStub, const Stub *outerFPGAStub, const L1TStub *outerStub)
std::vector< std::vector< TrackletProjectionsMemory * > > trackletprojdisks_
std::vector< AllStubsMemory * > outerallstubs_
unsigned int rptr() const
unsigned int nbitsvmte(unsigned int inner, unsigned int iSeed) const
bool writeMonitorData(std::string module) const
unsigned int nTracklets() const
const FPGAWord & phicorr() const
constexpr unsigned int NFINERZBITS
std::ofstream & ofstream(std::string fname)
unsigned int vmrlutzbits(unsigned int layerdisk) const
Log< level::Info, true > LogVerbatim
void addOutputProjection(TrackletProjectionsMemory *&outputProj, MemoryBase *memory)
std::string const & getName() const
std::vector< AllInnerStubsMemory * > innerallstubs_
unsigned int nvmte(unsigned int inner, unsigned int iSeed) const
unsigned int nallstubs(unsigned int layerdisk) const
bool debugTracklet() const
unsigned int maxStep(std::string module) const
std::vector< std::tuple< int, int, int > > regions_
constexpr unsigned int N_RZBITS
TrackletLUT innerOverlapTable_
bool useSeed(unsigned int iSeed) const
void initTPlut(bool fillInner, unsigned int iSeed, unsigned int layerdisk1, unsigned int layerdisk2, unsigned int nbitsfinephidiff, unsigned int iTP)
unsigned int nVMStubsBinned(unsigned int bin) const
unsigned int nbitsrfinebintable_
void addOutput(MemoryBase *memory, std::string output) override
void addInput(MemoryBase *memory, std::string input) override
VMStubsTEMemory * outervmstubs_
double rmaxdiskvm() const