13 TripletEngine::TripletEngine(
string name,
Settings const &settings,
Globals *global,
unsigned int iSector)
58 throw cms::Exception(
"LogicError") << __FILE__ <<
" " << __LINE__ <<
" Invalid seeding!";
82 if (
output ==
"stubtripout") {
83 auto *
tmp = dynamic_cast<StubTripletsMemory *>(
memory);
88 throw cms::Exception(
"BadConfig") << __FILE__ <<
" " << __LINE__ <<
" Could not find output : " <<
output;
96 if (
input ==
"thirdvmstubin") {
97 auto *
tmp = dynamic_cast<VMStubsTEMemory *>(
memory);
102 if (
input.substr(0, 8) ==
"stubpair") {
103 auto *
tmp = dynamic_cast<StubPairsMemory *>(
memory);
108 throw cms::Exception(
"BadConfig") << __FILE__ <<
" " << __LINE__ <<
" Could not find input : " <<
input;
112 unsigned int countall = 0;
113 unsigned int countpass = 0;
114 unsigned int nThirdStubs = 0;
117 for (
unsigned int iThirdMem = 0; iThirdMem <
thirdvmstubs_.size();
118 nThirdStubs +=
thirdvmstubs_.at(iThirdMem)->nVMStubs(), iThirdMem++)
124 bool print =
false && (
getName().substr(0, 10) ==
"TRE_L2cL3c");
137 oss += std::to_string(
stubpairs_.at(
i)->nStubPairs());
141 hacksum += nThirdStubs *
s;
151 for (
unsigned int j = 0;
j <
stubpairs_.at(
i)->nStubPairs(); ++
j) {
160 constexpr
unsigned int vmbitshift = 10;
161 int lookupbits = (
int)((firstvmstub.vmbits().value() >> vmbitshift) & 1023);
162 int newbin = (lookupbits & 127);
163 int bin = newbin / 8;
168 for (
int ibin =
start; ibin <=
last; ibin++) {
171 vmsteSuffix = vmsteSuffix.substr(0, vmsteSuffix.find_last_of(
'n'));
172 if (
stubpairs_.at(
i)->getLastPartOfName() != vmsteSuffix)
189 unsigned int nvmbitssecond =
nbits(nvmsecond);
199 FPGAWord secondbend = secondvmstub.bend();
209 <<
"Stub pair rejected because of stub pt cut bends : "
210 <<
benddecode(secondvmstub.bend().value(), secondvmstub.isPSmodule()) <<
" "
221 const string &tedName =
stubpairs_.at(
i)->getTEDName(
j);
232 ofstream
fout(
"seeds.txt", ofstream::app);
248 int lookupbits = (
int)((firstvmstub.vmbits().value() >> 10) & 1023);
249 int newbin = (lookupbits & 127);
250 int bin = newbin / 8;
255 if (firstvmstub.stub()->disk().value() < 0) {
260 for (
int ibin =
start; ibin <=
last; ibin++) {
263 vmsteSuffix = vmsteSuffix.substr(0, vmsteSuffix.find_last_of(
'n'));
264 if (
stubpairs_.at(
i)->getLastPartOfName() != vmsteSuffix)
277 FPGAWord iphisecondbin = secondvmstub.finephi();
282 FPGAWord secondbend = secondvmstub.bend();
292 <<
"Stub triplet rejected because of stub pt cut bends : "
293 <<
benddecode(secondvmstub.bend().value(), secondvmstub.isPSmodule()) <<
" "
304 const string &tedName =
stubpairs_.at(
i)->getTEDName(
j);
315 ofstream
fout(
"seeds.txt", ofstream::app);
329 int lookupbits = (
int)((firstvmstub.vmbits().value() >> 10) & 1023);
331 int newbin = (lookupbits & 127);
332 int bin = newbin / 8;
337 for (
int ibin =
start; ibin <=
last; ibin++) {
340 vmsteSuffix = vmsteSuffix.substr(0, vmsteSuffix.find_last_of(
'n'));
341 if (
stubpairs_.at(
i)->getLastPartOfName() != vmsteSuffix)
353 unsigned int nvmsecond;
356 unsigned int nvmbitssecond =
nbits(nvmsecond);
366 FPGAWord secondbend = secondvmstub.bend();
376 <<
"Stub pair rejected because of stub pt cut bends : "
377 <<
benddecode(secondvmstub.bend().value(), secondvmstub.isPSmodule()) <<
" "
388 const string &tedName =
stubpairs_.at(
i)->getTEDName(
j);
399 ofstream
fout(
"seeds.txt", ofstream::app);
415 for (
unsigned spIndex = 0; spIndex < tedName.second.size(); spIndex++) {
416 if (tedName.second.at(spIndex).empty())
418 vector<string>
entry(tedName.second.at(spIndex));
421 const string &spName =
entry.at(0);
425 if (spIndex >=
spTable_.at(tedName.first).size())
426 spTable_.at(tedName.first).resize(spIndex + 1);
427 if (!
spTable_.at(tedName.first).at(spIndex).count(spName))
428 spTable_.at(tedName.first).at(spIndex)[spName] = 0;
429 spTable_.at(tedName.first).at(spIndex)[spName]++;
444 unsigned int finddir = tablePath.find(
"table_TRE_");
445 tableName = tablePath.substr(0, finddir) +
"table_" +
name_ +
".txt";
454 table_.push_back(
num > 0 ?
true :
false);
470 for (
const auto &tedName :
spTable_) {
475 for (
const auto &
entry : tedName.second) {
476 for (
const auto &spName :
entry)
477 fout << spName.first <<
":" << spName.second <<
" ";