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) {
197 for (
int j = 0;
j <
ev.nstubs();
j++) {
199 unsigned int isector = stub.
region();
204 const string& dtc = stub.
DTClink();
213 for (
unsigned int index = 0;
index < layerstubssector.size();
index++) {
216 globals_->ofstream(
"stubslayersector.txt")
217 << layerdisk <<
" " <<
sector <<
" " << layerstubssector[
index] << endl;
222 for (
unsigned int layerdisk = 0; layerdisk < layerstubs.size(); layerdisk++) {
223 globals_->ofstream(
"stubslayer.txt") << layerdisk <<
" " << layerstubs[layerdisk] << endl;
284 int nTP =
globals_->event()->nsimtracks();
285 for (
int iTP = 0; iTP < nTP; iTP++) {
287 if (simtrk.
pt() < 2.0)
291 if (
hypot(simtrk.
vx(), simtrk.
vy()) > 0.1)
295 bool pion = (
abs(simtrk.
type()) == 211);
296 bool kaon = (
abs(simtrk.
type()) == 321);
297 bool proton = (
abs(simtrk.
type()) == 2212);
302 int simtrackid = simtrk.
trackid();
303 unsigned int hitmask = 0;
304 hitmask =
ev.layersHit(simtrackid,
nlayers, ndisks);
309 static ofstream outhit(
"hiteff.txt");
310 outhit << simtrk.
eta() <<
" " << (hitmask & 1) <<
" " << (hitmask & 2) <<
" " << (hitmask & 4) <<
" " 311 << (hitmask & 8) <<
" " << (hitmask & 16) <<
" " << (hitmask & 32) <<
" " << (hitmask & 64) <<
" " 312 << (hitmask & 128) <<
" " << (hitmask & 256) <<
" " << (hitmask & 512) <<
" " << (hitmask & 1024)
316 std::unordered_set<int> matchseed;
317 std::unordered_set<int> matchseedtmp =
sector_->seedMatch(iTP);
318 matchseed.insert(matchseedtmp.begin(), matchseedtmp.end());
321 bool eff = matchseed.find(
iseed) != matchseed.end();
376 sector_->executeFT(streamsTrackRaw, streamsStubRaw);
398 edm::LogVerbatim(
"Tracklet") <<
"Process Times called Average time (ms) Total time (s)" 414 << setprecision(3) <<
TPTimer_.
avgtime() * 1000.0 << setw(20) << setprecision(3)
417 << setprecision(3) <<
MPTimer_.
avgtime() * 1000.0 << setw(20) << setprecision(3)
421 << setprecision(3) <<
TETimer_.
avgtime() * 1000.0 << setw(20) << setprecision(3)
425 << setprecision(3) <<
TEDTimer_.
avgtime() * 1000.0 << setw(20) << setprecision(3)
428 << setprecision(3) <<
TRETimer_.
avgtime() * 1000.0 << setw(20) << setprecision(3)
430 <<
"TrackletCalculatorDisplaced" << setw(10) <<
TCDTimer_.
ntimes() << setw(20)
431 << setprecision(3) <<
TCDTimer_.
avgtime() * 1000.0 << setw(20) << setprecision(3)
434 <<
"TrackletProcessorDisplaced" << setw(10) <<
TPDTimer_.
ntimes() << setw(20)
435 << setprecision(3) <<
TPDTimer_.
avgtime() * 1000.0 << setw(20) << setprecision(3)
439 << setprecision(3) <<
TCTimer_.
avgtime() * 1000.0 << setw(20) << setprecision(3)
441 <<
"ProjectionRouter " << setw(10) <<
PRTimer_.
ntimes() << setw(20)
442 << setprecision(3) <<
PRTimer_.
avgtime() * 1000.0 << setw(20) << setprecision(3)
445 << setprecision(3) <<
METimer_.
avgtime() * 1000.0 << setw(20) << setprecision(3)
447 <<
"MatchCalculator " << setw(10) <<
MCTimer_.
ntimes() << setw(20)
448 << setprecision(3) <<
MCTimer_.
avgtime() * 1000.0 << setw(20) << setprecision(3)
452 << setprecision(3) <<
FTTimer_.
avgtime() * 1000.0 << setw(20) << setprecision(3)
455 << 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
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)
dictionary config
Read in AllInOne config in JSON format.
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)