CMS 3D CMS Logo

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

#include <MatchProcessor.h>

Inheritance diagram for trklet::MatchProcessor:
trklet::ProcessBase

Public Member Functions

void addInput (MemoryBase *memory, std::string input) override
 
void addOutput (MemoryBase *memory, std::string output) override
 
void execute ()
 
bool matchCalculator (Tracklet *tracklet, const Stub *fpgastub)
 
 MatchProcessor (std::string name, Settings const &settings, Globals *global, unsigned int iSector)
 
 ~MatchProcessor () 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

AllStubsMemoryallstubs_
 
bool barrel_
 
int disk_
 
int fact_
 
std::vector< FullMatchMemory * > fullmatches_
 
int ialphafactinner_ [N_DSS_MOD *2]
 
int ialphafactouter_ [N_DSS_MOD *2]
 
int icorrshift_
 
int icorzshift_
 
CircularBuffer< ProjectionTempinputProjBuffer_
 
std::vector< TrackletProjectionsMemory * > inputprojs_
 
int layer_
 
std::vector< MatchEngineUnitmatchengines_
 
unsigned int nMatchEngines_
 
int nphiderbits_
 
int nrbits_
 
int nvm_
 
int nvmbins_
 
int nvmbits_
 
int phi0shift_
 
double phifact_
 
unsigned int phimatchcut_ [N_SEED]
 
double phioffset_
 
unsigned int phiregion_
 
unsigned int rcut2S_ [N_SEED]
 
unsigned int rcutPS_ [N_SEED]
 
unsigned int rphicut2S_ [N_SEED]
 
unsigned int rphicutPS_ [N_SEED]
 
double rzfact_
 
std::vector< bool > table2S_
 
std::vector< bool > table_
 
std::vector< bool > tablePS_
 
std::vector< VMStubsMEMemory * > vmstubs_
 
unsigned int zmatchcut_ [N_SEED]
 

Additional Inherited Members

- 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 24 of file MatchProcessor.h.

Constructor & Destructor Documentation

◆ MatchProcessor()

MatchProcessor::MatchProcessor ( std::string  name,
Settings const &  settings,
Globals global,
unsigned int  iSector 
)

Definition at line 14 of file MatchProcessor.cc.

15  : ProcessBase(name, settings, global, iSector), fullmatches_(12), inputProjBuffer_(3) {
17 
18  phiregion_ = name[8] - 'A';
19 
21 
22  //TODO should sort out constants here
23  icorrshift_ = 7;
24 
25  if (layer_ <= 3) {
27  } else {
29  }
30  phi0shift_ = 3;
31  fact_ = 1;
32  if (layer_ >= 4) {
33  fact_ = (1 << (settings_.nzbitsstub(0) - settings_.nzbitsstub(5)));
34  icorrshift_ -= (10 - settings_.nrbitsstub(layer_ - 1));
37  phi0shift_ = 0;
38  }
39 
40  nrbits_ = 5;
41  nphiderbits_ = 6;
42 
43  //to adjust globaly the phi and rz matching cuts
44  phifact_ = 1.0;
45  rzfact_ = 1.0;
46 
47  for (unsigned int iSeed = 0; iSeed < 12; iSeed++) {
48  if (layer_ > 0) {
49  phimatchcut_[iSeed] =
51  zmatchcut_[iSeed] = settings_.zmatchcut(iSeed, layer_ - 1) / settings_.kz();
52  }
53  if (disk_ != 0) {
54  rphicutPS_[iSeed] = settings_.rphicutPS(iSeed, abs(disk_) - 1) / (settings_.kphi() * settings_.kr());
55  rphicut2S_[iSeed] = settings_.rphicut2S(iSeed, abs(disk_) - 1) / (settings_.kphi() * settings_.kr());
56  rcut2S_[iSeed] = settings_.rcut2S(iSeed, abs(disk_) - 1) / settings_.krprojshiftdisk();
57  rcutPS_[iSeed] = settings_.rcutPS(iSeed, abs(disk_) - 1) / settings_.krprojshiftdisk();
58  }
59  }
60 
61  if (iSector_ == 0 && layer_ > 0 && settings_.writeTable()) {
62  ofstream outphicut;
63  outphicut.open(getName() + "_phicut.tab");
64  outphicut << "{" << endl;
65  for (unsigned int seedindex = 0; seedindex < 12; seedindex++) {
66  if (seedindex != 0)
67  outphicut << "," << endl;
68  outphicut << phimatchcut_[seedindex];
69  }
70  outphicut << endl << "};" << endl;
71  outphicut.close();
72 
73  ofstream outzcut;
74  outzcut.open(getName() + "_zcut.tab");
75  outzcut << "{" << endl;
76  for (unsigned int seedindex = 0; seedindex < N_SEED; seedindex++) {
77  if (seedindex != 0)
78  outzcut << "," << endl;
79  outzcut << zmatchcut_[seedindex];
80  }
81  outzcut << endl << "};" << endl;
82  outzcut.close();
83  }
84 
85  if (layer_ > 0) {
86  unsigned int nbits = 3;
87  if (layer_ >= 4)
88  nbits = 4;
89 
90  for (unsigned int irinv = 0; irinv < 32; irinv++) {
91  double rinv = (irinv - 15.5) * (1 << (settings_.nbitsrinv() - 5)) * settings_.krinvpars();
92  double stripPitch =
94  double projbend = bend(settings_.rmean(layer_ - 1), rinv, stripPitch);
95  for (unsigned int ibend = 0; ibend < (unsigned int)(1 << nbits); ibend++) {
96  double stubbend = benddecode(ibend, layer_ <= (int)N_PSLAYER);
97  bool pass = std::abs(stubbend - projbend) < settings_.bendcutme(layer_ - 1);
98  table_.push_back(pass);
99  }
100  }
101 
102  if (settings_.writeTable()) {
103  ofstream out;
104  char layer = '0' + layer_;
105  string fname = "METable_L";
106  fname += layer;
107  fname += ".tab";
108  out.open(fname.c_str());
109  out << "{" << endl;
110  for (unsigned int i = 0; i < table_.size(); i++) {
111  if (i != 0) {
112  out << "," << endl;
113  }
114  out << table_[i];
115  }
116  out << "};" << endl;
117  out.close();
118  }
119  }
120 
121  if (disk_ > 0) {
122  for (unsigned int iprojbend = 0; iprojbend < 32; iprojbend++) {
123  double projbend = 0.5 * (iprojbend - 15.0);
124  for (unsigned int ibend = 0; ibend < 8; ibend++) {
125  double stubbend = benddecode(ibend, true);
126  bool pass = std::abs(stubbend - projbend) < settings_.bendcutme(disk_ + 5);
127  tablePS_.push_back(pass);
128  }
129  for (unsigned int ibend = 0; ibend < 16; ibend++) {
130  double stubbend = benddecode(ibend, false);
131  bool pass = std::abs(stubbend - projbend) < settings_.bendcutme(disk_ + 5);
132  table2S_.push_back(pass);
133  }
134  }
135  }
136 
137  for (unsigned int i = 0; i < N_DSS_MOD * 2; i++) {
139  (1 << (settings_.nbitsalpha() - 1)) / (settings_.rDSSinner(i) * settings_.rDSSinner(i)) /
140  settings_.kphi();
142  (1 << (settings_.nbitsalpha() - 1)) / (settings_.rDSSouter(i) * settings_.rDSSouter(i)) /
143  settings_.kphi();
144  }
145 
146  barrel_ = layer_ > 0;
147 
151 
152  if (nvm_ == 32)
153  nvmbits_ = 5;
154  if (nvm_ == 16)
155  nvmbits_ = 4;
156  assert(nvmbits_ != -1);
157 
158  nMatchEngines_ = 4;
159  for (unsigned int iME = 0; iME < nMatchEngines_; iME++) {
161  matchengines_.push_back(tmpME);
162  }
163 }

References funct::abs(), trklet::Settings::alphashift(), cms::cuda::assert(), barrel_, trklet::bend(), trklet::Settings::bendcutme(), trklet::benddecode(), disk_, fact_, alignmentValidation::fname, trklet::ProcessBase::getName(), trklet::Settings::half2SmoduleWidth(), mps_fire::i, ialphafactinner_, ialphafactouter_, icorrshift_, icorzshift_, trklet::ProcessBase::initLayerDisk(), createfilelist::int, trklet::ProcessBase::iSector_, trklet::Settings::kphi(), trklet::Settings::kphi1(), trklet::Settings::kr(), trklet::Settings::krinvpars(), trklet::Settings::krprojshiftdisk(), trklet::Settings::kz(), layer_, matchengines_, trklet::N_DSS_MOD, trklet::N_PSLAYER, trklet::N_SEED, trklet::Settings::nallstubs(), Skims_PA_cff::name, trklet::ProcessBase::nbits(), trklet::Settings::nbitsalpha(), trklet::Settings::nbitsrinv(), nMatchEngines_, nphiderbits_, nrbits_, trklet::Settings::nrbitsstub(), nvm_, nvmbins_, nvmbits_, trklet::Settings::nvmme(), trklet::Settings::nzbitsstub(), MillePedeFileConverter_cfg::out, phi0shift_, phifact_, phimatchcut_, trklet::ProcessBase::phimin_, phioffset_, phiregion_, trklet::Settings::PS_zderL_shift(), trklet::Settings::rcrit(), trklet::Settings::rcut2S(), rcut2S_, trklet::Settings::rcutPS(), rcutPS_, trklet::Settings::rDSSinner(), trklet::Settings::rDSSouter(), trklet::rinv(), trklet::Settings::rmean(), trklet::Settings::rphicut2S(), rphicut2S_, trklet::Settings::rphicutPS(), rphicutPS_, trklet::Settings::rphimatchcut(), rzfact_, trklet::ProcessBase::settings_, trklet::Settings::SS_zderL_shift(), trklet::Settings::stripPitch(), table2S_, table_, tablePS_, trklet::Settings::writeTable(), trklet::Settings::zmatchcut(), and zmatchcut_.

◆ ~MatchProcessor()

trklet::MatchProcessor::~MatchProcessor ( )
overridedefault

Member Function Documentation

◆ addInput()

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

Implements trklet::ProcessBase.

Definition at line 182 of file MatchProcessor.cc.

182  {
183  if (settings_.writetrace()) {
184  edm::LogVerbatim("Tracklet") << "In " << name_ << " adding input from " << memory->getName() << " to input "
185  << input;
186  }
187  if (input == "allstubin") {
188  auto* tmp = dynamic_cast<AllStubsMemory*>(memory);
189  assert(tmp != nullptr);
190  allstubs_ = tmp;
191  return;
192  }
193  if (input == "vmstubin") {
194  auto* tmp = dynamic_cast<VMStubsMEMemory*>(memory);
195  assert(tmp != nullptr);
196  vmstubs_.push_back(tmp); //to allow more than one stub in? vmstubs_=tmp;
197  return;
198  }
199  if (input == "projin") {
200  auto* tmp = dynamic_cast<TrackletProjectionsMemory*>(memory);
201  assert(tmp != nullptr);
202  inputprojs_.push_back(tmp);
203  return;
204  }
205  throw cms::Exception("BadConfig") << __FILE__ << " " << __LINE__ << " could not find input: " << input;
206 }

References allstubs_, cms::cuda::assert(), Exception, input, inputprojs_, trklet::ProcessBase::name_, trklet::ProcessBase::settings_, createJobs::tmp, vmstubs_, and trklet::Settings::writetrace().

◆ addOutput()

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

Implements trklet::ProcessBase.

Definition at line 165 of file MatchProcessor.cc.

165  {
166  if (settings_.writetrace()) {
167  edm::LogVerbatim("Tracklet") << "In " << name_ << " adding output to " << memory->getName() << " to output "
168  << output;
169  }
170  if (output.find("matchout") != std::string::npos) {
171  auto* tmp = dynamic_cast<FullMatchMemory*>(memory);
172  assert(tmp != nullptr);
173  unsigned int iSeed = getISeed(tmp->getName());
174  assert(iSeed < fullmatches_.size());
175  assert(fullmatches_[iSeed] == nullptr);
176  fullmatches_[iSeed] = tmp;
177  return;
178  }
179  throw cms::Exception("BadConfig") << __FILE__ << " " << __LINE__ << " could not find output: " << output;
180 }

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

◆ execute()

void MatchProcessor::execute ( void  )

Definition at line 208 of file MatchProcessor.cc.

208  {
209  if (globals_->projectionRouterBendTable() == nullptr) { // move to constructor?!
210  auto* bendTablePtr = new ProjectionRouterBendTable();
211  bendTablePtr->init(settings_, globals_, nrbits_, nphiderbits_);
212  globals_->projectionRouterBendTable() = bendTablePtr;
213  }
214 
215  /*
216  The code is organized in three 'steps' corresponding to the PR, ME, and MC functions. The output from
217  the PR step is buffered in a 'circular' buffer, and similarly the ME output is put in a circular buffer.
218 
219  The implementation is done in steps, emulating what can be done in firmware. One each step we do:
220 
221  1) A projection is read and if there is space it is insert into the inputProjBuffer_
222 
223  2) Process next match in the ME - if there is an idle ME the next projection is inserted
224 
225  3) Readout match from ME and send to match calculator
226 
227  */
228 
229  Tracklet* oldTracklet = nullptr;
230 
231  unsigned int countall = 0;
232  unsigned int countsel = 0;
233 
234  unsigned int iprojmem = 0;
235  unsigned int iproj = 0;
236 
237  inputProjBuffer_.reset();
238 
239  for (unsigned int istep = 0; istep < settings_.maxStep("MP"); istep++) {
240  //Step 1
241  //First step here checks if we have more input projections to put into
242  //the input puffer for projections
243  if (iprojmem < inputprojs_.size()) {
244  TrackletProjectionsMemory* projMem = inputprojs_[iprojmem];
245  if (projMem->nTracklets() == 0) {
246  iprojmem++;
247  } else if (iproj < projMem->nTracklets()) {
248  if (!inputProjBuffer_.almostfull()) {
249  if (settings_.debugTracklet()) {
250  edm::LogVerbatim("Tracklet") << getName() << " have projection in memory : " << projMem->getName();
251  }
252 
253  Tracklet* proj = projMem->getTracklet(iproj);
254  FPGAWord fpgaphi = barrel_ ? proj->fpgaphiproj(layer_) : proj->fpgaphiprojdisk(disk_);
255 
256  int iphi = (fpgaphi.value() >> (fpgaphi.nbits() - nvmbits_)) & (nvmbins_ - 1);
257 
258  int projrinv = -1;
259  if (barrel_) {
260  projrinv = 16 + (proj->fpgarinv().value() >> (proj->fpgarinv().nbits() - 5));
261  } else {
262  //The next lines looks up the predicted bend based on:
263  // 1 - r projections
264  // 2 - phi derivative
265  // 3 - the sign - i.e. if track is forward or backward
266  int rindex = (proj->fpgarprojdisk(disk_).value() >> (proj->fpgarprojdisk(disk_).nbits() - nrbits_)) &
267  ((1 << nrbits_) - 1);
268 
269  int phiderindex =
270  (proj->fpgaphiprojderdisk(disk_).value() >> (proj->fpgaphiprojderdisk(disk_).nbits() - nphiderbits_)) &
271  ((1 << nphiderbits_) - 1);
272 
273  int signindex = (proj->fpgarprojderdisk(disk_).value() < 0);
274 
275  int bendindex = (signindex << (nphiderbits_ + nrbits_)) + (rindex << (nphiderbits_)) + phiderindex;
276 
277  projrinv = globals_->projectionRouterBendTable()->bendLoookup(abs(disk_) - 1, bendindex);
278 
279  proj->setBendIndex(projrinv, disk_);
280  }
281  assert(projrinv >= 0);
282 
283  unsigned int slot = barrel_ ? proj->zbin1projvm(layer_) : proj->rbin1projvm(disk_);
284  bool second = (barrel_ ? proj->zbin2projvm(layer_) : proj->rbin2projvm(disk_)) == 1;
285 
286  unsigned int projfinephi = fpgaphi.value() >> (fpgaphi.nbits() - (nvmbits_ + 3)) & 7;
287  int projfinerz = barrel_ ? proj->finezvm(layer_) : proj->finervm(disk_);
288 
289  bool isPSseed = proj->PSseed() == 1;
290 
291  VMStubsMEMemory* stubmem = vmstubs_[iphi];
292  if (stubmem->nStubsBin(slot) != 0) {
293  ProjectionTemp tmpProj(proj, slot, projrinv, projfinerz, projfinephi, iphi, isPSseed);
294  inputProjBuffer_.store(tmpProj);
295  }
296  if (second && (stubmem->nStubsBin(slot + 1) != 0)) {
297  ProjectionTemp tmpProj(proj, slot + 1, projrinv, projfinerz - 8, projfinephi, iphi, isPSseed);
298  inputProjBuffer_.store(tmpProj);
299  }
300  iproj++;
301  if (iproj == projMem->nTracklets()) {
302  iproj = 0;
303  iprojmem++;
304  }
305  }
306  }
307  }
308 
309  //Step 2
310  //Check if we have ME that can process projection
311 
312  bool addedProjection = false;
313  for (unsigned int iME = 0; iME < nMatchEngines_; iME++) {
314  matchengines_[iME].step();
315  //if match engine empty and we have queued projections add to match engine
316  if ((!addedProjection) && matchengines_[iME].idle() && (!inputProjBuffer_.empty())) {
317  ProjectionTemp tmpProj = inputProjBuffer_.read();
318  VMStubsMEMemory* stubmem = vmstubs_[tmpProj.iphi()];
319 
320  if (settings_.debugTracklet()) {
321  edm::LogVerbatim("Tracklet") << getName() << " adding projection to match engine";
322  }
323 
324  matchengines_[iME].init(stubmem,
325  tmpProj.slot(),
326  tmpProj.projrinv(),
327  tmpProj.projfinerz(),
328  tmpProj.projfinephi(),
329  tmpProj.isPSseed(),
330  tmpProj.proj());
331  addedProjection = true;
332  }
333  }
334 
335  //Step 3
336  //Check if we have candidate match to process
337 
338  unsigned int iMEbest = nMatchEngines_;
339  int bestTCID = -1;
340  bool bestInPipeline = false;
341  for (unsigned int iME = 0; iME < nMatchEngines_; iME++) {
342  bool empty = matchengines_[iME].empty();
343  if (empty && matchengines_[iME].idle())
344  continue;
345  int currentTCID = empty ? matchengines_[iME].currentProj()->TCID() : matchengines_[iME].peek().first->TCID();
346  if ((iMEbest == nMatchEngines_) || (currentTCID < bestTCID)) {
347  iMEbest = iME;
348  bestTCID = currentTCID;
349  bestInPipeline = empty;
350  }
351  }
352 
353  if (iMEbest != nMatchEngines_ && (!bestInPipeline)) {
354  std::pair<Tracklet*, const Stub*> candmatch = matchengines_[iMEbest].read();
355 
356  const Stub* fpgastub = candmatch.second;
357  Tracklet* tracklet = candmatch.first;
358 
359  if (oldTracklet != nullptr) {
360  //allow equal here since we can have more than one cadidate match per tracklet projection
361  assert(oldTracklet->TCID() <= tracklet->TCID());
362  }
363  oldTracklet = tracklet;
364 
365  bool match = matchCalculator(tracklet, fpgastub);
366 
367  if (settings_.debugTracklet() && match) {
368  edm::LogVerbatim("Tracklet") << getName() << " have match";
369  }
370 
371  countall++;
372  if (match)
373  countsel++;
374  ;
375  }
376  }
377 
378  if (settings_.writeMonitorData("MC")) {
379  globals_->ofstream("matchcalculator.txt") << getName() << " " << countall << " " << countsel << endl;
380  }
381 }

References funct::abs(), cms::cuda::assert(), barrel_, trklet::ProjectionRouterBendTable::bendLoookup(), trklet::Settings::debugTracklet(), disk_, relativeConstraints::empty, trklet::MemoryBase::getName(), trklet::ProcessBase::getName(), trklet::TrackletProjectionsMemory::getTracklet(), trklet::ProcessBase::globals_, inputProjBuffer_, inputprojs_, trklet::ProjectionTemp::iphi(), LEDCalibrationChannels::iphi, trklet::ProjectionTemp::isPSseed(), layer_, match(), matchCalculator(), matchengines_, trklet::Settings::maxStep(), trklet::FPGAWord::nbits(), nMatchEngines_, nphiderbits_, nrbits_, trklet::VMStubsMEMemory::nStubsBin(), trklet::TrackletProjectionsMemory::nTracklets(), nvmbins_, nvmbits_, trklet::Globals::ofstream(), amptDefault_cfi::proj, trklet::ProjectionTemp::proj(), trklet::Globals::projectionRouterBendTable(), trklet::ProjectionTemp::projfinephi(), trklet::ProjectionTemp::projfinerz(), trklet::ProjectionTemp::projrinv(), edm::second(), trklet::ProcessBase::settings_, trklet::ProjectionTemp::slot(), trklet::Tracklet::TCID(), trklet::FPGAWord::value(), vmstubs_, and trklet::Settings::writeMonitorData().

◆ matchCalculator()

bool MatchProcessor::matchCalculator ( Tracklet tracklet,
const Stub fpgastub 
)

Definition at line 383 of file MatchProcessor.cc.

383  {
384  const L1TStub* stub = fpgastub->l1tstub();
385 
386  if (layer_ != 0) {
387  int ir = fpgastub->r().value();
388  int iphi = tracklet->fpgaphiproj(layer_).value();
389  int icorr = (ir * tracklet->fpgaphiprojder(layer_).value()) >> icorrshift_;
390  iphi += icorr;
391 
392  int iz = tracklet->fpgazproj(layer_).value();
393  int izcor = (ir * tracklet->fpgazprojder(layer_).value() + (1 << (icorzshift_ - 1))) >> icorzshift_;
394  iz += izcor;
395 
396  int ideltaz = fpgastub->z().value() - iz;
397  int ideltaphi = (fpgastub->phi().value() << phi0shift_) - (iphi << (settings_.phi0bitshift() - 1 + phi0shift_));
398 
399  //Floating point calculations
400 
401  double phi = stub->phi();
402  double r = stub->r();
403  double z = stub->z();
404 
405  if (settings_.useapprox()) {
406  double dphi = reco::reduceRange(phi - fpgastub->phiapprox(phimin_, phimax_));
407  assert(std::abs(dphi) < 0.001);
408  phi = fpgastub->phiapprox(phimin_, phimax_);
409  z = fpgastub->zapprox();
410  r = fpgastub->rapprox();
411  }
412 
413  if (phi < 0)
414  phi += 2 * M_PI;
415  phi -= phioffset_;
416 
417  double dr = r - tracklet->rproj(layer_);
419 
420  double dphi = reco::reduceRange(phi - (tracklet->phiproj(layer_) + dr * tracklet->phiprojder(layer_)));
421 
422  double dz = z - (tracklet->zproj(layer_) + dr * tracklet->zprojder(layer_));
423 
424  double dphiapprox =
425  reco::reduceRange(phi - (tracklet->phiprojapprox(layer_) + dr * tracklet->phiprojderapprox(layer_)));
426 
427  double dzapprox = z - (tracklet->zprojapprox(layer_) + dr * tracklet->zprojderapprox(layer_));
428 
429  int seedindex = tracklet->getISeed();
430 
431  assert(phimatchcut_[seedindex] > 0);
432  assert(zmatchcut_[seedindex] > 0);
433 
434  if (settings_.bookHistos()) {
435  bool truthmatch = tracklet->stubtruthmatch(stub);
436 
438  hists->FillLayerResidual(layer_,
439  seedindex,
440  dphiapprox * settings_.rmean(layer_ - 1),
441  ideltaphi * settings_.kphi1() * settings_.rmean(layer_ - 1),
442  ideltaz * fact_ * settings_.kz(),
443  dz,
444  truthmatch);
445  }
446 
447  if (settings_.writeMonitorData("Residuals")) {
448  double pt = 0.01 * settings_.c() * settings_.bfield() / std::abs(tracklet->rinv());
449 
450  globals_->ofstream("layerresiduals.txt")
451  << layer_ << " " << seedindex << " " << pt << " "
452  << ideltaphi * settings_.kphi1() * settings_.rmean(layer_ - 1) << " "
453  << dphiapprox * settings_.rmean(layer_ - 1) << " "
454  << phimatchcut_[seedindex] * settings_.kphi1() * settings_.rmean(layer_ - 1) << " "
455  << ideltaz * fact_ * settings_.kz() << " " << dz << " " << zmatchcut_[seedindex] * settings_.kz() << endl;
456  }
457 
458  bool imatch = (std::abs(ideltaphi) <= phifact_ * phimatchcut_[seedindex]) &&
459  (std::abs(ideltaz * fact_) <= rzfact_ * zmatchcut_[seedindex]);
460 
461  if (settings_.debugTracklet()) {
462  edm::LogVerbatim("Tracklet") << getName() << " imatch = " << imatch << " ideltaphi cut " << ideltaphi << " "
463  << phimatchcut_[seedindex] << " ideltaz*fact cut " << ideltaz * fact_ << " "
464  << zmatchcut_[seedindex];
465  }
466 
467  if (std::abs(dphi) > 0.2 || std::abs(dphiapprox) > 0.2) {
468  edm::LogPrint("Tracklet") << "WARNING dphi and/or dphiapprox too large : " << dphi << " " << dphiapprox;
469  }
470 
471  assert(std::abs(dphi) < 0.2);
472  assert(std::abs(dphiapprox) < 0.2);
473 
474  if (imatch) {
475  tracklet->addMatch(layer_,
476  ideltaphi,
477  ideltaz,
478  dphi,
479  dz,
480  dphiapprox,
481  dzapprox,
482  (phiregion_ << 7) + fpgastub->stubindex().value(),
483  stub->r(),
484  fpgastub);
485 
486  if (settings_.debugTracklet()) {
487  edm::LogVerbatim("Tracklet") << "Accepted full match in layer " << getName() << " " << tracklet << " "
488  << iSector_;
489  }
490 
491  int iSeed = tracklet->getISeed();
492  assert(fullmatches_[iSeed] != nullptr);
493  fullmatches_[iSeed]->addMatch(tracklet, fpgastub);
494 
495  return true;
496  } else {
497  return false;
498  }
499  } else { //disk matches
500 
501  //check that stubs and projections in same half of detector
502  assert(stub->z() * tracklet->t() > 0.0);
503 
504  int sign = (tracklet->t() > 0.0) ? 1 : -1;
505  int disk = sign * disk_;
506  assert(disk != 0);
507 
508  //Perform integer calculations here
509 
510  int iz = fpgastub->z().value();
511  int iphi = tracklet->fpgaphiprojdisk(disk).value();
512 
513  int shifttmp = 6; //TODO - express in terms of constants
514  assert(shifttmp >= 0);
515  int iphicorr = (iz * tracklet->fpgaphiprojderdisk(disk).value()) >> shifttmp;
516 
517  iphi += iphicorr;
518 
519  int ir = tracklet->fpgarprojdisk(disk).value();
520 
521  int shifttmp2 = 7; //TODO - express in terms of constants
522  assert(shifttmp2 >= 0);
523  int ircorr = (iz * tracklet->fpgarprojderdisk(disk).value()) >> shifttmp2;
524 
525  ir += ircorr;
526 
527  int ideltaphi = fpgastub->phi().value() * settings_.kphi() / settings_.kphi() - iphi;
528 
529  int irstub = fpgastub->r().value();
530  int ialphafact = 0;
531  if (!stub->isPSmodule()) {
532  assert(irstub < (int)N_DSS_MOD * 2);
533  if (disk_ <= 2) {
534  ialphafact = ialphafactinner_[irstub];
535  irstub = settings_.rDSSinner(irstub) / settings_.kr();
536  } else {
537  ialphafact = ialphafactouter_[irstub];
538  irstub = settings_.rDSSouter(irstub) / settings_.kr();
539  }
540  }
541 
542  int ideltar = (irstub * settings_.kr()) / settings_.krprojshiftdisk() - ir;
543 
544  if (!stub->isPSmodule()) {
545  int ialphanew = fpgastub->alphanew().value();
546  int iphialphacor = ((ideltar * ialphanew * ialphafact) >> settings_.alphashift());
547  ideltaphi += iphialphacor;
548  }
549 
550  //Perform floating point calculations here
551 
552  double phi = stub->phi();
553  double z = stub->z();
554  double r = stub->r();
555 
556  if (settings_.useapprox()) {
557  double dphi = reco::reduceRange(phi - fpgastub->phiapprox(phimin_, phimax_));
558  assert(std::abs(dphi) < 0.001);
559  phi = fpgastub->phiapprox(phimin_, phimax_);
560  z = fpgastub->zapprox();
561  r = fpgastub->rapprox();
562  }
563 
564  if (phi < 0)
565  phi += 2 * M_PI;
566  phi -= phioffset_;
567 
568  double dz = z - sign * settings_.zmean(disk_ - 1);
569 
570  if (std::abs(dz) > settings_.dzmax()) {
571  edm::LogProblem("Tracklet") << __FILE__ << ":" << __LINE__ << " " << name_ << "_" << iSector_ << " "
572  << tracklet->getISeed();
573  edm::LogProblem("Tracklet") << "stub " << stub->z() << " disk " << disk << " " << dz;
575  }
576 
577  double phiproj = tracklet->phiprojdisk(disk) + dz * tracklet->phiprojderdisk(disk);
578  double rproj = tracklet->rprojdisk(disk) + dz * tracklet->rprojderdisk(disk);
579  double deltar = r - rproj;
580 
581  double dr = stub->r() - rproj;
582  double drapprox = stub->r() - (tracklet->rprojapproxdisk(disk) + dz * tracklet->rprojderapproxdisk(disk));
583 
584  double dphi = reco::reduceRange(phi - phiproj);
585  double dphiapprox =
586  reco::reduceRange(phi - (tracklet->phiprojapproxdisk(disk) + dz * tracklet->phiprojderapproxdisk(disk)));
587 
588  double drphi = dphi * stub->r();
589  double drphiapprox = dphiapprox * stub->r();
590 
591  if (!stub->isPSmodule()) {
592  double alphanorm = stub->alphanorm();
593  dphi += dr * alphanorm * settings_.half2SmoduleWidth() / stub->r2();
594  ;
595  dphiapprox += drapprox * alphanorm * settings_.half2SmoduleWidth() / stub->r2();
596 
597  drphi += dr * alphanorm * settings_.half2SmoduleWidth() / stub->r();
598  drphiapprox += dr * alphanorm * settings_.half2SmoduleWidth() / stub->r();
599  }
600 
601  int seedindex = tracklet->getISeed();
602 
603  int idrphicut = rphicutPS_[seedindex];
604  int idrcut = rcutPS_[seedindex];
605  if (!stub->isPSmodule()) {
606  idrphicut = rphicut2S_[seedindex];
607  idrcut = rcut2S_[seedindex];
608  }
609 
610  double drphicut = idrphicut * settings_.kphi() * settings_.kr();
611  double drcut = idrcut * settings_.krprojshiftdisk();
612 
613  if (settings_.writeMonitorData("Residuals")) {
614  double pt = 0.01 * settings_.c() * settings_.bfield() / std::abs(tracklet->rinv());
615 
616  globals_->ofstream("diskresiduals.txt")
617  << disk_ << " " << stub->isPSmodule() << " " << tracklet->layer() << " " << abs(tracklet->disk()) << " " << pt
618  << " " << ideltaphi * settings_.kphi() * stub->r() << " " << drphiapprox << " " << drphicut << " "
619  << ideltar * settings_.krprojshiftdisk() << " " << deltar << " " << drcut << " " << endl;
620  }
621 
622  bool match = (std::abs(drphi) < drphicut) && (std::abs(deltar) < drcut);
623  bool imatch = (std::abs(ideltaphi * irstub) < idrphicut) && (std::abs(ideltar) < idrcut);
624 
625  if (settings_.debugTracklet()) {
626  edm::LogVerbatim("Tracklet") << "imatch match disk: " << imatch << " " << match << " " << std::abs(ideltaphi)
627  << " " << drphicut / (settings_.kphi() * stub->r()) << " " << std::abs(ideltar)
628  << " " << drcut / settings_.krprojshiftdisk() << " r = " << stub->r();
629  }
630 
631  if (imatch) {
632  if (settings_.debugTracklet()) {
633  edm::LogVerbatim("Tracklet") << "MatchCalculator found match in disk " << getName();
634  }
635 
636  if (std::abs(dphi) >= 0.25) {
637  edm::LogPrint("Tracklet") << "dphi " << dphi << " ISeed " << tracklet->getISeed();
638  }
639  assert(std::abs(dphi) < 0.25);
640  assert(std::abs(dphiapprox) < 0.25);
641 
642  tracklet->addMatchDisk(disk,
643  ideltaphi,
644  ideltar,
645  drphi / stub->r(),
646  dr,
647  drphiapprox / stub->r(),
648  drapprox,
649  stub->alpha(settings_.stripPitch(stub->isPSmodule())),
650  (phiregion_ << 7) + fpgastub->stubindex().value(),
651  stub->z(),
652  fpgastub);
653  if (settings_.debugTracklet()) {
654  edm::LogVerbatim("Tracklet") << "Accepted full match in disk " << getName() << " " << tracklet << " "
655  << iSector_;
656  }
657 
658  int iSeed = tracklet->getISeed();
659  assert(fullmatches_[iSeed] != nullptr);
660  fullmatches_[iSeed]->addMatch(tracklet, fpgastub);
661 
662  return true;
663  } else {
664  return false;
665  }
666  }
667 }

References funct::abs(), trklet::Tracklet::addMatch(), trklet::Tracklet::addMatchDisk(), trklet::L1TStub::alpha(), trklet::Stub::alphanew(), trklet::L1TStub::alphanorm(), trklet::Settings::alphashift(), cms::cuda::assert(), trklet::Settings::bfield(), trklet::Settings::bookHistos(), trklet::Settings::c(), trklet::Settings::debugTracklet(), trklet::Tracklet::disk(), disk_, flavorHistoryFilter_cfi::dr, trklet::Settings::drmax(), PVValHelper::dz, trklet::Settings::dzmax(), fact_, trklet::Tracklet::fpgaphiproj(), trklet::Tracklet::fpgaphiprojder(), trklet::Tracklet::fpgaphiprojderdisk(), trklet::Tracklet::fpgaphiprojdisk(), trklet::Tracklet::fpgarprojderdisk(), trklet::Tracklet::fpgarprojdisk(), trklet::Tracklet::fpgazproj(), trklet::Tracklet::fpgazprojder(), fullmatches_, trklet::Tracklet::getISeed(), trklet::ProcessBase::getName(), trklet::ProcessBase::globals_, trklet::Settings::half2SmoduleWidth(), trklet::Globals::histograms(), compare::hists, ialphafactinner_, ialphafactouter_, icorrshift_, icorzshift_, LEDCalibrationChannels::iphi, trklet::ProcessBase::iSector_, trklet::L1TStub::isPSmodule(), trklet::Settings::kphi(), trklet::Settings::kphi1(), trklet::Settings::kr(), trklet::Settings::krprojshiftdisk(), trklet::Settings::kz(), trklet::Stub::l1tstub(), trklet::Tracklet::layer(), layer_, M_PI, match(), trklet::N_DSS_MOD, trklet::ProcessBase::name_, trklet::Globals::ofstream(), trklet::Stub::phi(), trklet::L1TStub::phi(), trklet::Settings::phi0bitshift(), phi0shift_, trklet::Stub::phiapprox(), phifact_, phimatchcut_, trklet::ProcessBase::phimax_, trklet::ProcessBase::phimin_, phioffset_, trklet::Tracklet::phiproj(), trklet::Tracklet::phiprojapprox(), trklet::Tracklet::phiprojapproxdisk(), trklet::Tracklet::phiprojder(), trklet::Tracklet::phiprojderapprox(), trklet::Tracklet::phiprojderapproxdisk(), trklet::Tracklet::phiprojderdisk(), trklet::Tracklet::phiprojdisk(), phiregion_, DiDispStaMuonMonitor_cfi::pt, trklet::Stub::r(), trklet::L1TStub::r(), alignCSCRings::r, trklet::L1TStub::r2(), trklet::Stub::rapprox(), rcut2S_, rcutPS_, trklet::Settings::rDSSinner(), trklet::Settings::rDSSouter(), reco::reduceRange(), trklet::Tracklet::rinv(), trklet::Settings::rmean(), rphicut2S_, rphicutPS_, trklet::Tracklet::rproj(), trklet::Tracklet::rprojapproxdisk(), trklet::Tracklet::rprojderapproxdisk(), trklet::Tracklet::rprojderdisk(), trklet::Tracklet::rprojdisk(), rzfact_, trklet::ProcessBase::settings_, Validation_hcalonly_cfi::sign, trklet::Settings::stripPitch(), trklet::Stub::stubindex(), trklet::Tracklet::stubtruthmatch(), trklet::Tracklet::t(), trklet::Settings::useapprox(), trklet::FPGAWord::value(), trklet::Settings::writeMonitorData(), trklet::Stub::z(), trklet::L1TStub::z(), trklet::Stub::zapprox(), zmatchcut_, trklet::Settings::zmean(), trklet::Tracklet::zproj(), trklet::Tracklet::zprojapprox(), trklet::Tracklet::zprojder(), and trklet::Tracklet::zprojderapprox().

Referenced by execute().

Member Data Documentation

◆ allstubs_

AllStubsMemory* trklet::MatchProcessor::allstubs_
private

Definition at line 69 of file MatchProcessor.h.

Referenced by addInput().

◆ barrel_

bool trklet::MatchProcessor::barrel_
private

Definition at line 40 of file MatchProcessor.h.

Referenced by execute(), and MatchProcessor().

◆ disk_

int trklet::MatchProcessor::disk_
private

Definition at line 39 of file MatchProcessor.h.

Referenced by execute(), matchCalculator(), and MatchProcessor().

◆ fact_

int trklet::MatchProcessor::fact_
private

Definition at line 48 of file MatchProcessor.h.

Referenced by matchCalculator(), and MatchProcessor().

◆ fullmatches_

std::vector<FullMatchMemory*> trklet::MatchProcessor::fullmatches_
private

Definition at line 77 of file MatchProcessor.h.

Referenced by addOutput(), and matchCalculator().

◆ ialphafactinner_

int trklet::MatchProcessor::ialphafactinner_[N_DSS_MOD *2]
private

Definition at line 73 of file MatchProcessor.h.

Referenced by matchCalculator(), and MatchProcessor().

◆ ialphafactouter_

int trklet::MatchProcessor::ialphafactouter_[N_DSS_MOD *2]
private

Definition at line 74 of file MatchProcessor.h.

Referenced by matchCalculator(), and MatchProcessor().

◆ icorrshift_

int trklet::MatchProcessor::icorrshift_
private

Definition at line 49 of file MatchProcessor.h.

Referenced by matchCalculator(), and MatchProcessor().

◆ icorzshift_

int trklet::MatchProcessor::icorzshift_
private

Definition at line 50 of file MatchProcessor.h.

Referenced by matchCalculator(), and MatchProcessor().

◆ inputProjBuffer_

CircularBuffer<ProjectionTemp> trklet::MatchProcessor::inputProjBuffer_
private

Definition at line 89 of file MatchProcessor.h.

Referenced by execute().

◆ inputprojs_

std::vector<TrackletProjectionsMemory*> trklet::MatchProcessor::inputprojs_
private

Definition at line 71 of file MatchProcessor.h.

Referenced by addInput(), and execute().

◆ layer_

int trklet::MatchProcessor::layer_
private

Definition at line 38 of file MatchProcessor.h.

Referenced by execute(), matchCalculator(), and MatchProcessor().

◆ matchengines_

std::vector<MatchEngineUnit> trklet::MatchProcessor::matchengines_
private

Definition at line 87 of file MatchProcessor.h.

Referenced by execute(), and MatchProcessor().

◆ nMatchEngines_

unsigned int trklet::MatchProcessor::nMatchEngines_
private

Definition at line 86 of file MatchProcessor.h.

Referenced by execute(), and MatchProcessor().

◆ nphiderbits_

int trklet::MatchProcessor::nphiderbits_
private

Definition at line 67 of file MatchProcessor.h.

Referenced by execute(), and MatchProcessor().

◆ nrbits_

int trklet::MatchProcessor::nrbits_
private

Definition at line 66 of file MatchProcessor.h.

Referenced by execute(), and MatchProcessor().

◆ nvm_

int trklet::MatchProcessor::nvm_
private

Definition at line 44 of file MatchProcessor.h.

Referenced by MatchProcessor().

◆ nvmbins_

int trklet::MatchProcessor::nvmbins_
private

Definition at line 46 of file MatchProcessor.h.

Referenced by execute(), and MatchProcessor().

◆ nvmbits_

int trklet::MatchProcessor::nvmbits_
private

Definition at line 45 of file MatchProcessor.h.

Referenced by execute(), and MatchProcessor().

◆ phi0shift_

int trklet::MatchProcessor::phi0shift_
private

Definition at line 51 of file MatchProcessor.h.

Referenced by matchCalculator(), and MatchProcessor().

◆ phifact_

double trklet::MatchProcessor::phifact_
private

Definition at line 63 of file MatchProcessor.h.

Referenced by matchCalculator(), and MatchProcessor().

◆ phimatchcut_

unsigned int trklet::MatchProcessor::phimatchcut_[N_SEED]
private

Definition at line 55 of file MatchProcessor.h.

Referenced by matchCalculator(), and MatchProcessor().

◆ phioffset_

double trklet::MatchProcessor::phioffset_
private

Definition at line 53 of file MatchProcessor.h.

Referenced by matchCalculator(), and MatchProcessor().

◆ phiregion_

unsigned int trklet::MatchProcessor::phiregion_
private

Definition at line 42 of file MatchProcessor.h.

Referenced by matchCalculator(), and MatchProcessor().

◆ rcut2S_

unsigned int trklet::MatchProcessor::rcut2S_[N_SEED]
private

Definition at line 61 of file MatchProcessor.h.

Referenced by matchCalculator(), and MatchProcessor().

◆ rcutPS_

unsigned int trklet::MatchProcessor::rcutPS_[N_SEED]
private

Definition at line 60 of file MatchProcessor.h.

Referenced by matchCalculator(), and MatchProcessor().

◆ rphicut2S_

unsigned int trklet::MatchProcessor::rphicut2S_[N_SEED]
private

Definition at line 59 of file MatchProcessor.h.

Referenced by matchCalculator(), and MatchProcessor().

◆ rphicutPS_

unsigned int trklet::MatchProcessor::rphicutPS_[N_SEED]
private

Definition at line 58 of file MatchProcessor.h.

Referenced by matchCalculator(), and MatchProcessor().

◆ rzfact_

double trklet::MatchProcessor::rzfact_
private

Definition at line 64 of file MatchProcessor.h.

Referenced by matchCalculator(), and MatchProcessor().

◆ table2S_

std::vector<bool> trklet::MatchProcessor::table2S_
private

Definition at line 84 of file MatchProcessor.h.

Referenced by MatchProcessor().

◆ table_

std::vector<bool> trklet::MatchProcessor::table_
private

Definition at line 80 of file MatchProcessor.h.

Referenced by MatchProcessor().

◆ tablePS_

std::vector<bool> trklet::MatchProcessor::tablePS_
private

Definition at line 83 of file MatchProcessor.h.

Referenced by MatchProcessor().

◆ vmstubs_

std::vector<VMStubsMEMemory*> trklet::MatchProcessor::vmstubs_
private

Definition at line 70 of file MatchProcessor.h.

Referenced by addInput(), and execute().

◆ zmatchcut_

unsigned int trklet::MatchProcessor::zmatchcut_[N_SEED]
private

Definition at line 56 of file MatchProcessor.h.

Referenced by matchCalculator(), and MatchProcessor().

trklet::N_PSLAYER
constexpr unsigned int N_PSLAYER
Definition: Settings.h:21
trklet::Tracklet::stubtruthmatch
bool stubtruthmatch(const L1TStub *stub)
Definition: Tracklet.cc:149
trklet::Tracklet::fpgaphiprojder
const FPGAWord & fpgaphiprojder(int layer) const
Definition: Tracklet.h:94
mps_fire.i
i
Definition: mps_fire.py:355
trklet::Settings::writetrace
bool writetrace() const
Definition: Settings.h:147
trklet::Settings::rphimatchcut
double rphimatchcut(unsigned int iSeed, unsigned int ilayer) const
Definition: Settings.h:121
trklet::VMStubsMEMemory
Definition: VMStubsMEMemory.h:16
input
static const std::string input
Definition: EdmProvDump.cc:48
trklet::Settings::krprojshiftdisk
double krprojshiftdisk() const
Definition: Settings.h:341
trklet::MatchProcessor::vmstubs_
std::vector< VMStubsMEMemory * > vmstubs_
Definition: MatchProcessor.h:70
trklet::Tracklet::fpgaphiprojdisk
const FPGAWord & fpgaphiprojdisk(int disk) const
Definition: Tracklet.h:266
trklet::Stub::phi
const FPGAWord & phi() const
Definition: Stub.h:51
detailsBasic3DVector::z
float float float z
Definition: extBasic3DVector.h:14
trklet::Settings::krinvpars
double krinvpars() const
Definition: Settings.h:327
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:32
trklet::Settings::dzmax
double dzmax() const
Definition: Settings.h:106
trklet::Tracklet::rprojderdisk
double rprojderdisk(int disk) const
Definition: Tracklet.h:321
trklet::MatchProcessor::ialphafactouter_
int ialphafactouter_[N_DSS_MOD *2]
Definition: MatchProcessor.h:74
trklet::TrackletProjectionsMemory
Definition: TrackletProjectionsMemory.h:15
trklet::MatchProcessor::zmatchcut_
unsigned int zmatchcut_[N_SEED]
Definition: MatchProcessor.h:56
trklet::L1TStub
Definition: L1TStub.h:12
trklet::L1TStub::z
double z() const
Definition: L1TStub.h:56
trklet::Tracklet::getISeed
int getISeed() const
Definition: Tracklet.cc:847
trklet::Tracklet::addMatch
void addMatch(int layer, int ideltaphi, int ideltaz, double dphi, double dz, double dphiapprox, double dzapprox, int stubid, double rstub, const trklet::Stub *stubptr)
Definition: Tracklet.cc:308
cms::cuda::assert
assert(be >=bs)
trklet::MatchProcessor::rzfact_
double rzfact_
Definition: MatchProcessor.h:64
Validation_hcalonly_cfi.sign
sign
Definition: Validation_hcalonly_cfi.py:32
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:215
deltar
Definition: deltar.py:1
trklet::Settings::rphicutPS
double rphicutPS(unsigned int iSeed, unsigned int idisk) const
Definition: Settings.h:123
trklet::Settings::rmean
double rmean(unsigned int iLayer) const
Definition: Settings.h:128
trklet::ProcessBase::nbits
unsigned int nbits(unsigned int power)
Definition: ProcessBase.cc:29
trklet::ProcessBase::settings_
Settings const & settings_
Definition: ProcessBase.h:44
compare.hists
hists
Definition: compare.py:319
trklet::Stub::phiapprox
double phiapprox(double phimin, double) const
Definition: Stub.cc:236
trklet::Settings::kphi1
double kphi1() const
Definition: Settings.h:247
trklet::FPGAWord::nbits
int nbits() const
Definition: FPGAWord.h:25
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
trklet::Settings::rDSSinner
double rDSSinner(unsigned int iBin) const
Definition: Settings.h:135
trklet::Settings::half2SmoduleWidth
double half2SmoduleWidth() const
Definition: Settings.h:108
trklet::ProjectionTemp::projfinephi
unsigned int projfinephi() const
Definition: ProjectionTemp.h:27
trklet::Stub::r
const FPGAWord & r() const
Definition: Stub.h:49
trklet::Settings::bfield
double bfield() const
Definition: Settings.h:212
trklet::Settings::bookHistos
bool bookHistos() const
Definition: Settings.h:166
trklet::Tracklet::fpgarprojderdisk
const FPGAWord & fpgarprojderdisk(int disk) const
Definition: Tracklet.h:281
trklet::Settings::nrbitsstub
unsigned int nrbitsstub(unsigned int layerdisk) const
Definition: Settings.h:66
trklet::HistBase
Definition: HistBase.h:16
trklet::Settings::writeTable
bool writeTable() const
Definition: Settings.h:153
trklet::Tracklet::fpgazprojder
const FPGAWord & fpgazprojder(int layer) const
Definition: Tracklet.h:109
trklet::Tracklet
Definition: Tracklet.h:28
trklet::Settings::rDSSouter
double rDSSouter(unsigned int iBin) const
Definition: Settings.h:138
trklet::MatchProcessor::icorzshift_
int icorzshift_
Definition: MatchProcessor.h:50
LEDCalibrationChannels.iphi
iphi
Definition: LEDCalibrationChannels.py:64
trklet::ProjectionTemp::iphi
unsigned int iphi() const
Definition: ProjectionTemp.h:28
trklet::MatchProcessor::fullmatches_
std::vector< FullMatchMemory * > fullmatches_
Definition: MatchProcessor.h:77
trklet::Tracklet::addMatchDisk
void addMatchDisk(int disk, int ideltaphi, int ideltar, double dphi, double dr, double dphiapprox, double drapprox, double alpha, int stubid, double zstub, const trklet::Stub *stubptr)
Definition: Tracklet.cc:323
trklet::Tracklet::fpgazproj
const FPGAWord & fpgazproj(int layer) const
Definition: Tracklet.h:99
trklet::Stub::z
const FPGAWord & z() const
Definition: Stub.h:50
trklet::MemoryBase::getName
std::string const & getName() const
Definition: MemoryBase.h:19
trklet::MatchProcessor::barrel_
bool barrel_
Definition: MatchProcessor.h:40
trklet::Stub
Definition: Stub.h:16
trklet::Tracklet::rprojdisk
double rprojdisk(int disk) const
Definition: Tracklet.h:316
trklet::L1TStub::isPSmodule
unsigned int isPSmodule() const
Definition: L1TStub.h:93
trklet::Settings::alphashift
int alphashift() const
Definition: Settings.h:175
trklet::ProjectionTemp::projrinv
unsigned int projrinv() const
Definition: ProjectionTemp.h:25
trklet::MatchProcessor::inputProjBuffer_
CircularBuffer< ProjectionTemp > inputProjBuffer_
Definition: MatchProcessor.h:89
trklet::Settings::rcut2S
double rcut2S(unsigned int iSeed, unsigned int idisk) const
Definition: Settings.h:126
trklet::MatchProcessor::inputprojs_
std::vector< TrackletProjectionsMemory * > inputprojs_
Definition: MatchProcessor.h:71
trklet::MatchProcessor::rcutPS_
unsigned int rcutPS_[N_SEED]
Definition: MatchProcessor.h:60
trklet::Tracklet::phiprojder
double phiprojder(int layer) const
Definition: Tracklet.h:159
trklet::Settings::zmean
double zmean(unsigned int iDisk) const
Definition: Settings.h:131
trklet::Tracklet::phiprojderapprox
double phiprojderapprox(int layer) const
Definition: Tracklet.h:189
trklet::Tracklet::rproj
double rproj(int layer) const
Definition: Tracklet.h:194
trklet::MatchProcessor::nvmbins_
int nvmbins_
Definition: MatchProcessor.h:46
trklet::Tracklet::zproj
double zproj(int layer) const
Definition: Tracklet.h:164
trklet::MatchProcessor::rphicut2S_
unsigned int rphicut2S_[N_SEED]
Definition: MatchProcessor.h:59
trklet::FPGAWord
Definition: FPGAWord.h:9
trklet::Tracklet::phiprojderapproxdisk
double phiprojderapproxdisk(int disk) const
Definition: Tracklet.h:291
trklet::MatchProcessor::matchCalculator
bool matchCalculator(Tracklet *tracklet, const Stub *fpgastub)
Definition: MatchProcessor.cc:383
trklet::Tracklet::zprojderapprox
double zprojderapprox(int layer) const
Definition: Tracklet.h:179
trklet::ProcessBase::initLayerDisk
void initLayerDisk(unsigned int pos, int &layer, int &disk)
Definition: ProcessBase.cc:45
trklet::Settings::kr
double kr() const
Definition: Settings.h:250
trklet::MatchProcessor::disk_
int disk_
Definition: MatchProcessor.h:39
trklet::Settings::bendcutme
double bendcutme(unsigned int layerdisk) const
Definition: Settings.h:111
trklet::MatchProcessor::rphicutPS_
unsigned int rphicutPS_[N_SEED]
Definition: MatchProcessor.h:58
trklet::N_SEED
constexpr unsigned int N_SEED
Definition: Settings.h:22
trklet::Settings::drmax
double drmax() const
Definition: Settings.h:105
trklet::MatchProcessor::ialphafactinner_
int ialphafactinner_[N_DSS_MOD *2]
Definition: MatchProcessor.h:73
amptDefault_cfi.proj
proj
Definition: amptDefault_cfi.py:13
trklet::MatchProcessor::rcut2S_
unsigned int rcut2S_[N_SEED]
Definition: MatchProcessor.h:61
trklet::Settings::rcutPS
double rcutPS(unsigned int iSeed, unsigned int idisk) const
Definition: Settings.h:124
trklet::Stub::alphanew
const FPGAWord & alphanew() const
Definition: Stub.h:53
trklet::rinv
double rinv(double phi1, double phi2, double r1, double r2)
Definition: Util.h:167
trklet::N_DSS_MOD
constexpr unsigned int N_DSS_MOD
Definition: Settings.h:24
PVValHelper::phi
Definition: PVValidationHelpers.h:68
trklet::Tracklet::TCID
int TCID() const
Definition: Tracklet.h:500
trklet::TrackletProjectionsMemory::getTracklet
Tracklet * getTracklet(unsigned int i)
Definition: TrackletProjectionsMemory.h:25
trklet::Settings::nzbitsstub
unsigned int nzbitsstub(unsigned int layerdisk) const
Definition: Settings.h:64
trklet::Settings::nvmme
unsigned int nvmme(unsigned int layerdisk) const
Definition: Settings.h:81
edm::LogProblem
Definition: MessageLogger.h:387
match
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
trklet::MatchProcessor::tablePS_
std::vector< bool > tablePS_
Definition: MatchProcessor.h:83
trklet::Tracklet::phiprojdisk
double phiprojdisk(int disk) const
Definition: Tracklet.h:306
trklet::Stub::rapprox
double rapprox() const
Definition: Stub.cc:209
createfilelist.int
int
Definition: createfilelist.py:10
trklet::MatchProcessor::nMatchEngines_
unsigned int nMatchEngines_
Definition: MatchProcessor.h:86
trklet::MatchProcessor::icorrshift_
int icorrshift_
Definition: MatchProcessor.h:49
trklet::ProjectionTemp::slot
unsigned int slot() const
Definition: ProjectionTemp.h:24
trklet::L1TStub::alphanorm
double alphanorm() const
Definition: L1TStub.cc:91
trklet::Tracklet::phiprojapproxdisk
double phiprojapproxdisk(int disk) const
Definition: Tracklet.h:286
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:50
edm::LogVerbatim
Definition: MessageLogger.h:297
trklet::MatchProcessor::phioffset_
double phioffset_
Definition: MatchProcessor.h:53
edm::LogPrint
Definition: MessageLogger.h:342
trklet::MatchProcessor::table2S_
std::vector< bool > table2S_
Definition: MatchProcessor.h:84
trklet::Settings::nbitsrinv
int nbitsrinv() const
Definition: Settings.h:277
trklet::Tracklet::rprojderapproxdisk
double rprojderapproxdisk(int disk) const
Definition: Tracklet.h:301
trklet::ProjectionTemp::projfinerz
int projfinerz() const
Definition: ProjectionTemp.h:26
trklet::L1TStub::alpha
double alpha(double pitch) const
Definition: L1TStub.cc:79
trklet::FPGAWord::value
int value() const
Definition: FPGAWord.h:24
trklet::TrackletProjectionsMemory::nTracklets
unsigned int nTracklets() const
Definition: TrackletProjectionsMemory.h:23
trklet::Settings::nbitsalpha
int nbitsalpha() const
Definition: Settings.h:176
trklet::ProjectionRouterBendTable::bendLoookup
int bendLoookup(int diskindex, int bendindex)
Definition: ProjectionRouterBendTable.cc:54
trklet::Settings::stripPitch
double stripPitch(bool isPSmodule) const
Definition: Settings.h:219
trklet::Settings::kphi
double kphi() const
Definition: Settings.h:246
alignCSCRings.r
r
Definition: alignCSCRings.py:93
trklet::Globals::projectionRouterBendTable
ProjectionRouterBendTable *& projectionRouterBendTable()
Definition: Globals.h:46
alignmentValidation.fname
string fname
main script
Definition: alignmentValidation.py:959
trklet::Settings::writeMonitorData
bool writeMonitorData(std::string module) const
Definition: Settings.h:86
trklet::Tracklet::rinv
double rinv() const
Definition: Tracklet.h:409
trklet::Settings::SS_zderL_shift
int SS_zderL_shift() const
Definition: Settings.h:296
trklet::Globals::ofstream
std::ofstream & ofstream(std::string fname)
Definition: Globals.cc:44
trklet::Stub::l1tstub
L1TStub * l1tstub()
Definition: Stub.h:69
PVValHelper::dz
Definition: PVValidationHelpers.h:50
trklet::ProcessBase::getISeed
unsigned int getISeed(std::string name)
Definition: ProcessBase.cc:131
trklet::MatchProcessor::table_
std::vector< bool > table_
Definition: MatchProcessor.h:80
trklet::bend
double bend(double r, double rinv, double stripPitch)
Definition: Util.h:160
trklet::MatchProcessor::allstubs_
AllStubsMemory * allstubs_
Definition: MatchProcessor.h:69
trklet::MatchProcessor::nphiderbits_
int nphiderbits_
Definition: MatchProcessor.h:67
trklet::Tracklet::zprojder
double zprojder(int layer) const
Definition: Tracklet.h:169
trklet::Settings::useapprox
bool useapprox() const
Definition: Settings.h:193
relativeConstraints.empty
bool empty
Definition: relativeConstraints.py:46
trklet::MatchProcessor::layer_
int layer_
Definition: MatchProcessor.h:38
flavorHistoryFilter_cfi.dr
dr
Definition: flavorHistoryFilter_cfi.py:37
Exception
Definition: hltDiff.cc:246
trklet::MatchProcessor::phi0shift_
int phi0shift_
Definition: MatchProcessor.h:51
trklet::MatchProcessor::fact_
int fact_
Definition: MatchProcessor.h:48
trklet::Tracklet::phiproj
double phiproj(int layer) const
Definition: Tracklet.h:154
trklet::ProcessBase::getName
std::string const & getName() const
Definition: ProcessBase.h:22
trklet::Tracklet::fpgaphiproj
const FPGAWord & fpgaphiproj(int layer) const
Definition: Tracklet.h:104
trklet::Settings::kz
double kz() const
Definition: Settings.h:249
trklet::ProcessBase::name_
std::string name_
Definition: ProcessBase.h:38
trklet::Stub::stubindex
const FPGAWord & stubindex() const
Definition: Stub.h:55
trklet::Settings::nallstubs
unsigned int nallstubs(unsigned int layerdisk) const
Definition: Settings.h:84
trklet::Settings::phi0bitshift
int phi0bitshift() const
Definition: Settings.h:306
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::zmatchcut
double zmatchcut(unsigned int iSeed, unsigned int ilayer) const
Definition: Settings.h:122
trklet::Settings::rcrit
double rcrit() const
Definition: Settings.h:236
trklet::MatchProcessor::phiregion_
unsigned int phiregion_
Definition: MatchProcessor.h:42
trklet::Settings::rphicut2S
double rphicut2S(unsigned int iSeed, unsigned int idisk) const
Definition: Settings.h:125
trklet::ProjectionTemp
Definition: ProjectionTemp.h:9
trklet::Tracklet::fpgarprojdisk
const FPGAWord & fpgarprojdisk(int disk) const
Definition: Tracklet.h:276
trklet::MatchEngineUnit
Definition: MatchEngineUnit.h:18
trklet::Tracklet::disk
int disk() const
Definition: Tracklet.cc:822
trklet::Settings::maxStep
unsigned int maxStep(std::string module) const
Definition: Settings.h:93
trklet::L1TStub::r
double r() const
Definition: L1TStub.h:57
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
trklet::Settings::PS_zderL_shift
int PS_zderL_shift() const
Definition: Settings.h:295
trklet::Tracklet::rprojapproxdisk
double rprojapproxdisk(int disk) const
Definition: Tracklet.h:296
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::Tracklet::fpgaphiprojderdisk
const FPGAWord & fpgaphiprojderdisk(int disk) const
Definition: Tracklet.h:271
trklet::Globals::histograms
HistBase *& histograms()
Definition: Globals.h:40
trklet::ProcessBase::globals_
Globals * globals_
Definition: ProcessBase.h:45
trklet::Tracklet::phiprojderdisk
double phiprojderdisk(int disk) const
Definition: Tracklet.h:311
trklet::Tracklet::t
double t() const
Definition: Tracklet.h:412
trklet::ProcessBase::ProcessBase
ProcessBase(std::string name, Settings const &settings, Globals *global, unsigned int iSector)
Definition: ProcessBase.cc:14
trklet::ProjectionTemp::proj
Tracklet * proj() const
Definition: ProjectionTemp.h:23
trklet::Settings::c
double c() const
Definition: Settings.h:171
trklet::MatchProcessor::phimatchcut_
unsigned int phimatchcut_[N_SEED]
Definition: MatchProcessor.h:55
trklet::ProcessBase::phimax_
double phimax_
Definition: ProcessBase.h:42
trklet::MatchProcessor::nvm_
int nvm_
Definition: MatchProcessor.h:44
trklet::VMStubsMEMemory::nStubsBin
unsigned int nStubsBin(unsigned int bin) const
Definition: VMStubsMEMemory.h:28
trklet::MatchProcessor::nrbits_
int nrbits_
Definition: MatchProcessor.h:66
trklet::Tracklet::phiprojapprox
double phiprojapprox(int layer) const
Definition: Tracklet.h:184
trklet::Stub::zapprox
double zapprox() const
Definition: Stub.cc:217
trklet::L1TStub::r2
double r2() const
Definition: L1TStub.h:59
trklet::Tracklet::layer
int layer() const
Definition: Tracklet.cc:815
trklet::Tracklet::zprojapprox
double zprojapprox(int layer) const
Definition: Tracklet.h:174
trklet::L1TStub::phi
double phi() const
Definition: L1TStub.h:62
trklet::ProjectionRouterBendTable
Definition: ProjectionRouterBendTable.h:16
trklet::MatchProcessor::matchengines_
std::vector< MatchEngineUnit > matchengines_
Definition: MatchProcessor.h:87
memory
Definition: vlib.h:178
trklet::ProjectionTemp::isPSseed
bool isPSseed() const
Definition: ProjectionTemp.h:29
trklet::MatchProcessor::nvmbits_
int nvmbits_
Definition: MatchProcessor.h:45
trklet::MatchProcessor::phifact_
double phifact_
Definition: MatchProcessor.h:63
reco::reduceRange
constexpr T reduceRange(T x)
Definition: deltaPhi.h:18