14 using namespace trklet;
20 innerTable_(settings),
21 innerOverlapTable_(settings),
22 innerThirdTable_(settings) {
27 unsigned int region = name[9] -
'A';
46 layerdisk_, TrackletLUT::VMRTableType::inneroverlap, region);
52 layerdisk_, TrackletLUT::VMRTableType::innerthird, region);
65 if (output.substr(0, 10) ==
"allstubout") {
72 if (output.substr(0, 12) ==
"vmstuboutPHI" || output.substr(0, 14) ==
"vmstuboutMEPHI" ||
73 output.substr(0, 15) ==
"vmstuboutTEIPHI" || output.substr(0, 15) ==
"vmstuboutTEOPHI") {
74 char seedtype = memory->
getName().substr(11, 1)[0];
75 unsigned int pos = 12;
76 int vmbin = memory->
getName().substr(pos, 1)[0] -
'0';
79 if (memory->
getName().substr(pos, 1)[0] !=
'n') {
80 vmbin = vmbin * 10 + memory->
getName().substr(pos, 1)[0] -
'0';
86 unsigned int inner = 1;
87 if (memory->
getName().substr(3, 2) ==
"TE") {
104 }
else if (seedtype <
'M') {
109 }
else if (seedtype <=
'Z') {
116 }
else if (seedtype < 'o' && seedtype >=
'a') {
121 }
else if (seedtype >
'o' && seedtype <=
'z') {
128 throw cms::Exception(
"LogicError") << __FILE__ <<
" " << __LINE__ <<
" Invalid seeding!";
137 if (seedindex == -1) {
139 vector<VMStubsTEMemory*> avectmp;
140 vector<vector<VMStubsTEMemory*> > vectmp(
settings_.
nvmte(inner, iseed), avectmp);
146 }
else if (memory->
getName().substr(3, 2) ==
"ME") {
151 throw cms::Exception(
"LogicError") << __FILE__ <<
" " << __LINE__ <<
" should never get here!";
157 throw cms::Exception(
"BadConfig") << __FILE__ <<
" " << __LINE__ <<
" Could not find output : " <<
output;
165 if (input ==
"stubin") {
168 if (tmp1 !=
nullptr) {
183 throw cms::Exception(
"BadConfig") << __FILE__ <<
" " << __LINE__ <<
" Could not find input : " <<
input;
187 unsigned int allStubCounter = 0;
191 for (
unsigned int i = 0;
i < stubinput->nStubs();
i++) {
196 Stub* stub = stubinput->getStub(
i);
199 bool negdisk = (stub->
disk().
value() < 0);
214 allstub->addStub(stub);
225 unsigned int ivmPlus = ivm;
229 unsigned int ivmMinus = ivm;
230 if (extrabits == 0 && ivm != 0)
242 indexr = stub->
r().
value();
259 int vmbin = melut >> 3;
262 int rzfine = melut & 7;
271 FPGAWord(rzfine, 3,
true, __LINE__, __FILE__),
279 <<
" ivmPlus" << ivmPlus <<
" bin=" << vmbin;
282 if (ivmMinus != ivmPlus) {
287 <<
" ivmMinus" << ivmMinus <<
" bin=" << vmbin;
294 unsigned int iseed = ivmstubTEPHI.seednumber;
295 unsigned int inner = ivmstubTEPHI.stubposition;
313 if (stub->
r().
value() < 10) {
314 lutval = 8 * (1 + (stub->
r().
value() >> 2));
327 if (iseed < Seed::L1D1 || iseed >
Seed::L2D1) {
338 lutval += (lutval2 << 10);
344 FPGAWord binlookup(lutval, lutwidth,
true, __LINE__, __FILE__);
346 if (binlookup.
value() < 0)
355 bin = binlookup.
value() / 8;
356 unsigned int tmp = binlookup.
value() & 7;
357 binlookup.
set(tmp, 3,
true, __LINE__, __FILE__);
362 VMStubTE tmpstub(stub, finephi, stub->
bend(), binlookup, allStubIndex);
364 unsigned int nmem = ivmstubTEPHI.vmstubmem[ivmte].size();
368 for (
unsigned int l = 0;
l < nmem;
l++) {
371 << ivmstubTEPHI.vmstubmem[ivmte][
l]->getName() <<
" inner=" << inner
375 ivmstubTEPHI.vmstubmem[ivmte][
l]->addVMStub(tmpstub);
377 ivmstubTEPHI.vmstubmem[ivmte][
l]->addVMStub(tmpstub, bin);
void addInput(MemoryBase *memory, std::string input) override
Log< level::Info, true > LogVerbatim
unsigned int nbendbitsmedisk() const
const FPGAWord & bend() const
const FPGAWord & disk() const
unsigned int vmrlutrbits(unsigned int layerdisk) const
const FPGAWord & phicorr() const
TrackletLUT innerThirdTable_
std::vector< InputLinkMemory * > stubinputdisk2stmp_
unsigned int vmrlutzbits(unsigned int layerdisk) const
unsigned int nvmme(unsigned int layerdisk) const
std::vector< InputLinkMemory * > stubinputtmp_
Settings const & settings_
bool debugTracklet() const
static std::string const input
std::string const & getName() const
std::string const & getName() const
double nphireg(unsigned int inner, unsigned int iSeed) const
void addOutput(MemoryBase *memory, std::string output) override
void setAllStubIndex(int nstub)
unsigned int nvmte(unsigned int inner, unsigned int iSeed) const
double rmindiskl3overlapvm() const
unsigned int bits(unsigned int lsb, unsigned int nbit) const
std::vector< InputLinkMemory * > stubinputs_
unsigned int nallstubs(unsigned int layerdisk) const
uint16_t mem[nChs][nEvts]
unsigned int maxStep(std::string module) const
unsigned int overlapbits_
std::vector< VMStubsMEMemory * > vmstubsMEPHI_
const FPGAWord & z() const
void initLayerDisk(unsigned int pos, int &layer, int &disk)
int lookup(unsigned int index) const
void set(int value, int nbits, bool positive=true, int line=-1, const char *file=nullptr)
unsigned int nbitsallstubs(unsigned int layerdisk) const
FPGAWord iphivmFineBins(int VMbits, int finebits) const
TrackletLUT innerOverlapTable_
deadvectors[0] push_back({0.0175431, 0.538005, 6.80997, 13.29})
int nfinephi(unsigned int inner, unsigned int iSeed) const
const FPGAWord & r() const
void setAllStubIndex(unsigned int index)
unsigned int nbitsvmme(unsigned int layerdisk) const
double lutwidthtab(unsigned int inner, unsigned int iSeed) const
std::vector< AllStubsMemory * > allstubs_
std::vector< VMStubsTEPHI > vmstubsTEPHI_
unsigned int nbitsvmte(unsigned int inner, unsigned int iSeed) const
tuple size
Write out results.
double lutwidthtabextended(unsigned int inner, unsigned int iSeed) const
void initVMRTable(unsigned int layerdisk, VMRTableType type, int region=-1)
constexpr unsigned int N_BITSMEMADDRESS