CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
trklet::TrackletEngineDisplaced Class Reference

#include <TrackletEngineDisplaced.h>

Inheritance diagram for trklet::TrackletEngineDisplaced:
trklet::ProcessBase

Public Member Functions

void addInput (MemoryBase *memory, std::string input) override
 
void addOutput (MemoryBase *memory, std::string output) override
 
void execute ()
 
short memNameToIndex (const std::string &name)
 
void readTables ()
 
 TrackletEngineDisplaced (std::string name, Settings const &settings, Globals *global)
 
 ~TrackletEngineDisplaced () override
 
- Public Member Functions inherited from trklet::ProcessBase
unsigned int getISeed (const std::string &name)
 
std::string const & getName () const
 
void initLayerDisk (unsigned int pos, int &layer, int &disk)
 
void initLayerDisk (unsigned int pos, int &layer, int &disk, int &layerdisk)
 
unsigned int initLayerDisk (unsigned int pos)
 
void initLayerDisksandISeed (unsigned int &layerdisk1, unsigned int &layerdisk2, unsigned int &iSeed)
 
unsigned int nbits (unsigned int power)
 
 ProcessBase (std::string name, Settings const &settings, Globals *global)
 
virtual ~ProcessBase ()=default
 

Private Attributes

int disk1_
 
int disk2_
 
int firstphibits_
 
std::vector< VMStubsTEMemory * > firstvmstubs_
 
int iSeed_
 
int layer1_
 
int layer2_
 
int secondphibits_
 
VMStubsTEMemorysecondvmstubs_
 
std::vector< StubPairsMemory * > stubpairs_
 
std::vector< std::set< short > > table_
 

Additional Inherited Members

- Protected Attributes inherited from trklet::ProcessBase
Globalsglobals_
 
std::string name_
 
Settings const & settings_
 

Detailed Description

Definition at line 20 of file TrackletEngineDisplaced.h.

Constructor & Destructor Documentation

◆ TrackletEngineDisplaced()

TrackletEngineDisplaced::TrackletEngineDisplaced ( std::string  name,
Settings const &  settings,
Globals global 
)

Definition at line 15 of file TrackletEngineDisplaced.cc.

References disk1_, disk2_, firstphibits_, firstvmstubs_, iSeed_, layer1_, layer2_, Skims_PA_cff::name, trklet::Settings::nfinephi(), secondphibits_, secondvmstubs_, trklet::ProcessBase::settings_, and stubpairs_.

16  : ProcessBase(name, settings, global) {
17  stubpairs_.clear();
18  firstvmstubs_.clear();
19  secondvmstubs_ = nullptr;
20  layer1_ = 0;
21  layer2_ = 0;
22  disk1_ = 0;
23  disk2_ = 0;
24  string name1 = name.substr(1); //this is to correct for "TED" having one more letter then "TE"
25  if (name1[3] == 'L') {
26  layer1_ = name1[4] - '0';
27  }
28  if (name1[3] == 'D') {
29  disk1_ = name1[4] - '0';
30  }
31  if (name1[11] == 'L') {
32  layer2_ = name1[12] - '0';
33  }
34  if (name1[11] == 'D') {
35  disk2_ = name1[12] - '0';
36  }
37  if (name1[12] == 'L') {
38  layer2_ = name1[13] - '0';
39  }
40  if (name1[12] == 'D') {
41  disk2_ = name1[13] - '0';
42  }
43 
44  iSeed_ = -1;
45  if (layer1_ == 3 && layer2_ == 4)
46  iSeed_ = 8;
47  if (layer1_ == 5 && layer2_ == 6)
48  iSeed_ = 9;
49  if (layer1_ == 2 && layer2_ == 3)
50  iSeed_ = 10;
51  if (disk1_ == 1 && disk2_ == 2)
52  iSeed_ = 11;
53 
56 }
Settings const & settings_
Definition: ProcessBase.h:40
ProcessBase(std::string name, Settings const &settings, Globals *global)
Definition: ProcessBase.cc:14
std::vector< VMStubsTEMemory * > firstvmstubs_
int nfinephi(unsigned int inner, unsigned int iSeed) const
Definition: Settings.h:142
std::vector< StubPairsMemory * > stubpairs_

◆ ~TrackletEngineDisplaced()

TrackletEngineDisplaced::~TrackletEngineDisplaced ( )
override

Definition at line 58 of file TrackletEngineDisplaced.cc.

References table_.

58 { table_.clear(); }
std::vector< std::set< short > > table_

Member Function Documentation

◆ addInput()

void TrackletEngineDisplaced::addInput ( MemoryBase memory,
std::string  input 
)
overridevirtual

Implements trklet::ProcessBase.

Definition at line 74 of file TrackletEngineDisplaced.cc.

References cms::cuda::assert(), Exception, firstvmstubs_, input, mps_setup::memory, trklet::ProcessBase::name_, secondvmstubs_, trklet::ProcessBase::settings_, createJobs::tmp, and trklet::Settings::writetrace().

74  {
75  if (settings_.writetrace()) {
76  edm::LogVerbatim("Tracklet") << "In " << name_ << " adding input from " << memory->getName() << " to input "
77  << input;
78  }
79  if (input == "firstvmstubin") {
80  VMStubsTEMemory* tmp = dynamic_cast<VMStubsTEMemory*>(memory);
81  assert(tmp != nullptr);
82  firstvmstubs_.push_back(tmp);
83  return;
84  }
85  if (input == "secondvmstubin") {
86  VMStubsTEMemory* tmp = dynamic_cast<VMStubsTEMemory*>(memory);
87  assert(tmp != nullptr);
89  return;
90  }
91  throw cms::Exception("BadConfig") << __FILE__ << " " << __LINE__ << " Could not find input : " << input;
92 }
Log< level::Info, true > LogVerbatim
std::string name_
Definition: ProcessBase.h:38
Settings const & settings_
Definition: ProcessBase.h:40
bool writetrace() const
Definition: Settings.h:195
assert(be >=bs)
static std::string const input
Definition: EdmProvDump.cc:50
std::vector< VMStubsTEMemory * > firstvmstubs_
tmp
align.sh
Definition: createJobs.py:716

◆ addOutput()

void TrackletEngineDisplaced::addOutput ( MemoryBase memory,
std::string  output 
)
overridevirtual

Implements trklet::ProcessBase.

Definition at line 60 of file TrackletEngineDisplaced.cc.

References cms::cuda::assert(), Exception, mps_setup::memory, trklet::ProcessBase::name_, convertSQLitetoXML_cfg::output, trklet::ProcessBase::settings_, stubpairs_, createJobs::tmp, and trklet::Settings::writetrace().

60  {
61  if (settings_.writetrace()) {
62  edm::LogVerbatim("Tracklet") << "In " << name_ << " adding output to " << memory->getName() << " to output "
63  << output;
64  }
65  if (output == "stubpairout") {
66  StubPairsMemory* tmp = dynamic_cast<StubPairsMemory*>(memory);
67  assert(tmp != nullptr);
68  stubpairs_.push_back(tmp);
69  return;
70  }
71  throw cms::Exception("BadConfig") << __FILE__ << " " << __LINE__ << " Could not find output : " << output;
72 }
Log< level::Info, true > LogVerbatim
std::string name_
Definition: ProcessBase.h:38
Settings const & settings_
Definition: ProcessBase.h:40
bool writetrace() const
Definition: Settings.h:195
assert(be >=bs)
std::vector< StubPairsMemory * > stubpairs_
Definition: output.py:1
tmp
align.sh
Definition: createJobs.py:716

◆ execute()

void TrackletEngineDisplaced::execute ( void  )

Definition at line 94 of file TrackletEngineDisplaced.cc.

References cms::cuda::assert(), trklet::VMStubTE::bend(), trklet::Settings::benddecode(), newFWLiteAna::bin, trklet::Settings::debugTracklet(), trklet::Stub::disk(), disk1_, disk2_, trklet::Settings::enableTripletTables(), trklet::VMStubTE::finephi(), firstphibits_, firstvmstubs_, groupFilesInBlocks::fout, trklet::MemoryBase::getName(), trklet::ProcessBase::getName(), trklet::VMStubsTEMemory::getVMStubTE(), trklet::VMStubsTEMemory::getVMStubTEBinned(), trklet::ProcessBase::globals_, mps_fire::i, iSeed_, trklet::VMStubTE::isPSmodule(), dqmiolumiharvest::j, trklet::Stub::l1tstub(), dqmdumpme::last, layer1_, layer2_, trklet::Settings::maxStep(), trklet::ProcessBase::name_, trklet::FPGAWord::nbits(), trklet::VMStubsTEMemory::nVMStubs(), trklet::VMStubsTEMemory::nVMStubsBinned(), trklet::Globals::ofstream(), trklet::L1TStub::phi(), trklet::L1TStub::r(), readTables(), secondphibits_, secondvmstubs_, trklet::ProcessBase::settings_, trklet::VMStubTE::stub(), stubpairs_, table_, trklet::Settings::useSeed(), trklet::FPGAWord::value(), trklet::VMStubTE::vmbits(), trklet::Settings::writeMonitorData(), trklet::Settings::writeTripletTables(), and trklet::L1TStub::z().

94  {
95  if (!settings_.useSeed(iSeed_))
96  return;
97 
99  readTables();
100 
101  unsigned int countall = 0;
102  unsigned int countpass = 0;
103  unsigned int nInnerStubs = 0;
104 
105  for (unsigned int iInnerMem = 0; iInnerMem < firstvmstubs_.size();
106  nInnerStubs += firstvmstubs_.at(iInnerMem)->nVMStubs(), iInnerMem++)
107  ;
108 
109  assert(!firstvmstubs_.empty());
110  assert(secondvmstubs_ != nullptr);
111 
112  for (auto& iInnerMem : firstvmstubs_) {
113  assert(iInnerMem->nVMStubs() == iInnerMem->nVMStubs());
114  for (unsigned int i = 0; i < iInnerMem->nVMStubs(); i++) {
115  const VMStubTE& firstvmstub = iInnerMem->getVMStubTE(i);
116  if (settings_.debugTracklet()) {
117  edm::LogVerbatim("Tracklet") << "In " << getName() << " have first stub";
118  }
119 
120  if ((layer1_ == 3 && layer2_ == 4) || (layer1_ == 5 && layer2_ == 6)) {
121  int lookupbits = firstvmstub.vmbits().value() & 1023;
122  int zdiffmax = (lookupbits >> 7);
123  int newbin = (lookupbits & 127);
124  int bin = newbin / 8;
125 
126  int zbinfirst = newbin & 7;
127 
128  int start = (bin >> 1);
129  int last = start + (bin & 1);
130 
131  assert(last < 8);
132 
133  if (settings_.debugTracklet()) {
134  edm::LogVerbatim("Tracklet") << "Will look in zbins " << start << " to " << last;
135  }
136  for (int ibin = start; ibin <= last; ibin++) {
137  for (unsigned int j = 0; j < secondvmstubs_->nVMStubsBinned(ibin); j++) {
138  if (settings_.debugTracklet()) {
139  edm::LogVerbatim("Tracklet") << "In " << getName() << " have second stub(1) " << ibin << " " << j;
140  }
141 
142  if (countall >= settings_.maxStep("TE"))
143  break;
144  countall++;
145  const VMStubTE& secondvmstub = secondvmstubs_->getVMStubTEBinned(ibin, j);
146 
147  int zbin = (secondvmstub.vmbits().value() & 7);
148  if (start != ibin)
149  zbin += 8;
150  if (zbin < zbinfirst || zbin - zbinfirst > zdiffmax) {
151  if (settings_.debugTracklet()) {
152  edm::LogVerbatim("Tracklet") << "Stubpair rejected because of wrong zbin";
153  }
154  continue;
155  }
156 
157  assert(firstphibits_ != -1);
158  assert(secondphibits_ != -1);
159 
160  FPGAWord iphifirstbin = firstvmstub.finephi();
161  FPGAWord iphisecondbin = secondvmstub.finephi();
162 
163  unsigned int index = (iphifirstbin.value() << secondphibits_) + iphisecondbin.value();
164 
165  FPGAWord firstbend = firstvmstub.bend();
166  FPGAWord secondbend = secondvmstub.bend();
167 
168  index = (index << firstbend.nbits()) + firstbend.value();
169  index = (index << secondbend.nbits()) + secondbend.value();
170 
172  (index >= table_.size() || table_.at(index).empty())) {
173  if (settings_.debugTracklet()) {
174  edm::LogVerbatim("Tracklet")
175  << "Stub pair rejected because of stub pt cut bends : "
176  << settings_.benddecode(firstvmstub.bend().value(), layer1_ - 1, firstvmstub.isPSmodule()) << " "
177  << settings_.benddecode(secondvmstub.bend().value(), layer2_ - 1, secondvmstub.isPSmodule());
178  }
179 
180  //FIXME temporarily commented out until stub bend table fixed
181  //if (!settings_.writeTripletTables())
182  // continue;
183  }
184 
185  if (settings_.debugTracklet())
186  edm::LogVerbatim("Tracklet") << "Adding layer-layer pair in " << getName();
187  for (unsigned int isp = 0; isp < stubpairs_.size(); ++isp) {
188  if (!settings_.enableTripletTables() || settings_.writeTripletTables() || table_.at(index).count(isp)) {
189  if (settings_.writeMonitorData("Seeds")) {
190  ofstream fout("seeds.txt", ofstream::app);
191  fout << __FILE__ << ":" << __LINE__ << " " << name_ << " " << iSeed_ << endl;
192  fout.close();
193  }
194  stubpairs_.at(isp)->addStubPair(firstvmstub, secondvmstub, index, getName());
195  }
196  }
197 
198  countpass++;
199  }
200  }
201 
202  } else if (layer1_ == 2 && layer2_ == 3) {
203  int lookupbits = firstvmstub.vmbits().value() & 1023;
204  int zdiffmax = (lookupbits >> 7);
205  int newbin = (lookupbits & 127);
206  int bin = newbin / 8;
207 
208  int zbinfirst = newbin & 7;
209 
210  int start = (bin >> 1);
211  int last = start + (bin & 1);
212 
213  assert(last < 8);
214 
215  if (settings_.debugTracklet()) {
216  edm::LogVerbatim("Tracklet") << "Will look in zbins " << start << " to " << last;
217  }
218  for (int ibin = start; ibin <= last; ibin++) {
219  for (unsigned int j = 0; j < secondvmstubs_->nVMStubsBinned(ibin); j++) {
220  if (settings_.debugTracklet()) {
221  edm::LogVerbatim("Tracklet") << "In " << getName() << " have second stub(2) ";
222  }
223 
224  if (countall >= settings_.maxStep("TE"))
225  break;
226  countall++;
227 
228  const VMStubTE& secondvmstub = secondvmstubs_->getVMStubTEBinned(ibin, j);
229 
230  int zbin = (secondvmstub.vmbits().value() & 7);
231  if (start != ibin)
232  zbin += 8;
233  if (zbin < zbinfirst || zbin - zbinfirst > zdiffmax) {
234  if (settings_.debugTracklet()) {
235  edm::LogVerbatim("Tracklet") << "Stubpair rejected because of wrong zbin";
236  }
237  continue;
238  }
239 
240  assert(firstphibits_ != -1);
241  assert(secondphibits_ != -1);
242 
243  FPGAWord iphifirstbin = firstvmstub.finephi();
244  FPGAWord iphisecondbin = secondvmstub.finephi();
245 
246  unsigned int index = (iphifirstbin.value() << secondphibits_) + iphisecondbin.value();
247 
248  FPGAWord firstbend = firstvmstub.bend();
249  FPGAWord secondbend = secondvmstub.bend();
250 
251  index = (index << firstbend.nbits()) + firstbend.value();
252  index = (index << secondbend.nbits()) + secondbend.value();
253 
255  (index >= table_.size() || table_.at(index).empty())) {
256  if (settings_.debugTracklet()) {
257  edm::LogVerbatim("Tracklet")
258  << "Stub pair rejected because of stub pt cut bends : "
259  << settings_.benddecode(firstvmstub.bend().value(), layer1_ - 1, firstvmstub.isPSmodule()) << " "
260  << settings_.benddecode(secondvmstub.bend().value(), layer2_ - 1, secondvmstub.isPSmodule());
261  }
262  continue;
263  }
264 
265  if (settings_.debugTracklet())
266  edm::LogVerbatim("Tracklet") << "Adding layer-layer pair in " << getName();
267  for (unsigned int isp = 0; isp < stubpairs_.size(); ++isp) {
269  (index < table_.size() && table_.at(index).count(isp))) {
270  if (settings_.writeMonitorData("Seeds")) {
271  ofstream fout("seeds.txt", ofstream::app);
272  fout << __FILE__ << ":" << __LINE__ << " " << name_ << " " << iSeed_ << endl;
273  fout.close();
274  }
275  stubpairs_.at(isp)->addStubPair(firstvmstub, secondvmstub, index, getName());
276  }
277  }
278 
279  countpass++;
280  }
281  }
282 
283  } else if (disk1_ == 1 && disk2_ == 2) {
284  if (settings_.debugTracklet())
285  edm::LogVerbatim("Tracklet") << getName() << " Disk-disk pair";
286 
287  int lookupbits = firstvmstub.vmbits().value() & 511;
288  bool negdisk = firstvmstub.stub()->disk().value() < 0;
289  int rdiffmax = (lookupbits >> 6);
290  int newbin = (lookupbits & 63);
291  int bin = newbin / 8;
292 
293  int rbinfirst = newbin & 7;
294 
295  int start = (bin >> 1);
296  if (negdisk)
297  start += 4;
298  int last = start + (bin & 1);
299  assert(last < 8);
300  for (int ibin = start; ibin <= last; ibin++) {
301  if (settings_.debugTracklet()) {
302  edm::LogVerbatim("Tracklet") << getName() << " looking for matching stub in " << secondvmstubs_->getName()
303  << " in bin = " << ibin << " with " << secondvmstubs_->nVMStubsBinned(ibin)
304  << " stubs";
305  }
306  for (unsigned int j = 0; j < secondvmstubs_->nVMStubsBinned(ibin); j++) {
307  if (countall >= settings_.maxStep("TE"))
308  break;
309  countall++;
310 
311  const VMStubTE& secondvmstub = secondvmstubs_->getVMStubTEBinned(ibin, j);
312 
313  int rbin = (secondvmstub.vmbits().value() & 7);
314  if (start != ibin)
315  rbin += 8;
316  if (rbin < rbinfirst)
317  continue;
318  if (rbin - rbinfirst > rdiffmax)
319  continue;
320 
321  unsigned int irsecondbin = secondvmstub.vmbits().value() >> 2;
322 
323  FPGAWord iphifirstbin = firstvmstub.finephi();
324  FPGAWord iphisecondbin = secondvmstub.finephi();
325 
326  unsigned int index = (irsecondbin << (secondphibits_ + firstphibits_)) +
327  (iphifirstbin.value() << secondphibits_) + iphisecondbin.value();
328 
329  FPGAWord firstbend = firstvmstub.bend();
330  FPGAWord secondbend = secondvmstub.bend();
331 
332  index = (index << firstbend.nbits()) + firstbend.value();
333  index = (index << secondbend.nbits()) + secondbend.value();
334 
336  (index >= table_.size() || table_.at(index).empty())) {
337  if (settings_.debugTracklet()) {
338  edm::LogVerbatim("Tracklet")
339  << "Stub pair rejected because of stub pt cut bends : "
340  << settings_.benddecode(firstvmstub.bend().value(), disk1_ + 5, firstvmstub.isPSmodule()) << " "
341  << settings_.benddecode(secondvmstub.bend().value(), disk2_ + 5, secondvmstub.isPSmodule());
342  }
343  continue;
344  }
345 
346  if (settings_.debugTracklet())
347  edm::LogVerbatim("Tracklet") << "Adding disk-disk pair in " << getName();
348 
349  for (unsigned int isp = 0; isp < stubpairs_.size(); ++isp) {
351  (index < table_.size() && table_.at(index).count(isp))) {
352  if (settings_.writeMonitorData("Seeds")) {
353  ofstream fout("seeds.txt", ofstream::app);
354  fout << __FILE__ << ":" << __LINE__ << " " << name_ << " " << iSeed_ << endl;
355  fout.close();
356  }
357  stubpairs_.at(isp)->addStubPair(firstvmstub, secondvmstub, index, getName());
358  }
359  }
360  countpass++;
361  }
362  }
363  }
364  }
365  }
366  if (countall > 5000) {
367  edm::LogVerbatim("Tracklet") << "In TrackletEngineDisplaced::execute : " << getName() << " " << nInnerStubs << " "
368  << secondvmstubs_->nVMStubs() << " " << countall << " " << countpass;
369  for (auto& iInnerMem : firstvmstubs_) {
370  for (unsigned int i = 0; i < iInnerMem->nVMStubs(); i++) {
371  const VMStubTE& firstvmstub = iInnerMem->getVMStubTE(i);
372  edm::LogVerbatim("Tracklet") << "In TrackletEngineDisplaced::execute first stub : "
373  << firstvmstub.stub()->l1tstub()->r() << " "
374  << firstvmstub.stub()->l1tstub()->phi() << " "
375  << firstvmstub.stub()->l1tstub()->r() * firstvmstub.stub()->l1tstub()->phi() << " "
376  << firstvmstub.stub()->l1tstub()->z();
377  }
378  }
379  for (unsigned int i = 0; i < secondvmstubs_->nVMStubs(); i++) {
380  const VMStubTE& secondvmstub = secondvmstubs_->getVMStubTE(i);
381  edm::LogVerbatim("Tracklet") << "In TrackletEngineDisplaced::execute second stub : "
382  << secondvmstub.stub()->l1tstub()->r() << " "
383  << secondvmstub.stub()->l1tstub()->phi() << " "
384  << secondvmstub.stub()->l1tstub()->r() * secondvmstub.stub()->l1tstub()->phi() << " "
385  << secondvmstub.stub()->l1tstub()->z();
386  }
387  }
388 
389  if (settings_.writeMonitorData("TED")) {
390  globals_->ofstream("trackletenginedisplaces.txt") << getName() << " " << countall << " " << countpass << endl;
391  }
392 }
Definition: start.py:1
Log< level::Info, true > LogVerbatim
const VMStubTE & getVMStubTEBinned(unsigned int bin, unsigned int i) const
double phi() const
Definition: L1TStub.h:65
unsigned int maxStep(std::string module) const
Definition: Settings.h:125
bool isPSmodule() const
Definition: VMStubTE.h:31
std::string name_
Definition: ProcessBase.h:38
bool enableTripletTables() const
Definition: Settings.h:214
const FPGAWord & bend() const
Definition: VMStubTE.h:25
Settings const & settings_
Definition: ProcessBase.h:40
double z() const
Definition: L1TStub.h:59
Globals * globals_
Definition: ProcessBase.h:41
assert(be >=bs)
const FPGAWord & disk() const
Definition: Stub.h:74
const Stub * stub() const
Definition: VMStubTE.h:29
const FPGAWord & vmbits() const
Definition: VMStubTE.h:27
int value() const
Definition: FPGAWord.h:24
L1TStub * l1tstub()
Definition: Stub.h:83
std::string const & getName() const
Definition: MemoryBase.h:19
bool writeMonitorData(std::string module) const
Definition: Settings.h:118
const FPGAWord & finephi() const
Definition: VMStubTE.h:23
bool debugTracklet() const
Definition: Settings.h:194
const VMStubTE & getVMStubTE(unsigned int i) const
unsigned int nVMStubs() const
std::vector< VMStubsTEMemory * > firstvmstubs_
int nbits() const
Definition: FPGAWord.h:25
std::vector< std::set< short > > table_
bool useSeed(unsigned int iSeed) const
Definition: Settings.h:103
unsigned int nVMStubsBinned(unsigned int bin) const
double r() const
Definition: L1TStub.h:60
std::ofstream & ofstream(std::string fname)
Definition: Globals.cc:44
std::vector< StubPairsMemory * > stubpairs_
std::string const & getName() const
Definition: ProcessBase.h:22
bool writeTripletTables() const
Definition: Settings.h:215
double benddecode(unsigned int ibend, unsigned int layerdisk, bool isPSmodule) const
Definition: Settings.h:443

◆ memNameToIndex()

short TrackletEngineDisplaced::memNameToIndex ( const std::string &  name)

Definition at line 417 of file TrackletEngineDisplaced.cc.

References Skims_PA_cff::name, and stubpairs_.

Referenced by readTables().

417  {
418  for (unsigned int isp = 0; isp < stubpairs_.size(); ++isp)
419  if (stubpairs_.at(isp)->getName() == name)
420  return isp;
421  return -1;
422 }
std::vector< StubPairsMemory * > stubpairs_

◆ readTables()

void TrackletEngineDisplaced::readTables ( )

Definition at line 394 of file TrackletEngineDisplaced.cc.

References Exception, groupFilesInBlocks::fin, recoMuon::in, mps_splice::line, memNameToIndex(), trklet::ProcessBase::name_, trklet::ProcessBase::settings_, table_, HLT_2024v14_cff::tableName, and trklet::Settings::tableTEDFile().

Referenced by execute().

394  {
395  ifstream fin;
396  string tableName, line, word;
397 
398  string tablePath = settings_.tableTEDFile();
399  unsigned int finddir = tablePath.find("table_TED_");
400  tableName = tablePath.substr(0, finddir) + "table_" + name_ + ".txt";
401 
402  fin.open(tableName, ifstream::in);
403  if (!fin) {
404  throw cms::Exception("BadConfig") << "TripletEngine::readTables, file " << tableName << " not known";
405  }
406 
407  while (getline(fin, line)) {
408  istringstream iss(line);
409  table_.resize(table_.size() + 1);
410 
411  while (iss >> word)
412  table_[table_.size() - 1].insert(memNameToIndex(word));
413  }
414  fin.close();
415 }
short memNameToIndex(const std::string &name)
std::string name_
Definition: ProcessBase.h:38
Settings const & settings_
Definition: ProcessBase.h:40
std::string const & tableTEDFile() const
Definition: Settings.h:79
uint64_t word
std::vector< std::set< short > > table_

Member Data Documentation

◆ disk1_

int trklet::TrackletEngineDisplaced::disk1_
private

Definition at line 38 of file TrackletEngineDisplaced.h.

Referenced by execute(), and TrackletEngineDisplaced().

◆ disk2_

int trklet::TrackletEngineDisplaced::disk2_
private

Definition at line 39 of file TrackletEngineDisplaced.h.

Referenced by execute(), and TrackletEngineDisplaced().

◆ firstphibits_

int trklet::TrackletEngineDisplaced::firstphibits_
private

Definition at line 48 of file TrackletEngineDisplaced.h.

Referenced by execute(), and TrackletEngineDisplaced().

◆ firstvmstubs_

std::vector<VMStubsTEMemory*> trklet::TrackletEngineDisplaced::firstvmstubs_
private

Definition at line 41 of file TrackletEngineDisplaced.h.

Referenced by addInput(), execute(), and TrackletEngineDisplaced().

◆ iSeed_

int trklet::TrackletEngineDisplaced::iSeed_
private

Definition at line 51 of file TrackletEngineDisplaced.h.

Referenced by execute(), and TrackletEngineDisplaced().

◆ layer1_

int trklet::TrackletEngineDisplaced::layer1_
private

Definition at line 36 of file TrackletEngineDisplaced.h.

Referenced by execute(), and TrackletEngineDisplaced().

◆ layer2_

int trklet::TrackletEngineDisplaced::layer2_
private

Definition at line 37 of file TrackletEngineDisplaced.h.

Referenced by execute(), and TrackletEngineDisplaced().

◆ secondphibits_

int trklet::TrackletEngineDisplaced::secondphibits_
private

Definition at line 49 of file TrackletEngineDisplaced.h.

Referenced by execute(), and TrackletEngineDisplaced().

◆ secondvmstubs_

VMStubsTEMemory* trklet::TrackletEngineDisplaced::secondvmstubs_
private

Definition at line 42 of file TrackletEngineDisplaced.h.

Referenced by addInput(), execute(), and TrackletEngineDisplaced().

◆ stubpairs_

std::vector<StubPairsMemory*> trklet::TrackletEngineDisplaced::stubpairs_
private

◆ table_

std::vector<std::set<short> > trklet::TrackletEngineDisplaced::table_
private

Definition at line 46 of file TrackletEngineDisplaced.h.

Referenced by execute(), readTables(), and ~TrackletEngineDisplaced().