32 throw cms::Exception(
"Inconsistency") <<
"phi0 conversion parameter inconsistency\n";
36 throw cms::Exception(
"Inconsistency") <<
"ring conversion parameter inconsistency\n";
40 throw cms::Exception(
"Inconsistency") <<
"t conversion parameter inconsistency\n";
44 edm::LogVerbatim(
"Tracklet") <<
"========================================================= \n"
45 <<
"Conversion factors for global coordinates: \n"
49 <<
"========================================================= \n"
50 <<
"Conversion factors for track(let) parameters: \n"
56 <<
"========================================================= \n"
58 <<
"d0bitshift = ??? \n"
59 <<
"=========================================================";
99 while (inmem.good()) {
100 string memType, memName,
size;
101 inmem >> memType >> memName >>
size;
105 edm::LogVerbatim(
"Tracklet") <<
"Read memory: " << memType <<
" " << memName;
108 sector->addMem(memType, memName);
120 while (inproc.good()) {
121 string procType, procName;
122 inproc >> procType >> procName;
126 edm::LogVerbatim(
"Tracklet") <<
"Read process: " << procType <<
" " << procName;
129 sector->addProc(procType, procName);
141 while (inwire.good()) {
143 getline(inwire,
line);
150 string mem, tmp1, procin, tmp2, procout;
151 ss >>
mem >> tmp1 >> procin;
152 if (procin ==
"output=>") {
156 ss >> tmp2 >> procout;
160 sector->addWire(
mem, procin, procout);
169 while (indtc.good()) {
174 while (layerdisk > 0) {
200 for (
int j = 0;
j <
ev.nstubs();
j++) {
203 int layer = stub.
layer() + 1;
208 string dtcbase = dtc.substr(2, dtc.size() - 2);
210 dtcbase = dtc.substr(0, 4) + dtc.substr(6, dtc.size() - 6);
220 int diff =
k - isector;
229 double dphi = stub.
phi() - phiminsect;
238 static std::map<string, ofstream*> dtcstubs;
241 vector<string> dtcs =
cabling_->DTCs();
242 for (
const auto& dtc : dtcs) {
243 string dtcbase = dtc.substr(2, dtc.size() - 2);
245 dtcbase = dtc.substr(0, 4) + dtc.substr(6, dtc.size() - 6);
248 string fname =
"../data/MemPrints/InputStubs/Link_";
250 if (dtcstubs.find(dtcbase +
"A") != dtcstubs.end())
253 ofstream*
out =
new ofstream;
255 dtcstubs[dtcbase +
"A"] =
out;
257 fname =
"../data/MemPrints/InputStubs/Link_";
259 if (dtcstubs.find(dtcbase +
"B") != dtcstubs.end())
264 dtcstubs[dtcbase +
"B"] =
out;
267 static int oldevent = -1;
270 for (
auto& dtcstub : dtcstubs) {
273 (*(dtcstub.second)) <<
"BX " <<
tmp.str() <<
" Event : " <<
eventnum_ + 1 << endl;
281 int topbit = phi.value() >> (phi.nbits() - 1);
283 int layerdisk = stub.
layer() + 1;
284 if (layerdisk > 999) {
285 layerdisk = 10 +
abs(stub.
disk());
287 int layerdiskcode = -1;
288 for (
unsigned int i = 0;
i <
tmp.size();
i++) {
289 if (
tmp[
i] == layerdisk)
292 if (layerdiskcode == -1) {
293 edm::LogVerbatim(
"Tracklet") <<
"dtcbase layerdisk layer disk : " << dtcbase <<
" " << layerdisk <<
" "
294 << stub.
layer() + 1 <<
" " << stub.
disk();
296 assert(layerdiskcode >= 0);
297 assert(layerdiskcode < 4);
299 ldcode.
set(layerdiskcode, 2);
300 string dataword =
"1|" + ldcode.
str() +
"|" + fpgastub.
str();
302 (*dtcstubs[dtcbase +
"A"]) << dataword <<
" " <<
trklet::hexFormat(dataword) << endl;
304 (*dtcstubs[dtcbase +
"B"]) << dataword <<
" " <<
trklet::hexFormat(dataword) << endl;
377 int nTP =
globals_->event()->nsimtracks();
378 for (
int iTP = 0; iTP < nTP; iTP++) {
380 if (simtrk.
pt() < 2.0)
384 if (hypot(simtrk.
vx(), simtrk.
vy()) > 0.1)
388 bool pion = (
abs(simtrk.
type()) == 211);
389 bool kaon = (
abs(simtrk.
type()) == 321);
390 bool proton = (
abs(simtrk.
type()) == 2212);
395 int simtrackid = simtrk.
trackid();
396 unsigned int hitmask =
ev.layersHit(simtrackid,
nlayers, ndisks);
401 static ofstream outhit(
"hiteff.txt");
402 outhit << simtrk.
eta() <<
" " << (hitmask & 1) <<
" " << (hitmask & 2) <<
" " << (hitmask & 4) <<
" "
403 << (hitmask & 8) <<
" " << (hitmask & 16) <<
" " << (hitmask & 32) <<
" " << (hitmask & 64) <<
" "
404 << (hitmask & 128) <<
" " << (hitmask & 256) <<
" " << (hitmask & 512) <<
" " << (hitmask & 1024) << endl;
407 std::unordered_set<int> matchseed;
409 std::unordered_set<int> matchseedtmp =
sectors_[
k]->seedMatch(iTP);
410 matchseed.insert(matchseedtmp.begin(), matchseedtmp.end());
414 bool eff = matchseed.find(
iseed) != matchseed.end();
479 #ifndef USEHYBRID //don't try to print these memories if running hybrid
491 #ifndef USEHYBRID //don't try to print these memories if running hybrid
511 <<
"Process Times called Average time (ms) Total time (s) \n"
512 <<
"Cleaning " << setw(10) <<
cleanTimer_.
ntimes() << setw(20) << setprecision(3)
518 <<
"TrackletEngine " << setw(10) <<
TETimer_.
ntimes() << setw(20) << setprecision(3)
520 <<
"TrackletEngineDisplaced" << setw(10) <<
TEDTimer_.
ntimes() << setw(20) << setprecision(3)
522 <<
"TripletEngine " << setw(10) <<
TRETimer_.
ntimes() << setw(20) << setprecision(3)
524 <<
"TrackletCalculator " << setw(10) <<
TCTimer_.
ntimes() << setw(20) << setprecision(3)
526 <<
"TrackletCalculatorDisplaced" << setw(10) <<
TCDTimer_.
ntimes() << setw(20) << setprecision(3)
528 <<
"ProjectionRouter " << setw(10) <<
PRTimer_.
ntimes() << setw(20) << setprecision(3)
530 <<
"MatchEngine " << setw(10) <<
METimer_.
ntimes() << setw(20) << setprecision(3)
532 <<
"MatchCalculator " << setw(10) <<
MCTimer_.
ntimes() << setw(20) << setprecision(3)
534 <<
"MatchProcessor " << setw(10) <<
MPTimer_.
ntimes() << setw(20) << setprecision(3)
536 <<
"FitTrack " << setw(10) <<
FTTimer_.
ntimes() << setw(20) << setprecision(3)
538 <<
"PurgeDuplicate " << setw(10) <<
PDTimer_.
ntimes() << setw(20) << setprecision(3)