CMS 3D CMS Logo

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

#include <TrackletProcessor.h>

Inheritance diagram for trklet::TrackletProcessor:
trklet::TrackletCalculatorBase trklet::ProcessBase

Public Member Functions

void addInput (MemoryBase *memory, std::string input) override
 
void addOutput (MemoryBase *memory, std::string output) override
 
void addOutputProjection (TrackletProjectionsMemory *&outputProj, MemoryBase *memory)
 
void execute ()
 
void setVMPhiBin ()
 
 TrackletProcessor (std::string name, Settings const &settings, Globals *globals, unsigned int iSector)
 
void writeTETable ()
 
 ~TrackletProcessor () override=default
 
- Public Member Functions inherited from trklet::TrackletCalculatorBase
void addDiskProj (Tracklet *tracklet, int disk)
 
bool addLayerProj (Tracklet *tracklet, int layer)
 
void addProjection (int layer, int iphi, TrackletProjectionsMemory *trackletprojs, Tracklet *tracklet)
 
void addProjectionDisk (int disk, int iphi, TrackletProjectionsMemory *trackletprojs, Tracklet *tracklet)
 
bool barrelSeeding (const Stub *innerFPGAStub, const L1TStub *innerStub, const Stub *outerFPGAStub, const L1TStub *outerStub)
 
bool diskSeeding (const Stub *innerFPGAStub, const L1TStub *innerStub, const Stub *outerFPGAStub, const L1TStub *outerStub)
 
void exactproj (double rproj, double rinv, double phi0, double t, double z0, double &phiproj, double &zproj, double &phider, double &zder)
 
void exactprojdisk (double zproj, double rinv, double phi0, double t, double z0, double &phiproj, double &rproj, double &phider, double &rder)
 
void exacttracklet (double r1, double z1, double phi1, double r2, double z2, double phi2, double, double &rinv, double &phi0, double &t, double &z0, double phiproj[N_LAYER - 2], double zproj[N_LAYER - 2], double phider[N_LAYER - 2], double zder[N_LAYER - 2], double phiprojdisk[N_DISK], double rprojdisk[N_DISK], double phiderdisk[N_DISK], double rderdisk[N_DISK])
 
void exacttrackletdisk (double r1, double z1, double phi1, double r2, double z2, double phi2, double, double &rinv, double &phi0, double &t, double &z0, double phiprojLayer[N_PSLAYER], double zprojLayer[N_PSLAYER], double phiderLayer[N_PSLAYER], double zderLayer[N_PSLAYER], double phiproj[N_DISK - 2], double rproj[N_DISK - 2], double phider[N_DISK - 2], double rder[N_DISK - 2])
 
void exacttrackletOverlap (double r1, double z1, double phi1, double r2, double z2, double phi2, double, double &rinv, double &phi0, double &t, double &z0, double phiprojLayer[N_PSLAYER], double zprojLayer[N_PSLAYER], double phiderLayer[N_PSLAYER], double zderLayer[N_PSLAYER], double phiproj[N_DISK - 2], double rproj[N_DISK - 2], double phider[N_DISK - 2], double rder[N_DISK - 2])
 
bool goodTrackPars (bool goodrinv, bool goodz0)
 
bool inSector (int iphi0, int irinv, double phi0approx, double rinvapprox)
 
bool overlapSeeding (const Stub *innerFPGAStub, const L1TStub *innerStub, const Stub *outerFPGAStub, const L1TStub *outerStub)
 
 TrackletCalculatorBase (std::string name, Settings const &settings, Globals *global, unsigned int iSector)
 
 ~TrackletCalculatorBase () override=default
 
- Public Member Functions inherited from trklet::ProcessBase
unsigned int getISeed (std::string name)
 
std::string const & getName () const
 
unsigned int initLayerDisk (unsigned int pos)
 
void initLayerDisk (unsigned int pos, int &layer, int &disk)
 
void initLayerDisk (unsigned int pos, int &layer, int &disk, int &layerdisk)
 
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, unsigned int iSector)
 
virtual ~ProcessBase ()=default
 

Private Attributes

bool extra_
 
std::vector< AllStubsMemory * > innerallstubs_
 
int innerphibits_
 
std::vector< VMStubsTEMemory * > innervmstubs_
 
int iTC_
 
std::vector< AllStubsMemory * > outerallstubs_
 
int outerphibits_
 
std::vector< VMStubsTEMemory * > outervmstubs_
 
std::map< unsigned int, std::vector< bool > > phitable_
 
std::map< unsigned int, std::vector< bool > > pttableinner_
 
std::map< unsigned int, std::vector< bool > > pttableouter_
 

Additional Inherited Members

- Protected Attributes inherited from trklet::TrackletCalculatorBase
int disk_
 
unsigned int iSeed_
 
int layer_
 
unsigned int layerdisk1_
 
unsigned int layerdisk2_
 
double phioffset_
 
int TCIndex_
 
TrackletParametersMemorytrackletpars_
 
std::vector< std::vector< TrackletProjectionsMemory * > > trackletprojdisks_
 
std::vector< std::vector< TrackletProjectionsMemory * > > trackletprojlayers_
 
- Protected Attributes inherited from trklet::ProcessBase
Globalsglobals_
 
unsigned int iSector_
 
std::string name_
 
double phimax_
 
double phimin_
 
Settings const & settings_
 

Detailed Description

Definition at line 21 of file TrackletProcessor.h.

Constructor & Destructor Documentation

◆ TrackletProcessor()

TrackletProcessor::TrackletProcessor ( std::string  name,
Settings const &  settings,
Globals globals,
unsigned int  iSector 
)

Definition at line 14 of file TrackletProcessor.cc.

15  : TrackletCalculatorBase(name, settings, globals, iSector) {
16  double dphi = 2 * M_PI / N_SECTOR;
17  double dphiHG = 0.5 * settings_.dphisectorHG() - M_PI / N_SECTOR;
18  phimin_ = iSector_ * dphi - dphiHG;
19  phimax_ = phimin_ + dphi + 2 * dphiHG;
20  phimin_ -= M_PI / N_SECTOR;
21  phimax_ -= M_PI / N_SECTOR;
24  if (phimin_ > phimax_)
25  phimin_ -= 2 * M_PI;
27 
28  for (unsigned int ilayer = 0; ilayer < N_LAYER; ilayer++) {
29  vector<TrackletProjectionsMemory*> tmp(settings_.nallstubs(ilayer), nullptr);
30  trackletprojlayers_.push_back(tmp);
31  }
32 
33  for (unsigned int idisk = 0; idisk < N_DISK; idisk++) {
34  vector<TrackletProjectionsMemory*> tmp(settings_.nallstubs(idisk + N_LAYER), nullptr);
35  trackletprojdisks_.push_back(tmp);
36  }
37 
39 
40  layer_ = 0;
41  disk_ = 0;
42 
43  if (name_[3] == 'L') {
44  layer_ = name_[4] - '0';
45  if (name_[5] == 'D')
46  disk_ = name_[6] - '0';
47  }
48  if (name_[3] == 'D')
49  disk_ = name_[4] - '0';
50 
51  extra_ = (layer_ == 2 && disk_ == 0);
52 
53  // set TC index
54  if (name_[7] == 'A')
55  iTC_ = 0;
56  else if (name_[7] == 'B')
57  iTC_ = 1;
58  else if (name_[7] == 'C')
59  iTC_ = 2;
60  else if (name_[7] == 'D')
61  iTC_ = 3;
62  else if (name_[7] == 'E')
63  iTC_ = 4;
64  else if (name_[7] == 'F')
65  iTC_ = 5;
66  else if (name_[7] == 'G')
67  iTC_ = 6;
68  else if (name_[7] == 'H')
69  iTC_ = 7;
70  else if (name_[7] == 'I')
71  iTC_ = 8;
72  else if (name_[7] == 'J')
73  iTC_ = 9;
74  else if (name_[7] == 'K')
75  iTC_ = 10;
76  else if (name_[7] == 'L')
77  iTC_ = 11;
78  else if (name_[7] == 'M')
79  iTC_ = 12;
80  else if (name_[7] == 'N')
81  iTC_ = 13;
82  else if (name_[7] == 'O')
83  iTC_ = 14;
84 
85  assert(iTC_ != -1);
86 
87  iSeed_ = 99;
88  if (name_.substr(3, 4) == "L1L2")
89  iSeed_ = 0;
90  else if (name_.substr(3, 4) == "L3L4")
91  iSeed_ = 2;
92  else if (name_.substr(3, 4) == "L5L6")
93  iSeed_ = 3;
94  else if (name_.substr(3, 4) == "D1D2")
95  iSeed_ = 4;
96  else if (name_.substr(3, 4) == "D3D4")
97  iSeed_ = 5;
98  else if (name_.substr(3, 4) == "D1L1")
99  iSeed_ = 6;
100  else if (name_.substr(3, 4) == "D1L2")
101  iSeed_ = 7;
102  else if (name_.substr(3, 4) == "L1D1")
103  iSeed_ = 6;
104  else if (name_.substr(3, 4) == "L2D1")
105  iSeed_ = 7;
106  else if (name_.substr(3, 4) == "L2L3")
107  iSeed_ = 1;
108 
109  assert(iSeed_ != 99);
110 
111  TCIndex_ = (iSeed_ << 4) + iTC_;
112  assert(TCIndex_ >= 0 && TCIndex_ <= (int)settings_.ntrackletmax());
113 
114  assert((layer_ != 0) || (disk_ != 0));
115 
116  if (settings_.usephicritapprox()) {
117  double phicritFactor =
119  if (std::abs(phicritFactor - 2.) > 0.25)
120  edm::LogPrint("Tracklet")
121  << "TrackletProcessor::TrackletProcessor phicrit approximation may be invalid! Please check.";
122  }
123 }

References funct::abs(), cms::cuda::assert(), trklet::TrackletCalculatorBase::disk_, trklet::Settings::dphisectorHG(), extra_, trklet::ProcessBase::globals_, trklet::ProcessBase::initLayerDisksandISeed(), trklet::ProcessBase::iSector_, trklet::TrackletCalculatorBase::iSeed_, iTC_, trklet::Globals::ITC_L1L2(), trklet::VarBase::K(), trklet::TrackletCalculatorBase::layer_, trklet::TrackletCalculatorBase::layerdisk1_, trklet::TrackletCalculatorBase::layerdisk2_, M_PI, trklet::N_DISK, trklet::N_LAYER, trklet::N_SECTOR, trklet::Settings::nallstubs(), trklet::ProcessBase::name_, trklet::Settings::ntrackletmax(), trklet::IMATH_TrackletCalculator::phi0_final, trklet::ProcessBase::phimax_, trklet::ProcessBase::phimin_, trklet::TrackletCalculatorBase::phioffset_, trklet::Settings::rcrit(), reco::reduceRange(), trklet::IMATH_TrackletCalculator::rinv_final, trklet::ProcessBase::settings_, trklet::TrackletCalculatorBase::TCIndex_, createJobs::tmp, trklet::TrackletCalculatorBase::trackletprojdisks_, trklet::TrackletCalculatorBase::trackletprojlayers_, and trklet::Settings::usephicritapprox().

◆ ~TrackletProcessor()

trklet::TrackletProcessor::~TrackletProcessor ( )
overridedefault

Member Function Documentation

◆ addInput()

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

Implements trklet::ProcessBase.

Definition at line 172 of file TrackletProcessor.cc.

172  {
173  if (settings_.writetrace()) {
174  edm::LogVerbatim("Tracklet") << "In " << name_ << " adding input from " << memory->getName() << " to input "
175  << input;
176  }
177 
178  if (input == "innervmstubin") {
179  auto* tmp = dynamic_cast<VMStubsTEMemory*>(memory);
180  assert(tmp != nullptr);
181  innervmstubs_.push_back(tmp);
182  setVMPhiBin();
183  return;
184  }
185  if (input == "outervmstubin") {
186  auto* tmp = dynamic_cast<VMStubsTEMemory*>(memory);
187  assert(tmp != nullptr);
188  outervmstubs_.push_back(tmp);
189  setVMPhiBin();
190  return;
191  }
192  if (input == "innerallstubin") {
193  auto* tmp = dynamic_cast<AllStubsMemory*>(memory);
194  assert(tmp != nullptr);
195  innerallstubs_.push_back(tmp);
196  return;
197  }
198  if (input == "outerallstubin") {
199  auto* tmp = dynamic_cast<AllStubsMemory*>(memory);
200  assert(tmp != nullptr);
201  outerallstubs_.push_back(tmp);
202  return;
203  }
204  throw cms::Exception("BadConfig") << __FILE__ << " " << __LINE__ << " Could not find input : " << input;
205 }

References cms::cuda::assert(), Exception, innerallstubs_, innervmstubs_, input, trklet::ProcessBase::name_, outerallstubs_, outervmstubs_, trklet::ProcessBase::settings_, setVMPhiBin(), createJobs::tmp, and trklet::Settings::writetrace().

◆ addOutput()

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

Implements trklet::ProcessBase.

Definition at line 130 of file TrackletProcessor.cc.

130  {
131  if (settings_.writetrace()) {
132  edm::LogVerbatim("Tracklet") << "In " << name_ << " adding output to " << memory->getName() << " to output "
133  << output;
134  }
135  if (output == "trackpar") {
136  auto* tmp = dynamic_cast<TrackletParametersMemory*>(memory);
137  assert(tmp != nullptr);
138  trackletpars_ = tmp;
139  return;
140  }
141 
142  if (output.substr(0, 7) == "projout") {
143  //output is on the form 'projoutL2PHIC' or 'projoutD3PHIB'
144  auto* tmp = dynamic_cast<TrackletProjectionsMemory*>(memory);
145  assert(tmp != nullptr);
146 
147  unsigned int layerdisk = output[8] - '1'; //layer or disk counting from 0
148  unsigned int phiregion = output[12] - 'A'; //phiregion counting from 0
149 
150  if (output[7] == 'L') {
151  assert(layerdisk < N_LAYER);
152  assert(phiregion < trackletprojlayers_[layerdisk].size());
153  //check that phiregion not already initialized
154  assert(trackletprojlayers_[layerdisk][phiregion] == nullptr);
155  trackletprojlayers_[layerdisk][phiregion] = tmp;
156  return;
157  }
158 
159  if (output[7] == 'D') {
160  assert(layerdisk < N_DISK);
161  assert(phiregion < trackletprojdisks_[layerdisk].size());
162  //check that phiregion not already initialized
163  assert(trackletprojdisks_[layerdisk][phiregion] == nullptr);
164  trackletprojdisks_[layerdisk][phiregion] = tmp;
165  return;
166  }
167  }
168 
169  throw cms::Exception("BadConfig") << __FILE__ << " " << __LINE__ << " Could not find output : " << output;
170 }

References cms::cuda::assert(), Exception, trklet::N_DISK, trklet::N_LAYER, trklet::ProcessBase::name_, convertSQLitetoXML_cfg::output, trklet::ProcessBase::settings_, findQualityFiles::size, createJobs::tmp, trklet::TrackletCalculatorBase::trackletpars_, trklet::TrackletCalculatorBase::trackletprojdisks_, trklet::TrackletCalculatorBase::trackletprojlayers_, and trklet::Settings::writetrace().

◆ addOutputProjection()

void TrackletProcessor::addOutputProjection ( TrackletProjectionsMemory *&  outputProj,
MemoryBase memory 
)

Definition at line 125 of file TrackletProcessor.cc.

125  {
126  outputProj = dynamic_cast<TrackletProjectionsMemory*>(memory);
127  assert(outputProj != nullptr);
128 }

References cms::cuda::assert().

◆ execute()

void TrackletProcessor::execute ( void  )

Definition at line 207 of file TrackletProcessor.cc.

207  {
208  unsigned int countall = 0;
209  unsigned int countsel = 0;
210 
211  unsigned int countteall = 0;
212  unsigned int counttepass = 0;
213 
214  StubPairsMemory stubpairs("tmp", settings_, iSector_); //dummy arguments for now
215 
216  bool print = false;
217 
218  assert(innervmstubs_.size() == outervmstubs_.size());
219 
220  if (!settings_.useSeed(iSeed_))
221  return;
222 
223  for (unsigned int ivmmem = 0; ivmmem < innervmstubs_.size(); ivmmem++) {
224  unsigned int innerphibin = innervmstubs_[ivmmem]->phibin();
225  unsigned int outerphibin = outervmstubs_[ivmmem]->phibin();
226 
227  unsigned phiindex = 32 * innerphibin + outerphibin;
228 
229  //overlap seeding
230  if (disk_ == 1 && (layer_ == 1 || layer_ == 2)) {
231  for (unsigned int i = 0; i < innervmstubs_[ivmmem]->nVMStubs(); i++) {
232  const VMStubTE& innervmstub = innervmstubs_[ivmmem]->getVMStubTE(i);
233 
234  int lookupbits = innervmstub.vmbits().value();
235 
236  int rdiffmax = (lookupbits >> 7);
237  int newbin = (lookupbits & 127);
238  int bin = newbin / 8;
239 
240  int rbinfirst = newbin & 7;
241 
242  int start = (bin >> 1);
243  int last = start + (bin & 1);
244 
245  for (int ibin = start; ibin <= last; ibin++) {
246  if (settings_.debugTracklet()) {
247  edm::LogVerbatim("Tracklet") << getName() << " looking for matching stub in bin " << ibin << " with "
248  << outervmstubs_[ivmmem]->nVMStubsBinned(ibin) << " stubs";
249  }
250  for (unsigned int j = 0; j < outervmstubs_[ivmmem]->nVMStubsBinned(ibin); j++) {
251  countall++;
252  countteall++;
253 
254  const VMStubTE& outervmstub = outervmstubs_[ivmmem]->getVMStubTEBinned(ibin, j);
255  int rbin = (outervmstub.vmbits().value() & 7);
256  if (start != ibin)
257  rbin += 8;
258  if ((rbin < rbinfirst) || (rbin - rbinfirst > rdiffmax)) {
259  if (settings_.debugTracklet()) {
260  edm::LogVerbatim("Tracklet")
261  << getName() << " layer-disk stub pair rejected because rbin cut : " << rbin << " " << rbinfirst
262  << " " << rdiffmax;
263  }
264  continue;
265  }
266 
267  int ir = ((start & 3) << 3) + rbinfirst;
268 
269  assert(innerphibits_ != -1);
270  assert(outerphibits_ != -1);
271 
272  FPGAWord iphiinnerbin = innervmstub.finephi();
273  FPGAWord iphiouterbin = outervmstub.finephi();
274 
275  assert(iphiouterbin == outervmstub.finephi());
276 
277  unsigned int index = (((iphiinnerbin.value() << outerphibits_) + iphiouterbin.value()) << 5) + ir;
278 
279  assert(index < phitable_[phiindex].size());
280 
281  if (!phitable_[phiindex][index]) {
282  if (settings_.debugTracklet()) {
283  edm::LogVerbatim("Tracklet") << "Stub pair rejected because of tracklet pt cut";
284  }
285  continue;
286  }
287 
288  FPGAWord innerbend = innervmstub.bend();
289  FPGAWord outerbend = outervmstub.bend();
290 
291  int ptinnerindex = (index << innerbend.nbits()) + innerbend.value();
292  int ptouterindex = (index << outerbend.nbits()) + outerbend.value();
293 
294  if (!(pttableinner_[phiindex][ptinnerindex] && pttableouter_[phiindex][ptouterindex])) {
295  if (settings_.debugTracklet()) {
296  edm::LogVerbatim("Tracklet") << "Stub pair rejected because of stub pt cut bends : "
297  << benddecode(innervmstub.bend().value(), innervmstub.isPSmodule()) << " "
298  << benddecode(outervmstub.bend().value(), outervmstub.isPSmodule());
299  }
300  continue;
301  }
302 
303  if (settings_.debugTracklet())
304  edm::LogVerbatim("Tracklet") << "Adding layer-disk pair in " << getName();
305  if (settings_.writeMonitorData("Seeds")) {
306  ofstream fout("seeds.txt", ofstream::app);
307  fout << __FILE__ << ":" << __LINE__ << " " << name_ << "_" << iSector_ << " " << iSeed_ << endl;
308  fout.close();
309  }
310  stubpairs.addStubPair(
311  innervmstub, outervmstub, 0, innervmstubs_[ivmmem]->getName() + " " + outervmstubs_[ivmmem]->getName());
312  counttepass++;
313  countall++;
314  }
315  }
316  }
317 
318  } else {
319  for (unsigned int i = 0; i < innervmstubs_[ivmmem]->nVMStubs(); i++) {
320  if (settings_.debugTracklet()) {
321  edm::LogVerbatim("Tracklet") << "In " << getName() << " have inner stub";
322  }
323 
324  if ((layer_ == 1 && disk_ == 0) || (layer_ == 2 && disk_ == 0) || (layer_ == 3 && disk_ == 0) ||
325  (layer_ == 5 && disk_ == 0)) {
326  const VMStubTE& innervmstub = innervmstubs_[ivmmem]->getVMStubTE(i);
327 
328  int lookupbits = (int)innervmstub.vmbits().value();
329  int zdiffmax = (lookupbits >> 7);
330  int newbin = (lookupbits & 127);
331  int bin = newbin / 8;
332 
333  int zbinfirst = newbin & 7;
334 
335  int start = (bin >> 1);
336  int last = start + (bin & 1);
337 
338  if (print) {
339  edm::LogVerbatim("Tracklet") << "start last : " << start << " " << last;
340  }
341 
342  if (settings_.debugTracklet()) {
343  edm::LogVerbatim("Tracklet") << "Will look in zbins " << start << " to " << last;
344  }
345  for (int ibin = start; ibin <= last; ibin++) {
346  for (unsigned int j = 0; j < outervmstubs_[ivmmem]->nVMStubsBinned(ibin); j++) {
347  if (settings_.debugTracklet()) {
348  edm::LogVerbatim("Tracklet") << "In " << getName() << " have outer stub";
349  }
350 
351  countteall++;
352  countall++;
353 
354  const VMStubTE& outervmstub = outervmstubs_[ivmmem]->getVMStubTEBinned(ibin, j);
355 
356  int zbin = (outervmstub.vmbits().value() & 7);
357 
358  if (start != ibin)
359  zbin += 8;
360 
361  if (zbin < zbinfirst || zbin - zbinfirst > zdiffmax) {
362  if (settings_.debugTracklet()) {
363  edm::LogVerbatim("Tracklet") << "Stubpair rejected because of wrong fine z";
364  }
365  continue;
366  }
367 
368  if (print) {
369  edm::LogVerbatim("Tracklet") << "ibin j " << ibin << " " << j;
370  }
371 
372  assert(innerphibits_ != -1);
373  assert(outerphibits_ != -1);
374 
375  FPGAWord iphiinnerbin = innervmstub.finephi();
376  FPGAWord iphiouterbin = outervmstub.finephi();
377 
378  int index = (iphiinnerbin.value() << outerphibits_) + iphiouterbin.value();
379 
380  assert(index < (int)phitable_[phiindex].size());
381 
382  if (!phitable_[phiindex][index]) {
383  if (settings_.debugTracklet()) {
384  edm::LogVerbatim("Tracklet") << "Stub pair rejected because of tracklet pt cut";
385  }
386  continue;
387  }
388 
389  FPGAWord innerbend = innervmstub.bend();
390  FPGAWord outerbend = outervmstub.bend();
391 
392  int ptinnerindex = (index << innerbend.nbits()) + innerbend.value();
393  int ptouterindex = (index << outerbend.nbits()) + outerbend.value();
394 
395  if (!(pttableinner_[phiindex][ptinnerindex] && pttableouter_[phiindex][ptouterindex])) {
396  if (settings_.debugTracklet()) {
397  edm::LogVerbatim("Tracklet")
398  << "Stub pair rejected because of stub pt cut bends : "
399  << benddecode(innervmstub.bend().value(), innervmstub.isPSmodule()) << " "
400  << benddecode(outervmstub.bend().value(), outervmstub.isPSmodule());
401  }
402  continue;
403  }
404 
405  if (settings_.debugTracklet())
406  edm::LogVerbatim("Tracklet") << "Adding layer-layer pair in " << getName();
407  if (settings_.writeMonitorData("Seeds")) {
408  ofstream fout("seeds.txt", ofstream::app);
409  fout << __FILE__ << ":" << __LINE__ << " " << name_ << "_" << iSector_ << " " << iSeed_ << endl;
410  fout.close();
411  }
412  stubpairs.addStubPair(innervmstub,
413  outervmstub,
414  0,
415  innervmstubs_[ivmmem]->getName() + " " + outervmstubs_[ivmmem]->getName());
416  counttepass++;
417  countall++;
418  }
419  }
420 
421  } else if ((disk_ == 1 && layer_ == 0) || (disk_ == 3 && layer_ == 0)) {
422  if (settings_.debugTracklet())
423  edm::LogVerbatim("Tracklet") << getName() << "[" << iSector_ << "] Disk-disk pair";
424 
425  const VMStubTE& innervmstub = innervmstubs_[ivmmem]->getVMStubTE(i);
426 
427  int lookupbits = (int)innervmstub.vmbits().value();
428  bool negdisk = innervmstub.stub()->disk().value() < 0; //TODO - need to store negative disk
429  int rdiffmax = (lookupbits >> 6);
430  int newbin = (lookupbits & 63);
431  int bin = newbin / 8;
432 
433  int rbinfirst = newbin & 7;
434 
435  int start = (bin >> 1);
436  if (negdisk)
437  start += 4;
438  int last = start + (bin & 1);
439  for (int ibin = start; ibin <= last; ibin++) {
440  if (settings_.debugTracklet())
441  edm::LogVerbatim("Tracklet") << getName() << " looking for matching stub in bin " << ibin << " with "
442  << outervmstubs_[ivmmem]->nVMStubsBinned(ibin) << " stubs";
443  for (unsigned int j = 0; j < outervmstubs_[ivmmem]->nVMStubsBinned(ibin); j++) {
444  countall++;
445  countteall++;
446 
447  const VMStubTE& outervmstub = outervmstubs_[ivmmem]->getVMStubTEBinned(ibin, j);
448 
449  int vmbits = (int)outervmstub.vmbits().value();
450  int rbin = (vmbits & 7);
451  if (start != ibin)
452  rbin += 8;
453  if (rbin < rbinfirst)
454  continue;
455  if (rbin - rbinfirst > rdiffmax)
456  continue;
457 
458  int rzbin = outervmstub.vmbits().bits(0, 3);
459 
460  FPGAWord iphiinnerbin = innervmstub.finephi();
461  FPGAWord iphiouterbin = outervmstub.finephi();
462 
463  unsigned int index = (iphiinnerbin.value() << outerphibits_) + iphiouterbin.value();
464 
465  constexpr unsigned int n_barrelseed = 3;
466  if (iSeed_ > n_barrelseed) { //Also use r-position for disk/overlap seeds
467  int ir = ((ibin & n_barrelseed) << 1) + (rzbin >> 2);
468  index = (index << n_barrelseed) + ir;
469  }
470 
471  FPGAWord innerbend = innervmstub.bend();
472  FPGAWord outerbend = outervmstub.bend();
473 
474  unsigned int ptinnerindex = (index << innerbend.nbits()) + innerbend.value();
475  unsigned int ptouterindex = (index << outerbend.nbits()) + outerbend.value();
476 
477  assert(ptinnerindex < pttableinner_[phiindex].size());
478  assert(ptouterindex < pttableouter_[phiindex].size());
479 
480  if (!(pttableinner_[phiindex][ptinnerindex] && pttableouter_[phiindex][ptouterindex])) {
481  if (settings_.debugTracklet()) {
482  edm::LogVerbatim("Tracklet")
483  << "Stub pair rejected because of stub pt cut bends : "
484  << benddecode(innervmstub.bend().value(), innervmstub.isPSmodule()) << " "
485  << benddecode(outervmstub.bend().value(), outervmstub.isPSmodule())
486  << " pass : " << pttableinner_[phiindex][ptinnerindex] << " "
487  << pttableouter_[phiindex][ptouterindex];
488  }
489  }
490 
491  if (settings_.debugTracklet())
492  edm::LogVerbatim("Tracklet") << "Adding disk-disk pair in " << getName();
493 
494  if (settings_.writeMonitorData("Seeds")) {
495  ofstream fout("seeds.txt", ofstream::app);
496  fout << __FILE__ << ":" << __LINE__ << " " << name_ << "_" << iSector_ << " " << iSeed_ << endl;
497  fout.close();
498  }
499  stubpairs.addStubPair(innervmstub,
500  outervmstub,
501  0,
502  innervmstubs_[ivmmem]->getName() + " " + outervmstubs_[ivmmem]->getName());
503  countall++;
504  counttepass++;
505  }
506  }
507  }
508  }
509  }
510  }
511 
512  if (settings_.writeMonitorData("TE")) {
513  globals_->ofstream("trackletprocessor.txt") << getName() << " " << countteall << " " << counttepass << endl;
514  }
515 
516  for (unsigned int i = 0; i < stubpairs.nStubPairs(); i++) {
518  edm::LogVerbatim("Tracklet") << "Will break on too many tracklets in " << getName();
519  break;
520  }
521  countall++;
522  const Stub* innerFPGAStub = stubpairs.getVMStub1(i).stub();
523  const L1TStub* innerStub = innerFPGAStub->l1tstub();
524 
525  const Stub* outerFPGAStub = stubpairs.getVMStub2(i).stub();
526  const L1TStub* outerStub = outerFPGAStub->l1tstub();
527 
528  if (settings_.debugTracklet()) {
529  edm::LogVerbatim("Tracklet") << "TrackletProcessor execute " << getName() << "[" << iSector_ << "]";
530  }
531 
532  bool accept = false;
533 
534  if (innerFPGAStub->isBarrel() && (getName() != "TC_D1L2A" && getName() != "TC_D1L2B")) {
535  if (outerFPGAStub->isDisk()) {
536  //overlap seeding
537  accept = overlapSeeding(outerFPGAStub, outerStub, innerFPGAStub, innerStub);
538  } else {
539  //barrel+barrel seeding
540  accept = barrelSeeding(innerFPGAStub, innerStub, outerFPGAStub, outerStub);
541  }
542  } else {
543  if (outerFPGAStub->isDisk()) {
544  //disk+disk seeding
545  accept = diskSeeding(innerFPGAStub, innerStub, outerFPGAStub, outerStub);
546  } else if (innerFPGAStub->isDisk()) {
547  //layer+disk seeding
548  accept = overlapSeeding(innerFPGAStub, innerStub, outerFPGAStub, outerStub);
549  } else {
550  throw cms::Exception("LogicError") << __FILE__ << " " << __LINE__ << " Invalid seeding!";
551  }
552  }
553 
554  if (accept)
555  countsel++;
556 
557  if (settings_.writeMonitorData("TP")) {
558  globals_->ofstream("tc_seedpairs.txt") << stubpairs.getTEDName(i) << " " << accept << endl;
559  }
560 
562  edm::LogVerbatim("Tracklet") << "Will break on number of tracklets in " << getName();
563  break;
564  }
565 
566  if (countall >= settings_.maxStep("TP")) {
567  if (settings_.debugTracklet())
568  edm::LogVerbatim("Tracklet") << "Will break on MAXTC 1";
569  break;
570  }
571  if (settings_.debugTracklet()) {
572  edm::LogVerbatim("Tracklet") << "TrackletProcessor execute done";
573  }
574  }
575  if (countall >= settings_.maxStep("TP")) {
576  if (settings_.debugTracklet())
577  edm::LogVerbatim("Tracklet") << "Will break on MAXTC 2";
578  //break;
579  }
580 
581  if (settings_.writeMonitorData("TP")) {
582  globals_->ofstream("trackletcalculator.txt") << getName() << " " << countall << " " << countsel << endl;
583  }
584 }

References accept(), trklet::StubPairsMemory::addStubPair(), cms::cuda::assert(), trklet::TrackletCalculatorBase::barrelSeeding(), trklet::VMStubTE::bend(), trklet::benddecode(), newFWLiteAna::bin, trklet::FPGAWord::bits(), trklet::Settings::debugTracklet(), trklet::Stub::disk(), trklet::TrackletCalculatorBase::disk_, trklet::TrackletCalculatorBase::diskSeeding(), Exception, trklet::VMStubTE::finephi(), groupFilesInBlocks::fout, trklet::ProcessBase::getName(), trklet::StubPairsMemory::getTEDName(), trklet::StubPairsMemory::getVMStub1(), trklet::StubPairsMemory::getVMStub2(), trklet::ProcessBase::globals_, mps_fire::i, innerphibits_, innervmstubs_, createfilelist::int, trklet::Stub::isBarrel(), trklet::Stub::isDisk(), trklet::ProcessBase::iSector_, trklet::TrackletCalculatorBase::iSeed_, trklet::VMStubTE::isPSmodule(), dqmiolumiharvest::j, trklet::Stub::l1tstub(), dqmdumpme::last, trklet::TrackletCalculatorBase::layer_, trklet::Settings::maxStep(), trklet::ProcessBase::name_, trklet::FPGAWord::nbits(), trklet::StubPairsMemory::nStubPairs(), trklet::Settings::ntrackletmax(), trklet::TrackletParametersMemory::nTracklets(), trklet::Globals::ofstream(), outerphibits_, outervmstubs_, trklet::TrackletCalculatorBase::overlapSeeding(), phitable_, edm::print(), pttableinner_, pttableouter_, trklet::ProcessBase::settings_, findQualityFiles::size, trklet::VMStubTE::stub(), trklet::TrackletCalculatorBase::trackletpars_, trklet::Settings::useSeed(), trklet::FPGAWord::value(), trklet::VMStubTE::vmbits(), and trklet::Settings::writeMonitorData().

◆ setVMPhiBin()

void TrackletProcessor::setVMPhiBin ( )

Definition at line 586 of file TrackletProcessor.cc.

586  {
587  if (innervmstubs_.size() != outervmstubs_.size())
588  return;
589 
590  for (unsigned int ivmmem = 0; ivmmem < innervmstubs_.size(); ivmmem++) {
591  unsigned int innerphibin = innervmstubs_[ivmmem]->phibin();
592  unsigned int outerphibin = outervmstubs_[ivmmem]->phibin();
593 
594  unsigned phiindex = 32 * innerphibin + outerphibin;
595 
596  if (phitable_.find(phiindex) != phitable_.end())
597  continue;
598 
599  innervmstubs_[ivmmem]->setother(outervmstubs_[ivmmem]);
600  outervmstubs_[ivmmem]->setother(innervmstubs_[ivmmem]);
601 
602  if ((layer_ == 1 && disk_ == 0) || (layer_ == 2 && disk_ == 0) || (layer_ == 3 && disk_ == 0) ||
603  (layer_ == 5 && disk_ == 0)) {
606 
607  int innerphibins = (1 << innerphibits_);
608  int outerphibins = (1 << outerphibits_);
609 
610  double innerphimin, innerphimax;
611  innervmstubs_[ivmmem]->getPhiRange(innerphimin, innerphimax, iSeed_, 0);
612  double rinner = settings_.rmean(layer_ - 1);
613 
614  double outerphimin, outerphimax;
615  outervmstubs_[ivmmem]->getPhiRange(outerphimin, outerphimax, iSeed_, 1);
616  double router = settings_.rmean(layer_);
617 
618  double phiinner[2];
619  double phiouter[2];
620 
621  std::vector<bool> vmbendinner;
622  std::vector<bool> vmbendouter;
623  unsigned int nbins1 = 8;
624  if (layer_ >= 4)
625  nbins1 = 16;
626  for (unsigned int i = 0; i < nbins1; i++) {
627  vmbendinner.push_back(false);
628  }
629 
630  unsigned int nbins2 = 8;
631  if (layer_ >= 3)
632  nbins2 = 16;
633  for (unsigned int i = 0; i < nbins2; i++) {
634  vmbendouter.push_back(false);
635  }
636 
637  for (int iphiinnerbin = 0; iphiinnerbin < innerphibins; iphiinnerbin++) {
638  phiinner[0] = innerphimin + iphiinnerbin * (innerphimax - innerphimin) / innerphibins;
639  phiinner[1] = innerphimin + (iphiinnerbin + 1) * (innerphimax - innerphimin) / innerphibins;
640  for (int iphiouterbin = 0; iphiouterbin < outerphibins; iphiouterbin++) {
641  phiouter[0] = outerphimin + iphiouterbin * (outerphimax - outerphimin) / outerphibins;
642  phiouter[1] = outerphimin + (iphiouterbin + 1) * (outerphimax - outerphimin) / outerphibins;
643 
644  double bendinnermin = 20.0;
645  double bendinnermax = -20.0;
646  double bendoutermin = 20.0;
647  double bendoutermax = -20.0;
648  double rinvmin = 1.0;
649  for (int i1 = 0; i1 < 2; i1++) {
650  for (int i2 = 0; i2 < 2; i2++) {
651  double rinv1 = rinv(phiinner[i1], phiouter[i2], rinner, router);
652  double pitchinner =
653  (rinner < settings_.rcrit()) ? settings_.stripPitch(true) : settings_.stripPitch(false);
654  double pitchouter =
655  (router < settings_.rcrit()) ? settings_.stripPitch(true) : settings_.stripPitch(false);
656  double abendinner = -bend(rinner, rinv1, pitchinner);
657  double abendouter = -bend(router, rinv1, pitchouter);
658  if (abendinner < bendinnermin)
659  bendinnermin = abendinner;
660  if (abendinner > bendinnermax)
661  bendinnermax = abendinner;
662  if (abendouter < bendoutermin)
663  bendoutermin = abendouter;
664  if (abendouter > bendoutermax)
665  bendoutermax = abendouter;
666  if (std::abs(rinv1) < rinvmin) {
667  rinvmin = std::abs(rinv1);
668  }
669  }
670  }
671 
672  phitable_[phiindex].push_back(rinvmin < settings_.rinvcutte());
673 
674  int nbins1 = 8;
675  if (layer_ >= 4)
676  nbins1 = 16;
677  for (int ibend = 0; ibend < nbins1; ibend++) {
678  double bend = benddecode(ibend, layer_ <= 3);
679 
680  bool passinner = bend - bendinnermin > -settings_.bendcutte(0, iSeed_) &&
681  bend - bendinnermax < settings_.bendcutte(0, iSeed_);
682  if (passinner)
683  vmbendinner[ibend] = true;
684  pttableinner_[phiindex].push_back(passinner);
685  }
686 
687  int nbins2 = 8;
688  if (layer_ >= 3)
689  nbins2 = 16;
690  for (int ibend = 0; ibend < nbins2; ibend++) {
691  double bend = benddecode(ibend, layer_ <= 2);
692 
693  bool passouter = bend - bendoutermin > -settings_.bendcutte(1, iSeed_) &&
694  bend - bendoutermax < settings_.bendcutte(1, iSeed_);
695  if (passouter)
696  vmbendouter[ibend] = true;
697  pttableouter_[phiindex].push_back(passouter);
698  }
699  }
700  }
701 
702  innervmstubs_[ivmmem]->setbendtable(vmbendinner);
703  outervmstubs_[ivmmem]->setbendtable(vmbendouter);
704 
705  if (iSector_ == 0 && settings_.writeTable())
706  writeTETable();
707  }
708 
709  if ((disk_ == 1 && layer_ == 0) || (disk_ == 3 && layer_ == 0)) {
712 
713  int outerrbits = 3;
714 
715  int outerrbins = (1 << outerrbits);
716  int innerphibins = (1 << innerphibits_);
717  int outerphibins = (1 << outerphibits_);
718 
719  double innerphimin, innerphimax;
720  innervmstubs_[ivmmem]->getPhiRange(innerphimin, innerphimax, iSeed_, 0);
721 
722  double outerphimin, outerphimax;
723  outervmstubs_[ivmmem]->getPhiRange(outerphimin, outerphimax, iSeed_, 1);
724 
725  double phiinner[2];
726  double phiouter[2];
727  double router[2];
728 
729  std::vector<bool> vmbendinner;
730  std::vector<bool> vmbendouter;
731 
732  for (unsigned int i = 0; i < 8; i++) {
733  vmbendinner.push_back(false);
734  vmbendouter.push_back(false);
735  }
736 
737  for (int irouterbin = 0; irouterbin < outerrbins; irouterbin++) {
738  router[0] =
739  settings_.rmindiskvm() + irouterbin * (settings_.rmaxdiskvm() - settings_.rmindiskvm()) / outerrbins;
740  router[1] =
741  settings_.rmindiskvm() + (irouterbin + 1) * (settings_.rmaxdiskvm() - settings_.rmindiskvm()) / outerrbins;
742  for (int iphiinnerbin = 0; iphiinnerbin < innerphibins; iphiinnerbin++) {
743  phiinner[0] = innerphimin + iphiinnerbin * (innerphimax - innerphimin) / innerphibins;
744  phiinner[1] = innerphimin + (iphiinnerbin + 1) * (innerphimax - innerphimin) / innerphibins;
745  for (int iphiouterbin = 0; iphiouterbin < outerphibins; iphiouterbin++) {
746  phiouter[0] = outerphimin + iphiouterbin * (outerphimax - outerphimin) / outerphibins;
747  phiouter[1] = outerphimin + (iphiouterbin + 1) * (outerphimax - outerphimin) / outerphibins;
748 
749  double bendinnermin = 20.0;
750  double bendinnermax = -20.0;
751  double bendoutermin = 20.0;
752  double bendoutermax = -20.0;
753  double rinvmin = 1.0;
754  double rinvmax = -1.0;
755  for (int i1 = 0; i1 < 2; i1++) {
756  for (int i2 = 0; i2 < 2; i2++) {
757  for (int i3 = 0; i3 < 2; i3++) {
758  double rinner = router[i3] * settings_.zmean(disk_ - 1) / settings_.zmean(disk_);
759  double rinv1 = rinv(phiinner[i1], phiouter[i2], rinner, router[i3]);
760  double pitchinner =
761  (rinner < settings_.rcrit()) ? settings_.stripPitch(true) : settings_.stripPitch(false);
762  double pitchouter =
763  (router[i3] < settings_.rcrit()) ? settings_.stripPitch(true) : settings_.stripPitch(false);
764  double abendinner = bend(rinner, rinv1, pitchinner);
765  double abendouter = bend(router[i3], rinv1, pitchouter);
766  if (abendinner < bendinnermin)
767  bendinnermin = abendinner;
768  if (abendinner > bendinnermax)
769  bendinnermax = abendinner;
770  if (abendouter < bendoutermin)
771  bendoutermin = abendouter;
772  if (abendouter > bendoutermax)
773  bendoutermax = abendouter;
774  if (std::abs(rinv1) < rinvmin) {
775  rinvmin = std::abs(rinv1);
776  }
777  if (std::abs(rinv1) > rinvmax) {
778  rinvmax = std::abs(rinv1);
779  }
780  }
781  }
782  }
783 
784  phitable_[phiindex].push_back(rinvmin < settings_.rinvcutte());
785 
786  for (int ibend = 0; ibend < 8; ibend++) {
787  double bend = benddecode(ibend, true);
788 
789  bool passinner = bend - bendinnermin > -settings_.bendcutte(0, iSeed_) &&
790  bend - bendinnermax < settings_.bendcutte(0, iSeed_);
791  if (passinner)
792  vmbendinner[ibend] = true;
793  pttableinner_[phiindex].push_back(passinner);
794  }
795 
796  for (int ibend = 0; ibend < 8; ibend++) {
797  double bend = benddecode(ibend, true);
798 
799  bool passouter = bend - bendoutermin > -settings_.bendcutte(1, iSeed_) &&
800  bend - bendoutermax < settings_.bendcutte(1, iSeed_);
801  if (passouter)
802  vmbendouter[ibend] = true;
803  pttableouter_[phiindex].push_back(passouter);
804  }
805  }
806  }
807  }
808 
809  innervmstubs_[ivmmem]->setbendtable(vmbendinner);
810  outervmstubs_[ivmmem]->setbendtable(vmbendouter);
811 
812  if (iSector_ == 0 && settings_.writeTable())
813  writeTETable();
814 
815  } else if (disk_ == 1 && (layer_ == 1 || layer_ == 2)) {
818  unsigned int nrbits = 5;
819 
820  int innerphibins = (1 << innerphibits_);
821  int outerphibins = (1 << outerphibits_);
822 
823  double innerphimin, innerphimax;
824  innervmstubs_[ivmmem]->getPhiRange(innerphimin, innerphimax, iSeed_, 0);
825 
826  double outerphimin, outerphimax;
827  outervmstubs_[ivmmem]->getPhiRange(outerphimin, outerphimax, iSeed_, 1);
828 
829  double phiinner[2];
830  double phiouter[2];
831  double router[2];
832 
833  std::vector<bool> vmbendinner;
834  std::vector<bool> vmbendouter;
835 
836  for (unsigned int i = 0; i < 8; i++) {
837  vmbendinner.push_back(false);
838  vmbendouter.push_back(false);
839  }
840 
841  double dr = (settings_.rmaxdiskvm() - settings_.rmindiskvm()) / (1 << nrbits);
842 
843  for (int iphiinnerbin = 0; iphiinnerbin < innerphibins; iphiinnerbin++) {
844  phiinner[0] = innerphimin + iphiinnerbin * (innerphimax - innerphimin) / innerphibins;
845  phiinner[1] = innerphimin + (iphiinnerbin + 1) * (innerphimax - innerphimin) / innerphibins;
846  for (int iphiouterbin = 0; iphiouterbin < outerphibins; iphiouterbin++) {
847  phiouter[0] = outerphimin + iphiouterbin * (outerphimax - outerphimin) / outerphibins;
848  phiouter[1] = outerphimin + (iphiouterbin + 1) * (outerphimax - outerphimin) / outerphibins;
849  for (int irbin = 0; irbin < (1 << nrbits); irbin++) {
850  router[0] = settings_.rmindiskvm() + dr * irbin;
851  router[1] = router[0] + dr;
852  double bendinnermin = 20.0;
853  double bendinnermax = -20.0;
854  double bendoutermin = 20.0;
855  double bendoutermax = -20.0;
856  double rinvmin = 1.0;
857  for (int i1 = 0; i1 < 2; i1++) {
858  for (int i2 = 0; i2 < 2; i2++) {
859  for (int i3 = 0; i3 < 2; i3++) {
860  double rinner = settings_.rmean(layer_ - 1);
861  double rinv1 = rinv(phiinner[i1], phiouter[i2], rinner, router[i3]);
862  double pitchinner =
863  (rinner < settings_.rcrit()) ? settings_.stripPitch(true) : settings_.stripPitch(false);
864  double pitchouter =
865  (router[i3] < settings_.rcrit()) ? settings_.stripPitch(true) : settings_.stripPitch(false);
866  double abendinner = bend(rinner, rinv1, pitchinner);
867  double abendouter = bend(router[i3], rinv1, pitchouter);
868  if (abendinner < bendinnermin)
869  bendinnermin = abendinner;
870  if (abendinner > bendinnermax)
871  bendinnermax = abendinner;
872  if (abendouter < bendoutermin)
873  bendoutermin = abendouter;
874  if (abendouter > bendoutermax)
875  bendoutermax = abendouter;
876  if (std::abs(rinv1) < rinvmin) {
877  rinvmin = std::abs(rinv1);
878  }
879  }
880  }
881  }
882 
883  phitable_[phiindex].push_back(rinvmin < settings_.rinvcutte());
884 
885  for (int ibend = 0; ibend < 8; ibend++) {
886  double bend = benddecode(ibend, true);
887 
888  bool passinner = bend - bendinnermin > -settings_.bendcutte(0, iSeed_) &&
889  bend - bendinnermax < settings_.bendcutte(0, iSeed_);
890  if (passinner)
891  vmbendinner[ibend] = true;
892  pttableinner_[phiindex].push_back(passinner);
893  }
894 
895  for (int ibend = 0; ibend < 8; ibend++) {
896  double bend = benddecode(ibend, true);
897 
898  bool passouter = bend - bendoutermin > -settings_.bendcutte(1, iSeed_) &&
899  bend - bendoutermax < settings_.bendcutte(1, iSeed_);
900  if (passouter)
901  vmbendouter[ibend] = true;
902  pttableouter_[phiindex].push_back(passouter);
903  }
904  }
905  }
906  }
907 
908  innervmstubs_[ivmmem]->setbendtable(vmbendinner);
909  outervmstubs_[ivmmem]->setbendtable(vmbendouter);
910 
911  if (iSector_ == 0 && settings_.writeTable())
912  writeTETable();
913  }
914  }
915 }

References funct::abs(), trklet::bend(), trklet::Settings::bendcutte(), trklet::benddecode(), trklet::TrackletCalculatorBase::disk_, flavorHistoryFilter_cfi::dr, mps_fire::i, testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, testProducerWithPsetDescEmpty_cfi::i3, innerphibits_, innervmstubs_, trklet::ProcessBase::iSector_, trklet::TrackletCalculatorBase::iSeed_, trklet::TrackletCalculatorBase::layer_, trklet::Settings::nfinephi(), outerphibits_, outervmstubs_, phitable_, pttableinner_, pttableouter_, trklet::Settings::rcrit(), trklet::rinv(), trklet::Settings::rinvcutte(), trklet::Settings::rmaxdiskvm(), trklet::Settings::rmean(), trklet::Settings::rmindiskvm(), trklet::ProcessBase::settings_, trklet::Settings::stripPitch(), trklet::Settings::writeTable(), writeTETable(), and trklet::Settings::zmean().

Referenced by addInput().

◆ writeTETable()

void TrackletProcessor::writeTETable ( )

Definition at line 917 of file TrackletProcessor.cc.

917  {
918  ofstream outptcut;
919  outptcut.open(getName() + "_ptcut.tab");
920  outptcut << "{" << endl;
921  //for(unsigned int i=0;i<phitable_.size();i++){
922  // if (i!=0) outptcut<<","<<endl;
923  // outptcut << phitable_[i];
924  //}
925  outptcut << endl << "};" << endl;
926  outptcut.close();
927 
928  ofstream outstubptinnercut;
929  outstubptinnercut.open(getName() + "_stubptinnercut.tab");
930  outstubptinnercut << "{" << endl;
931  //for(unsigned int i=0;i<pttableinner_.size();i++){
932  // if (i!=0) outstubptinnercut<<","<<endl;
933  // outstubptinnercut << pttableinner_[i];
934  //}
935  outstubptinnercut << endl << "};" << endl;
936  outstubptinnercut.close();
937 
938  ofstream outstubptoutercut;
939  outstubptoutercut.open(getName() + "_stubptoutercut.tab");
940  outstubptoutercut << "{" << endl;
941  //for(unsigned int i=0;i<pttableouter_.size();i++){
942  // if (i!=0) outstubptoutercut<<","<<endl;
943  // outstubptoutercut << pttableouter_[i];
944  //}
945  outstubptoutercut << endl << "};" << endl;
946  outstubptoutercut.close();
947 }

References trklet::ProcessBase::getName().

Referenced by setVMPhiBin().

Member Data Documentation

◆ extra_

bool trklet::TrackletProcessor::extra_
private

Definition at line 48 of file TrackletProcessor.h.

Referenced by TrackletProcessor().

◆ innerallstubs_

std::vector<AllStubsMemory*> trklet::TrackletProcessor::innerallstubs_
private

Definition at line 45 of file TrackletProcessor.h.

Referenced by addInput().

◆ innerphibits_

int trklet::TrackletProcessor::innerphibits_
private

Definition at line 54 of file TrackletProcessor.h.

Referenced by execute(), and setVMPhiBin().

◆ innervmstubs_

std::vector<VMStubsTEMemory*> trklet::TrackletProcessor::innervmstubs_
private

Definition at line 42 of file TrackletProcessor.h.

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

◆ iTC_

int trklet::TrackletProcessor::iTC_
private

Definition at line 40 of file TrackletProcessor.h.

Referenced by TrackletProcessor().

◆ outerallstubs_

std::vector<AllStubsMemory*> trklet::TrackletProcessor::outerallstubs_
private

Definition at line 46 of file TrackletProcessor.h.

Referenced by addInput().

◆ outerphibits_

int trklet::TrackletProcessor::outerphibits_
private

Definition at line 55 of file TrackletProcessor.h.

Referenced by execute(), and setVMPhiBin().

◆ outervmstubs_

std::vector<VMStubsTEMemory*> trklet::TrackletProcessor::outervmstubs_
private

Definition at line 43 of file TrackletProcessor.h.

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

◆ phitable_

std::map<unsigned int, std::vector<bool> > trklet::TrackletProcessor::phitable_
private

Definition at line 50 of file TrackletProcessor.h.

Referenced by execute(), and setVMPhiBin().

◆ pttableinner_

std::map<unsigned int, std::vector<bool> > trklet::TrackletProcessor::pttableinner_
private

Definition at line 51 of file TrackletProcessor.h.

Referenced by execute(), and setVMPhiBin().

◆ pttableouter_

std::map<unsigned int, std::vector<bool> > trklet::TrackletProcessor::pttableouter_
private

Definition at line 52 of file TrackletProcessor.h.

Referenced by execute(), and setVMPhiBin().

trklet::TrackletCalculatorBase::iSeed_
unsigned int iSeed_
Definition: TrackletCalculatorBase.h:128
testProducerWithPsetDescEmpty_cfi.i2
i2
Definition: testProducerWithPsetDescEmpty_cfi.py:46
testProducerWithPsetDescEmpty_cfi.i3
i3
Definition: testProducerWithPsetDescEmpty_cfi.py:47
trklet::Settings::rmindiskvm
double rmindiskvm() const
Definition: Settings.h:260
mps_fire.i
i
Definition: mps_fire.py:355
trklet::Settings::ntrackletmax
unsigned int ntrackletmax() const
Definition: Settings.h:274
trklet::Settings::writetrace
bool writetrace() const
Definition: Settings.h:147
start
Definition: start.py:1
input
static const std::string input
Definition: EdmProvDump.cc:48
trklet::StubPairsMemory
Definition: StubPairsMemory.h:13
trklet::TrackletCalculatorBase::phioffset_
double phioffset_
Definition: TrackletCalculatorBase.h:134
trklet::TrackletCalculatorBase::trackletpars_
TrackletParametersMemory * trackletpars_
Definition: TrackletCalculatorBase.h:139
trklet::VMStubTE
Definition: VMStubTE.h:15
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:32
testProducerWithPsetDescEmpty_cfi.i1
i1
Definition: testProducerWithPsetDescEmpty_cfi.py:45
trklet::N_SECTOR
constexpr unsigned int N_SECTOR
Definition: Settings.h:17
trklet::TrackletCalculatorBase::layer_
int layer_
Definition: TrackletCalculatorBase.h:136
trklet::TrackletProcessor::pttableouter_
std::map< unsigned int, std::vector< bool > > pttableouter_
Definition: TrackletProcessor.h:52
trklet::L1TStub
Definition: L1TStub.h:12
cms::cuda::assert
assert(be >=bs)
trklet::Settings::rmean
double rmean(unsigned int iLayer) const
Definition: Settings.h:128
trklet::TrackletCalculatorBase::barrelSeeding
bool barrelSeeding(const Stub *innerFPGAStub, const L1TStub *innerStub, const Stub *outerFPGAStub, const L1TStub *outerStub)
Definition: TrackletCalculatorBase.cc:331
trklet::N_DISK
constexpr int N_DISK
Definition: Settings.h:20
trklet::ProcessBase::settings_
Settings const & settings_
Definition: ProcessBase.h:44
trklet::TrackletProcessor::extra_
bool extra_
Definition: TrackletProcessor.h:48
trklet::FPGAWord::nbits
int nbits() const
Definition: FPGAWord.h:25
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
trklet::VMStubTE::isPSmodule
bool isPSmodule() const
Definition: VMStubTE.h:31
trklet::TrackletProcessor::pttableinner_
std::map< unsigned int, std::vector< bool > > pttableinner_
Definition: TrackletProcessor.h:51
trklet::TrackletCalculatorBase::trackletprojlayers_
std::vector< std::vector< TrackletProjectionsMemory * > > trackletprojlayers_
Definition: TrackletCalculatorBase.h:142
trklet::Stub::isBarrel
bool isBarrel() const
Definition: Stub.h:60
trklet::Settings::writeTable
bool writeTable() const
Definition: Settings.h:153
trklet::VMStubTE::bend
const FPGAWord & bend() const
Definition: VMStubTE.h:25
trklet::TrackletProcessor::innerallstubs_
std::vector< AllStubsMemory * > innerallstubs_
Definition: TrackletProcessor.h:45
accept
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:30
dqmdumpme.last
last
Definition: dqmdumpme.py:56
trklet::Stub::disk
const FPGAWord & disk() const
Definition: Stub.h:57
trklet::Settings::dphisectorHG
double dphisectorHG() const
Definition: Settings.h:230
trklet::Stub
Definition: Stub.h:16
trklet::FPGAWord::bits
unsigned int bits(unsigned int lsb, unsigned int nbit) const
Definition: FPGAWord.cc:74
trklet::TrackletCalculatorBase::disk_
int disk_
Definition: TrackletCalculatorBase.h:137
trklet::N_LAYER
constexpr int N_LAYER
Definition: Settings.h:19
trklet::TrackletProcessor::outerphibits_
int outerphibits_
Definition: TrackletProcessor.h:55
trklet::Settings::zmean
double zmean(unsigned int iDisk) const
Definition: Settings.h:131
trklet::ProcessBase::initLayerDisksandISeed
void initLayerDisksandISeed(unsigned int &layerdisk1, unsigned int &layerdisk2, unsigned int &iSeed)
Definition: ProcessBase.cc:75
trklet::TrackletCalculatorBase::diskSeeding
bool diskSeeding(const Stub *innerFPGAStub, const L1TStub *innerStub, const Stub *outerFPGAStub, const L1TStub *outerStub)
Definition: TrackletCalculatorBase.cc:753
trklet::Stub::isDisk
bool isDisk() const
Definition: Stub.h:61
trklet::FPGAWord
Definition: FPGAWord.h:9
trklet::TrackletCalculatorBase::layerdisk1_
unsigned int layerdisk1_
Definition: TrackletCalculatorBase.h:129
trklet::rinv
double rinv(double phi1, double phi2, double r1, double r2)
Definition: Util.h:167
trklet::TrackletCalculatorBase::layerdisk2_
unsigned int layerdisk2_
Definition: TrackletCalculatorBase.h:130
trklet::VarBase::K
double K() const
Definition: imath.h:246
trklet::TrackletProcessor::innerphibits_
int innerphibits_
Definition: TrackletProcessor.h:54
trklet::Globals::ITC_L1L2
IMATH_TrackletCalculator * ITC_L1L2()
Definition: Globals.h:52
trklet::TrackletCalculatorBase::overlapSeeding
bool overlapSeeding(const Stub *innerFPGAStub, const L1TStub *innerStub, const Stub *outerFPGAStub, const L1TStub *outerStub)
Definition: TrackletCalculatorBase.cc:1108
trklet::IMATH_TrackletCalculator::phi0_final
VarAdjustK phi0_final
Definition: IMATH_TrackletCalculator.h:218
trklet::VMStubTE::stub
const Stub * stub() const
Definition: VMStubTE.h:29
groupFilesInBlocks.fout
fout
Definition: groupFilesInBlocks.py:162
trklet::Settings::bendcutte
double bendcutte(unsigned int inner, unsigned int iSeed) const
Definition: Settings.h:110
createfilelist.int
int
Definition: createfilelist.py:10
trklet::TrackletCalculatorBase::trackletprojdisks_
std::vector< std::vector< TrackletProjectionsMemory * > > trackletprojdisks_
Definition: TrackletCalculatorBase.h:143
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:50
edm::LogVerbatim
Definition: MessageLogger.h:297
trklet::TrackletProcessor::writeTETable
void writeTETable()
Definition: TrackletProcessor.cc:917
edm::LogPrint
Definition: MessageLogger.h:342
trklet::Settings::rinvcutte
double rinvcutte() const
Definition: Settings.h:258
trklet::TrackletProcessor::setVMPhiBin
void setVMPhiBin()
Definition: TrackletProcessor.cc:586
trklet::TrackletCalculatorBase::TrackletCalculatorBase
TrackletCalculatorBase(std::string name, Settings const &settings, Globals *global, unsigned int iSector)
Definition: TrackletCalculatorBase.cc:17
trklet::TrackletProcessor::outerallstubs_
std::vector< AllStubsMemory * > outerallstubs_
Definition: TrackletProcessor.h:46
trklet::VMStubTE::vmbits
const FPGAWord & vmbits() const
Definition: VMStubTE.h:27
trklet::FPGAWord::value
int value() const
Definition: FPGAWord.h:24
trklet::TrackletProcessor::innervmstubs_
std::vector< VMStubsTEMemory * > innervmstubs_
Definition: TrackletProcessor.h:42
edm::print
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66
trklet::Settings::stripPitch
double stripPitch(bool isPSmodule) const
Definition: Settings.h:219
newFWLiteAna.bin
bin
Definition: newFWLiteAna.py:161
trklet::IMATH_TrackletCalculator::rinv_final
VarAdjustK rinv_final
Definition: IMATH_TrackletCalculator.h:216
trklet::Settings::writeMonitorData
bool writeMonitorData(std::string module) const
Definition: Settings.h:86
trklet::TrackletCalculatorBase::TCIndex_
int TCIndex_
Definition: TrackletCalculatorBase.h:132
trklet::TrackletParametersMemory::nTracklets
unsigned int nTracklets() const
Definition: TrackletParametersMemory.h:25
trklet::Settings::usephicritapprox
bool usephicritapprox() const
Definition: Settings.h:194
trklet::Globals::ofstream
std::ofstream & ofstream(std::string fname)
Definition: Globals.cc:44
trklet::Stub::l1tstub
L1TStub * l1tstub()
Definition: Stub.h:69
trklet::bend
double bend(double r, double rinv, double stripPitch)
Definition: Util.h:160
flavorHistoryFilter_cfi.dr
dr
Definition: flavorHistoryFilter_cfi.py:37
Exception
Definition: hltDiff.cc:246
trklet::ProcessBase::getName
std::string const & getName() const
Definition: ProcessBase.h:22
trklet::ProcessBase::name_
std::string name_
Definition: ProcessBase.h:38
trklet::Settings::nallstubs
unsigned int nallstubs(unsigned int layerdisk) const
Definition: Settings.h:84
trklet::VMStubTE::finephi
const FPGAWord & finephi() const
Definition: VMStubTE.h:23
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
trklet::ProcessBase::iSector_
unsigned int iSector_
Definition: ProcessBase.h:39
trklet::Settings::debugTracklet
bool debugTracklet() const
Definition: Settings.h:146
trklet::Settings::rcrit
double rcrit() const
Definition: Settings.h:236
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
trklet::Settings::maxStep
unsigned int maxStep(std::string module) const
Definition: Settings.h:93
trklet::Settings::nfinephi
double nfinephi(unsigned int inner, unsigned int iSeed) const
Definition: Settings.h:112
trklet::TrackletProcessor::outervmstubs_
std::vector< VMStubsTEMemory * > outervmstubs_
Definition: TrackletProcessor.h:43
trklet::benddecode
double benddecode(int ibend, bool isPS)
Definition: Util.h:100
trklet::ProcessBase::phimin_
double phimin_
Definition: ProcessBase.h:41
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
trklet::TrackletProcessor::iTC_
int iTC_
Definition: TrackletProcessor.h:40
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
trklet::ProcessBase::globals_
Globals * globals_
Definition: ProcessBase.h:45
trklet::Settings::useSeed
bool useSeed(unsigned int iSeed) const
Definition: Settings.h:76
trklet::ProcessBase::phimax_
double phimax_
Definition: ProcessBase.h:42
memory
Definition: vlib.h:178
trklet::TrackletProcessor::phitable_
std::map< unsigned int, std::vector< bool > > phitable_
Definition: TrackletProcessor.h:50
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
trklet::Settings::rmaxdiskvm
double rmaxdiskvm() const
Definition: Settings.h:261
reco::reduceRange
constexpr T reduceRange(T x)
Definition: deltaPhi.h:18