CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Attributes
trklet::TrackletCalculatorBase Class Reference

#include <TrackletCalculatorBase.h>

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

Public Member Functions

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)
 
 ~TrackletCalculatorBase () override=default
 
- Public Member Functions inherited from trklet::ProcessBase
virtual void addInput (MemoryBase *memory, std::string input)=0
 
virtual void addOutput (MemoryBase *memory, std::string output)=0
 
unsigned int getISeed (const std::string &name)
 
std::string const & getName () const
 
void initLayerDisk (unsigned int pos, int &layer, int &disk)
 
void initLayerDisk (unsigned int pos, int &layer, int &disk, int &layerdisk)
 
unsigned int initLayerDisk (unsigned int pos)
 
void initLayerDisksandISeed (unsigned int &layerdisk1, unsigned int &layerdisk2, unsigned int &iSeed)
 
unsigned int nbits (unsigned int power)
 
 ProcessBase (std::string name, Settings const &settings, Globals *global)
 
virtual ~ProcessBase ()=default
 

Protected Attributes

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

Detailed Description

Definition at line 18 of file TrackletCalculatorBase.h.

Constructor & Destructor Documentation

◆ TrackletCalculatorBase()

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

Definition at line 18 of file TrackletCalculatorBase.cc.

19  : ProcessBase(name, settings, global) {}
ProcessBase(std::string name, Settings const &settings, Globals *global)
Definition: ProcessBase.cc:14

◆ ~TrackletCalculatorBase()

trklet::TrackletCalculatorBase::~TrackletCalculatorBase ( )
overridedefault

Member Function Documentation

◆ addDiskProj()

void TrackletCalculatorBase::addDiskProj ( Tracklet tracklet,
int  disk 
)

Definition at line 211 of file TrackletCalculatorBase.cc.

References funct::abs(), addProjectionDisk(), trklet::Projection::fpgaphiproj(), trklet::Projection::fpgarzproj(), hcalRecHitTable_cff::iphi, trklet::Settings::krprojshiftdisk(), trklet::N_LAYER, trklet::Settings::nallstubs(), trklet::FPGAWord::nbits(), trklet::Tracklet::proj(), trklet::Settings::rmaxdisk(), trklet::Settings::rmindiskvm(), trklet::ProcessBase::settings_, trackletprojdisks_, and trklet::FPGAWord::value().

Referenced by barrelSeeding(), diskSeeding(), and overlapSeeding().

211  {
212  disk = std::abs(disk);
213 
214  FPGAWord fpgar = tracklet->proj(N_LAYER + disk - 1).fpgarzproj();
215 
216  if (fpgar.value() * settings_.krprojshiftdisk() < settings_.rmindiskvm())
217  return;
218  if (fpgar.value() * settings_.krprojshiftdisk() > settings_.rmaxdisk())
219  return;
220 
221  FPGAWord fpgaphi = tracklet->proj(N_LAYER + disk - 1).fpgaphiproj();
222 
223  int iphivmRaw = fpgaphi.value() >> (fpgaphi.nbits() - 5);
224 
225  int iphi = iphivmRaw / (32 / settings_.nallstubs(disk + N_LAYER - 1));
226 
227  addProjectionDisk(disk, iphi, trackletprojdisks_[disk - 1][iphi], tracklet);
228 }
Projection & proj(int layerdisk)
Definition: Tracklet.h:87
Settings const & settings_
Definition: ProcessBase.h:40
double rmindiskvm() const
Definition: Settings.h:349
const FPGAWord & fpgaphiproj() const
Definition: Projection.h:39
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int value() const
Definition: FPGAWord.h:24
std::vector< std::vector< TrackletProjectionsMemory * > > trackletprojdisks_
unsigned int nallstubs(unsigned int layerdisk) const
Definition: Settings.h:114
double rmaxdisk() const
Definition: Settings.h:132
int nbits() const
Definition: FPGAWord.h:25
const FPGAWord & fpgarzproj() const
Definition: Projection.h:44
void addProjectionDisk(int disk, int iphi, TrackletProjectionsMemory *trackletprojs, Tracklet *tracklet)
double krprojshiftdisk() const
Definition: Settings.h:435
constexpr int N_LAYER
Definition: Settings.h:25

◆ addLayerProj()

bool TrackletCalculatorBase::addLayerProj ( Tracklet tracklet,
int  layer 
)

Definition at line 230 of file TrackletCalculatorBase.cc.

References funct::abs(), addProjection(), cms::cuda::assert(), trklet::FPGAWord::atExtreme(), trklet::Projection::fpgaphiproj(), trklet::Projection::fpgarzproj(), hcalRecHitTable_cff::iphi, trklet::Settings::kz(), trklet::Settings::nallstubs(), trklet::FPGAWord::nbits(), trklet::Tracklet::proj(), trklet::ProcessBase::settings_, trackletprojlayers_, trklet::FPGAWord::value(), and trklet::Settings::zlength().

Referenced by barrelSeeding(), diskSeeding(), and overlapSeeding().

230  {
231  assert(layer > 0);
232 
233  FPGAWord fpgaz = tracklet->proj(layer - 1).fpgarzproj();
234  FPGAWord fpgaphi = tracklet->proj(layer - 1).fpgaphiproj();
235 
236  if (fpgaphi.atExtreme())
237  edm::LogProblem("Tracklet") << "at extreme! " << fpgaphi.value();
238 
239  assert(!fpgaphi.atExtreme());
240 
241  if (fpgaz.atExtreme())
242  return false;
243 
244  if (std::abs(fpgaz.value() * settings_.kz()) > settings_.zlength())
245  return false;
246 
247  int iphivmRaw = fpgaphi.value() >> (fpgaphi.nbits() - 5);
248  int iphi = iphivmRaw / (32 / settings_.nallstubs(layer - 1));
249 
251 
252  return true;
253 }
double kz() const
Definition: Settings.h:336
double zlength() const
Definition: Settings.h:131
Projection & proj(int layerdisk)
Definition: Tracklet.h:87
Settings const & settings_
Definition: ProcessBase.h:40
assert(be >=bs)
const FPGAWord & fpgaphiproj() const
Definition: Projection.h:39
void addProjection(int layer, int iphi, TrackletProjectionsMemory *trackletprojs, Tracklet *tracklet)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int value() const
Definition: FPGAWord.h:24
unsigned int nallstubs(unsigned int layerdisk) const
Definition: Settings.h:114
std::vector< std::vector< TrackletProjectionsMemory * > > trackletprojlayers_
int nbits() const
Definition: FPGAWord.h:25
const FPGAWord & fpgarzproj() const
Definition: Projection.h:44
bool atExtreme() const
Definition: FPGAWord.cc:79

◆ addProjection()

void TrackletCalculatorBase::addProjection ( int  layer,
int  iphi,
TrackletProjectionsMemory trackletprojs,
Tracklet tracklet 
)

Definition at line 255 of file TrackletCalculatorBase.cc.

References trklet::TrackletProjectionsMemory::addProj(), cms::cuda::assert(), trklet::ProcessBase::getName(), hcalRecHitTable_cff::iphi, trklet::ProcessBase::settings_, and trklet::Settings::warnNoMem().

Referenced by addLayerProj().

258  {
259  if (trackletprojs == nullptr) {
260  if (settings_.warnNoMem()) {
261  edm::LogVerbatim("Tracklet") << "No projection memory exists in " << getName() << " for layer = " << layer
262  << " iphi = " << iphi + 1;
263  }
264  return;
265  }
266  assert(trackletprojs != nullptr);
267  trackletprojs->addProj(tracklet);
268 }
Log< level::Info, true > LogVerbatim
Settings const & settings_
Definition: ProcessBase.h:40
assert(be >=bs)
bool warnNoMem() const
Definition: Settings.h:195
std::string const & getName() const
Definition: ProcessBase.h:22

◆ addProjectionDisk()

void TrackletCalculatorBase::addProjectionDisk ( int  disk,
int  iphi,
TrackletProjectionsMemory trackletprojs,
Tracklet tracklet 
)

Definition at line 270 of file TrackletCalculatorBase.cc.

References funct::abs(), trklet::TrackletProjectionsMemory::addProj(), cms::cuda::assert(), trklet::ProcessBase::getName(), hcalRecHitTable_cff::iphi, iSeed_, trklet::L3L4, trklet::ProcessBase::settings_, and trklet::Settings::warnNoMem().

Referenced by addDiskProj().

273  {
274  if (iSeed_ == Seed::L3L4 && abs(disk) == 4)
275  return; //L3L4 projections to D3 are not used. Should be in configuration
276  if (trackletprojs == nullptr) {
277  if (iSeed_ == Seed::L3L4 && abs(disk) == 3)
278  return; //L3L4 projections to D3 are not used.
279  if (settings_.warnNoMem()) {
280  edm::LogVerbatim("Tracklet") << "No projection memory exists in " << getName() << " for disk = " << abs(disk)
281  << " iphi = " << iphi + 1;
282  }
283  return;
284  }
285  assert(trackletprojs != nullptr);
286  trackletprojs->addProj(tracklet);
287 }
Log< level::Info, true > LogVerbatim
Settings const & settings_
Definition: ProcessBase.h:40
assert(be >=bs)
bool warnNoMem() const
Definition: Settings.h:195
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::string const & getName() const
Definition: ProcessBase.h:22

◆ barrelSeeding()

bool TrackletCalculatorBase::barrelSeeding ( const Stub innerFPGAStub,
const L1TStub innerStub,
const Stub outerFPGAStub,
const L1TStub outerStub 
)

Definition at line 331 of file TrackletCalculatorBase.cc.

References funct::abs(), addDiskProj(), addLayerProj(), trklet::TrackletParametersMemory::addTracklet(), cms::cuda::assert(), trklet::Settings::bookHistos(), trklet::VarBase::calculate(), trklet::Settings::debugTracklet(), trklet::IMATH_TrackletCalculator::der_phiD_final, trklet::IMATH_TrackletCalculator::der_phiL_final, trklet::IMATH_TrackletCalculator::der_rD_final, trklet::IMATH_TrackletCalculator::der_zL_final, exacttracklet(), groupFilesInBlocks::fout, trklet::VarBase::fval(), trklet::Tracklet::getISeed(), trklet::ProcessBase::getName(), trklet::ProcessBase::globals_, goodTrackPars(), trklet::Globals::histograms(), compare::hists, mps_fire::i, trklet::Projection::init(), inSector(), iSector_, iSeed_, trklet::Globals::ITC_L1L2(), trklet::Globals::ITC_L2L3(), trklet::Globals::ITC_L3L4(), trklet::Globals::ITC_L5L6(), trklet::VarBase::ival(), dqmiolumiharvest::j, trklet::VarBase::K(), trklet::Stub::layer(), trklet::Stub::layerdisk(), layerdisk1_, layerdisk2_, trklet::VarBase::local_passes(), angle0to2pi::make0To2pi(), trklet::N_DISK, trklet::N_LAYER, trklet::ProcessBase::name_, trklet::Settings::nphibitsstub(), trklet::Settings::nrbitsstub(), trklet::TrackletParametersMemory::nTracklets(), trklet::Settings::nzbitsstub(), trklet::Globals::ofstream(), trklet::Stub::phi(), trklet::L1TStub::phi(), trklet::IMATH_TrackletCalculator::phi0_final, trklet::IMATH_TrackletCalculator::phi1, trklet::IMATH_TrackletCalculator::phi2, trklet::Stub::phiapprox(), trklet::IMATH_TrackletCalculator::phiD_0_final, trklet::IMATH_TrackletCalculator::phiD_1_final, trklet::IMATH_TrackletCalculator::phiD_2_final, trklet::IMATH_TrackletCalculator::phiD_3_final, trklet::IMATH_TrackletCalculator::phiD_4_final, trklet::IMATH_TrackletCalculator::phiL_0_final, trklet::IMATH_TrackletCalculator::phiL_1_final, trklet::IMATH_TrackletCalculator::phiL_2_final, trklet::IMATH_TrackletCalculator::phiL_3_final, phimax_, phimin_, trklet::Settings::projlayers(), trklet::Stub::r(), trklet::L1TStub::r(), trklet::IMATH_TrackletCalculator::r1, diffTwoXMLs::r2, trklet::IMATH_TrackletCalculator::r2, trklet::Stub::rapprox(), trklet::IMATH_TrackletCalculator::rD_0_final, trklet::IMATH_TrackletCalculator::rD_1_final, trklet::IMATH_TrackletCalculator::rD_2_final, trklet::IMATH_TrackletCalculator::rD_3_final, trklet::IMATH_TrackletCalculator::rD_4_final, trklet::rinv(), trklet::IMATH_TrackletCalculator::rinv_final, trklet::Settings::rmaxdisk(), trklet::Settings::rmean(), trklet::Settings::rmindisk(), trklet::IMATH_TrackletCalculator::rproj0, trklet::IMATH_TrackletCalculator::rproj1, trklet::IMATH_TrackletCalculator::rproj2, trklet::IMATH_TrackletCalculator::rproj3, trklet::VarDef::set_fval(), trklet::VarDef::set_ival(), trklet::Tracklet::setTCIndex(), trklet::ProcessBase::settings_, trklet::Tracklet::setTrackletIndex(), trklet::L1TStub::sigmaz(), submitPVValidationJobs::t, trklet::IMATH_TrackletCalculator::t_final, TCIndex_, cmsswSequenceInfo::tp, trklet::Tracklet::tpseed(), trackletpars_, trklet::Settings::useapprox(), trklet::Tracklet::validProj(), trklet::FPGAWord::value(), trklet::Settings::writeMonitorData(), trklet::L1TStub::z(), trklet::Stub::z(), trklet::IMATH_TrackletCalculator::z0_final, trklet::IMATH_TrackletCalculator::z1, testProducerWithPsetDescEmpty_cfi::z2, trklet::IMATH_TrackletCalculator::z2, trklet::Stub::zapprox(), trklet::IMATH_TrackletCalculator::zL_0_final, trklet::IMATH_TrackletCalculator::zL_1_final, trklet::IMATH_TrackletCalculator::zL_2_final, trklet::IMATH_TrackletCalculator::zL_3_final, trklet::Settings::zmean(), trklet::IMATH_TrackletCalculator::zproj0, trklet::IMATH_TrackletCalculator::zproj1, trklet::IMATH_TrackletCalculator::zproj2, trklet::IMATH_TrackletCalculator::zproj3, and trklet::IMATH_TrackletCalculator::zproj4.

Referenced by trklet::TrackletCalculator::execute(), and trklet::TrackletProcessor::execute().

334  {
335  if (settings_.debugTracklet()) {
336  edm::LogVerbatim("Tracklet") << "TrackletCalculatorBase " << getName()
337  << " trying stub pair in layer (inner outer): " << innerFPGAStub->layer().value()
338  << " " << outerFPGAStub->layer().value();
339  }
340 
341  assert(outerFPGAStub->layerdisk() < N_LAYER);
342  assert(layerdisk1_ == (unsigned int)innerFPGAStub->layer().value());
344 
345  double r1 = innerStub->r();
346  double z1 = innerStub->z();
347  double phi1 = innerStub->phi();
348 
349  double r2 = outerStub->r();
350  double z2 = outerStub->z();
351  double phi2 = outerStub->phi();
352 
353  double rinv, phi0, t, z0;
354 
355  double phiproj[N_LAYER - 2], zproj[N_LAYER - 2], phider[N_LAYER - 2], zder[N_LAYER - 2];
356  double phiprojdisk[N_DISK], rprojdisk[N_DISK], phiderdisk[N_DISK], rderdisk[N_DISK];
357 
359  z1,
360  phi1,
361  r2,
362  z2,
363  phi2,
364  outerStub->sigmaz(),
365  rinv,
366  phi0,
367  t,
368  z0,
369  phiproj,
370  zproj,
371  phider,
372  zder,
373  phiprojdisk,
374  rprojdisk,
375  phiderdisk,
376  rderdisk);
377 
378  if (settings_.useapprox()) {
379  phi1 = innerFPGAStub->phiapprox(phimin_, phimax_);
380  z1 = innerFPGAStub->zapprox();
381  r1 = innerFPGAStub->rapprox();
382 
383  phi2 = outerFPGAStub->phiapprox(phimin_, phimax_);
384  z2 = outerFPGAStub->zapprox();
385  r2 = outerFPGAStub->rapprox();
386  }
387 
388  double rinvapprox, phi0approx, tapprox, z0approx;
389  double phiprojapprox[N_LAYER - 2], zprojapprox[N_LAYER - 2];
390  double phiprojdiskapprox[N_DISK], rprojdiskapprox[N_DISK];
391 
393  if (iSeed_ == 0)
394  ITC = globals_->ITC_L1L2();
395  else if (iSeed_ == 1)
396  ITC = globals_->ITC_L2L3();
397  else if (iSeed_ == 2)
398  ITC = globals_->ITC_L3L4();
399  else
400  ITC = globals_->ITC_L5L6();
401 
404  ITC->z1.set_fval(z1);
405  ITC->z2.set_fval(z2);
406  double sphi1 = angle0to2pi::make0To2pi(phi1 - phimin_);
407  double sphi2 = angle0to2pi::make0To2pi(phi2 - phimin_);
408 
409  ITC->phi1.set_fval(sphi1);
410  ITC->phi2.set_fval(sphi2);
411 
416 
417  ITC->zproj0.set_fval(t > 0 ? settings_.zmean(0) : -settings_.zmean(0));
418  ITC->zproj1.set_fval(t > 0 ? settings_.zmean(1) : -settings_.zmean(1));
419  ITC->zproj2.set_fval(t > 0 ? settings_.zmean(2) : -settings_.zmean(2));
420  ITC->zproj3.set_fval(t > 0 ? settings_.zmean(3) : -settings_.zmean(3));
421  ITC->zproj4.set_fval(t > 0 ? settings_.zmean(4) : -settings_.zmean(4));
422 
423  ITC->rinv_final.calculate();
424  ITC->phi0_final.calculate();
425  ITC->t_final.calculate();
426  ITC->z0_final.calculate();
427 
428  ITC->phiL_0_final.calculate();
429  ITC->phiL_1_final.calculate();
430  ITC->phiL_2_final.calculate();
431  ITC->phiL_3_final.calculate();
432 
433  ITC->zL_0_final.calculate();
434  ITC->zL_1_final.calculate();
435  ITC->zL_2_final.calculate();
436  ITC->zL_3_final.calculate();
437 
438  ITC->phiD_0_final.calculate();
439  ITC->phiD_1_final.calculate();
440  ITC->phiD_2_final.calculate();
441  ITC->phiD_3_final.calculate();
442  ITC->phiD_4_final.calculate();
443 
444  ITC->rD_0_final.calculate();
445  ITC->rD_1_final.calculate();
446  ITC->rD_2_final.calculate();
447  ITC->rD_3_final.calculate();
448  ITC->rD_4_final.calculate();
449 
450  ITC->der_phiL_final.calculate();
451  ITC->der_zL_final.calculate();
452  ITC->der_phiD_final.calculate();
453  ITC->der_rD_final.calculate();
454 
455  //store the approximate results
456  rinvapprox = ITC->rinv_final.fval();
457  phi0approx = ITC->phi0_final.fval();
458  tapprox = ITC->t_final.fval();
459  z0approx = ITC->z0_final.fval();
460 
461  phiprojapprox[0] = ITC->phiL_0_final.fval();
462  phiprojapprox[1] = ITC->phiL_1_final.fval();
463  phiprojapprox[2] = ITC->phiL_2_final.fval();
464  phiprojapprox[3] = ITC->phiL_3_final.fval();
465 
466  zprojapprox[0] = ITC->zL_0_final.fval();
467  zprojapprox[1] = ITC->zL_1_final.fval();
468  zprojapprox[2] = ITC->zL_2_final.fval();
469  zprojapprox[3] = ITC->zL_3_final.fval();
470 
471  phiprojdiskapprox[0] = ITC->phiD_0_final.fval();
472  phiprojdiskapprox[1] = ITC->phiD_1_final.fval();
473  phiprojdiskapprox[2] = ITC->phiD_2_final.fval();
474  phiprojdiskapprox[3] = ITC->phiD_3_final.fval();
475  phiprojdiskapprox[4] = ITC->phiD_4_final.fval();
476 
477  rprojdiskapprox[0] = ITC->rD_0_final.fval();
478  rprojdiskapprox[1] = ITC->rD_1_final.fval();
479  rprojdiskapprox[2] = ITC->rD_2_final.fval();
480  rprojdiskapprox[3] = ITC->rD_3_final.fval();
481  rprojdiskapprox[4] = ITC->rD_4_final.fval();
482 
483  //now binary
484 
485  int irinv, iphi0, it, iz0;
486  Projection projs[N_LAYER + N_DISK];
487 
488  int iphiproj[N_LAYER - 2], izproj[N_LAYER - 2];
489  int iphiprojdisk[N_DISK], irprojdisk[N_DISK];
490 
491  int ir1 = innerFPGAStub->r().value();
492  int iphi1 = innerFPGAStub->phi().value();
493  int iz1 = innerFPGAStub->z().value();
494 
495  int ir2 = outerFPGAStub->r().value();
496  int iphi2 = outerFPGAStub->phi().value();
497  int iz2 = outerFPGAStub->z().value();
498 
501  ir1 <<= (8 - settings_.nrbitsstub(layerdisk1_));
502  ir2 <<= (8 - settings_.nrbitsstub(layerdisk2_));
503 
506 
507  ITC->r1.set_ival(ir1);
508  ITC->r2.set_ival(ir2);
509  ITC->z1.set_ival(iz1);
510  ITC->z2.set_ival(iz2);
511  ITC->phi1.set_ival(iphi1);
512  ITC->phi2.set_ival(iphi2);
513 
514  ITC->rinv_final.calculate();
515  ITC->phi0_final.calculate();
516  ITC->t_final.calculate();
517  ITC->z0_final.calculate();
518 
519  ITC->phiL_0_final.calculate();
520  ITC->phiL_1_final.calculate();
521  ITC->phiL_2_final.calculate();
522  ITC->phiL_3_final.calculate();
523 
524  ITC->zL_0_final.calculate();
525  ITC->zL_1_final.calculate();
526  ITC->zL_2_final.calculate();
527  ITC->zL_3_final.calculate();
528 
529  ITC->phiD_0_final.calculate();
530  ITC->phiD_1_final.calculate();
531  ITC->phiD_2_final.calculate();
532  ITC->phiD_3_final.calculate();
533  ITC->phiD_4_final.calculate();
534 
535  ITC->rD_0_final.calculate();
536  ITC->rD_1_final.calculate();
537  ITC->rD_2_final.calculate();
538  ITC->rD_3_final.calculate();
539  ITC->rD_4_final.calculate();
540 
541  ITC->der_phiL_final.calculate();
542  ITC->der_zL_final.calculate();
543  ITC->der_phiD_final.calculate();
544  ITC->der_rD_final.calculate();
545 
546  //store the binary results
547  irinv = ITC->rinv_final.ival();
548  iphi0 = ITC->phi0_final.ival();
549  it = ITC->t_final.ival();
550  iz0 = ITC->z0_final.ival();
551 
552  iphiproj[0] = ITC->phiL_0_final.ival();
553  iphiproj[1] = ITC->phiL_1_final.ival();
554  iphiproj[2] = ITC->phiL_2_final.ival();
555  iphiproj[3] = ITC->phiL_3_final.ival();
556 
557  izproj[0] = ITC->zL_0_final.ival();
558  izproj[1] = ITC->zL_1_final.ival();
559  izproj[2] = ITC->zL_2_final.ival();
560  izproj[3] = ITC->zL_3_final.ival();
561 
563  if (settings_.debugTracklet()) {
564  edm::LogVerbatim("Tracklet") << getName() << " Failed rinv or z0 cut";
565  }
566  return false;
567  }
568 
569  if (!inSector(iphi0, irinv, phi0approx, rinvapprox)) {
570  if (settings_.debugTracklet()) {
571  edm::LogVerbatim("Tracklet") << getName() << " Failed in sector check";
572  }
573  return false;
574  }
575 
576  for (unsigned int i = 0; i < N_LAYER - 2; ++i) {
577  //reject projection if z is out of range
578  if (izproj[i] < -(1 << (settings_.nzbitsstub(0) - 1)))
579  continue;
580  if (izproj[i] >= (1 << (settings_.nzbitsstub(0) - 1)))
581  continue;
582 
583  //reject projection if phi is out of range
584  if (iphiproj[i] >= (1 << settings_.nphibitsstub(5)) - 1)
585  continue;
586  if (iphiproj[i] <= 0)
587  continue;
588 
589  //Adjust bits for r and z projection depending on layer
590  if (settings_.projlayers(iSeed_, i) <= 3) { //TODO clean up logic
592  } else {
593  izproj[i] >>= (settings_.nzbitsstub(0) - settings_.nzbitsstub(5));
594  }
595 
596  projs[settings_.projlayers(iSeed_, i) - 1].init(settings_,
598  iphiproj[i],
599  izproj[i],
600  ITC->der_phiL_final.ival(),
601  ITC->der_zL_final.ival(),
602  phiproj[i],
603  zproj[i],
604  phider[i],
605  zder[i],
606  phiprojapprox[i],
607  zprojapprox[i],
608  ITC->der_phiL_final.fval(),
609  ITC->der_zL_final.fval(),
610  !(iSeed_ == 2 || iSeed_ == 3));
611  }
612 
613  iphiprojdisk[0] = ITC->phiD_0_final.ival();
614  iphiprojdisk[1] = ITC->phiD_1_final.ival();
615  iphiprojdisk[2] = ITC->phiD_2_final.ival();
616  iphiprojdisk[3] = ITC->phiD_3_final.ival();
617  iphiprojdisk[4] = ITC->phiD_4_final.ival();
618 
619  irprojdisk[0] = ITC->rD_0_final.ival();
620  irprojdisk[1] = ITC->rD_1_final.ival();
621  irprojdisk[2] = ITC->rD_2_final.ival();
622  irprojdisk[3] = ITC->rD_3_final.ival();
623  irprojdisk[4] = ITC->rD_4_final.ival();
624 
625  if (std::abs(it * ITC->t_final.K()) > 1.0) {
626  for (unsigned int i = 0; i < N_DISK; ++i) {
627  if (iphiprojdisk[i] <= 0)
628  continue;
629  if (iphiprojdisk[i] >= (1 << settings_.nphibitsstub(0)) - 1)
630  continue;
631 
632  if (irprojdisk[i] < settings_.rmindisk() / ITC->rD_0_final.K() ||
633  irprojdisk[i] >= settings_.rmaxdisk() / ITC->rD_0_final.K())
634  continue;
635 
636  projs[i + N_LAYER].init(settings_,
637  i + N_LAYER,
638  iphiprojdisk[i],
639  irprojdisk[i],
640  ITC->der_phiD_final.ival(),
641  ITC->der_rD_final.ival(),
642  phiprojdisk[i],
643  rprojdisk[i],
644  phiderdisk[i],
645  rderdisk[i],
646  phiprojdiskapprox[i],
647  rprojdiskapprox[i],
648  ITC->der_phiD_final.fval(),
649  ITC->der_rD_final.fval(),
650  !(iSeed_ == 2 || iSeed_ == 3));
651  }
652  }
653 
654  if (settings_.writeMonitorData("TPars")) {
655  globals_->ofstream("trackletpars.txt")
656  << "Trackpars " << layerdisk1_ + 1 << " " << rinv << " " << rinvapprox << " " << ITC->rinv_final.fval()
657  << " " << phi0 << " " << phi0approx << " " << ITC->phi0_final.fval() << " " << t << " " << tapprox << " "
658  << ITC->t_final.fval() << " " << z0 << " " << z0approx << " " << ITC->z0_final.fval() << endl;
659  }
660 
661  Tracklet* tracklet = new Tracklet(settings_,
662  iSeed_,
663  innerFPGAStub,
664  nullptr,
665  outerFPGAStub,
666  rinv,
667  phi0,
668  0.0,
669  z0,
670  t,
671  rinvapprox,
672  phi0approx,
673  0.0,
674  z0approx,
675  tapprox,
676  irinv,
677  iphi0,
678  0,
679  iz0,
680  it,
681  projs,
682  false);
683 
684  if (settings_.debugTracklet()) {
685  edm::LogVerbatim("Tracklet") << "TrackletCalculator " << getName() << " Found tracklet for seed = " << iSeed_ << " "
686  << iSector_ << " phi0 = " << phi0;
687  }
688 
690  tracklet->setTCIndex(TCIndex_);
691 
692  if (settings_.writeMonitorData("Seeds")) {
693  ofstream fout("seeds.txt", ofstream::app);
694  fout << __FILE__ << ":" << __LINE__ << " " << name_ << "_" << iSector_ << " " << tracklet->getISeed() << endl;
695  fout.close();
696  }
697  trackletpars_->addTracklet(tracklet);
698 
699  if (settings_.bookHistos()) {
701  int tp = tracklet->tpseed();
702  hists->fillTrackletParams(settings_,
703  globals_,
704  iSeed_,
705  iSector_,
706  rinvapprox,
707  irinv * ITC->rinv_final.K(),
708  phi0approx,
709  iphi0 * ITC->phi0_final.K(),
710  asinh(tapprox),
711  asinh(it * ITC->t_final.K()),
712  z0approx,
713  iz0 * ITC->z0_final.K(),
714  tp);
715  }
716 
717  bool addL3 = false;
718  bool addL4 = false;
719  bool addL5 = false;
720  bool addL6 = false;
721  for (unsigned int j = 0; j < N_LAYER - 2; j++) {
722  int lproj = settings_.projlayers(iSeed_, j);
723  bool added = false;
724  if (tracklet->validProj(lproj - 1)) {
725  added = addLayerProj(tracklet, lproj);
726  if (added && lproj == 3)
727  addL3 = true;
728  if (added && lproj == 4)
729  addL4 = true;
730  if (added && lproj == 5)
731  addL5 = true;
732  if (added && lproj == 6)
733  addL6 = true;
734  }
735  }
736 
737  for (unsigned int j = 0; j < N_DISK - 1; j++) { //no projections to 5th disk!!
738  int disk = j + 1;
739  if (disk == 4 && addL3)
740  continue;
741  if (disk == 3 && addL4)
742  continue;
743  if (disk == 2 && addL5)
744  continue;
745  if (disk == 1 && addL6)
746  continue;
747  if (it < 0)
748  disk = -disk;
749  if (tracklet->validProj(N_LAYER + abs(disk) - 1)) {
750  addDiskProj(tracklet, disk);
751  }
752  }
753 
754  return true;
755 }
Log< level::Info, true > LogVerbatim
double phi() const
Definition: L1TStub.h:65
double zapprox() const
Definition: Stub.cc:158
double fval() const
Definition: imath.h:213
constexpr int N_DISK
Definition: Settings.h:26
const FPGAWord & r() const
Definition: Stub.h:60
bool bookHistos() const
Definition: Settings.h:217
unsigned int nrbitsstub(unsigned int layerdisk) const
Definition: Settings.h:91
std::string name_
Definition: ProcessBase.h:38
IMATH_TrackletCalculator * ITC_L2L3()
Definition: Globals.h:49
double phiapprox(double phimin, double) const
Definition: Stub.cc:177
const FPGAWord & z() const
Definition: Stub.h:61
bool goodTrackPars(bool goodrinv, bool goodz0)
double rmindisk() const
Definition: Settings.h:133
Settings const & settings_
Definition: ProcessBase.h:40
bool addLayerProj(Tracklet *tracklet, int layer)
double z() const
Definition: L1TStub.h:59
Globals * globals_
Definition: ProcessBase.h:41
void set_fval(double fval)
Definition: imath.h:494
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])
assert(be >=bs)
unsigned int projlayers(unsigned int iSeed, unsigned int i) const
Definition: Settings.h:162
void init(Settings const &settings, unsigned int layerdisk, int iphiproj, int irzproj, int iphider, int irzder, double phiproj, double rzproj, double phiprojder, double rzprojder, double phiprojapprox, double rzprojapprox, double phiprojderapprox, double rzprojderapprox, bool isPSseed)
Definition: Projection.cc:11
unsigned int nzbitsstub(unsigned int layerdisk) const
Definition: Settings.h:89
unsigned int nphibitsstub(unsigned int layerdisk) const
Definition: Settings.h:90
double rmean(unsigned int iLayer) const
Definition: Settings.h:171
bool local_passes() const
Definition: imath.cc:315
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
IMATH_TrackletCalculator * ITC_L1L2()
Definition: Globals.h:48
int value() const
Definition: FPGAWord.h:24
TrackletParametersMemory * trackletpars_
bool writeMonitorData(std::string module) const
Definition: Settings.h:116
unsigned int layerdisk() const
Definition: Stub.cc:185
double rapprox() const
Definition: Stub.cc:144
double zmean(unsigned int iDisk) const
Definition: Settings.h:174
void setTCIndex(int index)
Definition: Tracklet.h:210
double K() const
Definition: imath.h:247
bool debugTracklet() const
Definition: Settings.h:192
double rmaxdisk() const
Definition: Settings.h:132
void setTrackletIndex(unsigned int index)
Definition: Tracklet.cc:796
double rinv(double phi1, double phi2, double r1, double r2)
Definition: Util.h:66
int getISeed() const
Definition: Tracklet.cc:801
constexpr valType make0To2pi(valType angle)
Definition: deltaPhi.h:67
long int ival() const
Definition: imath.h:214
IMATH_TrackletCalculator * ITC_L5L6()
Definition: Globals.h:51
void addDiskProj(Tracklet *tracklet, int disk)
IMATH_TrackletCalculator * ITC_L3L4()
Definition: Globals.h:50
void set_ival(int ival)
Definition: imath.h:502
double r() const
Definition: L1TStub.h:60
std::ofstream & ofstream(std::string fname)
Definition: Globals.cc:44
HistBase *& histograms()
Definition: Globals.h:38
const FPGAWord & layer() const
Definition: Stub.h:67
const FPGAWord & phi() const
Definition: Stub.h:62
double sigmaz() const
Definition: L1TStub.h:74
std::string const & getName() const
Definition: ProcessBase.h:22
bool calculate(int debug_level=0)
bool useapprox() const
Definition: Settings.h:245
bool validProj(int layerdisk) const
Definition: Tracklet.h:82
bool inSector(int iphi0, int irinv, double phi0approx, double rinvapprox)
constexpr int N_LAYER
Definition: Settings.h:25

◆ diskSeeding()

bool TrackletCalculatorBase::diskSeeding ( const Stub innerFPGAStub,
const L1TStub innerStub,
const Stub outerFPGAStub,
const L1TStub outerStub 
)

Definition at line 757 of file TrackletCalculatorBase.cc.

References funct::abs(), addDiskProj(), addLayerProj(), trklet::TrackletParametersMemory::addTracklet(), cms::cuda::assert(), trklet::VarBase::calculate(), trklet::Settings::debugTracklet(), trklet::IMATH_TrackletCalculatorDisk::der_phiD_final, trklet::IMATH_TrackletCalculatorDisk::der_phiL_final, trklet::IMATH_TrackletCalculatorDisk::der_rD_final, trklet::IMATH_TrackletCalculatorDisk::der_zL_final, trklet::Stub::disk(), exacttrackletdisk(), groupFilesInBlocks::fout, trklet::VarBase::fval(), trklet::Tracklet::getISeed(), trklet::ProcessBase::globals_, goodTrackPars(), mps_fire::i, trklet::Projection::init(), inSector(), iSector_, iSeed_, trklet::L1TStub::isPSmodule(), trklet::Globals::ITC_B1B2(), trklet::Globals::ITC_B3B4(), trklet::Globals::ITC_F1F2(), trklet::Globals::ITC_F3F4(), trklet::VarBase::ival(), dqmiolumiharvest::j, trklet::VarBase::K(), layerdisk1_, layerdisk2_, trklet::VarBase::local_passes(), angle0to2pi::make0To2pi(), trklet::N_DISK, trklet::N_LAYER, trklet::N_PSLAYER, trklet::ProcessBase::name_, trklet::Settings::nphibitsstub(), trklet::TrackletParametersMemory::nTracklets(), trklet::Settings::nzbitsstub(), trklet::Globals::ofstream(), trklet::Stub::phi(), trklet::L1TStub::phi(), trklet::IMATH_TrackletCalculatorDisk::phi0_final, trklet::IMATH_TrackletCalculatorDisk::phi1, trklet::IMATH_TrackletCalculatorDisk::phi2, trklet::Stub::phiapprox(), trklet::IMATH_TrackletCalculatorDisk::phiD_0_final, trklet::IMATH_TrackletCalculatorDisk::phiD_1_final, trklet::IMATH_TrackletCalculatorDisk::phiD_2_final, trklet::IMATH_TrackletCalculatorDisk::phiL_0_final, trklet::IMATH_TrackletCalculatorDisk::phiL_1_final, trklet::IMATH_TrackletCalculatorDisk::phiL_2_final, phimax_, phimin_, trklet::Settings::projdisks(), trklet::L1TStub::r(), trklet::Stub::r(), trklet::IMATH_TrackletCalculatorDisk::r1, diffTwoXMLs::r2, trklet::IMATH_TrackletCalculatorDisk::r2, trklet::Stub::rapprox(), trklet::IMATH_TrackletCalculatorDisk::rD_0_final, trklet::IMATH_TrackletCalculatorDisk::rD_1_final, trklet::IMATH_TrackletCalculatorDisk::rD_2_final, trklet::rinv(), trklet::IMATH_TrackletCalculatorDisk::rinv_final, trklet::Settings::rmaxdisk(), trklet::Settings::rmean(), trklet::IMATH_TrackletCalculatorDisk::rproj0, trklet::IMATH_TrackletCalculatorDisk::rproj1, trklet::IMATH_TrackletCalculatorDisk::rproj2, trklet::VarDef::set_fval(), trklet::VarDef::set_ival(), trklet::Tracklet::setTCIndex(), trklet::ProcessBase::settings_, trklet::Tracklet::setTrackletIndex(), trklet::L1TStub::sigmaz(), Validation_hcalonly_cfi::sign, submitPVValidationJobs::t, trklet::IMATH_TrackletCalculatorDisk::t_final, TCIndex_, trackletpars_, trklet::Settings::useapprox(), trklet::Tracklet::validProj(), trklet::FPGAWord::value(), trklet::Settings::writeMonitorData(), trklet::L1TStub::z(), trklet::Stub::z(), trklet::IMATH_TrackletCalculatorDisk::z0_final, trklet::IMATH_TrackletCalculatorDisk::z1, testProducerWithPsetDescEmpty_cfi::z2, trklet::IMATH_TrackletCalculatorDisk::z2, trklet::Stub::zapprox(), trklet::IMATH_TrackletCalculatorDisk::zL_0_final, trklet::IMATH_TrackletCalculatorDisk::zL_1_final, trklet::IMATH_TrackletCalculatorDisk::zL_2_final, trklet::Settings::zmean(), trklet::IMATH_TrackletCalculatorDisk::zproj0, trklet::IMATH_TrackletCalculatorDisk::zproj1, and trklet::IMATH_TrackletCalculatorDisk::zproj2.

Referenced by trklet::TrackletCalculator::execute(), and trklet::TrackletProcessor::execute().

760  {
761  if (settings_.debugTracklet()) {
762  edm::LogVerbatim("Tracklet") << "TrackletCalculator::execute calculate disk seeds";
763  }
764 
765  int sign = 1;
766  if (innerFPGAStub->disk().value() < 0)
767  sign = -1;
768 
769  int disk = innerFPGAStub->disk().value();
770  assert(abs(disk) == 1 || abs(disk) == 3);
771 
772  assert(innerStub->isPSmodule());
773  assert(outerStub->isPSmodule());
774 
775  double r1 = innerStub->r();
776  double z1 = innerStub->z();
777  double phi1 = innerStub->phi();
778 
779  double r2 = outerStub->r();
780  double z2 = outerStub->z();
781  double phi2 = outerStub->phi();
782 
783  if (r2 < r1 + 2.0) {
784  return false; //Protection... Should be handled cleaner to avoid problem with floating point calculation
785  }
786 
787  double rinv, phi0, t, z0;
788 
789  double phiproj[N_PSLAYER], zproj[N_PSLAYER], phider[N_PSLAYER], zder[N_PSLAYER];
790  double phiprojdisk[N_DISK - 2], rprojdisk[N_DISK - 2], phiderdisk[N_DISK - 2], rderdisk[N_DISK - 2];
791 
793  z1,
794  phi1,
795  r2,
796  z2,
797  phi2,
798  outerStub->sigmaz(),
799  rinv,
800  phi0,
801  t,
802  z0,
803  phiproj,
804  zproj,
805  phider,
806  zder,
807  phiprojdisk,
808  rprojdisk,
809  phiderdisk,
810  rderdisk);
811 
812  //Truncates floating point positions to integer representation precision
813  if (settings_.useapprox()) {
814  phi1 = innerFPGAStub->phiapprox(phimin_, phimax_);
815  z1 = innerFPGAStub->zapprox();
816  r1 = innerFPGAStub->rapprox();
817 
818  phi2 = outerFPGAStub->phiapprox(phimin_, phimax_);
819  z2 = outerFPGAStub->zapprox();
820  r2 = outerFPGAStub->rapprox();
821  }
822 
823  double rinvapprox, phi0approx, tapprox, z0approx;
824  double phiprojapprox[N_PSLAYER], zprojapprox[N_PSLAYER];
825  double phiprojdiskapprox[N_DISK - 2], rprojdiskapprox[N_DISK - 2];
826 
828  if (disk == 1)
829  ITC = globals_->ITC_F1F2();
830  else if (disk == 3)
831  ITC = globals_->ITC_F3F4();
832  else if (disk == -1)
833  ITC = globals_->ITC_B1B2();
834  else
835  ITC = globals_->ITC_B3B4();
836 
837  ITC->r1.set_fval(r1);
838  ITC->r2.set_fval(r2);
839  int signt = t > 0 ? 1 : -1;
840  ITC->z1.set_fval(z1 - signt * settings_.zmean(layerdisk1_ - N_LAYER));
841  ITC->z2.set_fval(z2 - signt * settings_.zmean(layerdisk2_ - N_LAYER));
842  double sphi1 = angle0to2pi::make0To2pi(phi1 - phimin_);
843  double sphi2 = angle0to2pi::make0To2pi(phi2 - phimin_);
844  ITC->phi1.set_fval(sphi1);
845  ITC->phi2.set_fval(sphi2);
846 
847  ITC->rproj0.set_fval(settings_.rmean(0));
848  ITC->rproj1.set_fval(settings_.rmean(1));
849  ITC->rproj2.set_fval(settings_.rmean(2));
850 
851  ITC->zproj0.set_fval(signt * settings_.zmean(settings_.projdisks(iSeed_, 0) - 1));
852  ITC->zproj1.set_fval(signt * settings_.zmean(settings_.projdisks(iSeed_, 1) - 1));
853  ITC->zproj2.set_fval(signt * settings_.zmean(settings_.projdisks(iSeed_, 2) - 1));
854 
855  ITC->rinv_final.calculate();
856  ITC->phi0_final.calculate();
857  ITC->t_final.calculate();
858  ITC->z0_final.calculate();
859 
860  ITC->phiL_0_final.calculate();
861  ITC->phiL_1_final.calculate();
862  ITC->phiL_2_final.calculate();
863 
864  ITC->zL_0_final.calculate();
865  ITC->zL_1_final.calculate();
866  ITC->zL_2_final.calculate();
867 
868  ITC->phiD_0_final.calculate();
869  ITC->phiD_1_final.calculate();
870  ITC->phiD_2_final.calculate();
871 
872  ITC->rD_0_final.calculate();
873  ITC->rD_1_final.calculate();
874  ITC->rD_2_final.calculate();
875 
876  ITC->der_phiL_final.calculate();
877  ITC->der_zL_final.calculate();
878  ITC->der_phiD_final.calculate();
879  ITC->der_rD_final.calculate();
880 
881  //store the approximate results
882  rinvapprox = ITC->rinv_final.fval();
883  phi0approx = ITC->phi0_final.fval();
884  tapprox = ITC->t_final.fval();
885  z0approx = ITC->z0_final.fval();
886 
887  phiprojapprox[0] = ITC->phiL_0_final.fval();
888  phiprojapprox[1] = ITC->phiL_1_final.fval();
889  phiprojapprox[2] = ITC->phiL_2_final.fval();
890 
891  zprojapprox[0] = ITC->zL_0_final.fval();
892  zprojapprox[1] = ITC->zL_1_final.fval();
893  zprojapprox[2] = ITC->zL_2_final.fval();
894 
895  phiprojdiskapprox[0] = ITC->phiD_0_final.fval();
896  phiprojdiskapprox[1] = ITC->phiD_1_final.fval();
897  phiprojdiskapprox[2] = ITC->phiD_2_final.fval();
898 
899  rprojdiskapprox[0] = ITC->rD_0_final.fval();
900  rprojdiskapprox[1] = ITC->rD_1_final.fval();
901  rprojdiskapprox[2] = ITC->rD_2_final.fval();
902 
903  //now binary
904 
905  int irinv, iphi0, it, iz0;
906  int iphiproj[N_PSLAYER], izproj[N_PSLAYER];
907 
908  int iphiprojdisk[N_DISK - 2], irprojdisk[N_DISK - 2];
909 
910  int ir1 = innerFPGAStub->r().value();
911  int iphi1 = innerFPGAStub->phi().value();
912  int iz1 = innerFPGAStub->z().value();
913 
914  int ir2 = outerFPGAStub->r().value();
915  int iphi2 = outerFPGAStub->phi().value();
916  int iz2 = outerFPGAStub->z().value();
917 
918  //To get same precission as for layers.
919  iphi1 <<= (settings_.nphibitsstub(5) - settings_.nphibitsstub(0));
920  iphi2 <<= (settings_.nphibitsstub(5) - settings_.nphibitsstub(0));
921 
922  ITC->r1.set_ival(ir1);
923  ITC->r2.set_ival(ir2);
924  ITC->z1.set_ival(iz1);
925  ITC->z2.set_ival(iz2);
926  ITC->phi1.set_ival(iphi1);
927  ITC->phi2.set_ival(iphi2);
928 
929  ITC->rinv_final.calculate();
930  ITC->phi0_final.calculate();
931  ITC->t_final.calculate();
932  ITC->z0_final.calculate();
933 
934  ITC->phiL_0_final.calculate();
935  ITC->phiL_1_final.calculate();
936  ITC->phiL_2_final.calculate();
937 
938  ITC->zL_0_final.calculate();
939  ITC->zL_1_final.calculate();
940  ITC->zL_2_final.calculate();
941 
942  ITC->phiD_0_final.calculate();
943  ITC->phiD_1_final.calculate();
944  ITC->phiD_2_final.calculate();
945 
946  ITC->rD_0_final.calculate();
947  ITC->rD_1_final.calculate();
948  ITC->rD_2_final.calculate();
949 
950  ITC->der_phiL_final.calculate();
951  ITC->der_zL_final.calculate();
952  ITC->der_phiD_final.calculate();
953  ITC->der_rD_final.calculate();
954 
955  //store the binary results
956  irinv = ITC->rinv_final.ival();
957  iphi0 = ITC->phi0_final.ival();
958  it = ITC->t_final.ival();
959  iz0 = ITC->z0_final.ival();
960 
961  iphiproj[0] = ITC->phiL_0_final.ival();
962  iphiproj[1] = ITC->phiL_1_final.ival();
963  iphiproj[2] = ITC->phiL_2_final.ival();
964 
965  izproj[0] = ITC->zL_0_final.ival();
966  izproj[1] = ITC->zL_1_final.ival();
967  izproj[2] = ITC->zL_2_final.ival();
968 
970  return false;
971 
972  if (!inSector(iphi0, irinv, phi0approx, rinvapprox))
973  return false;
974 
975  Projection projs[N_LAYER + N_DISK];
976 
977  for (unsigned int i = 0; i < N_DISK - 2; ++i) {
978  //Check is outside z range
979  if (izproj[i] < -(1 << (settings_.nzbitsstub(0) - 1)))
980  continue;
981  if (izproj[i] >= (1 << (settings_.nzbitsstub(0) - 1)))
982  continue;
983 
984  //Check if outside phi range
985  if (iphiproj[i] >= (1 << settings_.nphibitsstub(5)) - 1)
986  continue;
987  if (iphiproj[i] <= 0)
988  continue;
989 
990  //shift bits - allways in PS modules for disk seeding
991  iphiproj[i] >>= (settings_.nphibitsstub(5) - settings_.nphibitsstub(0));
992 
993  projs[i].init(settings_,
994  i,
995  iphiproj[i],
996  izproj[i],
997  ITC->der_phiL_final.ival(),
998  ITC->der_zL_final.ival(),
999  phiproj[i],
1000  zproj[i],
1001  phider[i],
1002  zder[i],
1003  phiprojapprox[i],
1004  zprojapprox[i],
1005  ITC->der_phiL_final.fval(),
1006  ITC->der_zL_final.fval(),
1007  true);
1008  }
1009 
1010  iphiprojdisk[0] = ITC->phiD_0_final.ival();
1011  iphiprojdisk[1] = ITC->phiD_1_final.ival();
1012  iphiprojdisk[2] = ITC->phiD_2_final.ival();
1013 
1014  irprojdisk[0] = ITC->rD_0_final.ival();
1015  irprojdisk[1] = ITC->rD_1_final.ival();
1016  irprojdisk[2] = ITC->rD_2_final.ival();
1017 
1018  for (unsigned int i = 0; i < N_DISK - 2; ++i) {
1019  //check that phi projection in range
1020  if (iphiprojdisk[i] <= 0)
1021  continue;
1022  if (iphiprojdisk[i] >= (1 << settings_.nphibitsstub(0)) - 1)
1023  continue;
1024 
1025  //check that r projection in range
1026  if (irprojdisk[i] <= 0 || irprojdisk[i] >= settings_.rmaxdisk() / ITC->rD_0_final.K())
1027  continue;
1028 
1029  projs[settings_.projdisks(iSeed_, i) + N_LAYER - 1].init(settings_,
1031  iphiprojdisk[i],
1032  irprojdisk[i],
1033  ITC->der_phiD_final.ival(),
1034  ITC->der_rD_final.ival(),
1035  phiprojdisk[i],
1036  rprojdisk[i],
1037  phiderdisk[i],
1038  rderdisk[i],
1039  phiprojdiskapprox[i],
1040  rprojdiskapprox[i],
1041  ITC->der_phiD_final.fval(),
1042  ITC->der_rD_final.fval(),
1043  true);
1044  }
1045 
1046  if (settings_.writeMonitorData("TPars")) {
1047  globals_->ofstream("trackletparsdisk.txt")
1048  << "Trackpars " << layerdisk1_ - 5 << " " << rinv << " " << rinvapprox << " "
1049  << ITC->rinv_final.fval() << " " << phi0 << " " << phi0approx << " " << ITC->phi0_final.fval() << " " << t
1050  << " " << tapprox << " " << ITC->t_final.fval() << " " << z0 << " " << z0approx << " " << ITC->z0_final.fval()
1051  << endl;
1052  }
1053 
1054  Tracklet* tracklet = new Tracklet(settings_,
1055  iSeed_,
1056  innerFPGAStub,
1057  nullptr,
1058  outerFPGAStub,
1059  rinv,
1060  phi0,
1061  0.0,
1062  z0,
1063  t,
1064  rinvapprox,
1065  phi0approx,
1066  0.0,
1067  z0approx,
1068  tapprox,
1069  irinv,
1070  iphi0,
1071  0,
1072  iz0,
1073  it,
1074  projs,
1075  true);
1076 
1077  if (settings_.debugTracklet()) {
1078  edm::LogVerbatim("Tracklet") << "Found tracklet for disk seed = " << iSeed_ << " " << tracklet << " " << iSector_;
1079  }
1080 
1082  tracklet->setTCIndex(TCIndex_);
1083 
1084  if (settings_.writeMonitorData("Seeds")) {
1085  ofstream fout("seeds.txt", ofstream::app);
1086  fout << __FILE__ << ":" << __LINE__ << " " << name_ << "_" << iSector_ << " " << tracklet->getISeed() << endl;
1087  fout.close();
1088  }
1089  trackletpars_->addTracklet(tracklet);
1090 
1091  if (tracklet->validProj(0)) {
1092  addLayerProj(tracklet, 1);
1093  }
1094 
1095  if (tracklet->validProj(1)) {
1096  addLayerProj(tracklet, 2);
1097  }
1098 
1099  for (unsigned int j = 0; j < N_DISK - 2; j++) {
1100  if (tracklet->validProj(N_LAYER + settings_.projdisks(iSeed_, j) - 1)) {
1101  addDiskProj(tracklet, sign * settings_.projdisks(iSeed_, j));
1102  }
1103  }
1104 
1105  return true;
1106 }
Log< level::Info, true > LogVerbatim
double phi() const
Definition: L1TStub.h:65
double zapprox() const
Definition: Stub.cc:158
double fval() const
Definition: imath.h:213
constexpr int N_DISK
Definition: Settings.h:26
const FPGAWord & r() const
Definition: Stub.h:60
std::string name_
Definition: ProcessBase.h:38
double phiapprox(double phimin, double) const
Definition: Stub.cc:177
const FPGAWord & z() const
Definition: Stub.h:61
bool goodTrackPars(bool goodrinv, bool goodz0)
Settings const & settings_
Definition: ProcessBase.h:40
bool addLayerProj(Tracklet *tracklet, int layer)
double z() const
Definition: L1TStub.h:59
Globals * globals_
Definition: ProcessBase.h:41
void set_fval(double fval)
Definition: imath.h:494
assert(be >=bs)
IMATH_TrackletCalculatorDisk * ITC_B1B2()
Definition: Globals.h:55
unsigned int isPSmodule() const
Definition: L1TStub.h:103
const FPGAWord & disk() const
Definition: Stub.h:68
IMATH_TrackletCalculatorDisk * ITC_F3F4()
Definition: Globals.h:54
void init(Settings const &settings, unsigned int layerdisk, int iphiproj, int irzproj, int iphider, int irzder, double phiproj, double rzproj, double phiprojder, double rzprojder, double phiprojapprox, double rzprojapprox, double phiprojderapprox, double rzprojderapprox, bool isPSseed)
Definition: Projection.cc:11
unsigned int nzbitsstub(unsigned int layerdisk) const
Definition: Settings.h:89
unsigned int nphibitsstub(unsigned int layerdisk) const
Definition: Settings.h:90
double rmean(unsigned int iLayer) const
Definition: Settings.h:171
bool local_passes() const
Definition: imath.cc:315
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int value() const
Definition: FPGAWord.h:24
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])
unsigned int projdisks(unsigned int iSeed, unsigned int i) const
Definition: Settings.h:163
TrackletParametersMemory * trackletpars_
bool writeMonitorData(std::string module) const
Definition: Settings.h:116
double rapprox() const
Definition: Stub.cc:144
double zmean(unsigned int iDisk) const
Definition: Settings.h:174
void setTCIndex(int index)
Definition: Tracklet.h:210
double K() const
Definition: imath.h:247
bool debugTracklet() const
Definition: Settings.h:192
constexpr unsigned int N_PSLAYER
Definition: Settings.h:27
IMATH_TrackletCalculatorDisk * ITC_B3B4()
Definition: Globals.h:56
double rmaxdisk() const
Definition: Settings.h:132
IMATH_TrackletCalculatorDisk * ITC_F1F2()
Definition: Globals.h:53
void setTrackletIndex(unsigned int index)
Definition: Tracklet.cc:796
double rinv(double phi1, double phi2, double r1, double r2)
Definition: Util.h:66
int getISeed() const
Definition: Tracklet.cc:801
constexpr valType make0To2pi(valType angle)
Definition: deltaPhi.h:67
long int ival() const
Definition: imath.h:214
void addDiskProj(Tracklet *tracklet, int disk)
void set_ival(int ival)
Definition: imath.h:502
double r() const
Definition: L1TStub.h:60
std::ofstream & ofstream(std::string fname)
Definition: Globals.cc:44
const FPGAWord & phi() const
Definition: Stub.h:62
double sigmaz() const
Definition: L1TStub.h:74
bool calculate(int debug_level=0)
bool useapprox() const
Definition: Settings.h:245
bool validProj(int layerdisk) const
Definition: Tracklet.h:82
bool inSector(int iphi0, int irinv, double phi0approx, double rinvapprox)
constexpr int N_LAYER
Definition: Settings.h:25

◆ exactproj()

void TrackletCalculatorBase::exactproj ( double  rproj,
double  rinv,
double  phi0,
double  t,
double  z0,
double &  phiproj,
double &  zproj,
double &  phider,
double &  zder 
)

Definition at line 175 of file TrackletCalculatorBase.cc.

References conifer::pow(), trklet::rinv(), mathSSE::sqrt(), and submitPVValidationJobs::t.

Referenced by exacttracklet(), exacttrackletdisk(), and exacttrackletOverlap().

183  {
184  phiproj = phi0 - asin(0.5 * rproj * rinv);
185  zproj = z0 + (2 * t / rinv) * asin(0.5 * rproj * rinv);
186 
187  phider = -0.5 * rinv / sqrt(1 - pow(0.5 * rproj * rinv, 2));
188  zder = t / sqrt(1 - pow(0.5 * rproj * rinv, 2));
189 }
constexpr int pow(int x)
Definition: conifer.h:24
T sqrt(T t)
Definition: SSEVec.h:19
double rinv(double phi1, double phi2, double r1, double r2)
Definition: Util.h:66

◆ exactprojdisk()

void TrackletCalculatorBase::exactprojdisk ( double  zproj,
double  rinv,
double  phi0,
double  t,
double  z0,
double &  phiproj,
double &  rproj,
double &  phider,
double &  rder 
)

Definition at line 191 of file TrackletCalculatorBase.cc.

References funct::cos(), trklet::rinv(), funct::sin(), submitPVValidationJobs::t, and createJobs::tmp.

Referenced by exacttracklet(), exacttrackletdisk(), and exacttrackletOverlap().

199  {
200  if (t < 0)
201  zproj = -zproj;
202 
203  double tmp = rinv * (zproj - z0) / (2.0 * t);
204  rproj = (2.0 / rinv) * sin(tmp);
205  phiproj = phi0 - tmp;
206 
207  phider = -rinv / (2 * t);
208  rder = cos(tmp) / t;
209 }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
double rinv(double phi1, double phi2, double r1, double r2)
Definition: Util.h:66
tmp
align.sh
Definition: createJobs.py:716

◆ exacttracklet()

void TrackletCalculatorBase::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] 
)

Definition at line 21 of file TrackletCalculatorBase.cc.

References funct::cos(), exactproj(), exactprojdisk(), mps_fire::i, iSeed_, trklet::N_DISK, trklet::N_LAYER, phimin_, trklet::Settings::projlayers(), diffTwoXMLs::r2, reco::reduceRange(), trklet::rinv(), trklet::Settings::rmean(), trklet::ProcessBase::settings_, funct::sin(), mathSSE::sqrt(), submitPVValidationJobs::t, testProducerWithPsetDescEmpty_cfi::z2, and trklet::Settings::zmean().

Referenced by barrelSeeding().

39  {
40  double deltaphi = reco::reduceRange(phi1 - phi2);
41 
42  double dist = sqrt(r2 * r2 + r1 * r1 - 2 * r1 * r2 * cos(deltaphi));
43 
44  rinv = 2 * sin(deltaphi) / dist;
45 
46  double phi1tmp = phi1 - phimin_;
47 
48  phi0 = reco::reduceRange(phi1tmp + asin(0.5 * r1 * rinv));
49 
50  double rhopsi1 = 2 * asin(0.5 * r1 * rinv) / rinv;
51  double rhopsi2 = 2 * asin(0.5 * r2 * rinv) / rinv;
52 
53  t = (z1 - z2) / (rhopsi1 - rhopsi2);
54 
55  z0 = z1 - t * rhopsi1;
56 
57  for (unsigned int i = 0; i < N_LAYER - 2; i++) {
59  rinv,
60  phi0,
61  t,
62  z0,
63  phiproj[i],
64  zproj[i],
65  phider[i],
66  zder[i]);
67  }
68 
69  for (unsigned int i = 0; i < N_DISK; i++) {
70  exactprojdisk(settings_.zmean(i), rinv, phi0, t, z0, phiprojdisk[i], rprojdisk[i], phiderdisk[i], rderdisk[i]);
71  }
72 }
constexpr int N_DISK
Definition: Settings.h:26
constexpr T reduceRange(T x)
Definition: deltaPhi.h:18
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Settings const & settings_
Definition: ProcessBase.h:40
void exactprojdisk(double zproj, double rinv, double phi0, double t, double z0, double &phiproj, double &rproj, double &phider, double &rder)
unsigned int projlayers(unsigned int iSeed, unsigned int i) const
Definition: Settings.h:162
double rmean(unsigned int iLayer) const
Definition: Settings.h:171
T sqrt(T t)
Definition: SSEVec.h:19
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
double zmean(unsigned int iDisk) const
Definition: Settings.h:174
void exactproj(double rproj, double rinv, double phi0, double t, double z0, double &phiproj, double &zproj, double &phider, double &zder)
double rinv(double phi1, double phi2, double r1, double r2)
Definition: Util.h:66
constexpr int N_LAYER
Definition: Settings.h:25

◆ exacttrackletdisk()

void TrackletCalculatorBase::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] 
)

Definition at line 74 of file TrackletCalculatorBase.cc.

References funct::cos(), exactproj(), exactprojdisk(), mps_fire::i, iSeed_, trklet::N_DISK, phimin_, trklet::Settings::projdisks(), diffTwoXMLs::r2, reco::reduceRange(), trklet::rinv(), trklet::Settings::rmean(), trklet::ProcessBase::settings_, funct::sin(), mathSSE::sqrt(), submitPVValidationJobs::t, testProducerWithPsetDescEmpty_cfi::z2, and trklet::Settings::zmean().

Referenced by diskSeeding().

92  {
93  double deltaphi = reco::reduceRange(phi1 - phi2);
94 
95  double dist = sqrt(r2 * r2 + r1 * r1 - 2 * r1 * r2 * cos(deltaphi));
96 
97  rinv = 2 * sin(deltaphi) / dist;
98 
99  double phi1tmp = phi1 - phimin_;
100 
101  phi0 = reco::reduceRange(phi1tmp + asin(0.5 * r1 * rinv));
102 
103  double rhopsi1 = 2 * asin(0.5 * r1 * rinv) / rinv;
104  double rhopsi2 = 2 * asin(0.5 * r2 * rinv) / rinv;
105 
106  t = (z1 - z2) / (rhopsi1 - rhopsi2);
107 
108  z0 = z1 - t * rhopsi1;
109 
110  for (unsigned int i = 0; i < N_DISK - 2; i++) {
112  rinv,
113  phi0,
114  t,
115  z0,
116  phiproj[i],
117  rproj[i],
118  phider[i],
119  rder[i]);
120  }
121 
122  for (unsigned int i = 0; i < N_DISK - 2; i++) {
123  exactproj(settings_.rmean(i), rinv, phi0, t, z0, phiprojLayer[i], zprojLayer[i], phiderLayer[i], zderLayer[i]);
124  }
125 }
constexpr int N_DISK
Definition: Settings.h:26
constexpr T reduceRange(T x)
Definition: deltaPhi.h:18
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Settings const & settings_
Definition: ProcessBase.h:40
void exactprojdisk(double zproj, double rinv, double phi0, double t, double z0, double &phiproj, double &rproj, double &phider, double &rder)
double rmean(unsigned int iLayer) const
Definition: Settings.h:171
T sqrt(T t)
Definition: SSEVec.h:19
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
unsigned int projdisks(unsigned int iSeed, unsigned int i) const
Definition: Settings.h:163
double zmean(unsigned int iDisk) const
Definition: Settings.h:174
void exactproj(double rproj, double rinv, double phi0, double t, double z0, double &phiproj, double &zproj, double &phider, double &zder)
double rinv(double phi1, double phi2, double r1, double r2)
Definition: Util.h:66

◆ exacttrackletOverlap()

void TrackletCalculatorBase::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] 
)

Definition at line 127 of file TrackletCalculatorBase.cc.

References funct::cos(), exactproj(), exactprojdisk(), mps_fire::i, phimin_, diffTwoXMLs::r2, reco::reduceRange(), trklet::rinv(), trklet::Settings::rmean(), trklet::ProcessBase::settings_, funct::sin(), mathSSE::sqrt(), submitPVValidationJobs::t, testProducerWithPsetDescEmpty_cfi::z2, and trklet::Settings::zmean().

Referenced by overlapSeeding().

145  {
146  double deltaphi = reco::reduceRange(phi1 - phi2);
147 
148  double dist = sqrt(r2 * r2 + r1 * r1 - 2 * r1 * r2 * cos(deltaphi));
149 
150  rinv = 2 * sin(deltaphi) / dist;
151 
152  if (r1 > r2)
153  rinv = -rinv;
154 
155  double phi1tmp = phi1 - phimin_;
156 
157  phi0 = reco::reduceRange(phi1tmp + asin(0.5 * r1 * rinv));
158 
159  double rhopsi1 = 2 * asin(0.5 * r1 * rinv) / rinv;
160  double rhopsi2 = 2 * asin(0.5 * r2 * rinv) / rinv;
161 
162  t = (z1 - z2) / (rhopsi1 - rhopsi2);
163 
164  z0 = z1 - t * rhopsi1;
165 
166  for (int i = 0; i < 4; i++) {
167  exactprojdisk(settings_.zmean(i + 1), rinv, phi0, t, z0, phiproj[i], rproj[i], phider[i], rder[i]);
168  }
169 
170  for (int i = 0; i < 1; i++) {
171  exactproj(settings_.rmean(i), rinv, phi0, t, z0, phiprojLayer[i], zprojLayer[i], phiderLayer[i], zderLayer[i]);
172  }
173 }
constexpr T reduceRange(T x)
Definition: deltaPhi.h:18
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Settings const & settings_
Definition: ProcessBase.h:40
void exactprojdisk(double zproj, double rinv, double phi0, double t, double z0, double &phiproj, double &rproj, double &phider, double &rder)
double rmean(unsigned int iLayer) const
Definition: Settings.h:171
T sqrt(T t)
Definition: SSEVec.h:19
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
double zmean(unsigned int iDisk) const
Definition: Settings.h:174
void exactproj(double rproj, double rinv, double phi0, double t, double z0, double &phiproj, double &zproj, double &phider, double &zder)
double rinv(double phi1, double phi2, double r1, double r2)
Definition: Util.h:66

◆ goodTrackPars()

bool TrackletCalculatorBase::goodTrackPars ( bool  goodrinv,
bool  goodz0 
)

Definition at line 289 of file TrackletCalculatorBase.cc.

References trklet::Settings::debugTracklet(), trklet::ProcessBase::getName(), trklet::ProcessBase::settings_, and summarizeEdmComparisonLogfiles::success.

Referenced by barrelSeeding(), diskSeeding(), and overlapSeeding().

289  {
290  bool success = true;
291  if (!goodrinv) {
292  if (settings_.debugTracklet()) {
293  edm::LogVerbatim("Tracklet") << getName() << " TrackletCalculatorBase irinv too large";
294  }
295  success = false;
296  }
297  if (!goodz0) {
298  if (settings_.debugTracklet()) {
299  edm::LogVerbatim("Tracklet") << getName() << " TrackletCalculatorBase z0 cut to large";
300  }
301  success = false;
302  }
303  return success;
304 }
Log< level::Info, true > LogVerbatim
Settings const & settings_
Definition: ProcessBase.h:40
bool debugTracklet() const
Definition: Settings.h:192
std::string const & getName() const
Definition: ProcessBase.h:22

◆ inSector()

bool TrackletCalculatorBase::inSector ( int  iphi0,
int  irinv,
double  phi0approx,
double  rinvapprox 
)

Definition at line 306 of file TrackletCalculatorBase.cc.

References trklet::Settings::debugTracklet(), trklet::ProcessBase::getName(), trklet::ProcessBase::globals_, trklet::Globals::ITC_L1L2(), trklet::VarBase::K(), runTheMatrix::keep, trklet::Settings::kphi0pars(), trklet::Settings::krinvpars(), trklet::IMATH_TrackletCalculator::phi0_final, trklet::Settings::phicritmaxmc(), trklet::Settings::phicritminmc(), trklet::Settings::rcrit(), trklet::ProcessBase::settings_, and trklet::Settings::usephicritapprox().

Referenced by barrelSeeding(), diskSeeding(), and overlapSeeding().

306  {
307  double phicritapprox = phi0approx - asin(0.5 * settings_.rcrit() * rinvapprox);
308 
309  int ifactor = 0.5 * settings_.rcrit() * settings_.krinvpars() / settings_.kphi0pars() * (1 << 8);
310  int iphicrit = iphi0 - (irinv >> 8) * ifactor;
311 
312  int iphicritmincut = settings_.phicritminmc() / globals_->ITC_L1L2()->phi0_final.K();
313  int iphicritmaxcut = settings_.phicritmaxmc() / globals_->ITC_L1L2()->phi0_final.K();
314 
315  bool keepapprox = (phicritapprox > settings_.phicritminmc()) && (phicritapprox < settings_.phicritmaxmc()),
316  keep = (iphicrit > iphicritmincut) && (iphicrit < iphicritmaxcut);
317  if (settings_.debugTracklet())
318  if (keepapprox && !keep)
319  edm::LogVerbatim("Tracklet") << getName()
320  << " Tracklet kept with exact phicrit cut but not approximate, phicritapprox: "
321  << phicritapprox;
322  if (settings_.usephicritapprox()) {
323  return keepapprox;
324  } else {
325  return keep;
326  }
327 
328  return true;
329 }
Log< level::Info, true > LogVerbatim
double phicritmaxmc() const
Definition: Settings.h:329
Settings const & settings_
Definition: ProcessBase.h:40
Globals * globals_
Definition: ProcessBase.h:41
double krinvpars() const
Definition: Settings.h:419
double phicritminmc() const
Definition: Settings.h:328
double kphi0pars() const
Definition: Settings.h:423
IMATH_TrackletCalculator * ITC_L1L2()
Definition: Globals.h:48
double K() const
Definition: imath.h:247
bool debugTracklet() const
Definition: Settings.h:192
bool usephicritapprox() const
Definition: Settings.h:246
std::string const & getName() const
Definition: ProcessBase.h:22
double rcrit() const
Definition: Settings.h:321

◆ overlapSeeding()

bool TrackletCalculatorBase::overlapSeeding ( const Stub innerFPGAStub,
const L1TStub innerStub,
const Stub outerFPGAStub,
const L1TStub outerStub 
)

Definition at line 1108 of file TrackletCalculatorBase.cc.

References addDiskProj(), addLayerProj(), trklet::TrackletParametersMemory::addTracklet(), cms::cuda::assert(), l1t::bitShift(), trklet::VarBase::calculate(), trklet::Settings::debugTracklet(), trklet::IMATH_TrackletCalculatorOverlap::der_phiD_final, trklet::IMATH_TrackletCalculatorOverlap::der_phiL_final, trklet::IMATH_TrackletCalculatorOverlap::der_rD_final, trklet::IMATH_TrackletCalculatorOverlap::der_zL_final, trklet::Stub::disk(), exacttrackletOverlap(), Exception, groupFilesInBlocks::fout, trklet::VarBase::fval(), trklet::Tracklet::getISeed(), trklet::ProcessBase::getName(), trklet::ProcessBase::globals_, goodTrackPars(), mps_fire::i, trklet::Projection::init(), inSector(), iSector_, iSeed_, trklet::Globals::ITC_L1B1(), trklet::Globals::ITC_L1F1(), trklet::Globals::ITC_L2B1(), trklet::Globals::ITC_L2F1(), trklet::VarBase::ival(), trklet::VarBase::K(), trklet::Stub::layer(), trklet::Stub::layerdisk(), layerdisk1_, layerdisk2_, trklet::VarBase::local_passes(), angle0to2pi::make0To2pi(), trklet::N_DISK, trklet::N_LAYER, trklet::N_PSLAYER, trklet::ProcessBase::name_, trklet::Settings::nphibitsstub(), trklet::Settings::nrbitsstub(), trklet::TrackletParametersMemory::nTracklets(), trklet::Settings::nzbitsstub(), trklet::Globals::ofstream(), trklet::Stub::phi(), trklet::L1TStub::phi(), trklet::IMATH_TrackletCalculatorOverlap::phi0_final, trklet::IMATH_TrackletCalculatorOverlap::phi1, trklet::IMATH_TrackletCalculatorOverlap::phi2, trklet::Stub::phiapprox(), trklet::IMATH_TrackletCalculatorOverlap::phiD_0_final, trklet::IMATH_TrackletCalculatorOverlap::phiD_1_final, trklet::IMATH_TrackletCalculatorOverlap::phiD_2_final, trklet::IMATH_TrackletCalculatorOverlap::phiD_3_final, trklet::IMATH_TrackletCalculatorOverlap::phiL_0_final, trklet::IMATH_TrackletCalculatorOverlap::phiL_1_final, trklet::IMATH_TrackletCalculatorOverlap::phiL_2_final, phimax_, phimin_, trklet::Stub::r(), trklet::L1TStub::r(), trklet::IMATH_TrackletCalculatorOverlap::r1, diffTwoXMLs::r2, trklet::IMATH_TrackletCalculatorOverlap::r2, trklet::Stub::rapprox(), trklet::IMATH_TrackletCalculatorOverlap::rD_0_final, trklet::IMATH_TrackletCalculatorOverlap::rD_1_final, trklet::IMATH_TrackletCalculatorOverlap::rD_2_final, trklet::IMATH_TrackletCalculatorOverlap::rD_3_final, trklet::rinv(), trklet::IMATH_TrackletCalculatorOverlap::rinv_final, trklet::Settings::rmaxdisk(), trklet::Settings::rmean(), trklet::IMATH_TrackletCalculatorOverlap::rproj0, trklet::IMATH_TrackletCalculatorOverlap::rproj1, trklet::IMATH_TrackletCalculatorOverlap::rproj2, trklet::VarDef::set_fval(), trklet::VarDef::set_ival(), trklet::Tracklet::setTCIndex(), trklet::ProcessBase::settings_, trklet::Tracklet::setTrackletIndex(), trklet::L1TStub::sigmaz(), submitPVValidationJobs::t, trklet::IMATH_TrackletCalculatorOverlap::t_final, TCIndex_, trackletpars_, trklet::Settings::useapprox(), trklet::Tracklet::validProj(), trklet::FPGAWord::value(), trklet::Settings::writeMonitorData(), trklet::L1TStub::z(), trklet::Stub::z(), trklet::IMATH_TrackletCalculatorOverlap::z0_final, trklet::IMATH_TrackletCalculatorOverlap::z1, testProducerWithPsetDescEmpty_cfi::z2, trklet::IMATH_TrackletCalculatorOverlap::z2, trklet::Stub::zapprox(), trklet::IMATH_TrackletCalculatorOverlap::zL_0_final, trklet::IMATH_TrackletCalculatorOverlap::zL_1_final, trklet::IMATH_TrackletCalculatorOverlap::zL_2_final, trklet::Settings::zmean(), trklet::IMATH_TrackletCalculatorOverlap::zproj0, trklet::IMATH_TrackletCalculatorOverlap::zproj1, trklet::IMATH_TrackletCalculatorOverlap::zproj2, and trklet::IMATH_TrackletCalculatorOverlap::zproj3.

Referenced by trklet::TrackletCalculator::execute(), and trklet::TrackletProcessor::execute().

1111  {
1112  //Deal with overlap stubs here
1113  assert(outerFPGAStub->layerdisk() < N_LAYER);
1114 
1115  assert(innerFPGAStub->layerdisk() >= N_LAYER);
1116 
1117  int disk = innerFPGAStub->disk().value();
1118 
1119  if (settings_.debugTracklet()) {
1120  edm::LogVerbatim("Tracklet") << "trying to make overlap tracklet for seed = " << iSeed_ << " " << getName();
1121  }
1122 
1123  double r1 = innerStub->r();
1124  double z1 = innerStub->z();
1125  double phi1 = innerStub->phi();
1126 
1127  double r2 = outerStub->r();
1128  double z2 = outerStub->z();
1129  double phi2 = outerStub->phi();
1130 
1131  //Protection for wrong radii. Could be handled cleaner to avoid problem with floating point calculation and with overflows in the integer calculation.
1132  if (r1 < r2 + 1.5) {
1133  return false;
1134  }
1135 
1136  double rinv, phi0, t, z0;
1137 
1138  double phiproj[N_PSLAYER], zproj[N_PSLAYER], phider[N_PSLAYER], zder[N_PSLAYER];
1139  double phiprojdisk[N_DISK - 1], rprojdisk[N_DISK - 1], phiderdisk[N_DISK - 1], rderdisk[N_DISK - 1];
1140 
1142  z1,
1143  phi1,
1144  r2,
1145  z2,
1146  phi2,
1147  outerStub->sigmaz(),
1148  rinv,
1149  phi0,
1150  t,
1151  z0,
1152  phiproj,
1153  zproj,
1154  phider,
1155  zder,
1156  phiprojdisk,
1157  rprojdisk,
1158  phiderdisk,
1159  rderdisk);
1160 
1161  //Truncates floating point positions to integer representation precision
1162  if (settings_.useapprox()) {
1163  phi1 = innerFPGAStub->phiapprox(phimin_, phimax_);
1164  z1 = innerFPGAStub->zapprox();
1165  r1 = innerFPGAStub->rapprox();
1166 
1167  phi2 = outerFPGAStub->phiapprox(phimin_, phimax_);
1168  z2 = outerFPGAStub->zapprox();
1169  r2 = outerFPGAStub->rapprox();
1170  }
1171 
1172  double rinvapprox, phi0approx, tapprox, z0approx;
1173  double phiprojapprox[N_PSLAYER], zprojapprox[N_PSLAYER];
1174  double phiprojdiskapprox[N_DISK - 1], rprojdiskapprox[N_DISK - 1];
1175 
1177  int ll = outerFPGAStub->layer().value() + 1;
1178  if (ll == 1 && disk == 1)
1179  ITC = globals_->ITC_L1F1();
1180  else if (ll == 2 && disk == 1)
1181  ITC = globals_->ITC_L2F1();
1182  else if (ll == 1 && disk == -1)
1183  ITC = globals_->ITC_L1B1();
1184  else if (ll == 2 && disk == -1)
1185  ITC = globals_->ITC_L2B1();
1186  else
1187  throw cms::Exception("LogicError") << __FILE__ << " " << __LINE__ << " Invalid seeding!";
1188 
1189  ITC->r1.set_fval(r2 - settings_.rmean(ll - 1));
1190  ITC->r2.set_fval(r1);
1191  int signt = t > 0 ? 1 : -1;
1192  ITC->z1.set_fval(z2);
1193  ITC->z2.set_fval(z1 - signt * settings_.zmean(layerdisk2_ - N_LAYER));
1194  double sphi1 = angle0to2pi::make0To2pi(phi1 - phimin_);
1195  double sphi2 = angle0to2pi::make0To2pi(phi2 - phimin_);
1196  ITC->phi1.set_fval(sphi2);
1197  ITC->phi2.set_fval(sphi1);
1198 
1199  ITC->rproj0.set_fval(settings_.rmean(0));
1200  ITC->rproj1.set_fval(settings_.rmean(1));
1201  ITC->rproj2.set_fval(settings_.rmean(2));
1202 
1203  ITC->zproj0.set_fval(signt * settings_.zmean(1));
1204  ITC->zproj1.set_fval(signt * settings_.zmean(2));
1205  ITC->zproj2.set_fval(signt * settings_.zmean(3));
1206  ITC->zproj3.set_fval(signt * settings_.zmean(4));
1207 
1208  ITC->rinv_final.calculate();
1209  ITC->phi0_final.calculate();
1210  ITC->t_final.calculate();
1211  ITC->z0_final.calculate();
1212 
1213  ITC->phiL_0_final.calculate();
1214  ITC->phiL_1_final.calculate();
1215  ITC->phiL_2_final.calculate();
1216 
1217  ITC->zL_0_final.calculate();
1218  ITC->zL_1_final.calculate();
1219  ITC->zL_2_final.calculate();
1220 
1221  ITC->phiD_0_final.calculate();
1222  ITC->phiD_1_final.calculate();
1223  ITC->phiD_2_final.calculate();
1224  ITC->phiD_3_final.calculate();
1225 
1226  ITC->rD_0_final.calculate();
1227  ITC->rD_1_final.calculate();
1228  ITC->rD_2_final.calculate();
1229  ITC->rD_3_final.calculate();
1230 
1231  ITC->der_phiL_final.calculate();
1232  ITC->der_zL_final.calculate();
1233  ITC->der_phiD_final.calculate();
1234  ITC->der_rD_final.calculate();
1235 
1236  //store the approximate results
1237  rinvapprox = ITC->rinv_final.fval();
1238  phi0approx = ITC->phi0_final.fval();
1239  tapprox = ITC->t_final.fval();
1240  z0approx = ITC->z0_final.fval();
1241 
1242  phiprojapprox[0] = ITC->phiL_0_final.fval();
1243  phiprojapprox[1] = ITC->phiL_1_final.fval();
1244  phiprojapprox[2] = ITC->phiL_2_final.fval();
1245 
1246  zprojapprox[0] = ITC->zL_0_final.fval();
1247  zprojapprox[1] = ITC->zL_1_final.fval();
1248  zprojapprox[2] = ITC->zL_2_final.fval();
1249 
1250  phiprojdiskapprox[0] = ITC->phiD_0_final.fval();
1251  phiprojdiskapprox[1] = ITC->phiD_1_final.fval();
1252  phiprojdiskapprox[2] = ITC->phiD_2_final.fval();
1253  phiprojdiskapprox[3] = ITC->phiD_3_final.fval();
1254 
1255  rprojdiskapprox[0] = ITC->rD_0_final.fval();
1256  rprojdiskapprox[1] = ITC->rD_1_final.fval();
1257  rprojdiskapprox[2] = ITC->rD_2_final.fval();
1258  rprojdiskapprox[3] = ITC->rD_3_final.fval();
1259 
1260  //now binary
1261 
1262  int irinv, iphi0, it, iz0;
1263  int iphiproj[N_LAYER - 2], izproj[N_LAYER - 2];
1264  int iphiprojdisk[N_DISK], irprojdisk[N_DISK];
1265 
1266  int ir2 = innerFPGAStub->r().value();
1267  int iphi2 = innerFPGAStub->phi().value();
1268  int iz2 = innerFPGAStub->z().value();
1269 
1270  int ir1 = outerFPGAStub->r().value();
1271  int iphi1 = outerFPGAStub->phi().value();
1272  int iz1 = outerFPGAStub->z().value();
1273 
1274  //To get global precission
1275  ir1 = l1t::bitShift(ir1, (8 - settings_.nrbitsstub(ll - 1)));
1276  iphi1 <<= (settings_.nphibitsstub(5) - settings_.nphibitsstub(0));
1277  iphi2 <<= (settings_.nphibitsstub(5) - settings_.nphibitsstub(0));
1278 
1279  ITC->r1.set_ival(ir1);
1280  ITC->r2.set_ival(ir2);
1281  ITC->z1.set_ival(iz1);
1282  ITC->z2.set_ival(iz2);
1283  ITC->phi1.set_ival(iphi1);
1284  ITC->phi2.set_ival(iphi2);
1285 
1286  ITC->rinv_final.calculate();
1287  ITC->phi0_final.calculate();
1288  ITC->t_final.calculate();
1289  ITC->z0_final.calculate();
1290 
1291  ITC->phiL_0_final.calculate();
1292  ITC->phiL_1_final.calculate();
1293  ITC->phiL_2_final.calculate();
1294 
1295  ITC->zL_0_final.calculate();
1296  ITC->zL_1_final.calculate();
1297  ITC->zL_2_final.calculate();
1298 
1299  ITC->phiD_0_final.calculate();
1300  ITC->phiD_1_final.calculate();
1301  ITC->phiD_2_final.calculate();
1302  ITC->phiD_3_final.calculate();
1303 
1304  ITC->rD_0_final.calculate();
1305  ITC->rD_1_final.calculate();
1306  ITC->rD_2_final.calculate();
1307  ITC->rD_3_final.calculate();
1308 
1309  ITC->der_phiL_final.calculate();
1310  ITC->der_zL_final.calculate();
1311  ITC->der_phiD_final.calculate();
1312  ITC->der_rD_final.calculate();
1313 
1314  //store the binary results
1315  irinv = ITC->rinv_final.ival();
1316  iphi0 = ITC->phi0_final.ival();
1317  it = ITC->t_final.ival();
1318  iz0 = ITC->z0_final.ival();
1319 
1320  iphiproj[0] = ITC->phiL_0_final.ival();
1321  iphiproj[1] = ITC->phiL_1_final.ival();
1322  iphiproj[2] = ITC->phiL_2_final.ival();
1323 
1324  izproj[0] = ITC->zL_0_final.ival();
1325  izproj[1] = ITC->zL_1_final.ival();
1326  izproj[2] = ITC->zL_2_final.ival();
1327 
1328  iphiprojdisk[0] = ITC->phiD_0_final.ival();
1329  iphiprojdisk[1] = ITC->phiD_1_final.ival();
1330  iphiprojdisk[2] = ITC->phiD_2_final.ival();
1331  iphiprojdisk[3] = ITC->phiD_3_final.ival();
1332 
1333  irprojdisk[0] = ITC->rD_0_final.ival();
1334  irprojdisk[1] = ITC->rD_1_final.ival();
1335  irprojdisk[2] = ITC->rD_2_final.ival();
1336  irprojdisk[3] = ITC->rD_3_final.ival();
1337 
1339  return false;
1340 
1341  if (!inSector(iphi0, irinv, phi0approx, rinvapprox))
1342  return false;
1343 
1344  Projection projs[N_LAYER + N_DISK];
1345 
1346  for (unsigned int i = 0; i < N_DISK - 2; ++i) {
1347  //check that zproj is in range
1348  if (izproj[i] < -(1 << (settings_.nzbitsstub(0) - 1)))
1349  continue;
1350  if (izproj[i] >= (1 << (settings_.nzbitsstub(0) - 1)))
1351  continue;
1352 
1353  //check that phiproj is in range
1354  if (iphiproj[i] >= (1 << settings_.nphibitsstub(5)) - 1)
1355  continue;
1356  if (iphiproj[i] <= 0)
1357  continue;
1358 
1359  //adjust bits for PS modules (no 2S modules in overlap seeds)
1360  iphiproj[i] >>= (settings_.nphibitsstub(5) - settings_.nphibitsstub(0));
1361 
1362  projs[i].init(settings_,
1363  i,
1364  iphiproj[i],
1365  izproj[i],
1366  ITC->der_phiL_final.ival(),
1367  ITC->der_zL_final.ival(),
1368  phiproj[i],
1369  zproj[i],
1370  phider[i],
1371  zder[i],
1372  phiprojapprox[i],
1373  zprojapprox[i],
1374  ITC->der_phiL_final.fval(),
1375  ITC->der_zL_final.fval(),
1376  true);
1377  }
1378 
1379  for (int i = 0; i < 4; ++i) {
1380  //check that phi projection in range
1381  if (iphiprojdisk[i] <= 0)
1382  continue;
1383  if (iphiprojdisk[i] >= (1 << settings_.nphibitsstub(0)) - 1)
1384  continue;
1385 
1386  //check that r projection in range
1387  if (irprojdisk[i] <= 0 || irprojdisk[i] >= settings_.rmaxdisk() / ITC->rD_0_final.K())
1388  continue;
1389 
1390  projs[N_LAYER + i + 1].init(settings_,
1391  N_LAYER + i + 1,
1392  iphiprojdisk[i],
1393  irprojdisk[i],
1394  ITC->der_phiD_final.ival(),
1395  ITC->der_rD_final.ival(),
1396  phiprojdisk[i],
1397  rprojdisk[i],
1398  phiderdisk[i],
1399  rderdisk[i],
1400  phiprojdiskapprox[i],
1401  rprojdiskapprox[i],
1402  ITC->der_phiD_final.fval(),
1403  ITC->der_rD_final.fval(),
1404  true);
1405  }
1406 
1407  if (settings_.writeMonitorData("TPars")) {
1408  globals_->ofstream("trackletparsoverlap.txt")
1409  << "Trackpars " << layerdisk1_ - 5 << " " << rinv << " " << irinv << " " << ITC->rinv_final.fval() << " "
1410  << phi0 << " " << iphi0 << " " << ITC->phi0_final.fval() << " " << t << " " << it << " "
1411  << ITC->t_final.fval() << " " << z0 << " " << iz0 << " " << ITC->z0_final.fval() << endl;
1412  }
1413 
1414  Tracklet* tracklet = new Tracklet(settings_,
1415  iSeed_,
1416  innerFPGAStub,
1417  nullptr,
1418  outerFPGAStub,
1419  rinv,
1420  phi0,
1421  0.0,
1422  z0,
1423  t,
1424  rinvapprox,
1425  phi0approx,
1426  0.0,
1427  z0approx,
1428  tapprox,
1429  irinv,
1430  iphi0,
1431  0,
1432  iz0,
1433  it,
1434  projs,
1435  false,
1436  true);
1437 
1438  if (settings_.debugTracklet()) {
1439  edm::LogVerbatim("Tracklet") << "Found tracklet in overlap seed = " << iSeed_ << " " << tracklet << " " << iSector_;
1440  }
1441 
1443  tracklet->setTCIndex(TCIndex_);
1444 
1445  if (settings_.writeMonitorData("Seeds")) {
1446  ofstream fout("seeds.txt", ofstream::app);
1447  fout << __FILE__ << ":" << __LINE__ << " " << name_ << "_" << iSector_ << " " << tracklet->getISeed() << endl;
1448  fout.close();
1449  }
1450  trackletpars_->addTracklet(tracklet);
1451 
1452  int layer = outerFPGAStub->layer().value() + 1;
1453 
1454  if (layer == 2) {
1455  if (tracklet->validProj(0)) {
1456  addLayerProj(tracklet, 1);
1457  }
1458  }
1459 
1460  for (unsigned int disk = 2; disk < 6; disk++) {
1461  if (layer == 2 && disk == 5)
1462  continue;
1463  if (tracklet->validProj(N_LAYER + disk - 1)) {
1464  addDiskProj(tracklet, disk);
1465  }
1466  }
1467 
1468  return true;
1469 }
Log< level::Info, true > LogVerbatim
double phi() const
Definition: L1TStub.h:65
double zapprox() const
Definition: Stub.cc:158
double fval() const
Definition: imath.h:213
constexpr int N_DISK
Definition: Settings.h:26
const FPGAWord & r() const
Definition: Stub.h:60
unsigned int nrbitsstub(unsigned int layerdisk) const
Definition: Settings.h:91
std::string name_
Definition: ProcessBase.h:38
double phiapprox(double phimin, double) const
Definition: Stub.cc:177
const FPGAWord & z() const
Definition: Stub.h:61
bool goodTrackPars(bool goodrinv, bool goodz0)
Settings const & settings_
Definition: ProcessBase.h:40
bool addLayerProj(Tracklet *tracklet, int layer)
double z() const
Definition: L1TStub.h:59
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])
Globals * globals_
Definition: ProcessBase.h:41
void set_fval(double fval)
Definition: imath.h:494
IMATH_TrackletCalculatorOverlap * ITC_L2B1()
Definition: Globals.h:61
assert(be >=bs)
const FPGAWord & disk() const
Definition: Stub.h:68
IMATH_TrackletCalculatorOverlap * ITC_L1F1()
Definition: Globals.h:58
void init(Settings const &settings, unsigned int layerdisk, int iphiproj, int irzproj, int iphider, int irzder, double phiproj, double rzproj, double phiprojder, double rzprojder, double phiprojapprox, double rzprojapprox, double phiprojderapprox, double rzprojderapprox, bool isPSseed)
Definition: Projection.cc:11
unsigned int nzbitsstub(unsigned int layerdisk) const
Definition: Settings.h:89
unsigned int nphibitsstub(unsigned int layerdisk) const
Definition: Settings.h:90
double rmean(unsigned int iLayer) const
Definition: Settings.h:171
bool local_passes() const
Definition: imath.cc:315
int value() const
Definition: FPGAWord.h:24
TrackletParametersMemory * trackletpars_
bool writeMonitorData(std::string module) const
Definition: Settings.h:116
unsigned int layerdisk() const
Definition: Stub.cc:185
double rapprox() const
Definition: Stub.cc:144
double zmean(unsigned int iDisk) const
Definition: Settings.h:174
void setTCIndex(int index)
Definition: Tracklet.h:210
double K() const
Definition: imath.h:247
bool debugTracklet() const
Definition: Settings.h:192
constexpr unsigned int N_PSLAYER
Definition: Settings.h:27
double rmaxdisk() const
Definition: Settings.h:132
void setTrackletIndex(unsigned int index)
Definition: Tracklet.cc:796
double rinv(double phi1, double phi2, double r1, double r2)
Definition: Util.h:66
int getISeed() const
Definition: Tracklet.cc:801
constexpr valType make0To2pi(valType angle)
Definition: deltaPhi.h:67
long int ival() const
Definition: imath.h:214
void addDiskProj(Tracklet *tracklet, int disk)
void set_ival(int ival)
Definition: imath.h:502
double r() const
Definition: L1TStub.h:60
IMATH_TrackletCalculatorOverlap * ITC_L1B1()
Definition: Globals.h:59
IMATH_TrackletCalculatorOverlap * ITC_L2F1()
Definition: Globals.h:60
std::ofstream & ofstream(std::string fname)
Definition: Globals.cc:44
const FPGAWord & layer() const
Definition: Stub.h:67
const FPGAWord & phi() const
Definition: Stub.h:62
double sigmaz() const
Definition: L1TStub.h:74
std::string const & getName() const
Definition: ProcessBase.h:22
bool calculate(int debug_level=0)
bool useapprox() const
Definition: Settings.h:245
bool validProj(int layerdisk) const
Definition: Tracklet.h:82
int bitShift(int num, int bits)
Definition: BitShift.h:6
bool inSector(int iphi0, int irinv, double phi0approx, double rinvapprox)
constexpr int N_LAYER
Definition: Settings.h:25

Member Data Documentation

◆ iSector_

unsigned int trklet::TrackletCalculatorBase::iSector_
protected

◆ iSeed_

unsigned int trklet::TrackletCalculatorBase::iSeed_
protected

◆ layerdisk1_

unsigned int trklet::TrackletCalculatorBase::layerdisk1_
protected

◆ layerdisk2_

unsigned int trklet::TrackletCalculatorBase::layerdisk2_
protected

◆ phimax_

double trklet::TrackletCalculatorBase::phimax_
protected

◆ phimin_

double trklet::TrackletCalculatorBase::phimin_
protected

◆ TCIndex_

int trklet::TrackletCalculatorBase::TCIndex_
protected

◆ trackletpars_

TrackletParametersMemory* trklet::TrackletCalculatorBase::trackletpars_
protected

◆ trackletprojdisks_

std::vector<std::vector<TrackletProjectionsMemory*> > trklet::TrackletCalculatorBase::trackletprojdisks_
protected

◆ trackletprojlayers_

std::vector<std::vector<TrackletProjectionsMemory*> > trklet::TrackletCalculatorBase::trackletprojlayers_
protected