13 TripletEngine::TripletEngine(
string name,
Settings const &settings,
Globals *global,
unsigned int iSector)
58 throw cms::Exception(
"LogicError") << __FILE__ <<
" " << __LINE__ <<
" Invalid seeding!";
81 if (
output ==
"stubtripout") {
82 auto *
tmp = dynamic_cast<StubTripletsMemory *>(
memory);
87 throw cms::Exception(
"BadConfig") << __FILE__ <<
" " << __LINE__ <<
" Could not find output : " <<
output;
95 if (
input ==
"thirdvmstubin") {
96 auto *
tmp = dynamic_cast<VMStubsTEMemory *>(
memory);
101 if (
input.substr(0, 8) ==
"stubpair") {
102 auto *
tmp = dynamic_cast<StubPairsMemory *>(
memory);
107 throw cms::Exception(
"BadConfig") << __FILE__ <<
" " << __LINE__ <<
" Could not find input : " <<
input;
111 unsigned int countall = 0;
112 unsigned int countpass = 0;
113 unsigned int nThirdStubs = 0;
116 for (
unsigned int iThirdMem = 0; iThirdMem <
thirdvmstubs_.size();
117 nThirdStubs +=
thirdvmstubs_.at(iThirdMem)->nVMStubs(), iThirdMem++)
123 bool print =
false && (
getName().substr(0, 10) ==
"TRE_L2cL3c");
136 oss += std::to_string(
stubpairs_.at(
i)->nStubPairs());
140 hacksum += nThirdStubs *
s;
150 for (
unsigned int j = 0;
j <
stubpairs_.at(
i)->nStubPairs(); ++
j) {
159 constexpr
unsigned int vmbitshift = 10;
160 int lookupbits = (
int)((firstvmstub.vmbits().value() >> vmbitshift) & 1023);
161 int newbin = (lookupbits & 127);
162 int bin = newbin / 8;
167 for (
int ibin =
start; ibin <=
last; ibin++) {
170 vmsteSuffix = vmsteSuffix.substr(0, vmsteSuffix.find_last_of(
'n'));
171 if (
stubpairs_.at(
i)->getLastPartOfName() != vmsteSuffix)
188 unsigned int nvmbitssecond =
nbits(nvmsecond);
198 FPGAWord secondbend = secondvmstub.bend();
210 <<
"Stub pair rejected because of stub pt cut bends : "
211 <<
benddecode(secondvmstub.bend().value(), secondvmstub.isPSmodule()) <<
" "
221 const string &tedName =
stubpairs_.at(
i)->getTEDName(
j);
231 ofstream
fout(
"seeds.txt", ofstream::app);
247 int lookupbits = (
int)((firstvmstub.vmbits().value() >> 10) & 1023);
248 int newbin = (lookupbits & 127);
249 int bin = newbin / 8;
254 if (firstvmstub.stub()->disk().value() < 0) {
259 for (
int ibin =
start; ibin <=
last; ibin++) {
262 vmsteSuffix = vmsteSuffix.substr(0, vmsteSuffix.find_last_of(
'n'));
263 if (
stubpairs_.at(
i)->getLastPartOfName() != vmsteSuffix)
276 FPGAWord iphisecondbin = secondvmstub.finephi();
281 FPGAWord secondbend = secondvmstub.bend();
293 <<
"Stub triplet rejected because of stub pt cut bends : "
294 <<
benddecode(secondvmstub.bend().value(), secondvmstub.isPSmodule()) <<
" "
302 const string &tedName =
stubpairs_.at(
i)->getTEDName(
j);
312 ofstream
fout(
"seeds.txt", ofstream::app);
326 int lookupbits = (
int)((firstvmstub.vmbits().value() >> 10) & 1023);
328 int newbin = (lookupbits & 127);
329 int bin = newbin / 8;
334 for (
int ibin =
start; ibin <=
last; ibin++) {
337 vmsteSuffix = vmsteSuffix.substr(0, vmsteSuffix.find_last_of(
'n'));
338 if (
stubpairs_.at(
i)->getLastPartOfName() != vmsteSuffix)
350 unsigned int nvmsecond;
353 unsigned int nvmbitssecond =
nbits(nvmsecond);
363 FPGAWord secondbend = secondvmstub.bend();
375 <<
"Stub pair rejected because of stub pt cut bends : "
376 <<
benddecode(secondvmstub.bend().value(), secondvmstub.isPSmodule()) <<
" "
384 const string &tedName =
stubpairs_.at(
i)->getTEDName(
j);
394 ofstream
fout(
"seeds.txt", ofstream::app);
410 for (
unsigned spIndex = 0; spIndex < tedName.second.size(); spIndex++) {
411 if (tedName.second.at(spIndex).empty())
413 vector<string>
entry(tedName.second.at(spIndex));
416 const string &spName =
entry.at(0);
420 if (spIndex >=
spTable_.at(tedName.first).size())
421 spTable_.at(tedName.first).resize(spIndex + 1);
422 if (!
spTable_.at(tedName.first).at(spIndex).count(spName))
423 spTable_.at(tedName.first).at(spIndex)[spName] = 0;
424 spTable_.at(tedName.first).at(spIndex)[spName]++;
439 unsigned int finddir = tablePath.find(
"table_TRE_");
440 tableName = tablePath.substr(0, finddir) +
"table_" +
name_ +
".txt";
449 table_.push_back(
num > 0 ?
true :
false);
465 for (
const auto &tedName :
spTable_) {
470 for (
const auto &
entry : tedName.second) {
471 for (
const auto &spName :
entry)
472 fout << spName.first <<
":" << spName.second <<
" ";