30 globals_ = make_unique<Globals>(*settings_);
34 throw cms::Exception(
"Inconsistency") <<
"phi0 conversion parameter inconsistency\n";
38 throw cms::Exception(
"Inconsistency") <<
"ring conversion parameter inconsistency\n";
42 throw cms::Exception(
"Inconsistency") <<
"t conversion parameter inconsistency\n";
52 edm::LogVerbatim(
"Tracklet") <<
"========================================================= \n" 53 <<
"Conversion factors for global coordinates: \n" 57 <<
"========================================================= \n" 58 <<
"Conversion factors for track(let) parameters: \n" 64 <<
"========================================================= \n" 66 <<
"d0bitshift = ??? \n" 67 <<
"=========================================================";
104 config.writeAll(
wires, memorymodules, processingmodules);
107 std::stringstream
wires;
108 std::stringstream memorymodules;
109 std::stringstream processingmodules;
111 config.writeAll(
wires, memorymodules, processingmodules);
122 while (inmem.good()) {
123 string memType, memName, size;
124 inmem >> memType >> memName >> size;
128 edm::LogVerbatim(
"Tracklet") <<
"Read memory: " << memType <<
" " << memName;
130 sector_->addMem(memType, memName);
138 while (inproc.good()) {
139 string procType, procName;
140 inproc >> procType >> procName;
144 edm::LogVerbatim(
"Tracklet") <<
"Read process: " << procType <<
" " << procName;
146 sector_->addProc(procType, procName);
154 while (inwire.good()) {
156 getline(inwire,
line);
163 string mem, tmp1, procin, tmp2, procout;
164 ss >>
mem >> tmp1 >> procin;
165 if (procin ==
"output=>") {
169 ss >> tmp2 >> procout;
177 vector<vector<string>>& streamsTrackRaw,
178 vector<vector<StubStreamData>>& streamsStubRaw) {
198 for (
int j = 0;
j <
ev.nstubs();
j++) {
200 unsigned int isector = stub.
region();
205 const string& dtc = stub.
DTClink();
214 for (
unsigned int index = 0;
index < layerstubssector.size();
index++) {
217 globals_->ofstream(
"stubslayersector.txt")
218 << layerdisk <<
" " <<
sector <<
" " << layerstubssector[
index] << endl;
223 for (
unsigned int layerdisk = 0; layerdisk < layerstubs.size(); layerdisk++) {
224 globals_->ofstream(
"stubslayer.txt") << layerdisk <<
" " << layerstubs[layerdisk] << endl;
285 int nTP =
globals_->event()->nsimtracks();
286 for (
int iTP = 0; iTP < nTP; iTP++) {
288 if (simtrk.
pt() < 2.0)
292 if (
hypot(simtrk.
vx(), simtrk.
vy()) > 0.1)
296 bool pion = (
abs(simtrk.
type()) == 211);
297 bool kaon = (
abs(simtrk.
type()) == 321);
298 bool proton = (
abs(simtrk.
type()) == 2212);
303 int simtrackid = simtrk.
trackid();
304 unsigned int hitmask = 0;
305 hitmask =
ev.layersHit(simtrackid,
nlayers, ndisks);
310 static ofstream outhit(
"hiteff.txt");
311 outhit << simtrk.
eta() <<
" " << (hitmask & 1) <<
" " << (hitmask & 2) <<
" " << (hitmask & 4) <<
" " 312 << (hitmask & 8) <<
" " << (hitmask & 16) <<
" " << (hitmask & 32) <<
" " << (hitmask & 64) <<
" " 313 << (hitmask & 128) <<
" " << (hitmask & 256) <<
" " << (hitmask & 512) <<
" " << (hitmask & 1024)
317 std::unordered_set<int> matchseed;
318 std::unordered_set<int> matchseedtmp =
sector_->seedMatch(iTP);
319 matchseed.insert(matchseedtmp.begin(), matchseedtmp.end());
322 bool eff = matchseed.find(
iseed) != matchseed.end();
377 sector_->executeFT(streamsTrackRaw, streamsStubRaw);
399 edm::LogVerbatim(
"Tracklet") <<
"Process Times called Average time (ms) Total time (s)" 415 << setprecision(3) <<
TPTimer_.
avgtime() * 1000.0 << setw(20) << setprecision(3)
418 << setprecision(3) <<
MPTimer_.
avgtime() * 1000.0 << setw(20) << setprecision(3)
422 << setprecision(3) <<
TETimer_.
avgtime() * 1000.0 << setw(20) << setprecision(3)
426 << setprecision(3) <<
TEDTimer_.
avgtime() * 1000.0 << setw(20) << setprecision(3)
429 << setprecision(3) <<
TRETimer_.
avgtime() * 1000.0 << setw(20) << setprecision(3)
431 <<
"TrackletCalculatorDisplaced" << setw(10) <<
TCDTimer_.
ntimes() << setw(20)
432 << setprecision(3) <<
TCDTimer_.
avgtime() * 1000.0 << setw(20) << setprecision(3)
435 <<
"TrackletProcessorDisplaced" << setw(10) <<
TPDTimer_.
ntimes() << setw(20)
436 << setprecision(3) <<
TPDTimer_.
avgtime() * 1000.0 << setw(20) << setprecision(3)
440 << setprecision(3) <<
TCTimer_.
avgtime() * 1000.0 << setw(20) << setprecision(3)
442 <<
"ProjectionRouter " << setw(10) <<
PRTimer_.
ntimes() << setw(20)
443 << setprecision(3) <<
PRTimer_.
avgtime() * 1000.0 << setw(20) << setprecision(3)
446 << setprecision(3) <<
METimer_.
avgtime() * 1000.0 << setw(20) << setprecision(3)
448 <<
"MatchCalculator " << setw(10) <<
MCTimer_.
ntimes() << setw(20)
449 << setprecision(3) <<
MCTimer_.
avgtime() * 1000.0 << setw(20) << setprecision(3)
453 << setprecision(3) <<
FTTimer_.
avgtime() * 1000.0 << setw(20) << setprecision(3)
456 << setprecision(3) <<
PDTimer_.
avgtime() * 1000.0 << setw(20) << setprecision(3)
Log< level::Info, true > LogVerbatim
std::vector< Track > tracks_
unsigned int ntimes() const
~TrackletEventProcessor()
MPlex< T, D1, D2, N > hypot(const MPlex< T, D1, D2, N > &a, const MPlex< T, D1, D2, N > &b)
void init(Settings const &theSettings, const tt::Setup *setup=nullptr)
std::unique_ptr< Sector > sector_
Class to process and provide run-time constants used by Track Trigger emulators.
std::string const & wiresFile() const
dictionary config
Read in AllInOne config in JSON format.
const std::string & DTClink() const
const Settings * settings_
virtual void bookDiskResidual()
virtual void bookLayerResidual()
std::unique_ptr< Globals > globals_
std::string tablePath() const
Abs< T >::type abs(const T &t)
virtual void bookSeedEff()
uint16_t mem[nChs][nEvts]
bool writeMonitorData(std::string module) const
std::string const & memoryModulesFile() const
bool debugTracklet() const
constexpr unsigned int N_SECTOR
std::string const & processingModulesFile() const
void configure(std::istream &inwire, std::istream &inmem, std::istream &inproc)
virtual void bookTrackletParams()
void event(SLHCEvent &ev, std::vector< std::vector< std::string >> &streamsTrackRaw, std::vector< std::vector< StubStreamData >> &streamsStubRaw)
unsigned int writememsect() const
std::ofstream openfile(const std::string &dir, const std::string &fname, const char *file, int line)